summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xbin/createpackage.pl29
-rw-r--r--config.tests/symbian/simple/main.cpp (renamed from doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h)20
-rw-r--r--config.tests/symbian/simple/simple.pro4
-rwxr-xr-xconfig.tests/unix/bsymbolic_functions.test3
-rwxr-xr-xconfigure51
-rwxr-xr-xconfigure.exebin1317376 -> 1319424 bytes
-rw-r--r--demos/declarative/calculator/calculator.qml4
-rw-r--r--demos/declarative/flickr/common/ScrollBar.qml2
-rw-r--r--demos/declarative/flickr/common/Slider.qml2
-rw-r--r--demos/declarative/flickr/flickr.qml4
-rw-r--r--demos/declarative/flickr/mobile/GridDelegate.qml8
-rw-r--r--demos/declarative/flickr/mobile/ImageDetails.qml18
-rw-r--r--demos/declarative/flickr/mobile/TitleBar.qml15
-rw-r--r--demos/declarative/flickr/mobile/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--demos/declarative/minehunt/MinehuntCore/Tile.qml2
-rw-r--r--demos/declarative/minehunt/minehunt.cpp2
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml10
-rw-r--r--demos/declarative/photoviewer/i18n/base.ts30
-rw-r--r--demos/declarative/photoviewer/i18n/qml_fr.qmbin0 -> 268 bytes
-rw-r--r--demos/declarative/photoviewer/i18n/qml_fr.ts30
-rw-r--r--demos/declarative/photoviewer/photoviewer.qml6
-rw-r--r--demos/declarative/rssnews/content/BusyIndicator.qml12
-rw-r--r--demos/declarative/rssnews/content/CategoryDelegate.qml41
-rw-r--r--demos/declarative/rssnews/content/NewsDelegate.qml29
-rw-r--r--demos/declarative/rssnews/content/RssFeeds.qml18
-rw-r--r--demos/declarative/rssnews/content/ScrollBar.qml66
-rw-r--r--demos/declarative/rssnews/content/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--demos/declarative/rssnews/content/images/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--demos/declarative/rssnews/rssnews.qml52
-rwxr-xr-xdemos/declarative/samegame/SamegameCore/samegame.js5
-rw-r--r--demos/declarative/snake/content/snake.js14
-rw-r--r--demos/declarative/snake/snake.qml6
-rw-r--r--demos/declarative/twitter/TwitterCore/FatDelegate.qml2
-rw-r--r--demos/declarative/twitter/TwitterCore/HomeTitleBar.qml4
-rw-r--r--demos/declarative/twitter/TwitterCore/MultiTitleBar.qml2
-rw-r--r--demos/declarative/twitter/TwitterCore/TitleBar.qml2
-rw-r--r--demos/declarative/twitter/twitter.qml2
-rw-r--r--demos/declarative/webbrowser/content/Button.qml18
-rw-r--r--demos/declarative/webbrowser/content/FlickableWebView.qml43
-rw-r--r--demos/declarative/webbrowser/content/Header.qml69
-rw-r--r--demos/declarative/webbrowser/content/RectSoftShadow.qml32
-rw-r--r--demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml113
-rw-r--r--demos/declarative/webbrowser/content/ScrollBar.qml66
-rw-r--r--demos/declarative/webbrowser/content/UrlInput.qml44
-rw-r--r--demos/declarative/webbrowser/content/fieldtext/FieldText.qml157
-rw-r--r--demos/declarative/webbrowser/content/fieldtext/pics/cancel.pngbin1038 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/fieldtext/pics/ok.pngbin655 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar-filled.pngbin694 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar-filled.sci6
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar.pngbin467 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/addressbar.sci6
-rw-r--r--demos/declarative/webbrowser/content/pics/back-disabled.pngbin475 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/back.pngbin707 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/display.pngbin0 -> 998 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/edit-delete.pngbin0 -> 1333 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/footer.pngbin200 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/footer.sci6
-rw-r--r--demos/declarative/webbrowser/content/pics/forward-disabled.pngbin471 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/forward.pngbin682 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-next-view.pngbin0 -> 1187 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/go-previous-view.pngbin0 -> 1226 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/header.pngbin193 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/reload.pngbin1283 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-bottom.pngbin186 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-left.pngbin598 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-left.sci5
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-right.pngbin636 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-right.sci5
-rw-r--r--demos/declarative/webbrowser/content/pics/softshadow-top.pngbin186 -> 0 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/titlebar-bg.pngbin0 -> 213 bytes
-rw-r--r--demos/declarative/webbrowser/content/pics/view-refresh.pngbin0 -> 2182 bytes
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml181
-rw-r--r--dist/changes-4.7.0122
-rw-r--r--doc/src/classes.qdoc6
-rw-r--r--doc/src/declarative/advtutorial.qdoc56
-rw-r--r--doc/src/declarative/animation.qdoc12
-rw-r--r--doc/src/declarative/basictypes.qdoc9
-rw-r--r--doc/src/declarative/codingconventions.qdoc7
-rw-r--r--doc/src/declarative/declarativeui.qdoc66
-rw-r--r--doc/src/declarative/dynamicobjects.qdoc199
-rw-r--r--doc/src/declarative/elements.qdoc12
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc20
-rw-r--r--doc/src/declarative/examples.qdoc128
-rw-r--r--doc/src/declarative/extending-examples.qdoc58
-rw-r--r--doc/src/declarative/extending.qdoc46
-rw-r--r--doc/src/declarative/focus.qdoc23
-rw-r--r--doc/src/declarative/globalobject.qdoc172
-rw-r--r--doc/src/declarative/integrating.qdoc50
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc5
-rw-r--r--doc/src/declarative/qdeclarativemodels.qdoc33
-rw-r--r--doc/src/declarative/qmlruntime.qdoc60
-rw-r--r--doc/src/declarative/qtbinding.qdoc26
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h55
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro13
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/main.qml32
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/qmldir1
-rw-r--r--doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp61
-rw-r--r--doc/src/declarative/tutorial.qdoc29
-rw-r--r--doc/src/development/assistant-manual.qdoc2
-rw-r--r--doc/src/development/developing-on-mac.qdoc5
-rw-r--r--doc/src/development/qmake-manual.qdoc1
-rw-r--r--doc/src/diagrams/modelview-move-rows-1.sk271
-rw-r--r--doc/src/diagrams/modelview-move-rows-2.sk271
-rw-r--r--doc/src/diagrams/modelview-move-rows-3.sk137
-rw-r--r--doc/src/diagrams/modelview-move-rows-4.sk137
-rw-r--r--doc/src/examples/elasticnodes.qdoc124
-rw-r--r--doc/src/examples/fingerpaint.qdoc2
-rw-r--r--doc/src/examples/padnavigator.qdoc552
-rw-r--r--doc/src/examples/pinchzoom.qdoc2
-rw-r--r--doc/src/examples/qml-examples.qdoc184
-rw-r--r--doc/src/files-and-resources/datastreamformat.qdoc3
-rw-r--r--doc/src/files-and-resources/resources.qdoc2
-rw-r--r--doc/src/frameworks-technologies/accessible.qdoc6
-rw-r--r--doc/src/frameworks-technologies/activeqt-container.qdoc7
-rw-r--r--doc/src/frameworks-technologies/activeqt-server.qdoc6
-rw-r--r--doc/src/frameworks-technologies/activeqt.qdoc5
-rw-r--r--doc/src/frameworks-technologies/animation.qdoc1
-rw-r--r--doc/src/frameworks-technologies/containers.qdoc2
-rw-r--r--doc/src/frameworks-technologies/dbus-adaptors.qdoc2
-rw-r--r--doc/src/frameworks-technologies/dbus-intro.qdoc2
-rw-r--r--doc/src/frameworks-technologies/desktop-integration.qdoc6
-rw-r--r--doc/src/frameworks-technologies/dnd.qdoc10
-rw-r--r--doc/src/frameworks-technologies/eventsandfilters.qdoc3
-rw-r--r--doc/src/frameworks-technologies/gestures.qdoc7
-rw-r--r--doc/src/frameworks-technologies/graphicsview.qdoc5
-rw-r--r--doc/src/frameworks-technologies/implicit-sharing.qdoc2
-rw-r--r--doc/src/frameworks-technologies/ipc.qdoc3
-rw-r--r--doc/src/frameworks-technologies/phonon.qdoc6
-rw-r--r--doc/src/frameworks-technologies/threads.qdoc1
-rw-r--r--doc/src/frameworks-technologies/unicode.qdoc2
-rw-r--r--doc/src/getting-started/demos.qdoc7
-rw-r--r--doc/src/getting-started/examples.qdoc74
-rw-r--r--doc/src/getting-started/installation.qdoc18
-rw-r--r--doc/src/getting-started/known-issues.qdoc10
-rw-r--r--doc/src/howtos/HWacceleration.qdoc15
-rw-r--r--doc/src/howtos/accelerators.qdoc1
-rw-r--r--doc/src/howtos/appicon.qdoc1
-rw-r--r--doc/src/howtos/guibooks.qdoc1
-rw-r--r--doc/src/howtos/qtdesigner.qdoc1
-rw-r--r--doc/src/howtos/restoring-geometry.qdoc2
-rw-r--r--doc/src/howtos/session.qdoc2
-rw-r--r--doc/src/howtos/sharedlibrary.qdoc2
-rw-r--r--doc/src/howtos/timers.qdoc2
-rw-r--r--doc/src/images/declarative-image_fillMode.gifbin79561 -> 0 bytes
-rw-r--r--doc/src/images/declarative-integrating-graphicswidgets.pngbin1061 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-preserveaspectcrop.pngbin0 -> 6440 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-preserveaspectfit.pngbin0 -> 4076 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-stretch.pngbin0 -> 5584 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tile.pngbin0 -> 3940 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tilehorizontally.pngbin0 -> 5544 bytes
-rw-r--r--doc/src/images/declarative-qtlogo-tilevertically.pngbin0 -> 6288 bytes
-rw-r--r--doc/src/images/declarative-qtlogo.png (renamed from doc/src/images/declarative-qtlogo1.png)bin3436 -> 3436 bytes
-rw-r--r--doc/src/images/declarative-qtlogo2.pngbin11023 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo3.pngbin4783 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo4.pngbin11241 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo5.pngbin3553 -> 0 bytes
-rw-r--r--doc/src/images/declarative-qtlogo6.pngbin4763 -> 0 bytes
-rw-r--r--doc/src/images/multitouch-fingerpaint-example.pngbin0 -> 17026 bytes
-rw-r--r--doc/src/index.qdoc60
-rw-r--r--doc/src/modules.qdoc46
-rw-r--r--doc/src/network-programming/bearermanagement.qdoc9
-rw-r--r--doc/src/network-programming/qtnetwork.qdoc1
-rw-r--r--doc/src/network-programming/ssl.qdoc6
-rw-r--r--doc/src/objectmodel/metaobjects.qdoc3
-rw-r--r--doc/src/objectmodel/object.qdoc3
-rw-r--r--doc/src/objectmodel/objecttrees.qdoc3
-rw-r--r--doc/src/objectmodel/properties.qdoc3
-rw-r--r--doc/src/objectmodel/signalsandslots.qdoc3
-rw-r--r--doc/src/overviews.qdoc87
-rw-r--r--doc/src/painting-and-printing/coordsys.qdoc3
-rw-r--r--doc/src/painting-and-printing/paintsystem.qdoc4
-rw-r--r--doc/src/painting-and-printing/printing.qdoc1
-rw-r--r--doc/src/platforms/platform-notes.qdoc2
-rw-r--r--doc/src/platforms/symbian-introduction.qdoc5
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp20
-rw-r--r--doc/src/snippets/declarative/Sprite.qml3
-rw-r--r--doc/src/snippets/declarative/borderimage.qml (renamed from doc/src/snippets/declarative/border-image.qml)0
-rw-r--r--doc/src/snippets/declarative/componentCreation.js47
-rw-r--r--doc/src/snippets/declarative/createComponent.qml9
-rw-r--r--doc/src/snippets/declarative/createQmlObject.qml18
-rw-r--r--doc/src/snippets/declarative/drag.qml2
-rw-r--r--doc/src/snippets/declarative/dynamicObjects.qml29
-rw-r--r--doc/src/snippets/declarative/flickableScrollbar.qml26
-rw-r--r--doc/src/snippets/declarative/focusscopes.qml27
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml2
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml2
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml2
-rw-r--r--doc/src/snippets/declarative/mouseregion.qml14
-rw-r--r--doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro (renamed from doc/src/declarative/snippets/qtbinding/contextproperties/contextproperties.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/contextproperties/main.qml (renamed from doc/src/declarative/snippets/qtbinding/contextproperties/main.qml)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h (renamed from doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro (renamed from doc/src/declarative/snippets/qtbinding/custompalette/custompalette.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/custompalette/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/custompalette/main.qml (renamed from doc/src/declarative/snippets/qtbinding/custompalette/main.qml)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/example.qrc (renamed from doc/src/declarative/snippets/qtbinding/resources/example.qrc)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/images/background.png (renamed from doc/src/declarative/snippets/qtbinding/resources/images/background.png)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/resources/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/main.qml (renamed from doc/src/declarative/snippets/qtbinding/resources/main.qml)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/resources/resources.pro (renamed from doc/src/declarative/snippets/qtbinding/resources/resources.pro)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/main.qml (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/main.qml)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.cpp)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h)0
-rw-r--r--doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro (renamed from doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.pro)0
-rw-r--r--doc/src/sql-programming/qsqldatatype-table.qdoc21
-rw-r--r--doc/src/sql-programming/sql-driver.qdoc2
-rw-r--r--doc/src/sql-programming/sql-programming.qdoc6
-rwxr-xr-xdoc/src/template/images/api_examples.pngbin1302 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/api_lookup.pngbin1879 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/api_topics.pngbin1216 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_l.pngbin139 -> 100 bytes
-rwxr-xr-xdoc/src/template/images/bg_l_blank.pngbin123 -> 84 bytes
-rwxr-xr-xdoc/src/template/images/bg_ll.pngbin514 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_ll_blank.pngbin320 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_lr.pngbin458 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_r.pngbin136 -> 96 bytes
-rwxr-xr-xdoc/src/template/images/bg_ul.pngbin516 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_ul_blank.pngbin304 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_ur.pngbin437 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/bg_ur_blank.pngbin437 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/box_bg.pngbin129 -> 89 bytes
-rwxr-xr-xdoc/src/template/images/breadcrumb.pngbin195 -> 134 bytes
-rwxr-xr-xdoc/src/template/images/bullet_gt.pngbin185 -> 124 bytes
-rwxr-xr-xdoc/src/template/images/bullet_sq.pngbin117 -> 74 bytes
-rwxr-xr-xdoc/src/template/images/content_bg.pngbin1498 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/form_bg.pngbin390 -> 0 bytes
-rw-r--r--doc/src/template/images/header.pngbin2600 -> 0 bytes
-rw-r--r--doc/src/template/images/page.pngbin0 -> 3102 bytes
-rwxr-xr-xdoc/src/template/images/page_bg.pngbin126 -> 84 bytes
-rwxr-xr-xdoc/src/template/images/print.pngbin575 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_guide.pngbin12685 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_icon.pngbin4775 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_ref_doc.pngbin2600 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/qt_tools.pngbin17508 -> 0 bytes
-rwxr-xr-xdoc/src/template/images/sep.pngbin120 -> 0 bytes
-rw-r--r--doc/src/template/images/spinner.gifbin0 -> 2037 bytes
-rwxr-xr-xdoc/src/template/images/sprites-combined.pngbin18070 -> 62534 bytes
-rwxr-xr-xdoc/src/template/scripts/functions.js162
-rwxr-xr-xdoc/src/template/style/style.css907
-rw-r--r--doc/src/widgets-and-layouts/layout.qdoc1
-rw-r--r--doc/src/widgets-and-layouts/styles.qdoc13
-rw-r--r--doc/src/widgets-and-layouts/widgets.qdoc201
-rw-r--r--doc/src/windows-and-dialogs/dialogs.qdoc1
-rw-r--r--doc/src/windows-and-dialogs/mainwindow.qdoc15
-rw-r--r--examples/declarative/animation/animation.qmlproject (renamed from examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject)0
-rw-r--r--examples/declarative/animation/basics/basics.qmlproject (renamed from examples/declarative/xmldata/xmldata.qmlproject)0
-rw-r--r--examples/declarative/animation/basics/color-animation.qml (renamed from examples/declarative/animations/color-animation.qml)5
-rw-r--r--examples/declarative/animation/basics/images/face-smile.png (renamed from examples/declarative/parallax/pics/face-smile.png)bin15408 -> 15408 bytes
-rw-r--r--examples/declarative/animation/basics/images/moon.png (renamed from examples/declarative/animations/images/moon.png)bin2433 -> 2433 bytes
-rw-r--r--examples/declarative/animation/basics/images/shadow.png (renamed from examples/declarative/parallax/pics/shadow.png)bin425 -> 425 bytes
-rw-r--r--examples/declarative/animation/basics/images/star.png (renamed from examples/declarative/dynamic/images/star.png)bin349 -> 349 bytes
-rw-r--r--examples/declarative/animation/basics/images/sun.png (renamed from examples/declarative/dynamic/images/sun.png)bin8153 -> 8153 bytes
-rw-r--r--examples/declarative/animation/basics/property-animation.qml (renamed from examples/declarative/animations/property-animation.qml)5
-rw-r--r--examples/declarative/animation/behaviors/SideRect.qml (renamed from examples/declarative/behaviors/SideRect.qml)0
-rw-r--r--examples/declarative/animation/behaviors/behavior-example.qml (renamed from examples/declarative/behaviors/behavior-example.qml)4
-rw-r--r--examples/declarative/animation/behaviors/behaviors.qmlproject (renamed from examples/declarative/behaviors/behaviors.qmlproject)0
-rw-r--r--examples/declarative/animation/easing/easing.qml105
-rw-r--r--examples/declarative/animation/easing/easing.qmlproject (renamed from examples/declarative/workerscript/workerscript.qmlproject)0
-rw-r--r--examples/declarative/animation/states/states.qml (renamed from examples/declarative/states/states.qml)0
-rw-r--r--examples/declarative/animation/states/states.qmlproject (renamed from examples/declarative/states/states.qmlproject)0
-rw-r--r--examples/declarative/animation/states/transitions.qml (renamed from examples/declarative/states/transitions.qml)4
-rw-r--r--examples/declarative/animation/states/user.png (renamed from examples/declarative/states/user.png)bin4886 -> 4886 bytes
-rw-r--r--examples/declarative/animations/easing.qml99
-rw-r--r--examples/declarative/border-image/animated.qml54
-rw-r--r--examples/declarative/border-image/borders.qml17
-rw-r--r--examples/declarative/border-image/content/MyBorderImage.qml37
-rw-r--r--examples/declarative/connections/connections-example.qml38
-rw-r--r--examples/declarative/connections/content/Button.qml12
-rw-r--r--examples/declarative/connections/content/bg1.jpgbin23771 -> 0 bytes
-rw-r--r--examples/declarative/connections/content/rotate-left.pngbin3061 -> 0 bytes
-rw-r--r--examples/declarative/connections/content/rotate-right.pngbin3115 -> 0 bytes
-rw-r--r--examples/declarative/cppextensions/cppextensions.pro10
-rw-r--r--examples/declarative/cppextensions/cppextensions.qmlproject (renamed from examples/declarative/webview/webview.qmlproject)0
-rw-r--r--examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir (renamed from examples/declarative/imageprovider/ImageProviderCore/qmldir)0
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider-example.qml (renamed from examples/declarative/imageprovider/imageprovider-example.qml)0
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.cpp (renamed from examples/declarative/imageprovider/imageprovider.cpp)0
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.pro (renamed from examples/declarative/imageprovider/imageprovider.pro)0
-rw-r--r--examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject (renamed from examples/declarative/imageprovider/imageprovider.qmlproject)0
-rw-r--r--examples/declarative/cppextensions/plugins/README (renamed from examples/declarative/plugins/README)0
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml (renamed from examples/declarative/plugins/com/nokia/TimeExample/Clock.qml)0
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/center.png)bin765 -> 765 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/clock.png)bin20653 -> 20653 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/hour.png)bin625 -> 625 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png (renamed from examples/declarative/plugins/com/nokia/TimeExample/minute.png)bin625 -> 625 bytes
-rw-r--r--examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir (renamed from examples/declarative/plugins/com/nokia/TimeExample/qmldir)0
-rw-r--r--examples/declarative/cppextensions/plugins/plugin.cpp (renamed from examples/declarative/plugins/plugin.cpp)0
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.pro (renamed from examples/declarative/plugins/plugins.pro)0
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.qml (renamed from examples/declarative/plugins/plugins.qml)0
-rw-r--r--examples/declarative/cppextensions/plugins/plugins.qmlproject (renamed from examples/declarative/plugins/plugins.qmlproject)0
-rw-r--r--examples/declarative/cppextensions/proxyviewer/main.cpp109
-rw-r--r--examples/declarative/cppextensions/proxyviewer/proxyviewer.pro9
-rw-r--r--examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc (renamed from examples/declarative/stringlistmodel/stringlistmodel.qrc)0
-rw-r--r--examples/declarative/cppextensions/proxyviewer/view.qml7
-rw-r--r--examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir (renamed from examples/declarative/proxywidgets/ProxyWidgets/qmldir)0
-rw-r--r--examples/declarative/cppextensions/proxywidgets/README (renamed from examples/declarative/proxywidgets/README)0
-rw-r--r--examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp (renamed from examples/declarative/proxywidgets/proxywidgets.cpp)0
-rw-r--r--examples/declarative/cppextensions/proxywidgets/proxywidgets.pro (renamed from examples/declarative/proxywidgets/proxywidgets.pro)0
-rw-r--r--examples/declarative/cppextensions/proxywidgets/proxywidgets.qml (renamed from examples/declarative/proxywidgets/proxywidgets.qml)2
-rw-r--r--examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject (renamed from examples/declarative/proxywidgets/proxywidgets.qmlproject)0
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro13
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp (renamed from src/imports/widgets/graphicslayouts.cpp)0
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml77
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc5
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h (renamed from src/imports/widgets/graphicslayouts_p.h)0
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp60
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro13
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml15
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc5
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp73
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro5
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject (renamed from examples/declarative/velocity/velocity.qmlproject)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/adding.pro (renamed from examples/declarative/extending/adding/adding.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/adding.qrc (renamed from examples/declarative/extending/adding/adding.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/example.qml (renamed from examples/declarative/extending/adding/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/main.cpp (renamed from examples/declarative/extending/adding/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/person.cpp (renamed from examples/declarative/extending/adding/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/adding/person.h (renamed from examples/declarative/extending/adding/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/attached.pro (renamed from examples/declarative/extending/attached/attached.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/attached.qrc (renamed from examples/declarative/extending/attached/attached.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp (renamed from examples/declarative/extending/attached/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h (renamed from examples/declarative/extending/attached/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/example.qml (renamed from examples/declarative/extending/attached/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/main.cpp (renamed from examples/declarative/extending/attached/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/person.cpp (renamed from examples/declarative/extending/valuesource/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/attached/person.h (renamed from examples/declarative/extending/valuesource/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/binding.pro (renamed from examples/declarative/extending/binding/binding.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/binding.qrc (renamed from examples/declarative/extending/binding/binding.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp (renamed from examples/declarative/extending/binding/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h (renamed from examples/declarative/extending/binding/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/example.qml (renamed from examples/declarative/extending/binding/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp (renamed from examples/declarative/extending/binding/happybirthdaysong.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h (renamed from examples/declarative/extending/binding/happybirthdaysong.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/main.cpp (renamed from examples/declarative/extending/binding/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/person.cpp (renamed from examples/declarative/extending/binding/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/binding/person.h (renamed from examples/declarative/extending/binding/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp (renamed from examples/declarative/extending/grouped/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h (renamed from examples/declarative/extending/coercion/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro (renamed from examples/declarative/extending/coercion/coercion.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc (renamed from examples/declarative/extending/coercion/coercion.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/example.qml (renamed from examples/declarative/extending/coercion/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/main.cpp (renamed from examples/declarative/extending/coercion/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/person.cpp (renamed from examples/declarative/extending/coercion/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/coercion/person.h (renamed from examples/declarative/extending/coercion/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp (renamed from examples/declarative/extending/default/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h (renamed from examples/declarative/extending/default/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/default.pro (renamed from examples/declarative/extending/default/default.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/default.qrc (renamed from examples/declarative/extending/default/default.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/example.qml (renamed from examples/declarative/extending/default/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/main.cpp (renamed from examples/declarative/extending/default/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/person.cpp (renamed from examples/declarative/extending/default/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/default/person.h (renamed from examples/declarative/extending/default/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/example.qml (renamed from examples/declarative/extending/extended/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/extended.pro (renamed from examples/declarative/extending/extended/extended.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/extended.qrc (renamed from examples/declarative/extending/extended/extended.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp (renamed from examples/declarative/extending/extended/lineedit.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/lineedit.h (renamed from examples/declarative/extending/extended/lineedit.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/extended/main.cpp (renamed from examples/declarative/extending/extended/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp (renamed from examples/declarative/extending/coercion/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h (renamed from examples/declarative/extending/grouped/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/example.qml (renamed from examples/declarative/extending/grouped/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro (renamed from examples/declarative/extending/grouped/grouped.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc (renamed from examples/declarative/extending/grouped/grouped.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/main.cpp (renamed from examples/declarative/extending/grouped/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/person.cpp (renamed from examples/declarative/extending/signal/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/grouped/person.h (renamed from examples/declarative/extending/grouped/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp (renamed from examples/declarative/extending/properties/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h (renamed from examples/declarative/extending/properties/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/example.qml (renamed from examples/declarative/extending/properties/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/main.cpp (renamed from examples/declarative/extending/properties/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/person.cpp (renamed from examples/declarative/extending/properties/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/person.h (renamed from examples/declarative/extending/properties/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/properties.pro (renamed from examples/declarative/extending/properties/properties.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/properties/properties.qrc (renamed from examples/declarative/extending/properties/properties.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/referenceexamples.pro (renamed from examples/declarative/extending/extending.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject (renamed from examples/declarative/tvtennis/tvtennis.qmlproject)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp (renamed from examples/declarative/extending/signal/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h (renamed from examples/declarative/extending/signal/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/example.qml (renamed from examples/declarative/extending/signal/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/main.cpp (renamed from examples/declarative/extending/signal/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/person.cpp (renamed from examples/declarative/extending/grouped/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/person.h (renamed from examples/declarative/extending/signal/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/signal.pro (renamed from examples/declarative/extending/signal/signal.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/signal/signal.qrc (renamed from examples/declarative/extending/signal/signal.qrc)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp (renamed from examples/declarative/extending/valuesource/birthdayparty.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h (renamed from examples/declarative/extending/valuesource/birthdayparty.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/example.qml (renamed from examples/declarative/extending/valuesource/example.qml)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp (renamed from examples/declarative/extending/valuesource/happybirthdaysong.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h (renamed from examples/declarative/extending/valuesource/happybirthdaysong.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp (renamed from examples/declarative/extending/valuesource/main.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp (renamed from examples/declarative/extending/attached/person.cpp)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/person.h (renamed from examples/declarative/extending/attached/person.h)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro (renamed from examples/declarative/extending/valuesource/valuesource.pro)0
-rw-r--r--examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc (renamed from examples/declarative/extending/valuesource/valuesource.qrc)0
-rw-r--r--examples/declarative/declarative.pro57
-rw-r--r--examples/declarative/dynamic/dynamic.qml157
-rw-r--r--examples/declarative/dynamic/qml/Button.qml24
-rw-r--r--examples/declarative/dynamic/qml/GenericItem.qml13
-rw-r--r--examples/declarative/dynamic/qml/PaletteItem.qml13
-rw-r--r--examples/declarative/dynamic/qml/PerspectiveItem.qml16
-rw-r--r--examples/declarative/dynamic/qml/Sun.qml24
-rw-r--r--examples/declarative/dynamic/qml/itemCreation.js82
-rw-r--r--examples/declarative/fillmode/content/QtLogo.qml30
-rw-r--r--examples/declarative/fillmode/content/qt-logo.pngbin5149 -> 0 bytes
-rw-r--r--examples/declarative/fillmode/fillmode.qml22
-rw-r--r--examples/declarative/i18n/i18n.qml37
-rw-r--r--examples/declarative/i18n/i18n.qmlproject (renamed from examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject)0
-rw-r--r--examples/declarative/i18n/i18n/base.ts12
-rw-r--r--examples/declarative/i18n/i18n/qml_en_AU.qmbin0 -> 81 bytes
-rw-r--r--examples/declarative/i18n/i18n/qml_en_AU.ts12
-rw-r--r--examples/declarative/i18n/i18n/qml_fr.qmbin0 -> 85 bytes
-rw-r--r--examples/declarative/i18n/i18n/qml_fr.ts12
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.qml57
-rw-r--r--examples/declarative/imageelements/borderimage/borderimage.qmlproject (renamed from examples/declarative/tabwidget/tabwidget.qmlproject)0
-rw-r--r--examples/declarative/imageelements/borderimage/content/MyBorderImage.qml50
-rw-r--r--examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml14
-rw-r--r--examples/declarative/imageelements/borderimage/content/bw.png (renamed from examples/declarative/border-image/content/bw.png)bin1357 -> 1357 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/content/colors-round.sci (renamed from examples/declarative/border-image/content/colors-round.sci)0
-rw-r--r--examples/declarative/imageelements/borderimage/content/colors-stretch.sci (renamed from examples/declarative/border-image/content/colors-stretch.sci)0
-rw-r--r--examples/declarative/imageelements/borderimage/content/colors.png (renamed from examples/declarative/border-image/content/colors.png)bin1655 -> 1655 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/content/shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/declarative/imageelements/borderimage/shadows.qml24
-rw-r--r--examples/declarative/imageelements/image/face_fit.qml (renamed from examples/declarative/aspectratio/face_fit.qml)0
-rw-r--r--examples/declarative/imageelements/image/face_fit_animated.qml (renamed from examples/declarative/aspectratio/face_fit_animated.qml)0
-rw-r--r--examples/declarative/imageelements/image/image.qmlproject (renamed from examples/declarative/sql/sql.qmlproject)0
-rw-r--r--examples/declarative/imageelements/image/pics/face.png (renamed from examples/declarative/aspectratio/pics/face.png)bin15408 -> 15408 bytes
-rw-r--r--examples/declarative/imageelements/image/scale_and_crop.qml (renamed from examples/declarative/aspectratio/scale_and_crop.qml)0
-rw-r--r--examples/declarative/imageelements/image/scale_and_crop_simple.qml (renamed from examples/declarative/aspectratio/scale_and_crop_simple.qml)0
-rw-r--r--examples/declarative/imageelements/image/scale_and_sidecrop.qml (renamed from examples/declarative/aspectratio/scale_and_sidecrop.qml)0
-rw-r--r--examples/declarative/imageelements/image/scale_to_fit.qml (renamed from examples/declarative/aspectratio/scale_to_fit.qml)0
-rw-r--r--examples/declarative/imageelements/image/scale_to_fit_simple.qml (renamed from examples/declarative/aspectratio/scale_to_fit_simple.qml)0
-rw-r--r--examples/declarative/imageelements/imageelements.qmlproject (renamed from examples/declarative/slideswitch/slideswitch.qmlproject)0
-rw-r--r--examples/declarative/images/content/lemonade.jpgbin6645 -> 0 bytes
-rw-r--r--examples/declarative/images/images.qml72
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ContextMenu.qml (renamed from examples/declarative/focus/Core/ContextMenu.qml)0
-rw-r--r--examples/declarative/keyinteraction/focus/Core/GridMenu.qml (renamed from examples/declarative/focus/Core/GridMenu.qml)0
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml (renamed from examples/declarative/focus/Core/ListViewDelegate.qml)0
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViews.qml (renamed from examples/declarative/focus/Core/ListViews.qml)6
-rw-r--r--examples/declarative/keyinteraction/focus/Core/images/arrow.png (renamed from examples/declarative/focus/Core/images/arrow.png)bin583 -> 583 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/Core/images/qt-logo.png (renamed from examples/declarative/focus/Core/images/qt-logo.png)bin5149 -> 5149 bytes
-rw-r--r--examples/declarative/keyinteraction/focus/Core/qmldir (renamed from examples/declarative/focus/Core/qmldir)0
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qml (renamed from examples/declarative/focus/focus.qml)4
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qmlproject (renamed from examples/declarative/focus/focus.qmlproject)0
-rw-r--r--examples/declarative/keyinteraction/keyinteraction.qmlproject (renamed from examples/declarative/searchbox/searchbox.qmlproject)0
-rw-r--r--examples/declarative/layouts/Button.qml22
-rw-r--r--examples/declarative/layouts/layouts.qml29
-rw-r--r--examples/declarative/modelviews/gridview/gridview-example.qml (renamed from examples/declarative/gridview/gridview-example.qml)0
-rw-r--r--examples/declarative/modelviews/gridview/gridview.qmlproject (renamed from examples/declarative/gridview/gridview.qmlproject)0
-rw-r--r--examples/declarative/modelviews/gridview/pics/AddressBook_48.png (renamed from examples/declarative/gridview/pics/AddressBook_48.png)bin3350 -> 3350 bytes
-rw-r--r--examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png (renamed from examples/declarative/gridview/pics/AudioPlayer_48.png)bin3806 -> 3806 bytes
-rw-r--r--examples/declarative/modelviews/gridview/pics/Camera_48.png (renamed from examples/declarative/gridview/pics/Camera_48.png)bin3540 -> 3540 bytes
-rw-r--r--examples/declarative/modelviews/gridview/pics/DateBook_48.png (renamed from examples/declarative/gridview/pics/DateBook_48.png)bin2610 -> 2610 bytes
-rw-r--r--examples/declarative/modelviews/gridview/pics/EMail_48.png (renamed from examples/declarative/gridview/pics/EMail_48.png)bin3655 -> 3655 bytes
-rw-r--r--examples/declarative/modelviews/gridview/pics/TodoList_48.png (renamed from examples/declarative/gridview/pics/TodoList_48.png)bin3429 -> 3429 bytes
-rw-r--r--examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png (renamed from examples/declarative/gridview/pics/VideoPlayer_48.png)bin4151 -> 4151 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml (renamed from examples/declarative/listview/content/ClickAutoRepeating.qml)0
-rw-r--r--examples/declarative/modelviews/listview/content/MediaButton.qml (renamed from examples/declarative/listview/content/MediaButton.qml)0
-rw-r--r--examples/declarative/modelviews/listview/content/pics/add.png (renamed from examples/declarative/listview/content/pics/add.png)bin1577 -> 1577 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/archive-insert.png (renamed from examples/declarative/listview/content/pics/archive-insert.png)bin896 -> 896 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/archive-remove.png (renamed from examples/declarative/listview/content/pics/archive-remove.png)bin1074 -> 1074 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/button-pressed.png (renamed from examples/declarative/listview/content/pics/button-pressed.png)bin571 -> 571 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/button.png (renamed from examples/declarative/listview/content/pics/button.png)bin564 -> 564 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/del.png (renamed from examples/declarative/listview/content/pics/del.png)bin1661 -> 1661 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg (renamed from examples/declarative/listview/content/pics/fruit-salad.jpg)bin17952 -> 17952 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/go-down.png (renamed from examples/declarative/listview/content/pics/go-down.png)bin892 -> 892 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/go-up.png (renamed from examples/declarative/listview/content/pics/go-up.png)bin929 -> 929 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/hamburger.jpg (renamed from examples/declarative/listview/content/pics/hamburger.jpg)bin8572 -> 8572 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/lemonade.jpg (renamed from examples/declarative/listview/content/pics/lemonade.jpg)bin6645 -> 6645 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/list-add.png (renamed from examples/declarative/listview/content/pics/list-add.png)bin907 -> 907 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/list-remove.png (renamed from examples/declarative/listview/content/pics/list-remove.png)bin498 -> 498 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/moreDown.png (renamed from examples/declarative/listview/content/pics/moreDown.png)bin217 -> 217 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/moreUp.png (renamed from examples/declarative/listview/content/pics/moreUp.png)bin212 -> 212 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/pancakes.jpg (renamed from examples/declarative/listview/content/pics/pancakes.jpg)bin9163 -> 9163 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/trash.png (renamed from examples/declarative/listview/content/pics/trash.png)bin989 -> 989 bytes
-rw-r--r--examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg (renamed from examples/declarative/listview/content/pics/vegetable-soup.jpg)bin8639 -> 8639 bytes
-rw-r--r--examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml (renamed from examples/declarative/listview/dummydata/MyPetsModel.qml)0
-rw-r--r--examples/declarative/modelviews/listview/dummydata/Recipes.qml (renamed from examples/declarative/listview/dummydata/Recipes.qml)0
-rw-r--r--examples/declarative/modelviews/listview/dynamic.qml (renamed from examples/declarative/listview/dynamic.qml)22
-rw-r--r--examples/declarative/modelviews/listview/highlight.qml (renamed from examples/declarative/listview/highlight.qml)2
-rw-r--r--examples/declarative/modelviews/listview/itemlist.qml (renamed from examples/declarative/listview/itemlist.qml)4
-rw-r--r--examples/declarative/modelviews/listview/listview-example.qml (renamed from examples/declarative/listview/listview-example.qml)4
-rw-r--r--examples/declarative/modelviews/listview/listview.qmlproject (renamed from examples/declarative/listview/listview.qmlproject)0
-rw-r--r--examples/declarative/modelviews/listview/recipes.qml (renamed from examples/declarative/listview/recipes.qml)0
-rw-r--r--examples/declarative/modelviews/listview/sections.qml (renamed from examples/declarative/listview/sections.qml)2
-rw-r--r--examples/declarative/modelviews/modelviews.pro7
-rw-r--r--examples/declarative/modelviews/modelviews.qmlproject (renamed from examples/declarative/scrollbar/scrollbar.qmlproject)0
-rw-r--r--examples/declarative/modelviews/objectlistmodel/dataobject.cpp (renamed from examples/declarative/objectlistmodel/dataobject.cpp)10
-rw-r--r--examples/declarative/modelviews/objectlistmodel/dataobject.h (renamed from examples/declarative/objectlistmodel/dataobject.h)8
-rw-r--r--examples/declarative/modelviews/objectlistmodel/main.cpp (renamed from examples/declarative/objectlistmodel/main.cpp)0
-rw-r--r--examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro (renamed from examples/declarative/objectlistmodel/objectlistmodel.pro)0
-rw-r--r--examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject (renamed from examples/declarative/objectlistmodel/objectlistmodel.qmlproject)0
-rw-r--r--examples/declarative/modelviews/objectlistmodel/objectlistmodel.qrc (renamed from examples/declarative/objectlistmodel/objectlistmodel.qrc)0
-rw-r--r--examples/declarative/modelviews/objectlistmodel/view.qml (renamed from examples/declarative/objectlistmodel/view.qml)2
-rw-r--r--examples/declarative/modelviews/package/Delegate.qml (renamed from examples/declarative/package/Delegate.qml)0
-rw-r--r--examples/declarative/modelviews/package/package.qmlproject (renamed from examples/declarative/package/package.qmlproject)0
-rw-r--r--examples/declarative/modelviews/package/view.qml (renamed from examples/declarative/package/view.qml)0
-rw-r--r--examples/declarative/modelviews/parallax/parallax.qml (renamed from examples/declarative/parallax/parallax.qml)6
-rw-r--r--examples/declarative/modelviews/parallax/parallax.qmlproject (renamed from examples/declarative/parallax/parallax.qmlproject)0
-rw-r--r--examples/declarative/modelviews/parallax/pics/background.jpg (renamed from examples/declarative/parallax/pics/background.jpg)bin209814 -> 209814 bytes
-rw-r--r--examples/declarative/modelviews/parallax/pics/face-smile.png (renamed from examples/declarative/dynamic/images/face-smile.png)bin15408 -> 15408 bytes
-rw-r--r--examples/declarative/modelviews/parallax/pics/home-page.svg (renamed from examples/declarative/parallax/pics/home-page.svg)0
-rw-r--r--examples/declarative/modelviews/parallax/pics/shadow.png (renamed from examples/declarative/animations/images/shadow.png)bin425 -> 425 bytes
-rw-r--r--examples/declarative/modelviews/parallax/pics/yast-joystick.png (renamed from examples/declarative/parallax/pics/yast-joystick.png)bin2723 -> 2723 bytes
-rw-r--r--examples/declarative/modelviews/parallax/pics/yast-wol.png (renamed from examples/declarative/parallax/pics/yast-wol.png)bin3769 -> 3769 bytes
-rw-r--r--examples/declarative/modelviews/parallax/qml/ParallaxView.qml (renamed from examples/declarative/parallax/qml/ParallaxView.qml)15
-rw-r--r--examples/declarative/modelviews/parallax/qml/Smiley.qml (renamed from examples/declarative/parallax/qml/Smiley.qml)7
-rw-r--r--examples/declarative/modelviews/stringlistmodel/main.cpp (renamed from examples/declarative/stringlistmodel/main.cpp)0
-rw-r--r--examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro (renamed from examples/declarative/stringlistmodel/stringlistmodel.pro)0
-rw-r--r--examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc5
-rw-r--r--examples/declarative/modelviews/stringlistmodel/view.qml (renamed from examples/declarative/stringlistmodel/view.qml)0
-rw-r--r--examples/declarative/modelviews/webview/alerts.html (renamed from examples/declarative/webview/alerts.html)0
-rw-r--r--examples/declarative/modelviews/webview/alerts.qml (renamed from examples/declarative/webview/alerts.qml)2
-rw-r--r--examples/declarative/modelviews/webview/autosize.qml (renamed from examples/declarative/webview/autosize.qml)0
-rw-r--r--examples/declarative/modelviews/webview/content/FieldText.qml (renamed from examples/declarative/webview/content/FieldText.qml)0
-rw-r--r--examples/declarative/modelviews/webview/content/Mapping/Map.qml (renamed from examples/declarative/webview/content/Mapping/Map.qml)0
-rwxr-xr-xexamples/declarative/modelviews/webview/content/Mapping/map.html (renamed from examples/declarative/webview/content/Mapping/map.html)0
-rw-r--r--examples/declarative/modelviews/webview/content/SpinSquare.qml (renamed from examples/declarative/webview/content/SpinSquare.qml)0
-rw-r--r--examples/declarative/modelviews/webview/content/pics/cancel.png (renamed from examples/declarative/webview/content/pics/cancel.png)bin1038 -> 1038 bytes
-rw-r--r--examples/declarative/modelviews/webview/content/pics/ok.png (renamed from examples/declarative/webview/content/pics/ok.png)bin655 -> 655 bytes
-rw-r--r--examples/declarative/modelviews/webview/googleMaps.qml (renamed from examples/declarative/webview/googleMaps.qml)0
-rw-r--r--examples/declarative/modelviews/webview/inline-html.qml (renamed from examples/declarative/webview/inline-html.qml)0
-rw-r--r--examples/declarative/modelviews/webview/newwindows.html (renamed from examples/declarative/webview/newwindows.html)0
-rw-r--r--examples/declarative/modelviews/webview/newwindows.qml (renamed from examples/declarative/webview/newwindows.qml)0
-rw-r--r--examples/declarative/modelviews/webview/transparent.qml (renamed from examples/declarative/webview/transparent.qml)0
-rw-r--r--examples/declarative/modelviews/webview/webview.qmlproject (renamed from examples/declarative/progressbar/progressbar.qmlproject)0
-rw-r--r--examples/declarative/positioners/Button.qml38
-rw-r--r--examples/declarative/positioners/add.png (renamed from examples/declarative/layouts/add.png)bin1577 -> 1577 bytes
-rw-r--r--examples/declarative/positioners/del.png (renamed from examples/declarative/layouts/del.png)bin1661 -> 1661 bytes
-rw-r--r--examples/declarative/positioners/positioners.qml (renamed from examples/declarative/layouts/positioners.qml)16
-rw-r--r--examples/declarative/positioners/positioners.qmlproject18
-rw-r--r--examples/declarative/positioners/positioners.qmlproject.user41
-rw-r--r--examples/declarative/scrollbar/ScrollBar.qml33
-rw-r--r--examples/declarative/sqllocalstorage/hello.qml (renamed from examples/declarative/sql/hello.qml)0
-rw-r--r--examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject (renamed from examples/declarative/mousearea/mousearea.qmlproject)0
-rw-r--r--examples/declarative/text/fonts/availableFonts.qml17
-rw-r--r--examples/declarative/text/fonts/banner.qml (renamed from examples/declarative/fonts/banner.qml)0
-rw-r--r--examples/declarative/text/fonts/fonts.qml (renamed from examples/declarative/fonts/fonts.qml)6
-rw-r--r--examples/declarative/text/fonts/fonts.qmlproject (renamed from examples/declarative/fonts/fonts.qmlproject)0
-rw-r--r--examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf (renamed from examples/declarative/fonts/fonts/tarzeau_ocr_a.ttf)bin24544 -> 24544 bytes
-rw-r--r--examples/declarative/text/fonts/hello.qml (renamed from examples/declarative/fonts/hello.qml)2
-rw-r--r--examples/declarative/text/text.qmlproject (renamed from examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject)0
-rw-r--r--examples/declarative/threading/threadedlistmodel/dataloader.js (renamed from examples/declarative/listmodel-threaded/dataloader.js)0
-rw-r--r--examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject (renamed from examples/declarative/layouts/layouts.qmlproject)0
-rw-r--r--examples/declarative/threading/threadedlistmodel/timedisplay.qml (renamed from examples/declarative/listmodel-threaded/timedisplay.qml)0
-rw-r--r--examples/declarative/threading/threading.qmlproject (renamed from examples/declarative/images/images.qmlproject)0
-rw-r--r--examples/declarative/threading/workerscript/workerscript.js (renamed from examples/declarative/workerscript/workerscript.js)0
-rw-r--r--examples/declarative/threading/workerscript/workerscript.qml (renamed from examples/declarative/workerscript/workerscript.qml)0
-rw-r--r--examples/declarative/threading/workerscript/workerscript.qmlproject (renamed from examples/declarative/gestures/gestures.qmlproject)0
-rw-r--r--examples/declarative/touchinteraction/gestures/experimental-gestures.qml (renamed from examples/declarative/gestures/experimental-gestures.qml)0
-rw-r--r--examples/declarative/touchinteraction/gestures/gestures.qmlproject (renamed from examples/declarative/flipable/flipable.qmlproject)0
-rw-r--r--examples/declarative/touchinteraction/mousearea/mouse.qml (renamed from examples/declarative/mousearea/mouse.qml)2
-rw-r--r--examples/declarative/touchinteraction/mousearea/mousearea.qmlproject (renamed from examples/declarative/fillmode/fillmode.qmlproject)0
-rw-r--r--examples/declarative/touchinteraction/touchinteraction.qmlproject (renamed from examples/declarative/extending/extending.qmlproject)0
-rw-r--r--examples/declarative/toys/clocks/clocks.qml (renamed from examples/declarative/clocks/clocks.qml)0
-rw-r--r--examples/declarative/toys/clocks/clocks.qmlproject (renamed from examples/declarative/clocks/clocks.qmlproject)0
-rw-r--r--examples/declarative/toys/clocks/content/Clock.qml (renamed from examples/declarative/clocks/content/Clock.qml)0
-rw-r--r--examples/declarative/toys/clocks/content/background.png (renamed from examples/declarative/clocks/content/background.png)bin46895 -> 46895 bytes
-rwxr-xr-xexamples/declarative/toys/clocks/content/center.png (renamed from examples/declarative/clocks/content/center.png)bin765 -> 765 bytes
-rwxr-xr-xexamples/declarative/toys/clocks/content/clock-night.png (renamed from examples/declarative/clocks/content/clock-night.png)bin23359 -> 23359 bytes
-rwxr-xr-xexamples/declarative/toys/clocks/content/clock.png (renamed from examples/declarative/clocks/content/clock.png)bin20653 -> 20653 bytes
-rwxr-xr-xexamples/declarative/toys/clocks/content/hour.png (renamed from examples/declarative/clocks/content/hour.png)bin625 -> 625 bytes
-rwxr-xr-xexamples/declarative/toys/clocks/content/minute.png (renamed from examples/declarative/clocks/content/minute.png)bin625 -> 625 bytes
-rwxr-xr-xexamples/declarative/toys/clocks/content/second.png (renamed from examples/declarative/clocks/content/second.png)bin303 -> 303 bytes
-rw-r--r--examples/declarative/toys/dial/content/Dial.qml (renamed from examples/declarative/dial/content/Dial.qml)6
-rw-r--r--examples/declarative/toys/dial/content/background.png (renamed from examples/declarative/dial/content/background.png)bin35876 -> 35876 bytes
-rw-r--r--examples/declarative/toys/dial/content/needle.png (renamed from examples/declarative/dial/content/needle.png)bin342 -> 342 bytes
-rw-r--r--examples/declarative/toys/dial/content/needle_shadow.png (renamed from examples/declarative/dial/content/needle_shadow.png)bin632 -> 632 bytes
-rw-r--r--examples/declarative/toys/dial/content/overlay.png (renamed from examples/declarative/dial/content/overlay.png)bin3564 -> 3564 bytes
-rw-r--r--examples/declarative/toys/dial/dial-example.qml (renamed from examples/declarative/dial/dial-example.qml)10
-rw-r--r--examples/declarative/toys/dial/dial.qmlproject (renamed from examples/declarative/dial/dial.qmlproject)0
-rw-r--r--examples/declarative/toys/dynamic/dynamic.qml176
-rw-r--r--examples/declarative/toys/dynamic/dynamic.qmlproject (renamed from examples/declarative/dynamic/dynamic.qmlproject)0
-rw-r--r--examples/declarative/toys/dynamic/images/NOTE (renamed from examples/declarative/dynamic/images/NOTE)0
-rw-r--r--examples/declarative/toys/dynamic/images/face-smile.png (renamed from examples/declarative/animations/images/face-smile.png)bin15408 -> 15408 bytes
-rw-r--r--examples/declarative/toys/dynamic/images/moon.png (renamed from examples/declarative/dynamic/images/moon.png)bin1757 -> 1757 bytes
-rw-r--r--examples/declarative/toys/dynamic/images/rabbit_brown.png (renamed from examples/declarative/dynamic/images/rabbit_brown.png)bin1245 -> 1245 bytes
-rw-r--r--examples/declarative/toys/dynamic/images/rabbit_bw.png (renamed from examples/declarative/dynamic/images/rabbit_bw.png)bin1759 -> 1759 bytes
-rw-r--r--examples/declarative/toys/dynamic/images/star.png (renamed from examples/declarative/animations/images/star.png)bin349 -> 349 bytes
-rw-r--r--examples/declarative/toys/dynamic/images/sun.png (renamed from examples/declarative/animations/images/sun.png)bin8153 -> 8153 bytes
-rw-r--r--examples/declarative/toys/dynamic/images/tree_s.png (renamed from examples/declarative/dynamic/images/tree_s.png)bin3406 -> 3406 bytes
-rw-r--r--examples/declarative/toys/dynamic/qml/Button.qml40
-rw-r--r--examples/declarative/toys/dynamic/qml/PaletteItem.qml19
-rw-r--r--examples/declarative/toys/dynamic/qml/PerspectiveItem.qml25
-rw-r--r--examples/declarative/toys/dynamic/qml/Sun.qml38
-rw-r--r--examples/declarative/toys/dynamic/qml/itemCreation.js65
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/Button.qml (renamed from examples/declarative/tic-tac-toe/content/Button.qml)0
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/TicTac.qml (renamed from examples/declarative/tic-tac-toe/content/TicTac.qml)0
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/pics/board.png (renamed from examples/declarative/tic-tac-toe/content/pics/board.png)bin12258 -> 12258 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/pics/o.png (renamed from examples/declarative/tic-tac-toe/content/pics/o.png)bin1470 -> 1470 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/pics/x.png (renamed from examples/declarative/tic-tac-toe/content/pics/x.png)bin1331 -> 1331 bytes
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js (renamed from examples/declarative/tic-tac-toe/content/tic-tac-toe.js)0
-rw-r--r--examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml (renamed from examples/declarative/tic-tac-toe/tic-tac-toe.qml)0
-rw-r--r--examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject (renamed from examples/declarative/connections/connections.qmlproject)0
-rw-r--r--examples/declarative/toys/toys.qmlproject (renamed from examples/declarative/border-image/border-image.qmlproject)0
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.qml (renamed from examples/declarative/tvtennis/tvtennis.qml)8
-rw-r--r--examples/declarative/toys/tvtennis/tvtennis.qmlproject (renamed from examples/declarative/aspectratio/aspectratio.qmlproject)0
-rw-r--r--examples/declarative/toys/velocity/Day.qml (renamed from examples/declarative/velocity/Day.qml)2
-rw-r--r--examples/declarative/toys/velocity/cork.jpg (renamed from examples/declarative/velocity/cork.jpg)bin149337 -> 149337 bytes
-rw-r--r--examples/declarative/toys/velocity/note-yellow.png (renamed from examples/declarative/velocity/note-yellow.png)bin54559 -> 54559 bytes
-rw-r--r--examples/declarative/toys/velocity/tack.png (renamed from examples/declarative/velocity/tack.png)bin7282 -> 7282 bytes
-rw-r--r--examples/declarative/toys/velocity/velocity.qml (renamed from examples/declarative/velocity/velocity.qml)0
-rw-r--r--examples/declarative/toys/velocity/velocity.qmlproject (renamed from examples/declarative/animations/animations.qmlproject)0
-rw-r--r--examples/declarative/tutorials/extending/extending.pro9
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial1.qml3
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial2.qml3
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial3.qml5
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/Block.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/Button.qml17
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/samegame.qml7
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/Block.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/Button.qml17
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.js11
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.qml5
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Button.qml17
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Dialog.qml33
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.js20
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.qml14
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/Button.qml17
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml57
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/content/samegame.js28
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame.qml38
-rw-r--r--examples/declarative/tutorials/tutorials.pro5
-rw-r--r--examples/declarative/tvtennis/click.wavbin3056 -> 0 bytes
-rw-r--r--examples/declarative/tvtennis/paddle.wavbin5320 -> 0 bytes
-rw-r--r--examples/declarative/ui-components/flipable/content/5_heart.png (renamed from examples/declarative/flipable/content/5_heart.png)bin3872 -> 3872 bytes
-rw-r--r--examples/declarative/ui-components/flipable/content/9_club.png (renamed from examples/declarative/flipable/content/9_club.png)bin6135 -> 6135 bytes
-rw-r--r--examples/declarative/ui-components/flipable/content/Card.qml (renamed from examples/declarative/flipable/content/Card.qml)0
-rw-r--r--examples/declarative/ui-components/flipable/content/back.png (renamed from examples/declarative/flipable/content/back.png)bin1418 -> 1418 bytes
-rw-r--r--examples/declarative/ui-components/flipable/flipable-example.qml (renamed from examples/declarative/flipable/flipable-example.qml)0
-rw-r--r--examples/declarative/ui-components/flipable/flipable.qmlproject16
-rw-r--r--examples/declarative/ui-components/progressbar/content/ProgressBar.qml (renamed from examples/declarative/progressbar/content/ProgressBar.qml)0
-rw-r--r--examples/declarative/ui-components/progressbar/content/background.png (renamed from examples/declarative/progressbar/content/background.png)bin426 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/progressbar/progressbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/progressbar/progressbars.qml (renamed from examples/declarative/progressbar/progressbars.qml)0
-rw-r--r--examples/declarative/ui-components/scrollbar/ScrollBar.qml33
-rw-r--r--examples/declarative/ui-components/scrollbar/display.qml (renamed from examples/declarative/scrollbar/display.qml)6
-rw-r--r--examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg (renamed from examples/declarative/scrollbar/pics/niagara_falls.jpg)bin604121 -> 604121 bytes
-rw-r--r--examples/declarative/ui-components/scrollbar/scrollbar.qmlproject16
-rw-r--r--examples/declarative/ui-components/searchbox/SearchBox.qml (renamed from examples/declarative/searchbox/SearchBox.qml)0
-rw-r--r--examples/declarative/ui-components/searchbox/images/edit-clear-locationbar-rtl.png (renamed from examples/declarative/searchbox/images/edit-clear-locationbar-rtl.png)bin429 -> 429 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png (renamed from examples/declarative/searchbox/images/lineedit-bg-focus.png)bin526 -> 526 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/images/lineedit-bg.png (renamed from examples/declarative/searchbox/images/lineedit-bg.png)bin426 -> 426 bytes
-rw-r--r--examples/declarative/ui-components/searchbox/main.qml (renamed from examples/declarative/searchbox/main.qml)0
-rw-r--r--examples/declarative/ui-components/searchbox/searchbox.qmlproject16
-rw-r--r--examples/declarative/ui-components/slideswitch/content/Switch.qml (renamed from examples/declarative/slideswitch/content/Switch.qml)4
-rw-r--r--examples/declarative/ui-components/slideswitch/content/background.svg (renamed from examples/declarative/slideswitch/content/background.svg)0
-rw-r--r--examples/declarative/ui-components/slideswitch/content/knob.svg (renamed from examples/declarative/slideswitch/content/knob.svg)0
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.qml (renamed from examples/declarative/slideswitch/slideswitch.qml)0
-rw-r--r--examples/declarative/ui-components/slideswitch/slideswitch.qmlproject16
-rw-r--r--examples/declarative/ui-components/spinner/content/Spinner.qml25
-rw-r--r--examples/declarative/ui-components/spinner/content/spinner-bg.pngbin0 -> 345 bytes
-rw-r--r--examples/declarative/ui-components/spinner/content/spinner-select.pngbin0 -> 320 bytes
-rw-r--r--examples/declarative/ui-components/spinner/main.qml18
-rw-r--r--examples/declarative/ui-components/spinner/spinner.qmlproject16
-rw-r--r--examples/declarative/ui-components/tabwidget/TabWidget.qml (renamed from examples/declarative/tabwidget/TabWidget.qml)0
-rw-r--r--examples/declarative/ui-components/tabwidget/tab.png (renamed from examples/declarative/tabwidget/tab.png)bin507 -> 507 bytes
-rw-r--r--examples/declarative/ui-components/tabwidget/tabs.qml (renamed from examples/declarative/tabwidget/tabs.qml)0
-rw-r--r--examples/declarative/ui-components/tabwidget/tabwidget.qmlproject16
-rw-r--r--examples/declarative/ui-components/ui-components.qmlproject16
-rw-r--r--examples/declarative/xml/xml.qmlproject16
-rw-r--r--examples/declarative/xml/xmlhttprequest/test.qml (renamed from examples/declarative/xmlhttprequest/test.qml)0
-rw-r--r--examples/declarative/xml/xmlhttprequest/test.xml (renamed from examples/declarative/xmlhttprequest/test.xml)0
-rw-r--r--examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject16
-rw-r--r--examples/declarative/xmldata/daringfireball.qml48
-rw-r--r--examples/declarative/xmldata/yahoonews.qml83
-rw-r--r--examples/graphicsview/padnavigator/flippablepad.cpp99
-rw-r--r--examples/graphicsview/padnavigator/flippablepad.h64
-rw-r--r--examples/graphicsview/padnavigator/form.ui (renamed from examples/graphicsview/padnavigator/backside.ui)4
-rw-r--r--examples/graphicsview/padnavigator/main.cpp14
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.cpp307
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.h71
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.pro23
-rw-r--r--examples/graphicsview/padnavigator/panel.cpp238
-rw-r--r--examples/graphicsview/padnavigator/panel.h92
-rw-r--r--examples/graphicsview/padnavigator/roundrectitem.cpp146
-rw-r--r--examples/graphicsview/padnavigator/roundrectitem.h51
-rw-r--r--examples/graphicsview/padnavigator/splashitem.cpp48
-rw-r--r--examples/graphicsview/padnavigator/splashitem.h25
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp3
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp12
-rw-r--r--examples/network/bearermonitor/sessionwidget.h5
-rw-r--r--examples/network/bearermonitor/sessionwidget.ui2
-rw-r--r--mkspecs/common/symbian/symbian-makefile.conf8
-rw-r--r--mkspecs/common/symbian/symbian.conf2
-rw-r--r--mkspecs/features/qttest_p4.prf2
-rw-r--r--mkspecs/features/symbian/symbian_building.prf43
-rw-r--r--mkspecs/symbian/linux-armcc/qmake.conf6
-rw-r--r--mkspecs/symbian/linux-gcce/qmake.conf16
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h2
-rw-r--r--qmake/generators/win32/msvc_vcxproj.cpp1
-rw-r--r--qmake/qmake.pri8
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/ChangeLog9
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog35
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/qt/api/QtScript.pro2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h6
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog449
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.gypi18
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pri9
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro39
-rw-r--r--src/3rdparty/webkit/WebCore/css/CSSValueKeywords.in5
-rw-r--r--src/3rdparty/webkit/WebCore/css/MediaQueryEvaluator.cpp3
-rw-r--r--src/3rdparty/webkit/WebCore/css/MediaQueryExp.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/css/MediaQueryExp.h3
-rw-r--r--src/3rdparty/webkit/WebCore/css/StyleMedia.cpp (renamed from src/3rdparty/webkit/WebCore/css/Media.cpp)8
-rw-r--r--src/3rdparty/webkit/WebCore/css/StyleMedia.h (renamed from src/3rdparty/webkit/WebCore/css/Media.h)17
-rw-r--r--src/3rdparty/webkit/WebCore/css/StyleMedia.idl (renamed from src/3rdparty/webkit/WebCore/css/Media.idl)3
-rw-r--r--src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c843
-rw-r--r--src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.h325
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h2
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSMedia.cpp201
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp201
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h (renamed from src/3rdparty/webkit/WebCore/generated/JSMedia.h)30
-rw-r--r--src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/page/AbstractView.idl2
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMWindow.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMWindow.h8
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMWindow.idl2
-rw-r--r--src/3rdparty/webkit/WebCore/page/EventHandler.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/page/FocusController.cpp74
-rw-r--r--src/3rdparty/webkit/WebCore/page/FocusController.h5
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.h2
-rw-r--r--src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/page/SpatialNavigation.h5
-rw-r--r--src/3rdparty/webkit/WebCore/platform/FileSystem.h6
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.h3
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/MediaPlayer.cpp3
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp16
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp29
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h11
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp18
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h1
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp3
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp18
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp (renamed from src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp)0
-rw-r--r--src/3rdparty/webkit/WebKit.pri2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp24
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp20
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp23
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp45
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp66
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp216
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp36
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp24
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp132
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog200
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc109
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp56
-rw-r--r--src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp8
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp40
-rw-r--r--src/corelib/animation/qabstractanimation.cpp3
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian.cpp63
-rw-r--r--src/corelib/io/qfilesystemwatcher_symbian_p.h6
-rw-r--r--src/corelib/io/qiodevice.cpp3
-rw-r--r--src/corelib/io/qurl.cpp6
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp56
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp13
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h7
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h1
-rw-r--r--src/corelib/tools/qchar.cpp31
-rw-r--r--src/corelib/tools/qchar.h9
-rw-r--r--src/corelib/tools/qdatetime.cpp44
-rw-r--r--src/corelib/tools/qdatetime.h1
-rw-r--r--src/corelib/tools/qlocale.cpp12
-rw-r--r--src/corelib/tools/qlocale_p.h18
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp53
-rw-r--r--src/corelib/tools/qmap.h20
-rw-r--r--src/dbus/qdbusinternalfilters.cpp2
-rw-r--r--src/dbus/qdbusxmlgenerator.cpp2
-rw-r--r--src/declarative/QmlChanges.txt19
-rw-r--r--src/declarative/declarative.pro4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp50
-rw-r--r--src/declarative/graphicsitems/qdeclarativeevents.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp253
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h35
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp17
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp117
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp224
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp575
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.h48
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h76
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp128
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp148
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader_p.h10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp68
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea_p.h8
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp31
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp35
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp111
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp121
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp93
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp96
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp91
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp142
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp88
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h6
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp21
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h2
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp33
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings_p.h6
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp86
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h4
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp112
-rw-r--r--src/declarative/qml/qdeclarativecomponent.h7
-rw-r--r--src/declarative/qml/qdeclarativecomponent_p.h3
-rw-r--r--src/declarative/qml/qdeclarativecompositetypedata_p.h2
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp77
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp21
-rw-r--r--src/declarative/qml/qdeclarativecontext.h2
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h1
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass.cpp46
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass_p.h4
-rw-r--r--src/declarative/qml/qdeclarativedata_p.h10
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp946
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h109
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass.cpp20
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeguard_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp925
-rw-r--r--src/declarative/qml/qdeclarativeimport_p.h139
-rw-r--r--src/declarative/qml/qdeclarativeinclude.cpp316
-rw-r--r--src/declarative/qml/qdeclarativeinclude_p.h115
-rw-r--r--src/declarative/qml/qdeclarativeinfo.cpp3
-rw-r--r--src/declarative/qml/qdeclarativeinstruction.cpp3
-rw-r--r--src/declarative/qml/qdeclarativeinstruction_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp13
-rw-r--r--src/declarative/qml/qdeclarativeparser_p.h3
-rw-r--r--src/declarative/qml/qdeclarativeparserstatus.cpp10
-rw-r--r--src/declarative/qml/qdeclarativeparserstatus.h4
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp31
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h1
-rw-r--r--src/declarative/qml/qdeclarativepropertyvaluesource.cpp3
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp75
-rw-r--r--src/declarative/qml/qdeclarativescriptstring.h2
-rw-r--r--src/declarative/qml/qdeclarativestringconverters_p.h2
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp220
-rw-r--r--src/declarative/qml/qdeclarativevaluetype_p.h147
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp11
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp3
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp35
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript_p.h5
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp27
-rw-r--r--src/declarative/qml/qml.pri4
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp154
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h1
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp23
-rw-r--r--src/declarative/util/qdeclarativebehavior_p.h3
-rw-r--r--src/declarative/util/qdeclarativebind.cpp9
-rw-r--r--src/declarative/util/qdeclarativebind_p.h1
-rw-r--r--src/declarative/util/qdeclarativeconnections.cpp50
-rw-r--r--src/declarative/util/qdeclarativeconnections_p.h5
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp9
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp38
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent_p.h2
-rw-r--r--src/declarative/util/qdeclarativeopenmetaobject.cpp2
-rw-r--r--src/declarative/util/qdeclarativepackage.cpp4
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp6
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp32
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp6
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p.h2
-rw-r--r--src/declarative/util/qdeclarativesmoothedfollow.cpp6
-rw-r--r--src/declarative/util/qdeclarativesmoothedfollow_p.h2
-rw-r--r--src/declarative/util/qdeclarativespringfollow.cpp2
-rw-r--r--src/declarative/util/qdeclarativestate.cpp4
-rw-r--r--src/declarative/util/qdeclarativestate_p.h1
-rw-r--r--src/declarative/util/qdeclarativestategroup.cpp10
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp105
-rw-r--r--src/declarative/util/qdeclarativestateoperations_p.h3
-rw-r--r--src/declarative/util/qdeclarativesystempalette.cpp1
-rw-r--r--src/declarative/util/qdeclarativetimeline.cpp15
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp4
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager_p_p.h2
-rw-r--r--src/declarative/util/qdeclarativeview.cpp61
-rw-r--r--src/declarative/util/qdeclarativeview.h3
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp99
-rw-r--r--src/gui/dialogs/qcolordialog_mac.mm20
-rw-r--r--src/gui/dialogs/qfiledialog.h1
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm32
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp15
-rw-r--r--src/gui/dialogs/qfileinfogatherer_p.h3
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm16
-rw-r--r--src/gui/dialogs/qmessagebox.h2
-rw-r--r--src/gui/dialogs/qnspanelproxy_mac.mm24
-rw-r--r--src/gui/dialogs/qpagesetupdialog_mac.mm8
-rw-r--r--src/gui/dialogs/qprintdialog_mac.mm8
-rw-r--r--src/gui/dialogs/qwizard_win.cpp3
-rw-r--r--src/gui/effects/qgraphicseffect.cpp2
-rw-r--r--src/gui/egl/qegl_qws.cpp2
-rw-r--r--src/gui/egl/qegl_x11.cpp5
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp60
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h1
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp38
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h40
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp78
-rw-r--r--src/gui/graphicsview/qgraphicsview_p.h33
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp14
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp9
-rw-r--r--src/gui/image/qpixmapcache.cpp43
-rw-r--r--src/gui/image/qpixmapcache.h10
-rw-r--r--src/gui/image/qpixmapcache_p.h2
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp2
-rw-r--r--src/gui/kernel/qapplication.cpp17
-rw-r--r--src/gui/kernel/qapplication_win.cpp2
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac.mm21
-rw-r--r--src/gui/kernel/qdnd_qws.cpp4
-rw-r--r--src/gui/kernel/qdnd_x11.cpp6
-rw-r--r--src/gui/kernel/qgesturemanager.cpp33
-rw-r--r--src/gui/kernel/qgesturemanager_p.h2
-rw-r--r--src/gui/kernel/qsound_mac.mm6
-rw-r--r--src/gui/kernel/qt_mac_p.h2
-rw-r--r--src/gui/kernel/qwidget.cpp88
-rw-r--r--src/gui/kernel/qwidget_mac.mm30
-rw-r--r--src/gui/kernel/qwidget_p.h8
-rw-r--r--src/gui/kernel/qwidget_win.cpp7
-rw-r--r--src/gui/kernel/qwidget_wince.cpp4
-rw-r--r--src/gui/kernel/qwidget_x11.cpp2
-rw-r--r--src/gui/painting/qbezier.cpp228
-rw-r--r--src/gui/painting/qbezier_p.h7
-rw-r--r--src/gui/painting/qdatabuffer_p.h19
-rw-r--r--src/gui/painting/qdrawutil.cpp14
-rw-r--r--src/gui/painting/qoutlinemapper.cpp3
-rw-r--r--src/gui/painting/qoutlinemapper_p.h11
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp52
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h3
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp2
-rw-r--r--src/gui/painting/qpaintengineex.cpp5
-rw-r--r--src/gui/painting/qpathclipper.cpp23
-rw-r--r--src/gui/painting/qpathclipper_p.h7
-rw-r--r--src/gui/painting/qpolygonclipper_p.h3
-rw-r--r--src/gui/painting/qprintengine_pdf.cpp46
-rw-r--r--src/gui/painting/qprintengine_pdf_p.h1
-rw-r--r--src/gui/painting/qrasterizer.cpp8
-rw-r--r--src/gui/painting/qstroker.cpp23
-rw-r--r--src/gui/painting/qstroker_p.h18
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h2
-rw-r--r--src/gui/painting/qtransform.cpp9
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp6
-rw-r--r--src/gui/styles/qgtkstyle.cpp45
-rw-r--r--src/gui/styles/qmacstyle_mac.mm20
-rw-r--r--src/gui/styles/qs60style_s60.cpp14
-rw-r--r--src/gui/styles/styles.pri7
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextengine_p.h2
-rw-r--r--src/gui/util/qcompleter.cpp21
-rw-r--r--src/gui/util/qsystemtrayicon_mac.mm37
-rw-r--r--src/gui/widgets/qabstractslider.cpp8
-rw-r--r--src/gui/widgets/qcocoatoolbardelegate_mac.mm2
-rw-r--r--src/gui/widgets/qcocoatoolbardelegate_mac_p.h2
-rw-r--r--src/gui/widgets/qcombobox.cpp3
-rw-r--r--src/gui/widgets/qcommandlinkbutton.cpp3
-rw-r--r--src/gui/widgets/qdockarealayout.cpp46
-rw-r--r--src/gui/widgets/qdockarealayout_p.h4
-rw-r--r--src/gui/widgets/qdockwidget.cpp9
-rw-r--r--src/gui/widgets/qmainwindowlayout_mac.mm2
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp2
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp277
-rw-r--r--src/imports/webkit/qdeclarativewebview_p.h32
-rw-r--r--src/imports/widgets/qmldir1
-rw-r--r--src/imports/widgets/widgets.cpp71
-rw-r--r--src/imports/widgets/widgets.pro30
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp11
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h2
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp7
-rw-r--r--src/network/access/qhttpnetworkrequest.cpp13
-rw-r--r--src/network/access/qhttpnetworkrequest_p.h4
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp5
-rw-r--r--src/network/access/qnetworkaccessbackend_p.h1
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp13
-rw-r--r--src/network/access/qnetworkaccesshttpbackend_p.h1
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp27
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp8
-rw-r--r--src/network/access/qnetworkrequest.cpp52
-rw-r--r--src/network/access/qnetworkrequest.h7
-rw-r--r--src/network/kernel/qhostinfo.cpp29
-rw-r--r--src/network/kernel/qhostinfo_p.h4
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp3
-rw-r--r--src/network/socket/qtcpserver.cpp18
-rw-r--r--src/network/socket/qtcpserver.h1
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h4
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp90
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h3
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker.cpp5
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qtriangulator.cpp12
-rw-r--r--src/opengl/qgl.cpp79
-rw-r--r--src/opengl/qgl.h1
-rw-r--r--src/opengl/qgl_egl.cpp20
-rw-r--r--src/opengl/qgl_p.h8
-rw-r--r--src/opengl/qglpaintdevice.cpp5
-rw-r--r--src/opengl/qpaintengine_opengl.cpp5
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp405
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.h15
-rw-r--r--src/plugins/bearer/symbian/symbian.pro1
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp248
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h27
-rw-r--r--src/plugins/imageformats/gif/qgifhandler.cpp7
-rw-r--r--src/plugins/imageformats/svg/qsvgiohandler.cpp10
-rw-r--r--src/s60installs/bwins/QtCoreu.def2
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def71
-rw-r--r--src/s60installs/bwins/QtGuiu.def8
-rw-r--r--src/s60installs/eabi/QtCoreu.def2
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def88
-rw-r--r--src/s60installs/eabi/QtGuiu.def7
-rw-r--r--src/src.pro20
-rw-r--r--tests/auto/bic/tst_bic.cpp2
-rw-r--r--tests/auto/declarative/declarative.pro137
-rw-r--r--tests/auto/declarative/examples/examples.pro9
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp25
-rw-r--r--tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml52
-rw-r--r--tests/auto/declarative/graphicswidgets/graphicswidgets.pro10
-rw-r--r--tests/auto/declarative/parserstress/parserstress.pro9
-rw-r--r--tests/auto/declarative/parserstress/tst_parserstress.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp53
-rw-r--r--tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp21
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml16
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro9
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp90
-rw-r--r--tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro9
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro6
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp37
-rw-r--r--tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro6
-rw-r--r--tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro9
-rw-r--r--tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/blank.js0
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/eval.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/exception.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml19
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml5
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.js8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml21
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml26
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp231
-rw-r--r--tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro6
-rw-r--r--tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro6
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp28
-rw-r--r--tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro9
-rw-r--r--tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro9
-rw-r--r--tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro9
-rw-r--r--tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro6
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp196
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro9
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml9
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro15
-rw-r--r--tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp115
-rw-r--r--tests/auto/declarative/qdeclarativelayouts/data/layouts.qml31
-rw-r--r--tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro10
-rw-r--r--tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp147
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro9
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro9
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/NoResize.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp76
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro6
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml28
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro9
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp46
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro9
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml38
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml88
-rw-r--r--tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro9
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp70
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro9
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro9
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp123
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/darker.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/lighter.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp26
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/objlist.qml2
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro9
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp19
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro9
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedfollow/qdeclarativesmoothedfollow.pro9
-rw-r--r--tests/auto/declarative/qdeclarativespringfollow/qdeclarativespringfollow.pro9
-rw-r--r--tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro9
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml24
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml14
-rw-r--r--tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro9
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp277
-rw-r--r--tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro7
-rw-r--r--tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml12
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro9
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp28
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml12
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro9
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp30
-rw-r--r--tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro6
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml22
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml21
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml14
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml8
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml7
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml10
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro9
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.h30
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp148
-rw-r--r--tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/data/orientation.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro18
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp108
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml16
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro10
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp99
-rw-r--r--tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro9
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro9
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro10
-rw-r--r--tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro9
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml4
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.pngbin0 -> 1149 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.pngbin0 -> 1173 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.pngbin0 -> 1173 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.pngbin0 -> 1149 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml1151
-rw-r--r--tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml27
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml4
-rw-r--r--tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.0.pngbin6886 -> 0 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml83
-rw-r--r--tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.0.pngbin6886 -> 0 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml83
-rw-r--r--tests/auto/declarative/qmlvisual/qmlvisual.pro31
-rw-r--r--tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp7
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml (renamed from tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml)0
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.qml115
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.pngbin0 -> 10185 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml115
-rw-r--r--tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.0.pngbin5659 -> 0 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml363
-rw-r--r--tests/auto/declarative/qmlvisual/webview/embedding/egg.qml26
-rw-r--r--tests/auto/declarative/qmlvisual/webview/embedding/nesting.html9
-rw-r--r--tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml9
-rw-r--r--tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp2
-rw-r--r--tests/auto/gestures/tst_gestures.cpp71
-rw-r--r--tests/auto/languagechange/tst_languagechange.cpp4
-rw-r--r--tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro1
-rw-r--r--tests/auto/qabstractsocket/qabstractsocket.pro1
-rw-r--r--tests/auto/qbuffer/tst_qbuffer.cpp26
-rw-r--r--tests/auto/qcolumnview/tst_qcolumnview.cpp10
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp26
-rw-r--r--tests/auto/qdirmodel/tst_qdirmodel.cpp5
-rw-r--r--tests/auto/qdockwidget/tst_qdockwidget.cpp24
-rw-r--r--tests/auto/qfile/largefile/tst_largefile.cpp4
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp4
-rw-r--r--tests/auto/qfiledialog2/tst_qfiledialog2.cpp16
-rw-r--r--tests/auto/qftp/qftp.pro1
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp24
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp15
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp57
-rw-r--r--tests/auto/qhostaddress/qhostaddress.pro1
-rw-r--r--tests/auto/qhostinfo/qhostinfo.pro1
-rw-r--r--tests/auto/qhttp/qhttp.pro1
-rw-r--r--tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro2
-rw-r--r--tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro1
-rw-r--r--tests/auto/qhttpsocketengine/qhttpsocketengine.pro1
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp63
-rw-r--r--tests/auto/qiodevice/qiodevice.pro1
-rw-r--r--tests/auto/qlocalsocket/qlocalsocket.pro1
-rw-r--r--tests/auto/qmessagebox/tst_qmessagebox.cpp2
-rw-r--r--tests/auto/qnativesocketengine/qnativesocketengine.pro1
-rw-r--r--tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro1
-rw-r--r--tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro1
-rw-r--r--tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro2
-rw-r--r--tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro1
-rw-r--r--tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp7
-rw-r--r--tests/auto/qnetworkcookie/qnetworkcookie.pro1
-rw-r--r--tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro1
-rw-r--r--tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro1
-rw-r--r--tests/auto/qnetworkinterface/qnetworkinterface.pro1
-rw-r--r--tests/auto/qnetworkproxy/qnetworkproxy.pro1
-rw-r--r--tests/auto/qnetworkreply/qnetworkreply.pro1
-rw-r--r--tests/auto/qnetworkreply/smb-file.txt1
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp23
-rw-r--r--tests/auto/qnetworkrequest/qnetworkrequest.pro1
-rw-r--r--tests/auto/qnetworksession/lackey/main.cpp24
-rw-r--r--tests/auto/qnetworksession/qnetworksession.pro1
-rw-r--r--tests/auto/qnetworksession/test/tst_qnetworksession.cpp391
-rw-r--r--tests/auto/qpixmapcache/tst_qpixmapcache.cpp34
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp28
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp24
-rw-r--r--tests/auto/qsocketnotifier/qsocketnotifier.pro1
-rw-r--r--tests/auto/qsocks5socketengine/qsocks5socketengine.pro1
-rw-r--r--tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp61
-rw-r--r--tests/auto/qsslcertificate/qsslcertificate.pro1
-rw-r--r--tests/auto/qsslcipher/qsslcipher.pro1
-rw-r--r--tests/auto/qsslerror/qsslerror.pro1
-rw-r--r--tests/auto/qsslkey/qsslkey.pro1
-rw-r--r--tests/auto/qsslsocket/qsslsocket.pro2
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp31
-rw-r--r--tests/auto/qtcpserver/qtcpserver.pro1
-rw-r--r--tests/auto/qtcpsocket/qtcpsocket.pro1
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp26
-rw-r--r--tests/auto/qudpsocket/qudpsocket.pro1
-rw-r--r--tests/auto/qurl/qurl.pro1
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp8
-rw-r--r--tests/auto/qwidgetaction/tst_qwidgetaction.cpp6
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp18
-rw-r--r--tests/auto/xmlpatternsxqts/tst_suitetest.cpp15
-rw-r--r--tests/benchmarks/declarative/binding/binding.pro14
-rw-r--r--tests/benchmarks/declarative/compilation/compilation.pro11
-rw-r--r--tests/benchmarks/declarative/compilation/data/BoomBlock.qml65
-rw-r--r--tests/benchmarks/declarative/compilation/tst_compilation.cpp (renamed from tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp)46
-rw-r--r--tests/benchmarks/declarative/creation/creation.pro11
-rw-r--r--tests/benchmarks/declarative/creation/tst_creation.cpp10
-rw-r--r--tests/benchmarks/declarative/declarative.pro5
-rw-r--r--tests/benchmarks/declarative/painting/painting.pro1
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro18
-rw-r--r--tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro10
-rw-r--r--tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp12
-rw-r--r--tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro9
-rw-r--r--tests/benchmarks/declarative/script/data/slot_complex_js.js8
-rw-r--r--tests/benchmarks/declarative/script/data/slot_complex_js.qml14
-rw-r--r--tests/benchmarks/declarative/script/data/slot_simple_js.js3
-rw-r--r--tests/benchmarks/declarative/script/data/slot_simple_js.qml10
-rw-r--r--tests/benchmarks/declarative/script/script.pro9
-rw-r--r--tests/benchmarks/declarative/script/tst_script.cpp6
-rw-r--r--tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp38
-rw-r--r--tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp5
-rw-r--r--tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp79
-rw-r--r--tests/manual/bearerex/bearerex.cpp18
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp1
-rw-r--r--tools/assistant/tools/assistant/contentwindow.cpp18
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp1
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.h1
-rw-r--r--tools/configure/configureapp.cpp4
-rw-r--r--tools/designer/src/designer/qdesigner_actions.cpp1
-rw-r--r--tools/qdoc3/htmlgenerator.cpp232
-rw-r--r--tools/qdoc3/htmlgenerator.h1
-rw-r--r--tools/qdoc3/node.cpp2
-rw-r--r--tools/qdoc3/test/assistant.qdocconf43
-rw-r--r--tools/qdoc3/test/designer.qdocconf57
-rw-r--r--tools/qdoc3/test/linguist.qdocconf57
-rw-r--r--tools/qdoc3/test/macros.qdocconf1
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf60
-rw-r--r--tools/qdoc3/test/qmake.qdocconf61
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf60
-rw-r--r--tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf60
-rw-r--r--tools/qdoc3/test/qt-defines.qdocconf37
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf90
-rw-r--r--tools/qdoc3/test/qt.qdocconf52
-rw-r--r--tools/qdoc3/test/qt_zh_CN.qdocconf60
-rw-r--r--tools/qdoc3/test/style/style.css797
-rw-r--r--tools/qml/Info_mac.plist2
-rw-r--r--tools/qml/content/Browser.qml6
-rw-r--r--tools/qml/loggerwidget.cpp120
-rw-r--r--tools/qml/loggerwidget.h32
-rw-r--r--tools/qml/main.cpp79
-rw-r--r--tools/qml/qdeclarativefolderlistmodel.cpp5
-rw-r--r--tools/qml/qdeclarativefolderlistmodel.h1
-rw-r--r--tools/qml/qml.icnsbin0 -> 196156 bytes
-rw-r--r--tools/qml/qml.pri8
-rw-r--r--tools/qml/qml.pro5
-rw-r--r--tools/qml/qmlruntime.cpp386
-rw-r--r--tools/qml/qmlruntime.h29
-rw-r--r--tools/runonphone/main.cpp4
-rw-r--r--tools/runonphone/symbianutils/launcher.cpp18
-rw-r--r--tools/runonphone/symbianutils/trkutils.cpp22
-rw-r--r--tools/runonphone/symbianutils/trkutils.h8
1362 files changed, 22502 insertions, 11510 deletions
diff --git a/.gitignore b/.gitignore
index ad8e3ea..5707371 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,7 +52,6 @@ bin/Qt*.dll
bin/assistant*
bin/designer*
bin/dumpcpp*
-bin/duiviewer*
bin/idc*
bin/linguist*
bin/lrelease*
diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index e844767..7453ba5 100755
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -69,15 +69,17 @@ Convenience script for creating signed packages you can install on your phone.
Usage: createpackage.pl [options] templatepkg [target]-[platform] [certificate key [passphrase]]
Where supported options are as follows:
- [-i|install] = Install the package right away using PC suite
+ [-i|install] = Install the package right away using PC suite.
[-p|preprocess] = Only preprocess the template .pkg file.
- [-c|certfile=<file>] = The file containing certificate information for signing.
+ [-c|certfile <file>] = The file containing certificate information for signing.
The file can have several certificates, each specified in
separate line. The certificate, key and passphrase in line
must be ';' separated. Lines starting with '#' are treated
as a comments. Also empty lines are ignored. The paths in
<file> can be absolute or relative to <file>.
- [-u|unsigned] = Preserves the unsigned package
+ [-u|unsigned] = Preserves the unsigned package.
+ [-s|stub] = Generates stub sis for ROM.
+ [-n|sisname <name>] = Specifies the final sis name.
Where parameters are as follows:
templatepkg = Name of .pkg file template
target = Either debug or release
@@ -118,12 +120,14 @@ my $preprocessonly = "";
my $certfile = "";
my $preserveUnsigned = "";
my $stub = "";
+my $signed_sis_name = "";
unless (GetOptions('i|install' => \$install,
'p|preprocess' => \$preprocessonly,
'c|certfile=s' => \$certfile,
'u|unsigned' => \$preserveUnsigned,
- 's|stub' => \$stub,)){
+ 's|stub' => \$stub,
+ 'n|sisname=s' => \$signed_sis_name,)) {
Usage();
}
@@ -162,10 +166,21 @@ $pkgoutputbasename = $pkgoutputbasename;
# Store output file names to variables
my $pkgoutput = $pkgoutputbasename.".pkg";
-my $sisoutputbasename = $pkgoutputbasename;
-$sisoutputbasename =~ s/_$targetplatform//g;
+my $sisoutputbasename;
+if ($signed_sis_name eq "") {
+ $sisoutputbasename = $pkgoutputbasename;
+ $sisoutputbasename =~ s/_$targetplatform//g;
+ $signed_sis_name = $sisoutputbasename.".sis";
+} else {
+ $sisoutputbasename = $signed_sis_name;
+ if ($sisoutputbasename =~ m/(\.sis$|\.sisx$)/i) {
+ $sisoutputbasename =~ s/$1//i;
+ } else {
+ $signed_sis_name = $signed_sis_name.".sis";
+ }
+}
+
my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis";
-my $signed_sis_name = $sisoutputbasename.".sis";
my $stub_sis_name = $sisoutputbasename."_stub.sis";
# Store some utility variables
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h b/config.tests/symbian/simple/main.cpp
index 3050662..9227c42 100644
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h
+++ b/config.tests/symbian/simple/main.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -38,17 +38,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
-#include <QGraphicsWidget>
-#include <QPainter>
+#include <stdio.h>
-class RedSquare : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
- {
- painter->fillRect(0, 0, size().width(), size().height(), QColor(Qt::red));
- }
-};
-//![0]
+int main(int, char **) {
+ printf("test\n");
+ return 0;
+}
diff --git a/config.tests/symbian/simple/simple.pro b/config.tests/symbian/simple/simple.pro
new file mode 100644
index 0000000..fa086c9
--- /dev/null
+++ b/config.tests/symbian/simple/simple.pro
@@ -0,0 +1,4 @@
+TEMPLATE = app
+QT =
+SOURCES += main.cpp
+
diff --git a/config.tests/unix/bsymbolic_functions.test b/config.tests/unix/bsymbolic_functions.test
index 52fdb32..6c34895 100755
--- a/config.tests/unix/bsymbolic_functions.test
+++ b/config.tests/unix/bsymbolic_functions.test
@@ -4,11 +4,12 @@ BSYMBOLIC_FUNCTIONS_SUPPORT=no
COMPILER=$1
VERBOSE=$2
+
cat >>bsymbolic_functions.c << EOF
int main() { return 0; }
EOF
-"$COMPILER" -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
+$COMPILER -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
rm -f bsymbolic_functions.c libtest.so
# done
diff --git a/configure b/configure
index 035b7c1..1ef71a4 100755
--- a/configure
+++ b/configure
@@ -607,7 +607,7 @@ mkdir -p "$outpath/config.tests"
rm -f "$outpath/config.tests/.qmake.cache"
cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
-QMakeVar add styles "cde mac motif plastique cleanlooks windows"
+QMakeVar add styles "cde mac motif plastique cleanlooks windows s60"
QMakeVar add decorations "default windows styled"
QMakeVar add mouse-drivers "pc"
if [ "$UNAME_SYSTEM" = "Linux" ] ; then
@@ -778,7 +778,7 @@ L_FLAGS=
RPATH_FLAGS=
l_FLAGS=
QCONFIG_FLAGS=
-XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
+XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" or "symbian/linux-gcce"
PLATFORM=$QMAKESPEC
QT_CROSS_COMPILE=no
OPT_CONFIRM_LICENSE=no
@@ -3081,8 +3081,8 @@ fi
# auto-detect support for separate debug info in objcopy
if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
- TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_].*=%%p' | tr '\n' ' '`
- TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_].*=%%p' | tr '\n' ' '`
+ TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_=]*[+*]*=%%p' | tr '\n' ' '`
+ TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_=]*[+*]*=%%p' | tr '\n' ' '`
TEST_OBJCOPY=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_OBJCOPY" | sed "s%.* *= *\(.*\)$%\1%" | tail -1`
COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
@@ -4034,7 +4034,7 @@ if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
EOF
fi
-if echo "$XPLATFORM" | grep symbian > /dev/null ; then
+case "$XPLATFORM" in *symbian*)
cat << EOF
Qt for Symbian only:
@@ -4046,7 +4046,8 @@ Qt for Symbian only:
-no-usedeffiles .... Disable the usage of DEF files.
* -usedeffiles ....... Enable the usage of DEF files.
EOF
-fi
+;;
+esac
[ "x$ERROR" = "xyes" ] && exit 1
exit 0
@@ -4674,6 +4675,40 @@ if [ "$CFG_ZLIB" = "auto" ]; then
fi
fi
+case "$XPLATFORM" in *symbian*)
+ if test -z "$EPOCROOT"; then
+ echo "Please export EPOCROOT. It should point to the sdk install dir"
+ exit 1
+ fi
+ if test ! -d "$EPOCROOT/epoc32"; then
+ echo "Could not find the 'epoc32' dir in your EPOCROOT."
+ exit 1
+ fi
+
+ # the main commands needed to compile;
+ (cd config.tests/symbian
+ mkdir -p rcomp
+ cd rcomp
+ rm -f rcomp_test.rsg
+ touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss
+ rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null
+ if test ! -f rcomp_test.rsg; then
+ echo "Finding a working rcomp in your PATH failed."
+ echo "Fatal error. Make sure you have the epoc tools working and in your PATH";
+ exit 1;
+ fi
+ )
+
+ # compile a simple main that uses printf
+ if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS
+ then
+ echo "Testing your compiler failed. Could not compile a simple application."
+ echo "Fatal error; Rerun configure with -verbose to get more details."
+ exit 1;
+ fi
+ ;;
+esac
+
if [ "$CFG_S60" = "auto" ]; then
if echo "$XPLATFORM" | grep symbian > /dev/null; then
CFG_S60=yes
@@ -5844,7 +5879,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
fi
CFG_EGL=no
# If QtOpenGL would be built against OpenGL ES, disable it as we can't to that if EGL is missing
- if [ "$CFG_OPENGL" = "es1" || "$CFG_OPENGL" = "es2" ]; then
+ if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then
CFG_OPENGL=no
fi
fi
@@ -7449,7 +7484,7 @@ then
# We cannot use Linux's default export rules since they export everything.
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_DLL"
# Disable non-working features.
- QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT QT_NO_QFUTURE QT_NO_CRASHHANDLER QT_NO_PRINTER QT_NO_CURSOR QT_NO_SYSTEMTRAYICON"
+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT QT_NO_QFUTURE QT_NO_CRASHHANDLER QT_NO_PRINTER QT_NO_SYSTEMTRAYICON"
fi
if [ -n "$QCONFIG_FLAGS" ]; then
diff --git a/configure.exe b/configure.exe
index 0344f2c..35116ff 100755
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml
index 286a4d1..75f5735 100644
--- a/demos/declarative/calculator/calculator.qml
+++ b/demos/declarative/calculator/calculator.qml
@@ -98,8 +98,8 @@ Rectangle {
transitions: Transition {
SequentialAnimation {
PropertyAction { target: rotateButton; property: "operation" }
- NumberAnimation { properties: "rotation"; duration: 300; easing.type: "InOutQuint" }
- NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: "InOutQuint" }
+ NumberAnimation { properties: "rotation"; duration: 300; easing.type: Easing.InOutQuint }
+ NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
}
}
}
diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml
index 4022d23..d70cd3c 100644
--- a/demos/declarative/flickr/common/ScrollBar.qml
+++ b/demos/declarative/flickr/common/ScrollBar.qml
@@ -19,7 +19,7 @@ Item {
states: [
State {
name: "show"
- when: flickableArea.moving
+ when: flickableArea.movingVertically
PropertyChanges {
target: container
opacity: 1
diff --git a/demos/declarative/flickr/common/Slider.qml b/demos/declarative/flickr/common/Slider.qml
index 4da370e..76f6303 100644
--- a/demos/declarative/flickr/common/Slider.qml
+++ b/demos/declarative/flickr/common/Slider.qml
@@ -29,7 +29,7 @@ Item {
MouseArea {
anchors.fill: parent; drag.target: parent
- drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: slider.xMax+2
+ drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2
onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; }
}
}
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index 8b73beb..29763d4 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -38,7 +38,7 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
}
}
@@ -76,7 +76,7 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
}
}
}
diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml
index 5ab7b87..df608bc 100644
--- a/demos/declarative/flickr/mobile/GridDelegate.qml
+++ b/demos/declarative/flickr/mobile/GridDelegate.qml
@@ -21,7 +21,7 @@
Item {
anchors.centerIn: parent
scale: 0.0
- Behavior on scale { NumberAnimation { easing.type: "InOutQuad"} }
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
id: scaleMe
Rectangle { height: 79; width: 79; id: blackRect; anchors.centerIn: parent; color: "black"; smooth: true }
@@ -38,7 +38,7 @@
states: [
State {
- name: "Show"; when: thumb.status == 1
+ name: "Show"; when: thumb.status == Image.Ready
PropertyChanges { target: scaleMe; scale: 1 }
},
State {
@@ -53,14 +53,14 @@
Transition {
from: "Show"; to: "Details"
ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
}
},
Transition {
from: "Details"; to: "Show"
SequentialAnimation {
ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
}
PropertyAction { targets: wrapper; properties: "z" }
}
diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml
index 58b0b83..79d7cab 100644
--- a/demos/declarative/flickr/mobile/ImageDetails.qml
+++ b/demos/declarative/flickr/mobile/ImageDetails.qml
@@ -54,7 +54,11 @@ Flipable {
Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
- Common.Progress { anchors.centerIn: parent; width: 200; height: 18; progress: bigImage.progress; visible: bigImage.status!=1 }
+ Common.Progress {
+ anchors.centerIn: parent; width: 200; height: 18
+ progress: bigImage.progress; visible: bigImage.status != Image.Ready
+ }
+
Flickable {
id: flickable; anchors.fill: parent; clip: true
contentWidth: imageContainer.width; contentHeight: imageContainer.height
@@ -66,10 +70,10 @@ Flipable {
Image {
id: bigImage; source: container.photoUrl; scale: slider.value
- anchors.centerIn: parent; smooth: !flickable.moving
+ anchors.centerIn: parent; smooth: !flickable.movingVertically
onStatusChanged : {
// Default scale shows the entire image.
- if (status == 1 && width != 0) {
+ if (status == Image.Ready && width != 0) {
slider.minimum = Math.min(flickable.width / width, flickable.height / height);
prevScale = Math.min(slider.minimum, 1);
slider.value = prevScale;
@@ -81,12 +85,12 @@ Flipable {
Text {
text: "Image Unavailable"
- visible: bigImage.status == 'Error'
+ visible: bigImage.status == Image.Error
anchors.centerIn: parent; color: "white"; font.bold: true
}
Common.Slider {
- id: slider; visible: { bigImage.status == 1 && maximum > minimum }
+ id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum }
anchors {
bottom: parent.bottom; bottomMargin: 65
left: parent.left; leftMargin: 25
@@ -114,8 +118,8 @@ Flipable {
transitions: Transition {
SequentialAnimation {
PropertyAction { target: bigImage; property: "smooth"; value: false }
- NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 500 }
- PropertyAction { target: bigImage; property: "smooth"; value: !flickable.moving }
+ NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 500 }
+ PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
}
}
}
diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml
index 71d9385..025b897 100644
--- a/demos/declarative/flickr/mobile/TitleBar.qml
+++ b/demos/declarative/flickr/mobile/TitleBar.qml
@@ -18,10 +18,21 @@ Item {
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: parent.left; right: tagButton.left; leftMargin: 10; rightMargin: 10
+ left: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10
verticalCenter: parent.verticalCenter
}
elide: Text.ElideLeft
@@ -70,6 +81,6 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
}
}
diff --git a/demos/declarative/flickr/mobile/images/quit.png b/demos/declarative/flickr/mobile/images/quit.png
new file mode 100644
index 0000000..5bda1b6
--- /dev/null
+++ b/demos/declarative/flickr/mobile/images/quit.png
Binary files differ
diff --git a/demos/declarative/minehunt/MinehuntCore/Tile.qml b/demos/declarative/minehunt/MinehuntCore/Tile.qml
index f3620f4..98b2017 100644
--- a/demos/declarative/minehunt/MinehuntCore/Tile.qml
+++ b/demos/declarative/minehunt/MinehuntCore/Tile.qml
@@ -57,7 +57,7 @@ Flipable {
PauseAnimation {
duration: pauseDur
}
- RotationAnimation { easing.type: "InOutQuad" }
+ RotationAnimation { easing.type: Easing.InOutQuad }
ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } }
}
}
diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp
index 93cd1c1..2a4ed10 100644
--- a/demos/declarative/minehunt/minehunt.cpp
+++ b/demos/declarative/minehunt/minehunt.cpp
@@ -212,6 +212,8 @@ void MinehuntGame::reset()
}
nMines = 12;
nFlags = 0;
+ emit numMinesChanged();
+ emit numFlagsChanged();
setPlaying(false);
QTimer::singleShot(600,this, SLOT(setBoard()));
}
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
index d39b7bc..71d3cdc 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -56,7 +56,7 @@ Component {
Tag {
anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 }
- frontLabel: tag; backLabel: "Delete"; flipped: mainWindow.editMode
+ frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode
onTagChanged: rssModel.tags = tag
onBackClicked: if (mainWindow.editMode) photosModel.remove(index);
}
@@ -78,11 +78,11 @@ Component {
]
GridView.onAdd: NumberAnimation {
- target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: "OutQuad"
+ 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: "OutQuad" }
+ NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad }
PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false }
}
@@ -92,12 +92,12 @@ Component {
SequentialAnimation {
NumberAnimation { properties: 'opacity'; duration: 250 }
PauseAnimation { duration: 350 }
- NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: "OutQuad" }
+ NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad }
}
},
Transition {
from: 'inGrid'; to: '*'
- NumberAnimation { properties: "y,opacity"; easing.type: "OutQuad"; duration: 300 }
+ NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 }
}
]
}
diff --git a/demos/declarative/photoviewer/i18n/base.ts b/demos/declarative/photoviewer/i18n/base.ts
new file mode 100644
index 0000000..1accfd2
--- /dev/null
+++ b/demos/declarative/photoviewer/i18n/base.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/demos/declarative/photoviewer/i18n/qml_fr.qm b/demos/declarative/photoviewer/i18n/qml_fr.qm
new file mode 100644
index 0000000..c24fcbc
--- /dev/null
+++ b/demos/declarative/photoviewer/i18n/qml_fr.qm
Binary files differ
diff --git a/demos/declarative/photoviewer/i18n/qml_fr.ts b/demos/declarative/photoviewer/i18n/qml_fr.ts
new file mode 100644
index 0000000..9f892db
--- /dev/null
+++ b/demos/declarative/photoviewer/i18n/qml_fr.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation>Supprimer</translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation>Ajouter</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation>Éditer</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation>Retour</translation>
+ </message>
+</context>
+</TS>
diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml
index 4094294..e384f46 100644
--- a/demos/declarative/photoviewer/photoviewer.qml
+++ b/demos/declarative/photoviewer/photoviewer.qml
@@ -27,7 +27,7 @@ Rectangle {
Column {
spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 }
Button {
- id: newButton; label: "New"; rotation: 3
+ id: newButton; label: qsTr("Add"); rotation: 3
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
mainWindow.editMode = false
@@ -36,7 +36,7 @@ Rectangle {
}
}
Button {
- id: deleteButton; label: "Delete"; rotation: -2;
+ id: deleteButton; label: qsTr("Edit"); rotation: -2;
onClicked: mainWindow.editMode = !mainWindow.editMode
anchors.horizontalCenter: parent.horizontalCenter
}
@@ -49,7 +49,7 @@ Rectangle {
ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false }
- Button { id: backButton; label: "Back"; rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 }
+ 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 }
diff --git a/demos/declarative/rssnews/content/BusyIndicator.qml b/demos/declarative/rssnews/content/BusyIndicator.qml
new file mode 100644
index 0000000..4be59a8
--- /dev/null
+++ b/demos/declarative/rssnews/content/BusyIndicator.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+
+ NumberAnimation on rotation {
+ running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200
+ }
+}
diff --git a/demos/declarative/rssnews/content/CategoryDelegate.qml b/demos/declarative/rssnews/content/CategoryDelegate.qml
new file mode 100644
index 0000000..1400c36
--- /dev/null
+++ b/demos/declarative/rssnews/content/CategoryDelegate.qml
@@ -0,0 +1,41 @@
+import Qt 4.7
+
+Item {
+ id: delegate
+
+ width: delegate.ListView.view.width; height: 60
+
+ Text {
+ text: name
+ color: delegate.ListView.isCurrentItem ? "white" : "black"
+ font { family: "Helvetica"; pixelSize: 16; bold: true }
+ anchors {
+ left: parent.left; leftMargin: 15
+ verticalCenter: parent.verticalCenter
+ }
+ }
+
+ BusyIndicator {
+ scale: 0.6
+ on: delegate.ListView.isCurrentItem && window.loading
+ anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter }
+ }
+
+ Rectangle {
+ width: delegate.width; height: 1; color: "#cccccc"
+ anchors.bottom: delegate.bottom
+ visible: delegate.ListView.isCurrentItem ? false : true
+ }
+ Rectangle {
+ width: delegate.width; height: 1; color: "white"
+ visible: delegate.ListView.isCurrentItem ? false : true
+ }
+
+ MouseArea {
+ anchors.fill: delegate
+ onClicked: {
+ delegate.ListView.view.currentIndex = index
+ window.currentFeed = feed
+ }
+ }
+}
diff --git a/demos/declarative/rssnews/content/NewsDelegate.qml b/demos/declarative/rssnews/content/NewsDelegate.qml
new file mode 100644
index 0000000..0d03880
--- /dev/null
+++ b/demos/declarative/rssnews/content/NewsDelegate.qml
@@ -0,0 +1,29 @@
+import Qt 4.7
+
+Item {
+ id: delegate
+ height: childrenRect.height + 20
+ width: delegate.ListView.view.width
+
+ Column {
+ x: 20; y: 20
+ width: parent.width - 40
+
+ Text {
+ id: titleText
+ text: title; width: parent.width; wrapMode: Text.WordWrap
+ font { bold: true; family: "Helvetica"; pointSize: 16 }
+ }
+
+ Text {
+ id: descriptionText
+ width: parent.width; text: description
+ wrapMode: Text.WordWrap; font.family: "Helvetica"
+ }
+ }
+
+ Rectangle {
+ width: parent.width; height: 1; color: "#cccccc"
+ anchors.bottom: parent.bottom
+ }
+}
diff --git a/demos/declarative/rssnews/content/RssFeeds.qml b/demos/declarative/rssnews/content/RssFeeds.qml
new file mode 100644
index 0000000..21e59fe
--- /dev/null
+++ b/demos/declarative/rssnews/content/RssFeeds.qml
@@ -0,0 +1,18 @@
+import Qt 4.7
+
+ListModel {
+ id: rssFeeds
+
+ ListElement { name: "Top Stories"; feed: "rss.news.yahoo.com/rss/topstories" }
+ ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" }
+ ListElement { name: "Europe"; feed: "rss.news.yahoo.com/rss/europe" }
+ ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" }
+ ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" }
+ ListElement { name: "Politics"; feed: "rss.news.yahoo.com/rss/politics" }
+ ListElement { name: "Business"; feed: "rss.news.yahoo.com/rss/business" }
+ ListElement { name: "Technology"; feed: "rss.news.yahoo.com/rss/tech" }
+ ListElement { name: "Entertainment"; feed: "rss.news.yahoo.com/rss/entertainment" }
+ ListElement { name: "Health"; feed: "rss.news.yahoo.com/rss/health" }
+ ListElement { name: "Science"; feed: "rss.news.yahoo.com/rss/science" }
+ ListElement { name: "Sports"; feed: "rss.news.yahoo.com/rss/sports" }
+}
diff --git a/demos/declarative/rssnews/content/ScrollBar.qml b/demos/declarative/rssnews/content/ScrollBar.qml
new file mode 100644
index 0000000..d0b08dd
--- /dev/null
+++ b/demos/declarative/rssnews/content/ScrollBar.qml
@@ -0,0 +1,66 @@
+import Qt 4.7
+
+Item {
+ id: container
+
+ property variant scrollArea
+ property variant orientation: Qt.Vertical
+
+ opacity: 0
+
+ function position()
+ {
+ var ny = 0;
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+ if (ny > 2) return ny; else return 2;
+ }
+
+ function size()
+ {
+ var nh, ny;
+
+ if (container.orientation == Qt.Vertical)
+ nh = scrollArea.visibleArea.heightRatio * container.height;
+ else
+ nh = scrollArea.visibleArea.widthRatio * container.width;
+
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+
+ if (ny > 3) {
+ var t;
+ if (container.orientation == Qt.Vertical)
+ t = Math.ceil(container.height - 3 - ny);
+ else
+ t = Math.ceil(container.width - 3 - ny);
+ if (nh > t) return t; else return nh;
+ } else return nh + ny;
+ }
+
+ Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 }
+
+ BorderImage {
+ source: "images/scrollbar.png"
+ border { left: 1; right: 1; top: 1; bottom: 1 }
+ x: container.orientation == Qt.Vertical ? 2 : position()
+ width: container.orientation == Qt.Vertical ? container.width - 4 : size()
+ y: container.orientation == Qt.Vertical ? position() : 2
+ height: container.orientation == Qt.Vertical ? size() : container.height - 4
+ }
+
+ states: State {
+ name: "visible"
+ when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
+ PropertyChanges { target: container; opacity: 1.0 }
+ }
+
+ transitions: Transition {
+ from: "visible"; to: ""
+ NumberAnimation { properties: "opacity"; duration: 600 }
+ }
+}
diff --git a/demos/declarative/rssnews/content/images/busy.png b/demos/declarative/rssnews/content/images/busy.png
new file mode 100644
index 0000000..664c2b1
--- /dev/null
+++ b/demos/declarative/rssnews/content/images/busy.png
Binary files differ
diff --git a/demos/declarative/rssnews/content/images/scrollbar.png b/demos/declarative/rssnews/content/images/scrollbar.png
new file mode 100644
index 0000000..0228dcf
--- /dev/null
+++ b/demos/declarative/rssnews/content/images/scrollbar.png
Binary files differ
diff --git a/demos/declarative/rssnews/rssnews.qml b/demos/declarative/rssnews/rssnews.qml
new file mode 100644
index 0000000..29a530f
--- /dev/null
+++ b/demos/declarative/rssnews/rssnews.qml
@@ -0,0 +1,52 @@
+import Qt 4.7
+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
+ 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 {}
+ }
+ }
+
+ ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
+ Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" }
+}
diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index bf99ca3..f9c6184 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -175,15 +175,14 @@ function createBlock(column,row){
// 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.isReady){
- var dynamicObject = component.createObject();
+ if(component.status == Component.Ready){
+ var dynamicObject = component.createObject(gameCanvas);
if(dynamicObject == null){
console.log("error creating block");
console.log(component.errorsString());
return false;
}
dynamicObject.type = Math.floor(Math.random() * 3);
- dynamicObject.parent = gameCanvas;
dynamicObject.x = column*gameCanvas.blockSize;
dynamicObject.targetX = column*gameCanvas.blockSize;
dynamicObject.targetY = row*gameCanvas.blockSize;
diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js
index 02f9757..f5c231e 100644
--- a/demos/declarative/snake/content/snake.js
+++ b/demos/declarative/snake/content/snake.js
@@ -52,15 +52,14 @@ function startNewGame()
link.spawned = false;
link.dying = false;
} else {
- if(linkComponent.isReady == false){
- if(linkComponent.isError == true)
+ if(linkComponent.status != Component.Ready) {
+ if(linkComponent.status == Component.Error)
console.log(linkComponent.errorsString());
else
console.log("Still loading linkComponent");
continue;//TODO: Better error handling?
}
- var link = linkComponent.createObject();
- link.parent = playfield;
+ var link = linkComponent.createObject(playfield);
link.z = numRows * numColumns + 1 - i;
link.type = i == 0 ? 2 : 0;
link.spawned = false;
@@ -293,15 +292,14 @@ function createCookie(value) {
}
}
- if(cookieComponent.isReady == false){
- if(cookieComponent.isError == true)
+ if(cookieComponent.status != Component.Ready) {
+ if(cookieComponent.status == Component.Error)
console.log(cookieComponent.errorsString());
else
console.log("Still loading cookieComponent");
return;//TODO: Better error handling?
}
- cookie = cookieComponent.createObject();
- cookie.parent = head.parent;
+ cookie = cookieComponent.createObject(head.parent);
cookie.value = value;
cookie.row = row;
cookie.column = column;
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index 47bced4..bc4a974 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -60,7 +60,7 @@ Rectangle {
Image {
id: title
source: "content/pics/snake.jpg"
- fillMode: "PreserveAspectCrop"
+ fillMode: Image.PreserveAspectCrop
anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
@@ -69,7 +69,7 @@ Rectangle {
Text {
color: "white"
font.pointSize: 24
- horizontalAlignment: "AlignHCenter"
+ horizontalAlignment: Text.AlignHCenter
text: "Last Score:\t" + lastScore + "\nHighscore:\t" + highScores.topScore;
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
@@ -78,7 +78,7 @@ Rectangle {
}
source: "content/pics/background.png"
- fillMode: "PreserveAspectCrop"
+ fillMode: Image.PreserveAspectCrop
anchors.left: parent.left
anchors.right: parent.right
diff --git a/demos/declarative/twitter/TwitterCore/FatDelegate.qml b/demos/declarative/twitter/TwitterCore/FatDelegate.qml
index 62ee11a..72e5ecc 100644
--- a/demos/declarative/twitter/TwitterCore/FatDelegate.qml
+++ b/demos/declarative/twitter/TwitterCore/FatDelegate.qml
@@ -27,7 +27,7 @@ Component {
id: whiteRect; x: 6; width: 50; height: 50; color: "white"; smooth: true
anchors.verticalCenter: parent.verticalCenter
- Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != 1 }
+ 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 }
}
Text { id:txt; y:4; x: 56
diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
index c1ae3e5..26ad1a9 100644
--- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml
@@ -37,7 +37,7 @@ Item {
UserModel { user: rssModel.authName; id: userModel }
Component { id: imgDelegate;
Item {
- Loading { width:48; height:48; visible: realImage.status != 1 }
+ Loading { width:48; height:48; visible: realImage.status != Image.Ready }
Image { source: image; width:48; height:48; id: realImage }
}
}
@@ -113,7 +113,7 @@ Item {
transitions: [
Transition {
from: "*"; to: "*"
- NumberAnimation { properties: "x,y,width,height"; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x,y,width,height"; easing.type: Easing.InOutQuad }
}
]
}
diff --git a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml
index 8c27e2b..445eda4 100644
--- a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml
@@ -18,7 +18,7 @@ Item {
}
]
transitions: [
- Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } }
+ Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } }
]
}
diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml
index 87ceec5..5256de4 100644
--- a/demos/declarative/twitter/TwitterCore/TitleBar.qml
+++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml
@@ -70,6 +70,6 @@ Item {
}
transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
}
}
diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml
index 0e3ec3e..f86388e 100644
--- a/demos/declarative/twitter/twitter.qml
+++ b/demos/declarative/twitter/twitter.qml
@@ -88,7 +88,7 @@ Item {
}
]
transitions: [
- Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } }
+ Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } }
]
}
}
diff --git a/demos/declarative/webbrowser/content/Button.qml b/demos/declarative/webbrowser/content/Button.qml
new file mode 100644
index 0000000..a1baf16
--- /dev/null
+++ b/demos/declarative/webbrowser/content/Button.qml
@@ -0,0 +1,18 @@
+import Qt 4.7
+
+Item {
+ property alias image: icon.source
+ property variant action
+
+ width: 40; height: parent.height
+
+ Image {
+ id: icon; anchors.centerIn: parent
+ opacity: action.enabled ? 1.0 : 0.4
+ }
+
+ MouseArea {
+ anchors { fill: parent; topMargin: -10; bottomMargin: -10 }
+ onClicked: action.trigger()
+ }
+}
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml
index 46f45e0..32d69d8 100644
--- a/demos/declarative/webbrowser/content/FlickableWebView.qml
+++ b/demos/declarative/webbrowser/content/FlickableWebView.qml
@@ -12,17 +12,22 @@ Flickable {
id: flickable
width: parent.width
- contentWidth: Math.max(parent.width,webView.width*webView.scale)
- contentHeight: Math.max(parent.height,webView.height*webView.scale)
+ contentWidth: Math.max(parent.width,webView.width)
+ contentHeight: Math.max(parent.height,webView.height)
anchors.top: headerSpace.bottom
- anchors.bottom: footer.top
+ 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
- pixelCacheSize: 4000000
transformOrigin: Item.TopLeft
function fixUrl(url)
@@ -42,8 +47,6 @@ Flickable {
url: fixUrl(webBrowser.urlString)
smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions
- smoothCache: true // We do want smooth rendering
- fillColor: "white"
focus: true
zoomFactor: 1
@@ -53,14 +56,13 @@ Flickable {
{
if (centerX) {
var sc = zoom/contentsScale;
- scaleAnim.to = sc;
+ scaleAnim.to = zoom;
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
- finalZoom.value = zoom
quickZoom.start()
}
}
@@ -68,8 +70,8 @@ Flickable {
Keys.onLeftPressed: webView.contentsScale -= 0.1
Keys.onRightPressed: webView.contentsScale += 0.1
- preferredWidth: flickable.width*zoomFactor
- preferredHeight: flickable.height*zoomFactor
+ preferredWidth: flickable.width
+ preferredHeight: flickable.height
contentsScale: 1/zoomFactor
onContentsSizeChanged: {
// zoom out
@@ -102,17 +104,16 @@ Flickable {
NumberAnimation {
id: scaleAnim
target: webView
- property: "scale"
- from: 1
- to: 0 // set before calling
- easing.type: "Linear"
+ property: "contentsScale"
+ // the to property is set before calling
+ easing.type: Easing.Linear
duration: 200
}
NumberAnimation {
id: flickVX
target: flickable
property: "contentX"
- easing.type: "Linear"
+ easing.type: Easing.Linear
duration: 200
from: 0 // set before calling
to: 0 // set before calling
@@ -121,22 +122,12 @@ Flickable {
id: flickVY
target: flickable
property: "contentY"
- easing.type: "Linear"
+ easing.type: Easing.Linear
duration: 200
from: 0 // set before calling
to: 0 // set before calling
}
}
- PropertyAction {
- id: finalZoom
- target: webView
- property: "contentsScale"
- }
- PropertyAction {
- target: webView
- property: "scale"
- value: 1.0
- }
// Have to set the contentXY, since the above 2
// size changes may have started a correction if
// contentsScale < 1.0.
diff --git a/demos/declarative/webbrowser/content/Header.qml b/demos/declarative/webbrowser/content/Header.qml
new file mode 100644
index 0000000..7c93580
--- /dev/null
+++ b/demos/declarative/webbrowser/content/Header.qml
@@ -0,0 +1,69 @@
+import Qt 4.7
+
+Image {
+ property alias editUrl: urlInput.url
+
+ 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
+ }
+ }
+
+ Button {
+ id: reloadButton
+ anchors { right: parent.right; rightMargin: 4 }
+ action: webView.reload; image: "pics/view-refresh.png"; visible: webView.progress == 1.0
+ }
+
+ Button {
+ id: stopButton
+ anchors { right: parent.right; rightMargin: 4 }
+ action: webView.stop; image: "pics/edit-delete.png"; visible: webView.progress < 1.0
+ }
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/RectSoftShadow.qml b/demos/declarative/webbrowser/content/RectSoftShadow.qml
deleted file mode 100644
index 53d098c..0000000
--- a/demos/declarative/webbrowser/content/RectSoftShadow.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import Qt 4.7
-
-Item {
- BorderImage {
- source: "pics/softshadow-left.sci"
- x: -16
- y: -16
- width: 16
- height: parent.height+32
- }
- BorderImage {
- source: "pics/softshadow-right.sci"
- x: parent.width
- y: -16
- width: 16
- height: parent.height+32
- }
- Image {
- source: "pics/softshadow-top.png"
- x: 0
- y: -16
- width: parent.width
- height: 16
- }
- Image {
- source: "pics/softshadow-bottom.png"
- x: 0
- y: parent.height
- width: parent.width
- height: 16
- }
-}
diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
deleted file mode 100644
index f5bfadf..0000000
--- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-import Qt 4.7
-
-import "fieldtext"
-
-Image {
- property alias editUrl: editUrl.text
-
- id: header
- source: "pics/header.png"
- width: parent.width
- height: 60
- x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width
- ? -webView.contentX+webView.contentWidth-webView.width : 0
- y: webView.contentY < 0 ? -webView.contentY : progressOff*
- (webView.contentY>height?-height:-webView.contentY)
- Row {
- id: headerTitle
-
- anchors.top: header.top
- anchors.topMargin: 4
- x: parent.width > headerIcon.width+headerText.width+6 ? (parent.width-headerIcon.width-headerText.width-6)/2 : 0
- spacing: 6
-
- Image {
- id: headerIcon
- pixmap: webView.icon
- }
-
- Text {
- id: headerText
-
- text: webView.title!='' || webView.progress == 1.0 ? webView.title : 'Loading...'
-
- color: "white"
- styleColor: "black"
- style: Text.Raised
-
- font.family: "Helvetica"
- font.pointSize: 10
- font.bold: true
-
- horizontalAlignment: Text.AlignHCenter
- }
- }
- Item {
- width: parent.width
- anchors.top: headerTitle.bottom
- anchors.topMargin: 2
- anchors.bottom: parent.bottom
-
- Item {
- id: urlBox
- height: 31
- anchors.left: parent.left
- anchors.leftMargin: 12
- anchors.right: parent.right
- anchors.rightMargin: 12
- anchors.top: parent.top
- clip: true
- property bool mouseGrabbed: false
-
- BorderImage {
- source: "pics/addressbar.sci"
- anchors.fill: urlBox
- }
-
- BorderImage {
- id: urlBoxhl
- source: "pics/addressbar-filled.sci"
- width: parent.width*webView.progress
- height: parent.height
- opacity: 1-header.progressOff
- clip: true
- }
-
- FieldText {
- id: editUrl
- mouseGrabbed: parent.mouseGrabbed
-
- text: webBrowser.urlString
- label: "url:"
- onConfirmed: { webBrowser.urlString = editUrl.text; webView.focus=true }
- onCancelled: { webView.focus=true }
- onStartEdit: { webView.focus=false }
-
- anchors.left: urlBox.left
- anchors.right: urlBox.right
- anchors.leftMargin: 6
- anchors.verticalCenter: urlBox.verticalCenter
- anchors.verticalCenterOffset: 1
- }
- }
- }
-
- property real progressOff : 1
- states: [
- State {
- name: "ProgressShown"
- when: webView.progress < 1.0
- PropertyChanges { target: header; progressOff: 0; }
- }
- ]
- transitions: [
- Transition {
- NumberAnimation {
- targets: header
- properties: "progressOff"
- easing.type: "InOutQuad"
- duration: 300
- }
- }
- ]
-}
diff --git a/demos/declarative/webbrowser/content/ScrollBar.qml b/demos/declarative/webbrowser/content/ScrollBar.qml
new file mode 100644
index 0000000..aa79d35
--- /dev/null
+++ b/demos/declarative/webbrowser/content/ScrollBar.qml
@@ -0,0 +1,66 @@
+import Qt 4.7
+
+Item {
+ id: container
+
+ property variant scrollArea
+ property variant orientation: Qt.Vertical
+
+ opacity: 0
+
+ function position()
+ {
+ var ny = 0;
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+ if (ny > 2) return ny; else return 2;
+ }
+
+ function size()
+ {
+ var nh, ny;
+
+ if (container.orientation == Qt.Vertical)
+ nh = scrollArea.visibleArea.heightRatio * container.height;
+ else
+ nh = scrollArea.visibleArea.widthRatio * container.width;
+
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+
+ if (ny > 3) {
+ var t;
+ if (container.orientation == Qt.Vertical)
+ t = Math.ceil(container.height - 3 - ny);
+ else
+ t = Math.ceil(container.width - 3 - ny);
+ if (nh > t) return t; else return nh;
+ } else return nh + ny;
+ }
+
+ Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.5 }
+
+ BorderImage {
+ source: "pics/scrollbar.png"
+ border { left: 1; right: 1; top: 1; bottom: 1 }
+ x: container.orientation == Qt.Vertical ? 2 : position()
+ width: container.orientation == Qt.Vertical ? container.width - 4 : size()
+ y: container.orientation == Qt.Vertical ? position() : 2
+ height: container.orientation == Qt.Vertical ? size() : container.height - 4
+ }
+
+ states: State {
+ name: "visible"
+ when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
+ PropertyChanges { target: container; opacity: 1.0 }
+ }
+
+ transitions: Transition {
+ from: "visible"; to: ""
+ NumberAnimation { properties: "opacity"; duration: 600 }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml
new file mode 100644
index 0000000..9f7fc38
--- /dev/null
+++ b/demos/declarative/webbrowser/content/UrlInput.qml
@@ -0,0 +1,44 @@
+import Qt 4.7
+
+Item {
+ id: container
+
+ property alias image: bg.source
+ property alias url: urlText.text
+
+ signal urlEntered(string url)
+
+ 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; focusOnPress: true
+ Keys.onEscapePressed: {
+ urlText.text = webView.url
+ webView.focus = true
+ }
+ Keys.onReturnPressed: {
+ container.urlEntered(urlText.text)
+ webView.focus = true
+ }
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18
+ verticalCenter: parent.verticalCenter
+ }
+ }
+}
diff --git a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml
deleted file mode 100644
index d1d003f..0000000
--- a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml
+++ /dev/null
@@ -1,157 +0,0 @@
-import Qt 4.7
-
-Item {
- id: fieldText
- height: 30
- property string text: ""
- property string label: ""
- property bool mouseGrabbed: false
- signal confirmed
- signal cancelled
- signal startEdit
-
- function edit() {
- if (!mouseGrabbed) {
- fieldText.startEdit();
- fieldText.state='editing';
- mouseGrabbed=true;
- }
- }
-
- function confirm() {
- fieldText.state='';
- fieldText.text = textEdit.text;
- mouseGrabbed=false;
- fieldText.confirmed();
- }
-
- function reset() {
- textEdit.text = fieldText.text;
- fieldText.state='';
- mouseGrabbed=false;
- fieldText.cancelled();
- }
-
- Image {
- id: cancelIcon
- width: 22
- height: 22
- anchors.right: parent.right
- anchors.rightMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- source: "pics/cancel.png"
- opacity: 0
- }
-
- Image {
- id: confirmIcon
- width: 22
- height: 22
- anchors.left: parent.left
- anchors.leftMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- source: "pics/ok.png"
- opacity: 0
- }
-
- TextInput {
- id: textEdit
- text: fieldText.text
- focus: false
- anchors.left: parent.left
- anchors.leftMargin: 0
- anchors.right: parent.right
- anchors.rightMargin: 0
- anchors.verticalCenter: parent.verticalCenter
- color: "black"
- font.bold: true
- readOnly: true
- onAccepted: confirm()
- Keys.onEscapePressed: reset()
- }
-
- Text {
- id: textLabel
- x: 5
- width: parent.width-10
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignHCenter
- color: fieldText.state == "editing" ? "#505050" : "#AAAAAA"
- font.italic: true
- font.bold: true
- text: label
- opacity: textEdit.text == '' ? 1 : 0
- Behavior on opacity {
- NumberAnimation {
- property: "opacity"
- duration: 250
- }
- }
- }
-
- MouseArea {
- anchors.fill: cancelIcon
- onClicked: { reset() }
- }
-
- MouseArea {
- anchors.fill: confirmIcon
- onClicked: { confirm() }
- }
-
- MouseArea {
- id: editRegion
- anchors.fill: textEdit
- onClicked: { edit() }
- }
-
- states: [
- State {
- name: "editing"
- PropertyChanges {
- target: confirmIcon
- opacity: 1
- }
- PropertyChanges {
- target: cancelIcon
- opacity: 1
- }
- PropertyChanges {
- target: textEdit
- color: "black"
- readOnly: false
- focus: true
- selectionStart: 0
- selectionEnd: -1
- }
- PropertyChanges {
- target: editRegion
- opacity: 0
- }
- PropertyChanges {
- target: textEdit.anchors
- leftMargin: 34
- }
- PropertyChanges {
- target: textEdit.anchors
- rightMargin: 34
- }
- }
- ]
-
- transitions: [
- Transition {
- from: ""
- to: "*"
- reversible: true
- NumberAnimation {
- properties: "opacity,leftMargin,rightMargin"
- duration: 200
- }
- ColorAnimation {
- property: "color"
- duration: 150
- }
- }
- ]
-}
diff --git a/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png b/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png
deleted file mode 100644
index ecc9533..0000000
--- a/demos/declarative/webbrowser/content/fieldtext/pics/cancel.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/fieldtext/pics/ok.png b/demos/declarative/webbrowser/content/fieldtext/pics/ok.png
deleted file mode 100644
index 5795f04..0000000
--- a/demos/declarative/webbrowser/content/fieldtext/pics/ok.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/addressbar-filled.png b/demos/declarative/webbrowser/content/pics/addressbar-filled.png
deleted file mode 100644
index d8452ec..0000000
--- a/demos/declarative/webbrowser/content/pics/addressbar-filled.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/addressbar-filled.sci b/demos/declarative/webbrowser/content/pics/addressbar-filled.sci
deleted file mode 100644
index 96c5efb..0000000
--- a/demos/declarative/webbrowser/content/pics/addressbar-filled.sci
+++ /dev/null
@@ -1,6 +0,0 @@
-border.left: 7
-border.top: 7
-border.bottom: 7
-border.right: 7
-source: addressbar-filled.png
-
diff --git a/demos/declarative/webbrowser/content/pics/addressbar.png b/demos/declarative/webbrowser/content/pics/addressbar.png
deleted file mode 100644
index 3278f58..0000000
--- a/demos/declarative/webbrowser/content/pics/addressbar.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/addressbar.sci b/demos/declarative/webbrowser/content/pics/addressbar.sci
deleted file mode 100644
index 8f1cd18..0000000
--- a/demos/declarative/webbrowser/content/pics/addressbar.sci
+++ /dev/null
@@ -1,6 +0,0 @@
-border.left: 7
-border.top: 7
-border.bottom: 7
-border.right: 7
-source: addressbar.png
-
diff --git a/demos/declarative/webbrowser/content/pics/back-disabled.png b/demos/declarative/webbrowser/content/pics/back-disabled.png
deleted file mode 100644
index 91b9e76..0000000
--- a/demos/declarative/webbrowser/content/pics/back-disabled.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/back.png b/demos/declarative/webbrowser/content/pics/back.png
deleted file mode 100644
index 9988dd3..0000000
--- a/demos/declarative/webbrowser/content/pics/back.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/display.png b/demos/declarative/webbrowser/content/pics/display.png
new file mode 100644
index 0000000..9507f43
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/display.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/edit-delete.png b/demos/declarative/webbrowser/content/pics/edit-delete.png
new file mode 100644
index 0000000..351659b
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/edit-delete.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/footer.png b/demos/declarative/webbrowser/content/pics/footer.png
deleted file mode 100644
index 8391a93..0000000
--- a/demos/declarative/webbrowser/content/pics/footer.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/footer.sci b/demos/declarative/webbrowser/content/pics/footer.sci
deleted file mode 100644
index 7be58f1..0000000
--- a/demos/declarative/webbrowser/content/pics/footer.sci
+++ /dev/null
@@ -1,6 +0,0 @@
-border.left: 5
-border.top: 0
-border.bottom: 0
-border.right: 5
-source: footer.png
-
diff --git a/demos/declarative/webbrowser/content/pics/forward-disabled.png b/demos/declarative/webbrowser/content/pics/forward-disabled.png
deleted file mode 100644
index cb87f4f..0000000
--- a/demos/declarative/webbrowser/content/pics/forward-disabled.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/forward.png b/demos/declarative/webbrowser/content/pics/forward.png
deleted file mode 100644
index 83870ee..0000000
--- a/demos/declarative/webbrowser/content/pics/forward.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-next-view.png b/demos/declarative/webbrowser/content/pics/go-next-view.png
new file mode 100644
index 0000000..3bce02d
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/go-next-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/go-previous-view.png b/demos/declarative/webbrowser/content/pics/go-previous-view.png
new file mode 100644
index 0000000..3ec011e
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/go-previous-view.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/header.png b/demos/declarative/webbrowser/content/pics/header.png
deleted file mode 100644
index 26588c3..0000000
--- a/demos/declarative/webbrowser/content/pics/header.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/reload.png b/demos/declarative/webbrowser/content/pics/reload.png
deleted file mode 100644
index 45b5535..0000000
--- a/demos/declarative/webbrowser/content/pics/reload.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/scrollbar.png b/demos/declarative/webbrowser/content/pics/scrollbar.png
new file mode 100644
index 0000000..0228dcf
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/scrollbar.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-bottom.png b/demos/declarative/webbrowser/content/pics/softshadow-bottom.png
deleted file mode 100644
index 85b0b44..0000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-bottom.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-left.png b/demos/declarative/webbrowser/content/pics/softshadow-left.png
deleted file mode 100644
index 02926d1..0000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-left.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-left.sci b/demos/declarative/webbrowser/content/pics/softshadow-left.sci
deleted file mode 100644
index 45c88d5..0000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-left.sci
+++ /dev/null
@@ -1,5 +0,0 @@
-border.left: 0
-border.top: 16
-border.bottom: 16
-border.right: 0
-source: softshadow-left.png
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-right.png b/demos/declarative/webbrowser/content/pics/softshadow-right.png
deleted file mode 100644
index e459f4f..0000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-right.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-right.sci b/demos/declarative/webbrowser/content/pics/softshadow-right.sci
deleted file mode 100644
index 4d459c0..0000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-right.sci
+++ /dev/null
@@ -1,5 +0,0 @@
-border.left: 0
-border.top: 16
-border.bottom: 16
-border.right: 0
-source: softshadow-right.png
diff --git a/demos/declarative/webbrowser/content/pics/softshadow-top.png b/demos/declarative/webbrowser/content/pics/softshadow-top.png
deleted file mode 100644
index 9a9e232..0000000
--- a/demos/declarative/webbrowser/content/pics/softshadow-top.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/titlebar-bg.png b/demos/declarative/webbrowser/content/pics/titlebar-bg.png
new file mode 100644
index 0000000..06961e8
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/titlebar-bg.png
Binary files differ
diff --git a/demos/declarative/webbrowser/content/pics/view-refresh.png b/demos/declarative/webbrowser/content/pics/view-refresh.png
new file mode 100644
index 0000000..afa2a9d
--- /dev/null
+++ b/demos/declarative/webbrowser/content/pics/view-refresh.png
Binary files differ
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index fbbe7b2..f539e21 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -3,168 +3,35 @@ import org.webkit 1.0
import "content"
-Item {
+Rectangle {
id: webBrowser
property string urlString : "http://qt.nokia.com/"
- width: 640
- height: 480
+ width: 800; height: 600
+ color: "#343434"
- Item {
- id: webPanel
- anchors.fill: parent
- clip: true
- Rectangle {
- color: "#555555"
- anchors.fill: parent
- }
- Image {
- source: "content/pics/softshadow-bottom.png"
- width: webPanel.width
- height: 16
- }
- Image {
- source: "content/pics/softshadow-top.png"
- width: webPanel.width
- height: 16
- anchors.bottom: footer.top
- }
- RectSoftShadow {
- x: -webView.contentX
- y: -webView.contentY
- width: webView.contentWidth
- height: webView.contentHeight+headerSpace.height
- }
- Item {
- id: headerSpace
- width: parent.width
- height: 60
- z: 1
+ FlickableWebView {
+ id: webView
+ url: webBrowser.urlString
+ 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 }
+ }
- RetractingWebBrowserHeader { id: header }
- }
- FlickableWebView {
- id: webView
- width: parent.width
- anchors.top: headerSpace.bottom
- anchors.bottom: footer.top
- anchors.left: parent.left
- anchors.right: parent.right
- }
- BorderImage {
- id: footer
- source: "content/pics/footer.sci"
- width: parent.width
- height: 43
- anchors.bottom: parent.bottom
- Rectangle {
- y: -1
- width: parent.width
- height: 1
- color: "#555555"
- }
- Item {
- id: backbutton
- width: back_e.width
- height: back_e.height
- anchors.right: reload.left
- anchors.rightMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- Image {
- id: back_e
- source: "content/pics/back.png"
- anchors.fill: parent
- }
- Image {
- id: back_d
- source: "content/pics/back-disabled.png"
- anchors.fill: parent
- }
- states: [
- State {
- name: "Enabled"
- when: webView.back.enabled==true
- PropertyChanges { target: back_e; opacity: 1 }
- PropertyChanges { target: back_d; opacity: 0 }
- },
- State {
- name: "Disabled"
- when: webView.back.enabled==false
- PropertyChanges { target: back_e; opacity: 0 }
- PropertyChanges { target: back_d; opacity: 1 }
- }
- ]
- transitions: [
- Transition {
- NumberAnimation {
- properties: "opacity"
- easing.type: "InOutQuad"
- duration: 300
- }
- }
- ]
- MouseArea {
- anchors.fill: back_e
- onClicked: { if (webView.back.enabled) webView.back.trigger() }
- }
- }
- Image {
- id: reload
- source: "content/pics/reload.png"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: reload
- onClicked: { webView.reload.trigger() }
- }
- Item {
- id: forwardbutton
- width: forward_e.width
- height: forward_e.height
- anchors.left: reload.right
- anchors.leftMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- Image {
- id: forward_e
- source: "content/pics/forward.png"
- anchors.fill: parent
- anchors.verticalCenter: parent.verticalCenter
- }
- Image {
- id: forward_d
- source: "content/pics/forward-disabled.png"
- anchors.fill: parent
- }
- states: [
- State {
- name: "Enabled"
- when: webView.forward.enabled==true
- PropertyChanges { target: forward_e; opacity: 1 }
- PropertyChanges { target: forward_d; opacity: 0 }
- },
- State {
- name: "Disabled"
- when: webView.forward.enabled==false
- PropertyChanges { target: forward_e; opacity: 0 }
- PropertyChanges { target: forward_d; opacity: 1 }
- }
- ]
- transitions: [
- Transition {
- NumberAnimation {
- properties: "opacity"
- easing.type: "InOutQuad"
- duration: 320
- }
- }
- ]
- MouseArea {
- anchors.fill: parent
- onClicked: { if (webView.forward.enabled) webView.forward.trigger() }
- }
- }
- }
+ ScrollBar {
+ scrollArea: webView; height: 8; orientation: Qt.Horizontal
+ anchors { right: parent.right; rightMargin: 8; left: parent.left; bottom: parent.bottom }
}
}
diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index 4fd7fdb..41fe9d2 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -27,6 +27,12 @@ General Improvements
- Support for the GL_EXT_geometry_shader4, aka Geometry Shaders, was added
to QGLShaderProgram.
+New features
+------------
+
+ - QNetworkSession, QNetworkConfiguration, QNetworkConfigurationManager
+ * New bearer management classes added.
+
Third party components
----------------------
@@ -44,6 +50,11 @@ Third party components
QtCore
------
+ - QXmlStreamReader
+ * [QTBUG-9196] fixed crash when parsing
+ - QTimer
+ * singleShot with 0 timeout will now avoid allocating objects
+
QtGui
-----
@@ -56,10 +67,107 @@ QtGui
functions, and replaced them with setCopyCount(), copyCount() and
supportsMultipleCopies().
+ - QPrintDialog/QPrinter
+ * Added support for printing the current page.
+
- QCommonStyle
* Fixed a bug that led to missing text pixels in QTabBar when using
small font sizes. (QTBUG-7137)
+ - QGraphicsEffect
+ * Fixed rendering bugs when scrolling graphics items with drop
+ shadows.
+
+ - QGraphicsItem
+ * [QTBUG-8112] itemChange() is now called when transformation
+ properties change (setRotation, setScale, setTransformOriginPoint).
+
+ - QGraphicsTextItem
+ * [QTBUG-7333] Fixed keyboard shortcuts not being triggered when the
+ the item has focus and something else has the same shortcut sequence.
+
+ - QGraphicsView
+ * [QTBUG-7438] Fixed viewport cursor getting reset when releasing
+ the mouse.
+
+ - QImage
+ * [QTBUG-9640] Prevented unneccessary copy in QImage::setAlphaChannel().
+ * [QTBUG-7982] Added QImage::bitPlaneCount().
+
+ - QPicture
+ * [QTBUG-4974] Printing QPictures containing text to a high resolution
+ QPrinter would in many cases cause incorrect character spacing.
+
+ - QPainter
+ * Added QPainter::drawPixmapFragments(), which makes it possible to draw
+ pixmaps, or sub-rectangles of pixmaps, at various positions with
+ different scale, opacity and rotation.
+ * [QTBUG-10018] Fixed image drawing inconsistencies when drawing
+ 1x1 source rects with rotating / shear / perspective transforms.
+ * Optimized various blending and rendering operations for ARM
+ processors with a NEON vector unit.
+ * Fixed some performance issues when drawing sub-pixmaps of large
+ pixmaps and falling back to raster in the X11 paint engine.
+
+ - QPainterPath
+ * [QTBUG-3778] Fixed bug in painter path polygon intersection code.
+ * [QTBUG-7396] Optimized painter path intersections for when at
+ least one of the paths is a rectangle by special casing.
+ * [QTBUG-8035] Got rid of bezier intersection code in the boolean
+ operators (intersect, subtract, unite) to prevent numerical
+ stability issues.
+
+ - QRegion
+ * [QTBUG-7699] Fixed crash caused by large x-coordinates.
+
+ - QTransform
+ * [QTBUG-8557] Fixed bug in QTransform::type() potentially occuring
+ after using operator/ or operator* or their overloads.
+
+QtNetwork
+---------
+ - QHostInfo: Added a small 60 second DNS cache
+ - QNetworkAccessManager
+ * Performance improvements for file:// and http://
+ * Crash fixes
+ * Improvements on HTTP pipelining
+ * Fix problem with canReadLine()
+ * Fix problem with HTTP 100 reply
+ * Some new attributes for QNetworkRequest
+ * [QTBUG-8206] add method to send custom requests
+ * [QTBUG-9618] [MR 2372] send secure cookies only over secure connections
+ * [QTBUG-7713] Fix bug related to re-sending request
+ * [QTBUG-7673] Fix issue with some webservers
+ - Sockets
+ * Better support for derived QTcpServer
+ * [QTBUG-7054] Fix error handling with waitFor*() for socket engine
+ * [QTBUG-7316, QTBUG-7317] Also handle unknown errors from socket engine
+ - SSL
+ * [QTBUG-2515] Do not make OpenSSL prompt for a password
+ * [QTBUG-6504, QTBUG-8924, QTBUG-5645] Fix memleak
+
+QtXmlPatterns
+-------------
+
+ - [QTBUG-8920] fixed crash with anonymous types in XsdSchemaChecker
+ - [QTBUG-8394] include/import/redefine schemas only once
+ - QXmlSchema: fix crash with referencing elements
+
+Qt Plugins
+----------
+
+ - Jpeg image IO plugin
+ * Fixed failure to store certain QImage formats as jpeg (QTBUG-7780)
+ * Optimized smoothscaling
+ * Optimized to avoid data copy when reading from memory device (QTBUG-9095)
+
+ - SVG image IO plugin
+ * Added support for svgz format (QTBUG-8227)
+ * Fixed canRead() so that it can be used also for non-sequential
+ devices. (QTBUG-9053)
+ * Added support for clipping and scaling and backgroundcolor
+ * Optimized to avoid data copy when reading from memory device (QTBUG-9095)
+
****************************************************************************
* Database Drivers *
****************************************************************************
@@ -125,7 +233,16 @@ Qt for Windows CE
- Designer
-
+ - [QTBUG-9351] Fixed a bug that caused modified headerview-properties
+ of item views to be duplicated in the UI-file.
+ - [QTBUG-8347] Fixed a layout problem caused by embedded images in the rich
+ text of a QLabel.
+ - [QTBUG-8041], [QTBUG-8213] Fixed a crash related to undo while moving
+ widgets by arrow keys.
+ - [QTBUG-7822] Added support for the 'windowOpacity'-property.
+ - [QTBUG-7764] Fixed the emission of the propertyChanged()-signal of
+ QDesignerPropertyEditorInterface.
+ - [QTBUG-5492] Made widgetbox-filter match on class names, too.
- Linguist
- Linguist GUI
@@ -143,9 +260,10 @@ Qt for Windows CE
- uic
-
- uic3
+ - [QTBUG-9207] Fixed export of image files of type XPM, added
+ compatibility option -limit-xpm-linelength.
- qmake
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
index 1552f56..594c1fe 100644
--- a/doc/src/classes.qdoc
+++ b/doc/src/classes.qdoc
@@ -59,7 +59,7 @@
/*!
\page classes.html
- \title All Qt Classes
+ \title All Classes
\ingroup classlists
\brief If you know the name of the class you want, find it here.
@@ -71,7 +71,7 @@
\generatelist classes
- \sa {Qt3 Support Classes}, {All Qt Modules}, {Obsolete Classes}
+ \sa {Qt3 Support Classes}, {All Modules}, {Obsolete Classes}
*/
/*!
@@ -162,7 +162,7 @@
/*!
\page namespaces.html
- \title All Qt Namespaces
+ \title All Namespaces
\ingroup classlists
\brief A Qt namespace contains enum types, functions, and sometimes classes.
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index 2d05850..47504ae 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -105,16 +105,20 @@ is the \l SystemPalette item. This provides access to the Qt system palette
and is used to give the button a more native look-and-feel.
Notice the anchors for the \c Item, \c Button and \c Text elements are set using
-\l {codingconventions.html#Grouped-properties}{group notation} for readability.
+\l {qdeclarativeintroduction.html#dot-properties}{group notation} for readability.
\section2 Adding \c Button and \c Block components
-The \c Button item in the code above is defined in a separate file named \c Button.qml.
+The \c Button item in the code above is defined in a separate component file named \c Button.qml.
To create a functional button, we use the QML elements \l Text and \l MouseArea inside a \l Rectangle.
Here is the \c Button.qml code:
\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
+This essentially defines a rectangle that contains text and can be clicked. The \l MouseArea
+has an \c onClicked() handler that is implemented to emit the \c clicked() signal of the
+\c container when the area is clicked.
+
In Same Game, the screen is filled with small blocks when the game begins.
Each block is just an item that contains an image. The block
code is defined in a separate \c Block.qml file:
@@ -174,7 +178,7 @@ The \c createBlock() function creates a block from the \c Block.qml file
and moves the new block to its position on the game canvas. This involves several steps:
\list
-\o \l {createComponent(url file)}{createComponent()} is called to generate an element from \c Block.qml.
+\o \l {Qt.createComponent(url file)}{Qt.createComponent()} is called to generate an element from \c Block.qml.
If the component is ready, we can call \c createObject() to create an instance of the \c Block item.
\o If \c createObject() returned null (i.e. if there was an error while
loading the object), print the error information.
@@ -226,14 +230,14 @@ until it is won or lost.
To do this, we have added the following functions to \c samegame.js:
\list
-\o function \c{handleClick(x,y)}
-\o function \c{floodFill(xIdx,yIdx,type)}
-\o function \c{shuffleDown()}
-\o function \c{victoryCheck()}
-\o function \c{floodMoveCheck(xIdx, yIdx, type)}
+\o \c{handleClick(x,y)}
+\o \c{floodFill(xIdx,yIdx,type)}
+\o \c{shuffleDown()}
+\o \c{victoryCheck()}
+\o \c{floodMoveCheck(xIdx, yIdx, type)}
\endlist
-As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to JavaScript.
+As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to QML.
\section3 Enabling mouse click interaction
@@ -269,6 +273,8 @@ And this is how it is used in the main \c samegame.qml file:
\snippet declarative/tutorials/samegame/samegame3/samegame.qml 2
+We give the dialog a \l {Item::z}{z} value of 100 to ensure it is displayed on top of our other components. The default \c z value for an item is 0.
+
\section3 A dash of color
@@ -383,15 +389,41 @@ The theme change here is produced simply by replacing the block images. This can
Another feature we might want to add to the game is a method of storing and retrieving high scores.
-In \c samegame.qml we now pop up a dialog when the game is over and requests the player's name so it can be added to a High Scores table. The dialog is created using \c Dialog.qml:
+To do this, we will show a dialog when the game is over to request the player's name and add it to a High Scores table.
+This requires a few changes to \c Dialog.qml. In addition to a \c Text element, it now has a
+\c TextInput child item for receiving keyboard text input:
+
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 2
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+
+We'll also add a \c showWithInput() function. The text input will only be visible if this function
+is called instead of \c show(). When the dialog is closed, it emits a \c closed() signal, and
+other elements can retrieve the text entered by the user through an \c inputText property:
+
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 1
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+
+Now the dialog can be used in \c samegame.qml:
\snippet declarative/tutorials/samegame/samegame4/samegame.qml 0
-When the dialog is closed, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible.
+When the dialog emits the \c closed signal, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible.
+The \c nameInputDialog is activated in the \c victoryCheck() function in \c samegame.js:
+
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 3
+\dots 4
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 4
\section3 Storing high scores offline
+Now we need to implement the functionality to actually save the High Scores table.
+
Here is the \c saveHighScore() function in \c samegame.js:
\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 2
@@ -436,6 +468,6 @@ By following this tutorial you've seen how you can write a fully functional appl
\endlist
There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the
-demos and examples and the \l {Declarative UI (QML)}{documentation} to find out all the things you can do with QML!
+demos and examples and the \l {Declarative UI Using QML}{documentation} to find out all the things you can do with QML!
*/
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index 88aca1b..6e98949 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -73,9 +73,9 @@ Rectangle {
y: 0
SequentialAnimation on y {
loops: Animation.Infinite
- NumberAnimation { to: 200-img.height; easing.type: "OutBounce"; duration: 2000 }
+ NumberAnimation { to: 200-img.height; easing.type: Easing.OutBounce; duration: 2000 }
PauseAnimation { duration: 1000 }
- NumberAnimation { to: 0; easing.type: "OutQuad"; duration: 1000 }
+ NumberAnimation { to: 0; easing.type: Easing.OutQuad; duration: 1000 }
}
}
}
@@ -136,7 +136,7 @@ transitions: [
Transition {
NumberAnimation {
properties: "x,y"
- easing.type: "OutBounce"
+ easing.type: Easing.OutBounce
duration: 200
}
}
@@ -157,7 +157,7 @@ Transition {
SequentialAnimation {
NumberAnimation {
duration: 1000
- easing.type: "OutBounce"
+ easing.type: Easing.OutBounce
// animate myItem's x and y if they have changed in the state
target: myItem
properties: "x,y"
@@ -199,7 +199,7 @@ Transition {
ParallelAnimation {
NumberAnimation {
duration: 1000
- easing.type: "OutBounce"
+ easing.type: Easing.OutBounce
targets: box1
properties: "x,y"
}
@@ -227,7 +227,7 @@ Rectangle {
id: redRect
color: "red"
width: 100; height: 100
- Behavior on x { NumberAnimation { duration: 300; easing.type: "InOutQuad" } }
+ Behavior on x { NumberAnimation { duration: 300; easing.type: Easing.InOutQuad } }
}
\endqml
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 6901947..8db1c35 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -43,9 +43,12 @@
\page qdeclarativebasictypes.html
\title QML Basic Types
- QML uses a set of property types, which are primitive within QML.
- These basic types are referenced throughout the documentation of the
- QML elements. Almost all of them are exactly what you would expect.
+ QML has a set of primitive types, as listed below, that are used throughout
+ the \l {QML Elements}.
+
+ The simpler types in this list can also be used for defining a new
+ \c property in a component. See \l{Extending types from QML} for the
+ list of types that can be used for custom properties.
\annotatedlist qmlbasictypes
*/
diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc
index 7ca206b..4fa7d0c 100644
--- a/doc/src/declarative/codingconventions.qdoc
+++ b/doc/src/declarative/codingconventions.qdoc
@@ -57,7 +57,7 @@ Through our documentation and examples, QML objects are always structured in the
\o id
\o property declarations
\o signal declarations
-\o javascript functions
+\o JavaScript functions
\o object properties
\o child objects
\o states
@@ -72,7 +72,6 @@ For example, a hypothetical \e photo QML object would look like this:
\snippet doc/src/snippets/declarative/codingconventions/photo.qml 0
-\target Grouped properties
\section1 Grouped properties
If using multiple properties from a group of properties,
@@ -102,7 +101,7 @@ we will write this:
\snippet doc/src/snippets/declarative/codingconventions/lists.qml 1
-\section1 Javascript code
+\section1 JavaScript code
If the script is a single expression, we recommend writing it inline:
@@ -116,7 +115,7 @@ If the script is more than a couple of lines long or can be used by different ob
\snippet doc/src/snippets/declarative/codingconventions/javascript.qml 2
-For long scripts, we will put the functions in their own javascript file and import it like this:
+For long scripts, we will put the functions in their own JavaScript file and import it like this:
\snippet doc/src/snippets/declarative/codingconventions/javascript-imports.qml 0
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index d79c4d2..5283ba8 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -40,46 +40,42 @@
****************************************************************************/
/*!
-\title Declarative UI Using QML
+\title Qt Quick
\page declarativeui.html
-\brief The Qt Declarative module provides a declarative framework for building
-highly dynamic, custom user interfaces.
+\brief Qt Quick provides a declarative framework for building highly
+dynamic, custom user interfaces.
-\section1 \l{QML Elements}{Fast QML Elements Reference Page}
+Qt Quick provides a declarative framework for building highly dynamic,
+custom user interfaces from a rich set of \l {QML Elements}{QML elements}.
+Qt Quick helps programmers and designers collaborate to
+build the fluid user interfaces that are becoming common in portable
+consumer devices, such as mobile phones, media players, set-top boxes
+and netbooks.
-\raw HTML
-<br>
-\endraw
+QML is an extension to \l
+{http://www.ecma-international.org/publications/standards/Ecma-262.htm}
+{JavaScript}, that provides a mechanism to declaratively build an
+object tree of \l {QML Elements}{QML elements}. QML improves the
+integration between JavaScript and Qt's existing QObject based type
+system, adds support for automatic \l {Property Binding}{property
+bindings} and provides \l {Network Transparency}{network transparency}
+at the language level.
-\section1 Preamble
+The \l {QML Elements}{QML elements} are a sophisticated set of
+graphical and behavioral building blocks. These different elements
+are combined together in \l {QML Documents}{QML documents} to build
+components ranging in complexity from simple buttons and sliders, to
+complete internet-enabled applications like a \l
+{http://www.flickr.com}{Flickr} photo browser.
-Qt Declarative UI provides a declarative framework for building highly dynamic, custom
-user interfaces. Declarative UI helps programmers and designers collaborate to build
-the animation rich, fluid user interfaces that are becoming common in portable
-consumer devices, such as mobile phones, media players, set-top boxes and netbooks.
+Qt Quick builds on \l {QML for Qt programmers}{Qt's existing
+strengths}. QML can be be used to incrementally extend an existing
+application or to build completely new applications. QML is fully \l
+{Extending QML in C++}{extensible from C++}.
-The Qt Declarative module provides an engine for interpreting the declarative
-QML language, and a rich set of \bold { \l {QML Elements}{QML elements} }
-that can be used from QML.
+\section1 Getting Started
-QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm}
-{JavaScript}, that provides a mechanism to declaratively build an object tree
-of QML elements. QML improves the integration between JavaScript and Qt's
-existing QObject based type system, adds support for automatic
-\l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language
-level.
-
-The QML elements are a sophisticated set of graphical and behavioral building
-blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components
-ranging in complexity from simple buttons and sliders, to complete
-internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser.
-
-Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}.
-QML can be be used to incrementally extend an existing application or to build
-completely new applications. QML is fully \l {Extending QML in C++}{extensible from C++}.
-
-\section1 Getting Started:
\list
\o \l {Introduction to the QML language}
\o \l {QML Tutorial}{Tutorial: 'Hello World'}
@@ -88,7 +84,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {QML for Qt programmers}
\endlist
-\section1 Core QML Features:
+\section1 Core QML Features
\list
\o \l {QML Documents}
\o \l {Property Binding}
@@ -106,7 +102,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {qmlruntime.html}{The Qt Declarative Runtime}
\endlist
-\section1 Using QML with C++:
+\section1 Using QML with C++
\list
\o \l {Tutorial: Writing QML extensions with C++}
\o \l {Extending QML in C++}
@@ -114,7 +110,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible
\o \l {Integrating QML with existing Qt UI code}
\endlist
-\section1 Reference:
+\section1 Reference
\list
\o \l {QML Elements}
\o \l {QML Global Object}
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 4cb5198..2688ee5 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -43,84 +43,68 @@
\page qdeclarativedynamicobjects.html
\title Dynamic Object Management
-QML has some support for dynamically loading and managing QML objects from
-within Javascript blocks. It is preferable to use the existing QML elements for
-dynamic object management wherever possible; these are \l{Loader},
-\l{Repeater}, \l{ListView}, \l{GridView} and \l{PathView}. It is also possible
-to dynamically create and manage objects from C++, and this is preferable for
-hybrid QML/C++ applications - see \l{Using QML in C++ Applications}.
-Dynamically creating and managing objects from
-within Javascript blocks is intended for when none of the existing QML elements
-fit the needs of your application, and you do not desire for your application
-to involve C++ code.
+QML provides a number of ways to dynamically create and manage QML objects.
+The \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and \l{PathView} elements
+all support dynamic object management. Objects can also be created and managed
+from C++, and this is the preferred method for hybrid QML/C++ applications
+(see \l{Using QML in C++ Applications}).
+
+QML also supports the dynamic creation of objects from within JavaScript
+code. This is useful if the existing QML elements do not fit the needs of your
+application, and there are no C++ components involved.
+
\section1 Creating Objects Dynamically
-There are two ways of creating objects dynamically. You can either create
-a component which instantiates items, or create an item from a string of QML.
-Creating a component is better for the situation where you have a predefined
-item which you want to manage dynamic instances of, and creating an item from
-a string of QML is intended for when the QML itself is generated at runtime.
+There are two ways to create objects dynamically from JavaScript. You can either call
+\l {Qt.createComponent(url file)}{Qt.createComponent()} to create
+a component which instantiates items, or use \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()}
+to create an item from a string of QML.
+Creating a component is better if you have a predefined
+item, and you want to create dynamic instances of that item; creating an item from
+a string of QML is useful when the item QML itself is generated at runtime.
If you have a component specified in a QML file, you can dynamically load it with
-the \l {createComponent(url file)}{createComponent()} function on the \l{QML Global Object}.
+the \l {Qt.createComponent(url file)}{Qt.createComponent()} function on the \l{QML Global Object}.
This function takes the URL of the QML file as its only argument and returns
a component object which can be used to create and load that QML file.
-Once you have a component you can use its \c createObject() method to create an instance of
-the component. Example QML script is below. Remember that QML files that might be loaded
- over the network cannot be expected to be ready immediately.
- \code
- var component;
- var sprite;
- function finishCreation() {
- if(component.isReady()) {
- sprite = component.createObject();
- if(sprite == 0) {
- // Error Handling
- } else {
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- } else if(component.isError()) {
- // Error Handling
- }
- }
-
- component = createComponent("Sprite.qml");
- if(component.isReady()) {
- finishCreation();
- } else {
- component.statusChanged.connect(finishCreation);
- }
- \endcode
-
- If you are certain the files will be local, you could simplify to
-
- \code
- component = createComponent("Sprite.qml");
- sprite = component.createObject();
- if(sprite == 0) {
- // Error Handling
- console.log(component.errorsString());
- } else {
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- \endcode
-
-After creating the item, remember to set its parent to an item within the scene.
-Otherwise your dynamically created item will not appear in the scene. When using files with relative paths, the path should
-be relative to the file where \c createComponent() is executed.
-
-If the QML does not exist until runtime, you can create a QML item from
-a string of QML using the \l{createQmlObject(string qml, object parent, string filepath)}{createQmlObject()} function, as in the following example:
-
- \code
- newObject = createQmlObject('import Qt 4.7; Rectangle { color: "red"; width: 20; height: 20 }',
- targetItem, "dynamicSnippet1");
- \endcode
+Once you have a component you can use its \l {Component::createObject()}{createObject()} method to create an instance of
+the component. This function takes exactly one argument, which is the parent for the new item. Since graphical items will
+not appear on the scene without a parent, it is recommended that you set the parent this way. However, if you wish to set
+the parent later you can safely pass null to this function.
+
+Here is an example. Here is a \c Sprite.qml, which defines a simple QML component:
+
+\quotefile doc/src/snippets/declarative/Sprite.qml
+
+Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file
+that will create \c Sprite objects:
+
+\quotefile doc/src/snippets/declarative/createComponent.qml
+
+Here is \c componentCreation.js. Remember that QML files that might be loaded
+over the network cannot be expected to be ready immediately:
+
+\snippet doc/src/snippets/declarative/componentCreation.js 0
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js 1
+
+If you are certain the files will be local, you could simplify to:
+
+\snippet doc/src/snippets/declarative/componentCreation.js 2
+
+Notice that once a \c Sprite object is created, its parent is set to \c appWindow (defined
+in \c main.qml). After creating an item, you must set its parent to an item within the scene.
+Otherwise your dynamically created item will not appear in the scene.
+
+When using files with relative paths, the path should
+be relative to the file where \l {Qt.createComponent(url file)}{Qt.createComponent()} is executed.
+
+If the QML component does not exist until runtime, you can create a QML item from
+a string of QML using the \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()} function, as in the following example:
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+
The first argument is the string of QML to create. Just like in a new file, you will need to
import any types you wish to use. For importing files with relative paths, the path should
be relative to the file where the item in the second argument is defined. Remember to set the parent after
@@ -130,47 +114,44 @@ item, which is used for error reporting.
\section1 Maintaining Dynamically Created Objects
-Dynamically created objects may be used the same as other objects, however they
-will not have an id in QML.
+When managing dynamically created items, you must ensure the creation context
+outlives the created item. Otherwise, if the creation context is destroyed first,
+the bindings in the dynamic item will no longer work.
+
+The actual creation context depends on how an item is created:
+
+\list
+\o If \l {Qt.createComponent(url file)}{Qt.createComponent()} is used, the creation context
+ is the QDeclarativeContext in which this method is called
+\o If \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()}
+ if called, it is the context of the item used as the second argument to this method
+\o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
+ is called on that item, it is the context in which the \c Component is defined
+\endlist
+
+Also, note that while dynamically created objects may be used the same as other objects, they
+do not have an id in QML.
-A restriction which you need to manage with dynamically created items,
-is that the creation context must outlive the
-created item. The creation context is the QDeclarativeContext in which \c createComponent()
-was called, or the context in which the Component element, or the item used as the
-second argument to \c createQmlObject(), was specified. If the creation
-context is destroyed before the dynamic item is, then bindings in the dynamic item will
-fail to work.
\section1 Deleting Objects Dynamically
-You should generally avoid dynamically deleting objects that you did not
-dynamically create. In many UIs, it is sufficient to set the opacity to 0 or
-to move the item off of the edge of the screen. If you have lots of dynamically
-created items however, deleting them when they are no longer used will provide
-a worthwhile performance benefit. Note that you should never manually delete
-items which were dynamically created by QML Elements such as \l{Loader}.
-
-To manually delete a QML item, call its destroy method. This method has one
-argument, which is an approximate delay in ms and which defaults to zero. This
-allows you to wait until the completion of an animation or transition. An example:
-
-\code
- Component {
- id: fadesOut
- Rectangle{
- id: rect
- width: 40; height: 40;
- NumberAnimation on opacity { from:1; to:0; duration: 1000 }
- Component.onCompleted: rect.destroy(1000);
- }
- }
- function createFadesOut(parentItem)
- {
- var object = fadesOut.createObject();
- object.parent = parentItem;
- }
-\endcode
-In the above example, the dynamically created rectangle calls destroy as soon as it's created,
- but delays long enough for its fade out animation to play.
+In many user interfaces, it is sufficient to set an item's opacity to 0 or
+to move the item off the screen instead of deleting the item. If you have
+lots of dynamically created items, however, you may receive a worthwhile
+performance benefit if unused items are deleted.
+
+Note that you should never manually delete items that were dynamically created
+by QML elements (such as \l Loader). Also, you should generally avoid deleting
+items that you did not dynamically create yourself.
+
+Items can be deleted using the \c destroy() method. This method has an optional
+argument (which defaults to 0) that specifies the approximate delay in milliseconds
+before the object is to be destroyed. This allows you to wait until the completion of
+an animation or transition. An example:
+
+\snippet doc/src/snippets/declarative/dynamicObjects.qml 0
+
+Here, \c Rectangle objects are destroyed one second after they are created, which is long
+enough for the \c NumberAnimation to be played before the object is destroyed.
*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 79fe909..574a187 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -120,11 +120,22 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\list
\o \l Item
\o \l Rectangle
+ \list
+ \o \l Gradient
+ \list
+ \o \l GradientStop
+ \endlist
+ \endlist
\o \l Image
\o \l BorderImage
\o \l AnimatedImage
\o \l Text
\o \l TextInput
+ \list
+ \o \l IntValidator
+ \o \l DoubleValidator
+ \o \l RegExpValidator
+ \endlist
\o \l TextEdit
\endlist
@@ -142,6 +153,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\o \l Loader
\o \l Repeater
\o \l SystemPalette
+\o \l FontLoader
\o \l LayoutItem
\endlist
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
index c14208e..27b7f38 100644
--- a/doc/src/declarative/example-slideswitch.qdoc
+++ b/doc/src/declarative/example-slideswitch.qdoc
@@ -45,7 +45,7 @@
This example shows how to create a reusable switch component in QML.
-The code for this example can be found in the \c $QTDIR/examples/declarative/slideswitch directory.
+The code for this example can be found in the \c $QTDIR/examples/declarative/ui-components/slideswitch directory.
\section1 Overview
@@ -61,12 +61,12 @@ The elements that composed the switch are:
\endlist
\section1 Switch.qml
-\snippet examples/declarative/slideswitch/content/Switch.qml 0
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 0
\section1 Walkthrough
\section2 Interface
-\snippet examples/declarative/slideswitch/content/Switch.qml 1
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 1
This property is the interface of the switch. By default, the switch is off and this property is \c false.
It can be used to activate/disactivate the switch or to query its current state.
@@ -81,14 +81,14 @@ Text { text: "The switch is on"; visible: mySwitch.on == true }
the text will only be visible when the switch is on.
\section2 Images and user interaction
-\snippet examples/declarative/slideswitch/content/Switch.qml 4
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 4
First, we create the background image of the switch.
In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image.
A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
\c toggle() function. We will see what this function does in a moment.
-\snippet examples/declarative/slideswitch/content/Switch.qml 5
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 5
Then, we place the image of the knob on top of the background.
The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag
@@ -96,7 +96,7 @@ property of the \c MouseArea is for. We also want to toggle the switch if the kn
in the \c dorelease() function that is called in the \c onReleased property.
\section2 States
-\snippet examples/declarative/slideswitch/content/Switch.qml 6
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 6
We define the two states of the switch:
\list
@@ -110,13 +110,13 @@ For more information on states see \l{qmlstates}{QML States}.
We add two JavaScript functions to our switch:
-\snippet examples/declarative/slideswitch/content/Switch.qml 2
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 2
This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
states (\e on and \e off).
-\snippet examples/declarative/slideswitch/content/Switch.qml 3
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 3
This second function is called when the knob is released and we want to make sure that the knob does not end up between states
(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing.
@@ -124,7 +124,7 @@ This second function is called when the knob is released and we want to make sur
For more information on scripts see \l{Integrating JavaScript}.
\section2 Transition
-\snippet examples/declarative/slideswitch/content/Switch.qml 7
+\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 7
At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
In order for the the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
@@ -133,5 +133,5 @@ For more information on transitions see \l{state-transitions}{QML Transitions}.
\section1 Usage
The switch can be used in a QML file, like this:
-\snippet examples/declarative/slideswitch/slideswitch.qml 0
+\snippet examples/declarative/ui-components/slideswitch/slideswitch.qml 0
*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index e01459f..cdc308a 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -40,8 +40,9 @@
****************************************************************************/
/*!
-\page qdeclarativeexamples.html
-\title QML Examples and Demos
+ \page qdeclarativeexamples.html
+ \title QML Examples and Demos
+ \ingroup all-examples
\previouspage Graphics View Examples
\contentspage Qt Examples
@@ -70,50 +71,92 @@ For example, from your build directory, run:
\section1 Examples
+\section2 Animation
\list
-\o \l{declarative/animations}{Animations}
-\o \l{declarative/aspectratio}{Aspect Ratio}
-\o \l{declarative/behaviors}{Behaviors}
-\o \l{declarative/border-image}{Border Image}
-\o \l{declarative/clocks}{Clocks}
-\o \l{declarative/connections}{Connections}
-\o \l{declarative/dial}{Dial}
-\o \l{declarative/dynamic}{Dynamic}
-\o \l{declarative/extending}{Extending}
-\o \l{declarative/fillmode}{Fillmode}
-\o \l{declarative/flipable}{Flipable}
-\o \l{declarative/focus}{Focus}
-\o \l{declarative/fonts}{Fonts}
-\o \l{declarative/gridview}{GridView}
-\o \l{declarative/imageprovider}{Image Provider}
-\o \l{declarative/images}{Images}
-\o \l{declarative/layouts}{Layouts}
-\o \l{declarative/listmodel-threaded}{ListModel Threaded}
-\o \l{declarative/listview}{ListView}
-\o \l{declarative/mousearea}{Mouse Area}
-\o \l{declarative/objectlistmodel}{Object ListModel}
-\o \l{declarative/package}{Package}
-\o \l{declarative/parallax}{Parallax}
-\o \l{declarative/plugins}{Plugins}
-\o \l{declarative/progressbar}{Progress Bars}
-\o \l{declarative/proxywidgets}{Proxy Widgets}
-\o \l{declarative/scrollbar}{Scrollbar}
-\o \l{declarative/searchbox}{Search Box}
-\o \l{declarative/slideswitch}{Slide Switch}
-\o \l{declarative/sql}{SQL}
-\o \l{declarative/states}{States}
-\o \l{declarative/stringlistmodel}{String ListModel}
-\o \l{declarative/tabwidget}{Tab Widget}
-\o \l{declarative/tic-tac-toe}{Tic-Tac-Toe}
-\o \l{declarative/tvtennis}{TV Tennis}
-\o \l{declarative/velocity}{Velocity}
-\o \l{declarative/webview}{WebView}
-\o \l{declarative/workerscript}{WorkerScript}
-\o \l{declarative/xmldata}{XML Data}
-\o \l{declarative/xmlhttprequest}{XMLHttpRequest}
+\o \l{declarative/animation/basics}{Basics}
+\o \l{declarative/animation/behaviors}{Behaviors}
+\o \l{declarative/animation/easing}{Easing}
+\o \l{declarative/animation/states}{States}
+\endlist
+
+\section2 Image Elements
+\list
+\o \l{declarative/imageelements/borderimage}{BorderImage}
+\o \l{declarative/imageelements/image}{Image}
+\endlist
+
+\section2 \l{declarative/positioners}{Positioners}
+
+\section2 Key Interaction
+\list
+\o \l{declarative/keyinteraction/focus}{Focus}
+\endlist
+\section2 Touch Interaction
+\list
+\o \l{declarative/touchinteraction/gestures}{Gestures}
+\o \l{declarative/touchinteraction/mousearea}{MouseArea}
+\endlist
+
+\section2 UI Components
+\list
+\o \l{declarative/ui-components/flipable}{Flipable}
+\o \l{declarative/ui-components/progressbar}{Progress bar}
+\o \l{declarative/ui-components/scrollbar}{Scroll bar}
+\o \l{declarative/ui-components/searchbox}{Search box}
+\o \l{declarative/ui-components/slideswitch}{Slide switch}
+\o \l{declarative/ui-components/spinner}{Spinner}
+\o \l{declarative/ui-components/tabwidget}{Tab widget}
\endlist
+\section2 Models and Views
+\list
+\o \l{declarative/modelviews/gridview}{GridView}
+\o \l{declarative/modelviews/listview}{ListView}
+\o \l{declarative/modelviews/objectlistmodel}{Object list model}
+\o \l{declarative/modelviews/package}{Package}
+\o \l{declarative/modelviews/parallax}{Parallax}
+\o \l{declarative/modelviews/stringlistmodel}{String list model}
+\o \l{declarative/modelviews/webview}{WebView}
+\endlist
+
+\section2 XML
+\list
+\o \l{declarative/xml/xmldata}{XML data}
+\o \l{declarative/xml/xmlhttprequest}{XmlHttpRequest}
+\endlist
+
+\section2 \l{declarative/i18n}{Internationalization (i18n)}
+
+\section2 Threading
+\list
+\o \l{declarative/threading/threadedlistmodel}{Threaded ListModel}
+\o \l{declarative/threading/workerscript}{WorkerScript}
+\endlist
+
+\section2 \l{declarative/sqllocalstorage}{SQL Local Storage}
+
+\section2 C++ Extensions
+\list
+\o \l{declarative/cppextensions/referenceexamples}{Reference examples} (discussed in \l {Extending QML in C++})
+\o \l{declarative/cppextensions/plugins}{Plugins}
+\o \l{declarative/cppextensions/proxywidgets}{QtWidgets}
+\o \l{declarative/cppextensions/qgraphicslayouts}{QGraphicsLayouts}
+\o \l{declarative/cppextensions/imageprovider}{Image provider}
+\o \l{declarative/cppextensions/proxyviewer}{Network access manager factory}
+\endlist
+
+\section2 Toys
+\list
+\o \l{declarative/toys/clocks}{Clocks}
+\o \l{declarative/toys/dial}{Dial}
+\o \l{declarative/toys/dynamic}{Dynamic}
+\o \l{declarative/toys/tic-tac-toe}{Tic Tac Toe}
+\o \l{declarative/toys/tvtennis}{TV Tennis}
+\o \l{declarative/toys/velocity}{Velocity}
+\endlist
+
+
\section1 Demos
\list
@@ -126,3 +169,4 @@ For example, from your build directory, run:
\endlist
*/
+
diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc
index 307162e..577ab78 100644
--- a/doc/src/declarative/extending-examples.qdoc
+++ b/doc/src/declarative/extending-examples.qdoc
@@ -40,13 +40,13 @@
****************************************************************************/
/*!
-\example declarative/extending/adding
+\example declarative/cppextensions/referenceexamples/adding
\title Extending QML - Adding Types Example
The Adding Types Example shows how to add a new element type, \c Person, to QML.
The \c Person type can be used from QML like this:
-\snippet examples/declarative/extending/adding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
\section1 Declare the Person class
@@ -55,17 +55,17 @@ with the two properties we want accessible on the QML type - name and shoeSize.
Although in this example we use the same name for the C++ class as the QML
element, the C++ class can be named differently, or appear in a namespace.
-\snippet examples/declarative/extending/adding/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.h 0
\section1 Define the Person class
-\snippet examples/declarative/extending/adding/person.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/person.cpp 0
The Person class implementation is quite basic. The property accessors simply
return members of the object instance.
-The implementation must also be registered using the QML_REGISTER_TYPE() macro. This macro
-registers the Person class with QML as a type in the People library version 1.0,
+The \c main.cpp file also calls the \c qmlRegisterType() function to
+register the \c Person type with QML as a type in the People library version 1.0,
and defines the mapping between the C++ and QML class names.
\section1 Running the example
@@ -75,7 +75,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/properties
+\example declarative/cppextensions/referenceexamples/properties
\title Extending QML - Object and List Property Types Example
This example builds on:
@@ -88,16 +88,16 @@ properties in QML. This example adds a BirthdayParty element that specifies
a birthday party, consisting of a celebrant and a list of guests. People are
specified using the People QML type built in the previous example.
-\snippet examples/declarative/extending/properties/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
\section1 Declare the BirthdayParty
The BirthdayParty class is declared like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 0
-\snippet examples/declarative/extending/properties/birthdayparty.h 1
-\snippet examples/declarative/extending/properties/birthdayparty.h 2
-\snippet examples/declarative/extending/properties/birthdayparty.h 3
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 3
The class contains a member to store the celebrant object, and also a
QList<Person *> member.
@@ -114,7 +114,7 @@ scenarios.
The implementation of BirthdayParty property accessors is straight forward.
-\snippet examples/declarative/extending/properties/birthdayparty.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp 0
\section1 Running the example
@@ -123,7 +123,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/coercion
+\example declarative/cppextensions/referenceexamples/coercion
\title Extending QML - Inheritance and Coercion Example
This example builds on:
@@ -136,11 +136,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign
elements of more than one type to a property. It specializes the Person element
developed in the previous examples into two elements - a \c Boy and a \c Girl.
-\snippet examples/declarative/extending/coercion/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
\section1 Declare Boy and Girl
-\snippet examples/declarative/extending/coercion/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.h 0
The Person class remains unaltered in this example and the Boy and Girl C++
classes are trivial extensions of it. As an example, the inheritance used here
@@ -155,19 +155,17 @@ previous example. However, as we have repurposed the People class as a common
base for Boy and Girl, we want to prevent it from being instantiated from QML
directly - an explicit Boy or Girl should be instantiated instead.
-\snippet examples/declarative/extending/coercion/main.cpp 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp 0
While we want to disallow instantiating Person from within QML, it still needs
to be registered with the QML engine, so that it can be used as a property type
-and other types can be coerced to it. To register a type, without defining a
-named mapping into QML, we call the QML_REGISTER_NOCREATE_TYPE() macro instead of
-the QML_REGISTER_TYPE() macro used previously.
+and other types can be coerced to it.
\section2 Define Boy and Girl
The implementation of Boy and Girl are trivial.
-\snippet examples/declarative/extending/coercion/person.cpp 1
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/person.cpp 1
All that is necessary is to implement the constructor, and to register the types
and their QML name with the QML engine.
@@ -177,7 +175,7 @@ and their QML name with the QML engine.
The BirthdayParty element has not changed since the previous example. The
celebrant and guests property still use the People type.
-\snippet examples/declarative/extending/coercion/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h 0
However, as all three types, Person, Boy and Girl, have been registered with the
QML system, on assignment QML automatically (and type-safely) converts the Boy
@@ -188,7 +186,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/default
+\example declarative/cppextensions/referenceexamples/default
\title Extending QML - Default Property Example
This example builds on:
@@ -202,14 +200,14 @@ The Default Property Example is a minor modification of the
\l {Extending QML - Inheritance and Coercion Example} that simplifies the
specification of a BirthdayParty through the use of a default property.
-\snippet examples/declarative/extending/default/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
\section1 Declaring the BirthdayParty class
The only difference between this example and the last, is the addition of the
\c DefaultProperty class info annotation.
-\snippet examples/declarative/extending/default/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h 0
The default property specifies the property to assign to whenever an explicit
property is not specified, in the case of the BirthdayParty element the guest
@@ -224,7 +222,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example declarative/extending/grouped
+\example declarative/cppextensions/referenceexamples/grouped
\title Extending QML - Grouped Properties Example
This example builds on:
@@ -238,7 +236,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/grouped
+\example declarative/cppextensions/referenceexamples/grouped
\title Extending QML - Attached Properties Example
This example builds on:
@@ -253,7 +251,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/signal
+\example declarative/cppextensions/referenceexamples/signal
\title Extending QML - Signal Support Example
This example builds on:
@@ -269,7 +267,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/valuesource
+\example declarative/cppextensions/referenceexamples/valuesource
\title Extending QML - Property Value Source Example
This example builds on:
@@ -286,7 +284,7 @@ This example builds on:
*/
/*!
-\example declarative/extending/binding
+\example declarative/cppextensions/referenceexamples/binding
\title Extending QML - Binding Example
This example builds on:
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 1c159e4..5b695f7 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -56,7 +56,7 @@ QML for their own independent use.
\section1 Adding Types
\target adding-types
-\snippet examples/declarative/extending/adding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/adding/example.qml 0
The QML snippet shown above instantiates one \c Person instance and sets
the \c name and \c shoeSize properties on it. Everything in QML ultimately comes down
@@ -121,7 +121,7 @@ the \c Person type.
\section1 Object and List Property Types
-\snippet examples/declarative/extending/properties/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's
\c host property, and assigns three \c Person objects to the guests property.
@@ -136,7 +136,7 @@ Properties that are pointers to objects or Qt interfaces are declared with the
Q_PROPERTY() macro, just like other properties. The \c host property
declaration looks like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
As long as the property type, in this case \c Person, is registered with QML the
property can be assigned.
@@ -165,14 +165,14 @@ As with object properties, the type \a T must be registered with QML.
The \c guest property declaration looks like this:
-\snippet examples/declarative/extending/properties/birthdayparty.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
\l {Extending QML - Object and List Property Types Example} shows the complete
code used to create the \c BirthdayParty type.
\section1 Inheritance and Coercion
-\snippet examples/declarative/extending/coercion/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's
\c host property, and assigns three other objects to the \c guests property.
@@ -214,7 +214,7 @@ code used to create the \c Boy and \c Girl types.
\section1 Default Property
-\snippet examples/declarative/extending/default/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/default/example.qml 0
The QML snippet shown above assigns a collection of objects to the
\c BirthdayParty's default property.
@@ -246,7 +246,7 @@ specify a default property.
\section1 Grouped Properties
-\snippet examples/declarative/extending/grouped/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml 1
The QML snippet shown above assigns a number of properties to the \c Boy object,
including four properties using the grouped property syntax.
@@ -259,7 +259,7 @@ different types through implementation reuse.
A grouped property block is implemented as a read-only object property. The
\c shoe property shown is declared like this:
-\snippet examples/declarative/extending/grouped/person.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/grouped/person.h 1
The \c ShoeDescription type declares the properties available to the grouped
property block - in this case the \c size, \c color, \c brand and \c price properties.
@@ -271,7 +271,7 @@ implement the \c shoe property grouping.
\section1 Attached Properties
-\snippet examples/declarative/extending/attached/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml 1
The QML snippet shown above assigns a date to the \c rsvp property using the attached
property syntax.
@@ -393,8 +393,8 @@ this situation, but it must not crash.
\section1 Signal Support
-\snippet examples/declarative/extending/signal/example.qml 0
-\snippet examples/declarative/extending/signal/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 1
The QML snippet shown above associates the evaluation of a JavaScript expression
with the emission of a Qt signal.
@@ -406,7 +406,7 @@ signal name: "on" is prepended, and the first letter of the signal name upper
cased. For example, the signal used in the example above has the following
C++ signature:
-\snippet examples/declarative/extending/signal/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h 0
In classes with multiple signals with the same name, only the final signal
is accessible as a signal property. Note that signals with the same name
@@ -424,8 +424,8 @@ implement the onPartyStarted signal property.
\section1 Property Value Sources
-\snippet examples/declarative/extending/valuesource/example.qml 0
-\snippet examples/declarative/extending/valuesource/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1
The QML snippet shown above applies a property value source to the \c announcment property.
A property value source generates a value for a property that changes over time.
@@ -440,7 +440,7 @@ The example shown here is rather contrived: the \c announcment property of the
the \c HappyBirthdaySong value source generates the lyrics of the song
"Happy Birthday".
-\snippet examples/declarative/extending/valuesource/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h 0
Normally, assigning an object to a string property would not be allowed. In
the case of a property value source, rather than assigning the object instance
@@ -453,9 +453,9 @@ QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when
associating the property value source with a property. The relevant part of
the \c HappyBirthdaySong type declaration looks like this:
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 0
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 1
-\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 2
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1
+\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2
In all other respects, property value sources are regular QML types. They must
be registered with the QML engine using the same macros as other types, and can
@@ -471,8 +471,8 @@ implement the \c HappyBirthdaySong property value source.
\section1 Property Binding
-\snippet examples/declarative/extending/binding/example.qml 0
-\snippet examples/declarative/extending/binding/example.qml 1
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/example.qml 1
The QML snippet shown above uses a property binding to ensure the
\c HappyBirthdaySong's \c name property remains up to date with the \c host.
@@ -492,7 +492,7 @@ the property's value. QML relies on the presence of a
Here is the \c host property declaration:
-\snippet examples/declarative/extending/binding/birthdayparty.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h 0
The NOTIFY attribute is followed by a signal name. It is the responsibility of
the class implementer to ensure that whenever the property's value changes, the
@@ -531,7 +531,7 @@ subsequently change. The most common case of this is when a type uses
only freed when the object is deleted. In these cases, the CONSTANT attribute
may be added to the property declaration instead of a NOTIFY signal.
-\snippet examples/declarative/extending/binding/person.h 0
+\snippet examples/declarative/cppextensions/referenceexamples/binding/person.h 0
Extreme care must be taken here or applications using your type may misbehave.
The CONSTANT attribute should only be used for properties whose value is set,
@@ -543,7 +543,7 @@ include NOTIFY signals for use in binding.
\section1 Extension Objects
-\snippet examples/declarative/extending/extended/example.qml 0
+\snippet examples/declarative/cppextensions/referenceexamples/extended/example.qml 0
The QML snippet shown above adds a new property to an existing C++ type without
modifying its source code.
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index e5c1d32..e2b8bb6 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -291,28 +291,7 @@ print the name of the current list item.
\table
\row
-\o \code
-Rectangle {
- color: "lightsteelblue"; width: 240; height: 320
-
- ListView {
- id: myView; anchors.fill: parent; focus: true
- model: ListModel {
- ListElement { name: "Bob" }
- ListElement { name: "John" }
- ListElement { name: "Michael" }
- }
- delegate: FocusScope {
- width: contents.width; height: contents.height
- Text {
- focus: true
- text: name
- Keys.onReturnPressed: console.log(name)
- }
- }
- }
-}
-\endcode
+\o \snippet doc/src/snippets/declarative/focusscopes.qml 0
\o \image declarative-qmlfocus4.png
\endtable
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index 57eaae7..2a83e30 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -166,10 +166,33 @@ If no format is specified the locale's short format is used. Alternatively, you
\section2 Functions
The Qt object also contains the following miscellaneous functions which expose Qt functionality for use in QML.
-\section3 Qt.lighter(color baseColor)
-This function returns a color 50% lighter than \c baseColor. See QColor::lighter() for further details.
-\section3 Qt.darker(color baseColor)
-This function returns a color 50% darker than \c baseColor. See QColor::darker() for further details.
+\section3 Qt.lighter(color baseColor, real factor)
+This function returns a color lighter than \c baseColor by the \c factor provided.
+
+If the factor is greater than 1.0, this functions returns a lighter color.
+Setting factor to 1.5 returns a color that is 50% brighter. If the factor is less than 1.0,
+the return color is darker, but we recommend using the Qt.darker() function for this purpose.
+If the factor is 0 or negative, the return value is unspecified.
+
+The function converts the current RGB color to HSV, multiplies the value (V) component
+by factor and converts the color back to RGB.
+
+If \c factor is not supplied, returns a color 50% lighter than \c baseColor (factor 1.5).
+
+\section3 Qt.darker(color baseColor, real factor)
+This function returns a color darker than \c baseColor by the \c factor provided.
+
+If the factor is greater than 1.0, this function returns a darker color.
+Setting factor to 3.0 returns a color that has one-third the brightness.
+If the factor is less than 1.0, the return color is lighter, but we recommend using
+the Qt.lighter() function for this purpose. If the factor is 0 or negative, the return
+value is unspecified.
+
+The function converts the current RGB color to HSV, divides the value (V) component
+by factor and converts the color back to RGB.
+
+If \c factor is not supplied, returns a color 50% darker than \c baseColor (factor 2.0).
+
\section3 Qt.tint(color baseColor, color tintColor)
This function allows tinting one color with another.
@@ -203,6 +226,9 @@ This function causes the QML engine to emit the quit signal, which in
This function returns \c url resolved relative to the URL of the
caller.
+\section3 Qt.fontFamilies()
+This function returns a list of the font families available to the application.
+
\section3 Qt.isQtObject(object)
Returns true if \c object is a valid reference to a Qt or QML object, otherwise false.
@@ -211,87 +237,61 @@ The following functions on the global object allow you to dynamically create QML
items from files or strings. See \l{Dynamic Object Management} for an overview
of their use.
-\section2 createComponent(url file)
- This function takes the URL of a QML file as its only argument. It returns
- a component object which can be used to create and load that QML file.
-
- Example QML script is below. Remember that QML files that might be loaded
- over the network cannot be expected to be ready immediately.
- \code
- var component;
- var sprite;
- function finishCreation(){
- if(component.isReady()){
- sprite = component.createObject();
- if(sprite == null){
- // Error Handling
- }else{
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- }else if(component.isError()){
- // Error Handling
- }
- }
-
- component = createComponent("Sprite.qml");
- if(component.isReady()){
- finishCreation();
- }else{
- component.statusChanged.connect(finishCreation);
- }
- \endcode
-
- If you are certain the files will be local, you could simplify to
-
- \code
- component = createComponent("Sprite.qml");
- sprite = component.createObject();
- if(sprite == null){
- // Error Handling
- console.log(component.errorsString());
- }else{
- sprite.parent = page;
- sprite.x = 200;
- //...
- }
- \endcode
-
- The methods and properties of the Component element are defined in its own
- page, but when using it dynamically only two methods are usually used.
- Component.createObject() returns the created object or null if there is an error.
- If there is an error, Component.errorsString() describes what the error was.
-
- If you want to just create an arbitrary string of QML, instead of
- loading a QML file, consider the createQmlObject() function.
-
-\section2 createQmlObject(string qml, object parent, string filepath)
- Creates a new object from the specified string of QML. It requires a
- second argument, which is the id of an existing QML object to use as
- the new object's parent. If a third argument is provided, this is used
- for error reporting as the filepath that the QML came from.
-
- Example (where targetItem is the id of an existing QML item):
- \code
- newObject = createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
- targetItem, "dynamicSnippet1");
- \endcode
-
- This function is intended for use inside QML only. It is intended to behave
- similarly to eval, but for creating QML elements.
-
- Returns the created object, or null if there is an error. In the case of an
- error, a QtScript Error object is thrown. This object has the additional property,
- qmlErrors, which is an array of all the errors encountered when trying to execute the
- QML. Each object in the array has the members: lineNumber, columnNumber, fileName and message.
-
- Note that this function returns immediately, and therefore may not work if
- the QML loads new components. If you are trying to load a new component,
- for example from a QML file, consider the createComponent() function
- instead. 'New components' refers to external QML files that have not yet
- been loaded, and so it is safe to use createQmlObject to load built-in
- components.
+
+\section2 Qt.createComponent(url file)
+
+This function takes the URL of a QML file as its only argument. It returns
+a component object which can be used to create and load that QML file.
+
+Here is an example. Remember that QML files that might be loaded
+over the network cannot be expected to be ready immediately.
+
+\snippet doc/src/snippets/declarative/componentCreation.js 0
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js 1
+
+If you are certain the files will be local, you could simplify to:
+
+\snippet doc/src/snippets/declarative/componentCreation.js 2
+
+The methods and properties of the Component element are defined in its own
+page, but when using it dynamically only two methods are usually used.
+\c Component.createObject() returns the created object or \c null if there is an error.
+If there is an error, \l {Component::errorsString()}{Component.errorsString()} describes
+the error that occurred. Note that createObject() takes exactly one argument, which is set
+to the parent of the created object. Graphical objects without a parent will not appear
+on the scene, but if you do not wish to parent the item at this point you can safely pass
+in null.
+
+If you want to just create an arbitrary string of QML, instead of
+loading a QML file, consider the \l{Qt.createQmlObject(string qml, object parent, string filepath)}{Qt.createQmlObject()} function.
+
+
+\section2 Qt.createQmlObject(string qml, object parent, string filepath)
+
+Creates a new object from the specified string of QML. It requires a
+second argument, which is the id of an existing QML object to use as
+the new object's parent. If a third argument is provided, this is used
+for error reporting as the filepath that the QML came from.
+
+Example (where \c targetItem is the id of an existing QML item):
+
+\snippet doc/src/snippets/declarative/createQmlObject.qml 0
+
+This function is intended for use inside QML only. It is intended to behave
+similarly to eval, but for creating QML elements.
+
+Returns the created object, \c or null if there is an error. In the case of an
+error, a QtScript Error object is thrown. This object has the additional property,
+qmlErrors, which is an array of all the errors encountered when trying to execute the
+QML. Each object in the array has the members \c lineNumber, \c columnNumber, \c fileName and \c message.
+
+Note that this function returns immediately, and therefore may not work if
+the QML loads new components. If you are trying to load a new component,
+for example from a QML file, consider the \l{Qt.createComponent(url file)}{Qt.createComponent()} function
+instead. 'New components' refers to external QML files that have not yet
+been loaded, and so it is safe to use \c Qt.createQmlObject() to load built-in
+components.
\section1 XMLHttpRequest
@@ -382,7 +382,7 @@ of QDeclarativeEngine::offlineStoragePath(), currently as SQLite databases.
The API can be used from JavaScript functions in your QML:
-\quotefile declarative/sql/hello.qml
+\quotefile declarative/sqllocalstorage/hello.qml
The API conforms to the Synchronous API of the HTML5 Web Database API,
\link http://www.w3.org/TR/2009/WD-webdatabase-20091029/ W3C Working Draft 29 October 2009\endlink.
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
index 0051f09..83380a1 100644
--- a/doc/src/declarative/integrating.qdoc
+++ b/doc/src/declarative/integrating.qdoc
@@ -110,51 +110,11 @@ of QML UIs:
\section2 Loading QGraphicsWidget objects in QML
An alternative approach is to expose your existing QGraphicsWidget objects to
-QML and construct your scene in QML instead. To do this, you need to register
-any custom C++ types and create a plugin that registers the custom types
-so that they can be used from your QML file.
+QML and construct your scene in QML instead. See the \l {declarative/cppextensions/qgraphicslayouts}{graphics layouts example}
+which shows how to expose Qt's graphics layout classes to QML in order
+to use QGraphicsWidget with classes like QGraphicsLinearLayout and QGraphicsGridLayout.
-Here is an example. Suppose you have two classes, \c RedSquare and \c BlueCircle,
-that both inherit from QGraphicsWidget:
-
-\c [graphicswidgets/redsquare.h]
-\snippet doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h 0
-
-\c [graphicswidgets/bluecircle.h]
-\snippet doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h 0
-
-Then, create a plugin by subclassing QDeclarativeExtensionPlugin, and register the
-types by calling qmlRegisterType(). Also export the plugin with Q_EXPORT_PLUGIN2.
-
-\c [graphicswidgets/shapesplugin.cpp]
-\snippet doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp 0
-
-Now write a project file that creates the plugin:
-
-\c [graphicswidgets/graphicswidgets.pro]
-\quotefile doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro
-
-And add a \c qmldir file that includes the \c graphicswidgets plugin from the \c lib
-subdirectory (as defined in the project file):
-
-\c [graphicswidgets/qmldir]
-\quotefile doc/src/declarative/snippets/integrating/graphicswidgets/qmldir
-
-Now, we can write a QML file that uses the \c RedSquare and \c BlueCircle widgets.
-(As an example, we can also create \c QGraphicsWidget items if we import the \c Qt.widgets
-module.)
-
-\c [main.qml]
-\quotefile doc/src/declarative/snippets/integrating/graphicswidgets/main.qml
-
-Here is a screenshot of the result:
-
-\image declarative-integrating-graphicswidgets.png
-
-
-Note this approach of creating your graphics objects from QML does not work
-with QGraphicsItems that are not QGraphicsObject-based, since they are not QObjects.
-
-See \l{Extending QML in C++} for further information on using C++ types.
+To expose your existing QGraphicsWidget classes to QML, use \l {qmlRegisterType()}.
+See \l{Extending QML in C++} for further information on using C++ types in QML.
*/
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index a98c9e1..acf4ec9 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -60,10 +60,13 @@ technologies like HTML and CSS, but it's not required.
QML looks like this:
\code
+import Qt 4.7
+
Rectangle {
width: 200
height: 200
- color: "white"
+ color: "blue"
+
Image {
source: "pics/logo.png"
anchors.centerIn: parent
diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index 91acb3c..788d417 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -143,6 +143,28 @@ ListView {
}
\endcode
+It is also possible to manipulate the ListModel directly via JavaScript.
+In this case, the first item inserted will determine the roles available
+to any views using the model. For example, if an empty ListModel is
+created and populated via JavaScript the roles provided by the first
+insertion are the only roles that will be shown in the view:
+
+\code
+Item {
+ ListModel {
+ id: fruitModel
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: fruitModel.append({"cost": 5.95, "name":"Pizza"})
+ }
+}
+\endcode
+
+When the MouseArea is clicked fruitModel will have two roles, "cost" and "name".
+Even if subsequent roles are added, only the first two will be handled by views
+using the model.
+
\section2 XmlListModel
@@ -283,7 +305,9 @@ QDeclarativeContext *ctxt = view.rootContext();
ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
\endcode
-The properties of the object may then be accessed in the delegate:
+The QObject* is available as the \c modelData property. As a convenience,
+the properties of the object are also made available directly in the
+delegate's context:
\code
ListView {
@@ -295,13 +319,18 @@ ListView {
Rectangle {
height: 25
width: 100
- color: model.color
+ color: model.modelData.color
Text { text: name }
}
}
}
\endcode
+Note the use of the fully qualified access to the \c color property.
+The properties of the object are not replicated in the \c model
+object, since they are easily available via the modelData
+object.
+
Note: There is no way for the view to know that the contents of a QList
have changed. If the QList is changed, it will be necessary to reset
the model by calling QDeclarativeContext::setContextProperty() again.
diff --git a/doc/src/declarative/qmlruntime.qdoc b/doc/src/declarative/qmlruntime.qdoc
index a724c7d..b105df4 100644
--- a/doc/src/declarative/qmlruntime.qdoc
+++ b/doc/src/declarative/qmlruntime.qdoc
@@ -46,15 +46,14 @@
\ingroup qttools
This page documents the \e{Declarative UI Runtime} for the Qt GUI
- toolkit, and the \c qml executable which can be used to run apps
- written for the runtime. The \c qml executable reads a declarative user interface definition
- (\c .qml) file and displays the user interface it describes.
+ toolkit, and the \QQL which can be used to run apps
+ written for the runtime. The \QQL reads a declarative
+ user interface definition (\c .qml) file and displays the user interface it describes.
- QML is a runtime, as you can run plain qml files which pull in their required modules.
+ QML is a runtime, as you can run plain QML files which pull in their required modules.
To run apps with the QML runtime, you can either start the runtime
- from your own application (using a QDeclarativeView) or with the simple \c qml application.
- The \c qml application can be
- installed in a production environment, assuming that it is not already
+ from your own application (using a QDeclarativeView) or with the simple \QQL.
+ The launcher can be installed in a production environment, assuming that it is not already
present in the system. It is generally packaged alongside Qt.
To deploy an application using the QML runtime, you have two options:
@@ -62,18 +61,18 @@
\list
\o Write your own Qt application including a QDeclarative view and deploy it the same as
any other Qt application (not discussed further on this page), or
- \o Write a main QML file for your application, and run your application using the included \c qml tool.
+ \o Write a main QML file for your application, and run your application using the included \QQL.
\endlist
- To run an application with the \c qml tool, pass the filename as an argument:
+ To run an application with the \QQL, pass the filename as an argument:
\code
qml myQmlFile.qml
\endcode
- Deploying a QML application via the \c qml executable allows for QML only deployments, but can also
+ Deploying a QML application via the \QQL allows for QML only deployments, but can also
include custom C++ modules just as easily. Below is an example of how you might structure
- a complex application deployed via the qml runtime, it is a listing of the files that would
+ a complex application deployed via the QML runtime, it is a listing of the files that would
be included in the deployment package.
\code
@@ -94,7 +93,7 @@
modules must contain a QDeclarativeExtentionPlugin subclass.
The application would be executed either with your own application, the command 'qml MyApp.qml' or by
- opening the qml file if your system has the \c qml executable registered as the handler for qml files. The MyApp.qml file would have access
+ opening the file if your system has the \QQL registered as the handler for QML files. The MyApp.qml file would have access
to all of the deployed types using the import statements such as the following:
\code
@@ -102,19 +101,36 @@
import "OtherModule" 1.0 as Other
\endcode
- \section1 \c qml application functionality
- The \c qml application implements some additional functionality to help it serve the role of a launcher
- for myriad applications. If you implement your own launcher application, you may also wish to reimplement
+ \section1 Qt QML Launcher functionality
+ The \QQL implements some additional functionality to help it supporting
+ myriad applications. If you implement your own application, you may also wish to reimplement
some or all of this functionality. However, much of this functionality is intended to aid the prototyping of
- qml applications and may not be necessary for a deployed application.
+ QML applications and may not be necessary for a deployed application.
\section2 Options
- When run with the \c -help option, qml shows available options.
+ When run with the \c -help option, \c qml shows available options.
+
+ \section2 Translations
+
+ When the launcher loads an initial QML file, it will install a translation file from
+ a "i18n" subdirectory relative to that initial QML file. The actual translation file
+ loaded will be according to the system locale and have the form
+ "qml_<language>.qm", where <language> is a two-letter ISO 639 language,
+ such as "qml_fr.qm", optionally followed by an underscore and an uppercase two-letter ISO 3166 country
+ code, such as "qml_fr_FR.qm" or "qml_fr_CA.qm".
+
+ Such files can be created using \l{Qt Linguist}.
+
+ See the \l{scripting.html#internationalization}{Qt Internationalization} documentation for information about how to make
+ the JavaScript in QML files use translatable strings.
+
+ Additionally, the launcher will load translation files specified on the
+ command line via the \c -translation option.
\section2 Dummy Data
- The secondary use of the qml runtime is to allow QML files to be viewed with
+ The secondary use of the launcher is to allow QML files to be viewed with
dummy data. This is useful when prototyping the UI, as the dummy data can
be later replaced with actual data and bindings from a C++ plugin.
To provide dummy data: create a directory called "dummydata" in the same directory as
@@ -136,13 +152,13 @@
\section2 Runtime Object
- All applications using the qmlruntime will have access to the 'runtime'
+ All applications using the launcher will have access to the 'runtime'
property on the root context. This property contains several pieces of
information about the runtime environment of the application.
\section3 Screen Orientation
- A special piece of dummy data which is integrated into the runtime is
+ A special piece of dummy data which is integrated into the launcher is
a simple orientation property. The orientation can be set via the
settings menu in the application, or by pressing Ctrl+T to toggle it.
@@ -156,13 +172,13 @@
}
\endcode
- This allows your application to respond to the orientation of the screen changing. The runtime
+ This allows your application to respond to the orientation of the screen changing. The launcher
will automatically update this on some platforms (currently the N900 only) to match the physical
screen's orientation. On other plaforms orientation changes will only happen when explictly asked for.
\section3 Window Active
- The runtime.isActiveWindow property tells whether the main window of the qml runtime is currently active
+ The runtime.isActiveWindow property tells whether the main window of the launcher is currently active
or not. This is especially useful for embedded devices when you want to pause parts of your application,
including animations, when your application loses focus or goes to the background.
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
index d024ff2..7d696d7 100644
--- a/doc/src/declarative/qtbinding.qdoc
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -97,17 +97,17 @@ The following example shows how to expose a background color to a QML file throu
\row
\o
\c {// main.cpp}
-\snippet doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp 0
\o
\c {// main.qml}
-\snippet doc/src/declarative/snippets/qtbinding/contextproperties/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.qml 0
\endtable
Or, if you want \c main.cpp to create the component without showing it in a QDeclarativeView, you could create an instance of QDeclarativeContext using QDeclarativeEngine::rootContext() instead:
-\snippet doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp 1
+\snippet doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp 1
Context properties work just like normal properties in QML bindings - if the \c backgroundColor
context property in this example was changed to red, the component object instances would
@@ -135,15 +135,15 @@ allow QML to set values.
The following example creates a \c CustomPalette object, and sets it as the \c palette context
property.
-\snippet doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h 0
+\snippet doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h 0
-\snippet doc/src/declarative/snippets/qtbinding/custompalette/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/custompalette/main.cpp 0
The QML that follows references the palette object, and its properties, to set the appropriate
background and text colors. When the window is clicked, the palette's text color is changed, and
the window text will update accordingly.
-\snippet doc/src/declarative/snippets/qtbinding/custompalette/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/custompalette/main.qml 0
To detect when a C++ property value - in this case the \c CustomPalette's \c text property -
changes, the property must have a corresponding NOTIFY signal. The NOTIFY signal specifies a signal
@@ -185,12 +185,12 @@ This example toggles the "Stopwatch" object on/off when the MouseArea is clicked
\row
\o
\c {// main.cpp}
-\snippet doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h 0
-\snippet doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h 0
+\snippet doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp 0
\o
\c {// main.qml}
-\snippet doc/src/declarative/snippets/qtbinding/stopwatch/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/stopwatch/main.qml 0
\endtable
@@ -258,16 +258,16 @@ QML content can be loaded from \l {The Qt Resource System} using the \e qrc: URL
For example:
\c [project/example.qrc]
-\quotefile doc/src/declarative/snippets/qtbinding/resources/example.qrc
+\quotefile doc/src/snippets/declarative/qtbinding/resources/example.qrc
\c [project/project.pro]
-\quotefile doc/src/declarative/snippets/qtbinding/resources/resources.pro
+\quotefile doc/src/snippets/declarative/qtbinding/resources/resources.pro
\c [project/main.cpp]
-\snippet doc/src/declarative/snippets/qtbinding/resources/main.cpp 0
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.cpp 0
\c [project/main.qml]
-\snippet doc/src/declarative/snippets/qtbinding/resources/main.qml 0
+\snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0
*/
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h
deleted file mode 100644
index 73d66b7..0000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the 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$
-**
-****************************************************************************/
-//![0]
-#include <QGraphicsWidget>
-#include <QPainter>
-
-class BlueCircle : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
- {
- painter->setPen(QColor(Qt::blue));
- painter->drawEllipse(0, 0, size().width(), size().height());
- }
-};
-//![0]
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro b/doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro
deleted file mode 100644
index 21c8a37..0000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/graphicswidgets.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = lib
-CONFIG += qt plugin
-QT += declarative
-
-HEADERS += redsquare.h \
- bluecircle.h
-
-SOURCES += shapesplugin.cpp
-
-DESTDIR = lib
-OBJECTS_DIR = tmp
-MOC_DIR = tmp
-
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/main.qml b/doc/src/declarative/snippets/integrating/graphicswidgets/main.qml
deleted file mode 100644
index ffcf79d..0000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/main.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import Qt 4.7
-import Qt.widgets 4.7
-
-Rectangle {
- width: 200
- height: 200
-
- RedSquare {
- id: square
- width: 80
- height: 80
- }
-
- BlueCircle {
- anchors.left: square.right
- width: 80
- height: 80
- }
-
- QGraphicsWidget {
- anchors.top: square.bottom
- size.width: 80
- size.height: 80
- layout: QGraphicsLinearLayout {
- LayoutItem {
- preferredSize: "100x100"
- Rectangle { color: "yellow"; anchors.fill: parent }
- }
- }
- }
-}
-
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/qmldir b/doc/src/declarative/snippets/integrating/graphicswidgets/qmldir
deleted file mode 100644
index f94dad2..0000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin graphicswidgets lib
diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp b/doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp
deleted file mode 100644
index 4c18ef3..0000000
--- a/doc/src/declarative/snippets/integrating/graphicswidgets/shapesplugin.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the 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$
-**
-****************************************************************************/
-//![0]
-#include "redsquare.h"
-#include "bluecircle.h"
-
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-#include <QtDeclarative/qdeclarative.h>
-
-class ShapesPlugin : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- void registerTypes(const char *uri) {
- qmlRegisterType<RedSquare>(uri, 1, 0, "RedSquare");
- qmlRegisterType<BlueCircle>(uri, 1, 0, "BlueCircle");
- }
-};
-
-#include "shapesplugin.moc"
-
-Q_EXPORT_PLUGIN2(shapesplugin, ShapesPlugin);
-//![0]
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index 1a93d05..75c0f851 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -57,10 +57,10 @@ The tutorial's source code is located in the $QTDIR/examples/declarative/tutoria
Tutorial chapters:
-\list
-\o \l {QML Tutorial 1 - Basic Types}
-\o \l {QML Tutorial 2 - QML Component}
-\o \l {QML Tutorial 3 - States and Transitions}
+\list 1
+\o \l {QML Tutorial 1 - Basic Types}{Basic Types}
+\o \l {QML Tutorial 2 - QML Components}{QML Components}
+\o \l {QML Tutorial 3 - States and Transitions}{States and Transitions}
\endlist
*/
@@ -86,7 +86,7 @@ Here is the QML code for the application:
\section2 Import
First, we need to import the types that we need for this example. Most QML files will import the built-in QML
-types (like \l{Rectangle}, \l{Image}, ...) that come with Qt with:
+types (like \l{Rectangle}, \l{Image}, ...) that come with Qt, using:
\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 3
@@ -95,7 +95,7 @@ types (like \l{Rectangle}, \l{Image}, ...) that come with Qt with:
\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 1
We declare a root element of type \l{Rectangle}. It is one of the basic building blocks you can use to create an application in QML.
-We give it an \c{id} to be able to refer to it later. In this case, we call it \e page.
+We give it an \c{id} to be able to refer to it later. In this case, we call it "page".
We also set the \c width, \c height and \c color properties.
The \l{Rectangle} element contains many other properties (such as \c x and \c y), but these are left at their default values.
@@ -103,15 +103,16 @@ The \l{Rectangle} element contains many other properties (such as \c x and \c y)
\snippet examples/declarative/tutorials/helloworld/tutorial1.qml 2
-We add a \l Text element as a child of our root element that will display the text 'Hello world!'.
+We add a \l Text element as a child of the root Rectangle element that displays the text 'Hello world!'.
The \c y property is used to position the text vertically at 30 pixels from the top of its parent.
-The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}.
-
The \c anchors.horizontalCenter property refers to the horizontal center of an element.
In this case, we specify that our text element should be horizontally centered in the \e page element (see \l{anchor-layout}{Anchor-based Layout}).
+The \c font.pointSize and \c font.bold properties are related to fonts and use the \l{dot properties}{dot notation}.
+
+
\section2 Viewing the example
To view what you have created, run the \l{Qt Declarative UI Runtime}{qml} tool (located in the \c bin directory) with your filename as the first argument.
@@ -124,7 +125,7 @@ bin/qml $QTDIR/examples/declarative/tutorials/helloworld/tutorial1.qml
/*!
\page qml-tutorial2.html
-\title QML Tutorial 2 - QML Component
+\title QML Tutorial 2 - QML Components
\contentspage QML Tutorial
\previouspage QML Tutorial 1 - Basic Types
\nextpage QML Tutorial 3 - States and Transitions
@@ -134,10 +135,10 @@ This chapter adds a color picker to change the color of the text.
\image declarative-tutorial2.png
Our color picker is made of six cells with different colors.
-To avoid writing the same code multiple times, we first create a new \c Cell component.
+To avoid writing the same code multiple times for each cell, we create a new \c Cell component.
A component provides a way of defining a new type that we can re-use in other QML files.
-A QML component is like a black-box and interacts with the outside world through properties, signals and slots and is generally
-defined in its own QML file (for more details, see \l {Defining new Components}).
+A QML component is like a black-box and interacts with the outside world through properties, signals and functions and is generally
+defined in its own QML file. (For more details, see \l {Defining new Components}).
The component's filename must always start with a capital letter.
Here is the QML code for \c Cell.qml:
@@ -157,7 +158,7 @@ An \l Item is the most basic visual element in QML and is often used as a contai
We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us
to instantiate the cells with different colors.
-This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{intro-properties}{Properties}).
+This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{Adding new properties}).
\snippet examples/declarative/tutorials/helloworld/Cell.qml 5
diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc
index 7d56ea1..afc6361 100644
--- a/doc/src/development/assistant-manual.qdoc
+++ b/doc/src/development/assistant-manual.qdoc
@@ -359,7 +359,7 @@
The \menu{Options} page lets you specify the homepage \QA will display when
you click the \gui{Home} button in \QA's main user interface. You can specify
- the hompage by typing it here or clicking on one of the buttons below the
+ the homepage by typing it here or clicking on one of the buttons below the
textbox. \gui{Current Page} sets the currently displayed page as your home
page while \gui{Restore to default} will reset your home page to the default
home page.
diff --git a/doc/src/development/developing-on-mac.qdoc b/doc/src/development/developing-on-mac.qdoc
index 785858f..0c0af79 100644
--- a/doc/src/development/developing-on-mac.qdoc
+++ b/doc/src/development/developing-on-mac.qdoc
@@ -41,9 +41,8 @@
/*!
\page developing-on-mac.html
- \title Developing Qt Applications on Mac OS X
- \brief A overview of items to be aware of when developing Qt applications
- on Mac OS X
+ \title Developing Qt Applications for Mac OS X
+ \brief Information for developing Qt applications for Mac OS X
\ingroup platform-specific
\tableofcontents
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index 688122b..c63e96c 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -347,6 +347,7 @@
\row \o vcapp \o Creates a Visual Studio Project file to build
an application.
\row \o vclib \o Creates a Visual Studio Project file to build a library.
+ \row \o vcsubdirs \o Creates a Visual Studio Solution file to build projects in sub-directories.
\endtable
See the \l{qmake Tutorial} for advice on writing project files for
diff --git a/doc/src/diagrams/modelview-move-rows-1.sk b/doc/src/diagrams/modelview-move-rows-1.sk
new file mode 100644
index 0000000..dc90cfb
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-1.sk
@@ -0,0 +1,271 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+fp((1,1,1))
+lw(1)
+ld((5, 5))
+r(30,0,0,-30,220,515)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,665)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,664.044)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,425)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,337.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,605)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,515.177)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,575)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,485.177)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,277.5,575)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,335)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,575)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,545)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30.262,220,305.262)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,307.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,455.177)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,635)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,545.177)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,695)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30.956,415.038,695)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,367.5)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,277.5,605)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,365)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,605)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,277.5,635)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,395)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,635)
+le()
+lw(1)
+r(165,0,0,-230,210,705)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,673.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.478,672.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.44,345.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,643.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.478,642.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,403.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.44,315.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,613.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.478,523.317))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(286.94,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,373.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.44,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,583.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.478,493.317))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(286.94,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,343.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.44,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,553.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.478,463.317))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(286.94,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.44,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.44,523.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.133,283.402))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.44,285.64))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.478,433.317))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(277.5,635,0)
+bs(252.5,635,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(292.5,380,0)
+bs(292.5,542.5,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(250,380,0)
+bs(290,380,0)
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/diagrams/modelview-move-rows-2.sk b/doc/src/diagrams/modelview-move-rows-2.sk
new file mode 100644
index 0000000..7ddb95e
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-2.sk
@@ -0,0 +1,271 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+fp((1,1,1))
+lw(1)
+ld((5, 5))
+r(30,0,0,-30,220,515)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,665)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,664.044)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,425)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,337.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,605)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,605)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,575)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,575)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,275,455)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,335)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,545)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,545)
+fp((1,1,1))
+lw(1)
+r(29.6927,0,0,-30,220,305.262)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,307.5)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,635)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,635)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,695)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415.038,694.044)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,415,367.5)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,275,485)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,365)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,485)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,275,515)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,395)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,415,515)
+le()
+lw(1)
+r(165,0,0,-230,210,705)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,673.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.478,672.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(424.44,345.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,643.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.478,642.184))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,403.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(424.44,315.64))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.44,613.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(284.44,493.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,373.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(424.44,493.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.44,583.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(284.44,463.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,343.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(424.44,463.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.44,553.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(284.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(424.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.44,523.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.44,523.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.133,283.402))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(424.44,285.64))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(275,515,0)
+bs(252.5,515,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(292.5,380,0)
+bs(292.5,422.5,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(250,380,0)
+bs(290,380,0)
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/diagrams/modelview-move-rows-3.sk b/doc/src/diagrams/modelview-move-rows-3.sk
new file mode 100644
index 0000000..33a9ad1
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-3.sk
@@ -0,0 +1,137 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,425)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,344.997,400)
+lw(1)
+r(30,0,0,-30,220,335)
+lw(1)
+r(30,0,0,-30,345,339.739)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,305.262)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,345,310)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,344.997,430)
+lw(1)
+r(30,0,0,-30,220,365)
+lw(1)
+r(30,0,0,-30,345,369.739)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,272.5,455)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,345,460)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,395)
+le()
+lw(1)
+r(165,0,0,-230,210,705)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,433.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(354.437,408.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,403.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(354.437,378.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(281.94,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(354.44,438.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,373.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,343.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(354.44,347.879))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(354.44,317.879))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.133,283.402))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(355.049,288.14))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(272.5,455,0)
+bs(252.5,455,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(287.5,380,0)
+bs(287.5,422.5,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(250,380,0)
+bs(285,380,0)
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/diagrams/modelview-move-rows-4.sk b/doc/src/diagrams/modelview-move-rows-4.sk
new file mode 100644
index 0000000..0531749
--- /dev/null
+++ b/doc/src/diagrams/modelview-move-rows-4.sk
@@ -0,0 +1,137 @@
+##Sketch 1 2
+document()
+layout('A4',0)
+layer('Layer 1',1,1,0,0,(0,0,0))
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,425)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,345,430)
+lw(1)
+r(30,0,0,-30,220,335.18)
+lw(1)
+r(30,0,0,-30,345,339.739)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30.442,220,305.442)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,345,310)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,220,455)
+fp((1,1,1))
+lw(1)
+r(30,0,0,-30,345,460)
+lw(1)
+r(30,0,0,-30,220,365)
+lw(1)
+r(30,0,0,-30,345,400)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,272.5,335)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,345,370)
+fp((0.753,0.753,1))
+lw(1)
+r(30,0,0,-30,220,395)
+le()
+lw(1)
+r(165,0,0,-230,210,705)
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(229.44,433.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('0',(354.44,438.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(229.44,403.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('1',(354.44,408.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(281.94,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(354.44,348.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('2',(229.44,373.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(229.44,343.14))
+fp((0.503,0.503,0.503))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('3',(354.44,378.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(229.44,313.14))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('4',(354.44,317.879))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(229.44,283.582))
+fp((0,0,0))
+le()
+lw(1)
+Fn('Helvetica')
+Fs(20)
+txt('5',(354.44,288.14))
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(272.5,335,0)
+bs(252.5,335,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(287.5,380,0)
+bs(287.5,337.5,0)
+lw(1.5)
+la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1))
+b()
+bs(250,380,0)
+bs(285,380,0)
+guidelayer('Guide Lines',1,0,0,1,(0,0,1))
+grid((0,0,2.5,2.5),1,(0,0,1),'Grid')
diff --git a/doc/src/examples/elasticnodes.qdoc b/doc/src/examples/elasticnodes.qdoc
index edc62d8..e6e6594 100644
--- a/doc/src/examples/elasticnodes.qdoc
+++ b/doc/src/examples/elasticnodes.qdoc
@@ -83,7 +83,7 @@
also reimplements \l{QGraphicsItem::shape()}{shape()} to ensure its hit
area has an elliptic shape (as opposed to the default bounding rectangle).
- For edge management purposes the node provides a simple API for adding
+ For edge management purposes, the node provides a simple API for adding
edges to a node, and for listing all connected edges.
The \l{QGraphicsItem::advance()}{advance()} reimplementation is called
@@ -126,16 +126,21 @@
\snippet examples/graphicsview/elasticnodes/node.cpp 2
- The \e calculateForces() function implements the elastic forces effect that
- pulls and pushes on nodes in the grid. In addition to this algorithm, the
- user can move one node around with the mouse. Because we do not want the
- two to interfere, we start by checking if this \c Node is the current mouse
- grabber item (i.e., QGraphicsScene::mouseGrabberItem()). Because we need to
- find all neighboring (but not necessarily connected) nodes, we also make
- sure the item is part of a scene in the first place.
+ There are two ways to move a node. The \c calculateForces() function
+ implements the elastic effect that pulls and pushes on nodes in the grid.
+ In addition, the user can directly move one node around with the mouse.
+ Because we do not want the two approaches to operate at the same time on
+ the same node, we start \c calculateForces() by checking if this \c Node is
+ the current mouse grabber item (i.e., QGraphicsScene::mouseGrabberItem()).
+ Because we need to find all neighboring (but not necessarily connected)
+ nodes, we also make sure the item is part of a scene in the first place.
\snippet examples/graphicsview/elasticnodes/node.cpp 3
+ The "elastic" effect comes from an algorithm that applies pushing and
+ pulling forces. The effect is impressive, and surprisingly simple to
+ implement.
+
The algorithm has two steps: the first is to calculate the forces that push
the nodes apart, and the second is to subtract the forces that pull the
nodes together. First we need to find all the nodes in the graph. We call
@@ -143,19 +148,20 @@
qgraphicsitem_cast() to look for \c Node instances.
We make use of \l{QGraphicsItem::mapFromItem()}{mapFromItem()} to create a
- vector pointing from this node to each other node, in \l{The Graphics View
- Coordinate System}{local coordinates}. We use the decomposed components of
- this vector to determine the direction and strength of force that apply to
- the node. The forces are added up for each node, and weighted so that the
- closest nodes are given the strongest force. The sum of all forces are
- stored in \e xvel (X-velocity) and \e yvel (Y-velocity).
+ temporary vector pointing from this node to each other node, in \l{The
+ Graphics View Coordinate System}{local coordinates}. We use the decomposed
+ components of this vector to determine the direction and strength of force
+ that should apply to the node. The forces accumulate for each node, and are
+ then adjusted so that the closest nodes are given the strongest force, with
+ rapid degradation when distance increases. The sum of all forces is stored
+ in \c xvel (X-velocity) and \c yvel (Y-velocity).
\snippet examples/graphicsview/elasticnodes/node.cpp 4
- The edges between the nodes represent the forces that pull the nodes
- together. By visiting each edge that is connected to this node, we can use
- a similar approach as above to find the direction and strength of all
- forces. These forces are subtracted from \e xvel and \e yvel.
+ The edges between the nodes represent forces that pull the nodes together.
+ By visiting each edge that is connected to this node, we can use a similar
+ approach as above to find the direction and strength of all pulling forces.
+ These forces are subtracted from \c xvel and \c yvel.
\snippet examples/graphicsview/elasticnodes/node.cpp 5
@@ -166,20 +172,20 @@
\snippet examples/graphicsview/elasticnodes/node.cpp 6
- The final step of \e calculateForces() determines the node's new position.
+ The final step of \c calculateForces() determines the node's new position.
We add the force to the node's current position. We also make sure the new
position stays inside of our defined boundaries. We don't actually move the
- item in this function; that's done in a separate step, from \e advance().
+ item in this function; that's done in a separate step, from \c advance().
\snippet examples/graphicsview/elasticnodes/node.cpp 7
- The \e advance() function updates the item's current position. It is called
- from \e GraphWidget::timerEvent(). If the node's position changed, the
+ The \c advance() function updates the item's current position. It is called
+ from \c GraphWidget::timerEvent(). If the node's position changed, the
function returns true; otherwise false is returned.
\snippet examples/graphicsview/elasticnodes/node.cpp 8
- The \e Node's bounding rectangle is a 20x20 sized rectangle centered around
+ The \c Node's bounding rectangle is a 20x20 sized rectangle centered around
its origin (0, 0), adjusted by 2 units in all directions to compensate for
the node's outline stroke, and by 3 units down and to the right to make
room for a simple drop shadow.
@@ -188,8 +194,8 @@
The shape is a simple ellipse. This ensures that you must click inside the
node's elliptic shape in order to drag it around. You can test this effect
- by running the example, and zooming far enough in so that the nodes become
- very large. Without reimplementing \l{QGraphicsItem::shape()}{shape()}, the
+ by running the example, and zooming far in so that the nodes are very
+ large. Without reimplementing \l{QGraphicsItem::shape()}{shape()}, the
item's hit area would be identical to its bounding rectangle (i.e.,
rectangular).
@@ -197,7 +203,7 @@
This function implements the node's painting. We start by drawing a simple
dark gray elliptic drop shadow at (-7, -7), that is, (3, 3) units down and
- to the right.
+ to the right from the top-left corner (-10, -10) of the ellipse.
We then draw an ellipse with a radial gradient fill. This fill is either
Qt::yellow to Qt::darkYellow when raised, or the opposite when sunken. In
@@ -217,8 +223,8 @@
calculations.
This notification is the only reason why the nodes need to keep a pointer
- back to the \e GraphWidget. Another approach could be to provide such
- notification using a signal; in such case, \e Node would need to inherit
+ back to the \c GraphWidget. Another approach could be to provide such
+ notification using a signal; in such case, \c Node would need to inherit
from QGraphicsObject.
\snippet examples/graphicsview/elasticnodes/node.cpp 12
@@ -226,14 +232,14 @@
Because we have set the \l{QGraphicsItem::ItemIsMovable}{ItemIsMovable}
flag, we don't need to implement the logic that moves the node according to
mouse input; this is already provided for us. We still need to reimplement
- the mouse press and release handlers though, to update the nodes' visual
+ the mouse press and release handlers, though, to update the nodes' visual
appearance (i.e., sunken or raised).
\section1 Edge Class Definition
- The \e Edge class represents the arrow-lines between the nodes in this
+ The \c Edge class represents the arrow-lines between the nodes in this
example. The class is very simple: it maintains a source- and destination
- node pointer, and provides an \e adjust() function that makes sure the line
+ node pointer, and provides an \c adjust() function that makes sure the line
starts at the position of the source, and ends at the position of the
destination. The edges are the only items that change continuously as
forces pull and push on the nodes.
@@ -242,13 +248,13 @@
\snippet examples/graphicsview/elasticnodes/edge.h 0
- \e Edge inherits from QGraphicsItem, as it's a simple class that has no use
+ \c Edge inherits from QGraphicsItem, as it's a simple class that has no use
for signals, slots, and properties (compare to QGraphicsObject).
The constructor takes two node pointers as input. Both pointers are
mandatory in this example. We also provide get-functions for each node.
- The \e adjust() function repositions the edge, and the item also implements
+ The \c adjust() function repositions the edge, and the item also implements
\l{QGraphicsItem::boundingRect()}{boundingRect()} and
\{QGraphicsItem::paint()}{paint()}.
@@ -256,7 +262,7 @@
\snippet examples/graphicsview/elasticnodes/edge.cpp 0
- The \e Edge constructor initializes its arrowSize data member to 10 units;
+ The \c Edge constructor initializes its \c arrowSize data member to 10 units;
this determines the size of the arrow which is drawn in
\l{QGraphicsItem::paint()}{paint()}.
@@ -265,7 +271,7 @@
This ensures that the edge items are not considered for mouse input at all
(i.e., you cannot click the edges). Then, the source and destination
pointers are updated, this edge is registered with each node, and we call
- \e adjust() to update this edge's start end end position.
+ \c adjust() to update this edge's start end end position.
\snippet examples/graphicsview/elasticnodes/edge.cpp 1
@@ -274,7 +280,7 @@
\snippet examples/graphicsview/elasticnodes/edge.cpp 2
- In \e adjust(), we define two points: \e sourcePoint, and \e destPoint,
+ In \c adjust(), we define two points: \c sourcePoint, and \c destPoint,
pointing at the source and destination nodes' origins respectively. Each
point is calculated using \l{The Graphics View Coordinate System}{local
coordinates}.
@@ -295,7 +301,7 @@
It's important to notice that we call
\l{QGraphicsItem::prepareGeometryChange()}{prepareGeometryChange()} in this
- function. The reason is that the variables \e sourcePoint and \e destPoint
+ function. The reason is that the variables \c sourcePoint and \c destPoint
are used directly when painting, and they are returned from the
\l{QGraphicsItem::boundingRect()}{boundingRect()} reimplementation. We must
always call
@@ -338,26 +344,26 @@
\section1 GraphWidget Class Definition
- \e GraphWidget is a subclass of QGraphicsView, which provides the main
+ \c GraphWidget is a subclass of QGraphicsView, which provides the main
window with scrollbars.
\snippet examples/graphicsview/elasticnodes/graphwidget.h 0
- It provides a basic constructor that initializes the scene, an \e
+ The class provides a basic constructor that initializes the scene, an \c
itemMoved() function to notify changes in the scene's node graph, a few
event handlers, a reimplementation of
\l{QGraphicsView::drawBackground()}{drawBackground()}, and a helper
- function for scaling the view by mouse or keyboard.
+ function for scaling the view by using the mouse wheel or keyboard.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 0
- \e GraphicsWidget's constructor creates the scene, and because most items
- move around most of the time, it sets QGraphicsScene::NoIndex. Then the
- scene gets a fixed \l{QGraphicsScene::sceneRect}{scene rectangle}.
- The scene is then assigned to the \e GraphWidget view.
+ \c GraphicsWidget's constructor creates the scene, and because most items
+ move around most of the time, it sets QGraphicsScene::NoIndex. The scene
+ then gets a fixed \l{QGraphicsScene::sceneRect}{scene rectangle}, and is
+ assigned to the \c GraphWidget view.
The view enables QGraphicsView::CacheBackground to cache rendering of its
- static and somewhat complex background. Because the graph renders a close
+ static, and somewhat complex, background. Because the graph renders a close
collection of small items that all move around, it's unnecessary for
Graphics View to waste time finding accurate update regions, so we set the
QGraphicsView::BoundingRectViewportUpdate viewport update mode. The default
@@ -381,15 +387,15 @@
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 2
- \e GraphWidget is notified of node movement through this \e itemMoved()
+ \c GraphWidget is notified of node movement through this \c itemMoved()
function. Its job is simply to restart the main timer in case it's not
running already. The timer is designed to stop when the graph stabilizes,
and start once it's unstable again.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 3
- This is \e GraphWidget's key event handler. The arrow keys move the center
- node around, the '+' and '-' keys zoom in and out by calling \e
+ This is \c GraphWidget's key event handler. The arrow keys move the center
+ node around, the '+' and '-' keys zoom in and out by calling \c
scaleView(), and the enter and space keys randomize the positions of the
nodes. All other key events (e.g., page up and page down) are handled by
QGraphicsView's default implementation.
@@ -398,16 +404,16 @@
The timer event handler's job is to run the whole force calculation
machinery as a smooth animation. Each time the timer is triggered, the
- handler will find all nodes in the scene, and call \e
+ handler will find all nodes in the scene, and call \c
Node::calculateForces() on each node, one at a time. Then, in a final step
- it will call \e Node::advance() to move all nodes to their new positions.
- By checking the return value of \e advance(), we can decide if the grid
+ it will call \c Node::advance() to move all nodes to their new positions.
+ By checking the return value of \c advance(), we can decide if the grid
stabilized (i.e., no nodes moved). If so, we can stop the timer.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 5
In the wheel event handler, we convert the mouse wheel delta to a scale
- factor, and pass this factor to \e scaleView(). This approach takes into
+ factor, and pass this factor to \c scaleView(). This approach takes into
account the speed that the wheel is rolled. The faster you roll the mouse
wheel, the faster the view will zoom.
@@ -415,24 +421,24 @@
The view's background is rendered in a reimplementation of
QGraphicsView::drawBackground(). We draw a large rectangle filled with a
- linear gradient, with a drop shadow, and then render text in top. The text
- is rendered twice to give a similar simple drop-shadow effect.
+ linear gradient, add a drop shadow, and then render text on top. The text
+ is rendered twice for a simple drop-shadow effect.
This background rendering is quite expensive; this is why the view enables
QGraphicsView::CacheBackground.
\snippet examples/graphicsview/elasticnodes/graphwidget.cpp 7
- The \e scaleView() helper function checks that the scale factor stays
+ The \c scaleView() helper function checks that the scale factor stays
within certain limits (i.e., you cannot zoom too far in nor too far out),
- and then applies this scale.
+ and then applies this scale to the view.
\section1 The main() Function
- In contrast to the complexity of the rest of this example, the \e main()
+ In contrast to the complexity of the rest of this example, the \c main()
function is very simple: We create a QApplication instance, seed the
- randomizer using qsrand(), and then create and show an instance of \e
- GraphWidget. Because all nodes in the grid are moved initially, the \e
+ randomizer using qsrand(), and then create and show an instance of \c
+ GraphWidget. Because all nodes in the grid are moved initially, the \c
GraphWidget timer will start immediately after control has returned to the
event loop.
*/
diff --git a/doc/src/examples/fingerpaint.qdoc b/doc/src/examples/fingerpaint.qdoc
index e5eb4ef..7eb1512 100644
--- a/doc/src/examples/fingerpaint.qdoc
+++ b/doc/src/examples/fingerpaint.qdoc
@@ -46,5 +46,5 @@
The Finger Paint example shows the use of multi-touch with a custom widget
to create a simple painting application.
- \image multitouch-fingerpaint.png
+ \image multitouch-fingerpaint-example.png
*/
diff --git a/doc/src/examples/padnavigator.qdoc b/doc/src/examples/padnavigator.qdoc
index 70e131e..e29a3b2 100644
--- a/doc/src/examples/padnavigator.qdoc
+++ b/doc/src/examples/padnavigator.qdoc
@@ -43,9 +43,555 @@
\example graphicsview/padnavigator
\title Pad Navigator Example
- The Pad Navigator Example shows how you can use Graphics View
- together with embedded widgets to create a simple but useful
- dynamic user interface for embedded devices.
+ The Pad Navigator Example shows how you can use Graphics View together with
+ embedded widgets and Qt's \l{State Machine Framework} to create a simple
+ but useful, dynamic, animated user interface.
\image padnavigator-example.png
+
+ The interface consists of a flippable, rotating pad with icons that can be
+ selected using the arrow keys on your keyboard or keypad. Pressing enter
+ will flip the pad around and reveal its back side, which has a form
+ embedded into a QGraphicsProxyWidget. You can interact with the form, and
+ press the enter key to flip back to the front side of the pad at any time.
+
+ Graphics View provides the QGraphicsScene class for managing and
+ interacting with a large number of custom-made 2D graphical items derived
+ from the QGraphicsItem class, and a QGraphicsView widget for visualizing
+ the items, with support for zooming and rotation.
+
+ This example consists of a \c RoundRectItem class, a \c FlippablePad class,
+ a \c PadNavigator class, a \c SplashItem class, and a \c main() function.
+
+ \section1 RoundRectItem Class Definition
+
+ The \c RoundRectItem class is used by itself to diplay the icons on the
+ pad, and as a base class for \c FlippablePad, the class for the pad itself.
+ The role of the class is to paint a round rectangle of a specified size and
+ gradient color, and optionally to paint a pixmap icon on top. To support \c
+ FlippablePad it also allows filling its contents with a plain window
+ background color.
+
+ Let's start by reviewing the \c RoundRectItem class declaration.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.h 0
+
+ \c RoundRectItem inherits QGraphicsObject, which makes it easy to control
+ its properties using QPropertyAnimation. Its constructor takes a rectangle
+ to determine its bounds, and a color.
+
+ Besides implementing the mandatory \l{QGraphicsItem::paint()}{paint()} and
+ \l{QGraphicsItem::boundingRect()}{boundingRect()} pure virtual functions,
+ it also provides the \c pixmap and \c fill properties.
+
+ The \c pixmap property sets an optional pixmap that is drawn on top of the
+ round rectangle. The \c fill property will, when true, fill the round
+ rectangle contents with a fixed QPalette::Window background color.
+ Otherwise the contents are filled using a gradient based on the color
+ passed to \c RoundRectItem's constructor.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.h 1
+
+ The private data members are:
+
+ \list
+ \o \c pix: The optional pixmap that is drawn on top of the rectangle.
+ \o \c fillRect: Corresponds to the \c fill property.
+ \o \c color: The configurable gradient color fill of the rectangle.
+ \o \c bounds: The bounds of the rectangle.
+ \o \c gradient: A precalculated gradient used to fill the rectangle.
+ \endlist
+
+ We will now review the \c RoundRectItem implementation. Let's start by
+ looking at its constructor:
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 0
+
+ The constructor initializes its member variables and forwards the \c parent
+ argument to QGraphicsObject's constructor. It then constructs the linear
+ gradient that is used in \l{QGraphicsItem::paint()}{paint()} to draw the
+ round rectangle's gradient background. The linear gradient's starting point
+ is at the top-left corner of the bounds, and the end is at the bottom-left
+ corner. The start color is identical to the color passed as an argument,
+ and a slightly darker color is chosen for the final stop.
+
+ We store this gradient as a member variable to avoid having to recreate the
+ gradient every time the item is repainted.
+
+ Finally we set the cache mode
+ \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache}. This mode
+ causes the item's rendering to be cached into an off-screen pixmap that
+ remains persistent as we move and transform the item. This mode is ideal
+ for this example, and works particularily well with OpenGL and OpenGL ES.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 1
+
+ The \c pixmap property implementation simple returns the member pixmap, or
+ sets it and then calls \l{QGraphicsItem::update()}{update()}.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 2
+
+ As the \l{QGraphicsItem::paint()}{paint()} implementation below draws a
+ simple drop shadow down and to the right of the item, we return a slightly
+ adjusted rectangle from \l{QGraphicsItem::boundingRect()}{boundingRect()}.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 3
+
+ The \l{QGraphicsItem::paint()}{paint()} implementation starts by rendering
+ a semi transparent black round rectangle drop shadow, two units down and to
+ the right of the main item.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 4
+
+ We then draw the "foreground" round rectangle itself. The fill depends on
+ the \c fill property; if true, we will with a plain QPalette::Window color.
+ We get the corrent brush from QApplication::palette(). We assign a single
+ unit wide pen for the stroke, assign the brush, and then draw the
+ rectangle.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 5
+
+ If a pixmap has been assigned to the \e pixmap property, we draw this
+ pixmap in the center of the rectangle item. The pixmaps are scaled to match
+ the size of the icons; in arguably a better approach would have been to
+ store the icons with the right size in the first places.
+
+ \snippet examples/graphicsview/padnavigator/roundrectitem.cpp 6
+
+ Finally, for completeness we include the \c fill property implementation.
+ It returns the \c fill member variable's value, and when assigned to, it
+ calls \l{QGraphicsItem::update()}{update()}.
+
+ As mentioned already, \c RoundRectItem is the base class for \c
+ FlippablePad, which is the class representing the tilting pad itself. We
+ will proceed to reviewing \c FlippablePad.
+
+ \section1 FlippablePad Class Definition
+
+ \c FlippablePad is, in addition to its inherited \c RoundRectItem
+ responsibilities, responsible for creating and managing a grid of icons.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.h 0
+
+ Its declaration is very simple: It inherits \c RoundRectItem and does not
+ need any special polymorphic behavior. It's suitable to declare its own
+ constructor, and a getter-function that allows \c PadNavigator to access
+ the icons in the grid by (row, column).
+
+ The example has no "real" behavior or logic of any kind, and because of
+ that, the icons do not need to provide any \e behavior or special
+ interactions management. In a real application, however, it would be
+ natural for the \c FlippablePad and its icons to handle more of the
+ navigation logic. In this example, we have chosen to leave this to
+ the \c PadNavigator class, which we will get back to below.
+
+ We will now review the \c FlippablePad implementation. This implementation
+ starts with two helper functions: \c boundsFromSize() and \c
+ posForLocation():
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 0
+
+ \c boundsForSize() takes a QSize argument, and returns the bounding
+ rectangle of the flippable pad item. The QSize determines how many rows and
+ columns the icon grid should have. Each icon is given 150x150 units of
+ space, and this determines the bounds.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 1
+
+ \c posForLocation() returns the position of an icon given its row and
+ column position. Like \c boundsForSize(), the function assumes each icon is
+ given 150x150 units of space, and that all icons are centered around the
+ flippable pad item's origin (0, 0).
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 2
+
+ The \c FlippablePad constructor passes suitable bounds (using \c
+ boundsForSize()) and specific color to \c RoundRectItem's constructor.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 3
+
+ It then loads pixmaps from compiled-in resources to use for its icons.
+ QDirIterator is very useful in this context, as it allows us to fetch all
+ resource "*.png" files inside the \c :/images directory without explicitly
+ naming the files.
+
+ We also make sure not to load more pixmaps than we need.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 4
+
+ Now that we have the pixmaps, we can create icons, position then and assign
+ pixmaps. We start by finding a suitable size and color for the icons, and
+ initializing a convenient grid structure for storing the icons. This \c
+ iconGrid is also used later to find the icon for a specific (column, row)
+ location.
+
+ For each row and column in our grid, we proceed to constructing each icon
+ as an instance of \c RoundRectItem. The item is placed by using the \c
+ posForLocation() helper function. To make room for the slip-behind
+ selection item, we give each icon a \l{QGraphicsItem::zValue()}{Z-value} of
+ 1. The pixmaps are distributed to the icons in round-robin fasion.
+
+ Again, this approach is only suitable for example purposes. In a real-life
+ application where each icon represents a specific action, it would be more
+ natural to assign the pixmaps directly, or that the icons themselves
+ provide suitable pixmaps.
+
+ \snippet examples/graphicsview/padnavigator/flippablepad.cpp 5
+
+ Finally, the \c iconAt() function returns a pointer to the icon at a
+ specific row and column. It makes a somewhat bold assumption that the input
+ is valid, which is fair because the \c PadNavigator class only calls this
+ function with correct input.
+
+ We will now review the \c SplashItem class.
+
+ \section1 SplashItem Class Definition
+
+ The \c SplashItem class represents the "splash window", a semitransparent
+ white overlay with text that appears immediately after the application has
+ started, and disappears after pressing any key. The animation is controlled
+ by \c PadNavigator; this class is very simple by itself.
+
+ \snippet examples/graphicsview/padnavigator/splashitem.h 0
+
+ The class declaration shows that \c SplashItem inherits QGraphicsObject to
+ allow it to be controlled by QPropertyAnimation. It reimplements the
+ mandatory \l{QGraphicsItem::paint()}{paint()} and
+ \l{QGraphicsItem::boundingRect()}{boundingRect()} pure virtual functions,
+ and keeps a \c text member variable which will contain the information text
+ displayed on this splash item.
+
+ Let's look at its implementation.
+
+ \snippet examples/graphicsview/padnavigator/splashitem.cpp 0
+
+ The constructor forwards to QGraphicsObject as expected, assigns a text
+ message to the \c text member variable, and enables
+ \l{QGraphicsItem::DeviceCoordinateCache}{DeviceCoordinateCache}. This cache
+ mode is suitable because the splash item only moves and is never
+ transformed, and because it contains text, it's important that it has a
+ pixel perfect visual appearance (in constrast to
+ \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache}, where the
+ visual appearance is not as good).
+
+ We use caching to avoid having to relayout and rerender the text for each
+ frame. An alterative approach would be to use the new QStaticText class.
+
+ \snippet examples/graphicsview/padnavigator/splashitem.cpp 1
+
+ \c SplashItem's bounding rectangle is fixed at (400x175).
+
+ \snippet examples/graphicsview/padnavigator/splashitem.cpp 2
+
+ The \l{QGraphicsItem::paint()}{paint()} implementation draws a clipped
+ round rectangle with a thick 2-unit border and a semi-transparent white
+ background. It proceeds to finding a suitable text area by adjusting the
+ splash item's bounding rectangle with 10 units in each side. The text is
+ rendered inside this rectangle, with top-left alignment, and with word
+ wrapping enabled.
+
+ The main class now remains. We will proceed to reviewing \c PadNavigator.
+
+ \section1 PadNavigator Class Definition
+
+ \c PadNavigator represents the main window of our Pad Navigator Example
+ application. It creates and controls a somewhat complex state machine, and
+ several animations. Its class declaration is very simple:
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.h 0
+
+ It inherits QGraphicsView and reimplements only one function:
+ \l{QGraphicsView::resizeEvent()}{resizeEvent()}, to ensure the scene is
+ scaled to fit inside the view when resizing the main window.
+
+ The \c PadNavigator constructor takes a QSize argument that determines the
+ number or rows and columns in the grid.
+
+ It also keeps a private member instance, \c form, which is the generated
+ code for the pad's back side item's QGraphicsProxyWidget-embedded form.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 0
+
+ \c PadNavigator's constructor is a bit long. In short, its job is to create
+ all items, including the \c FlippablePad, the \c SplashItem and the
+ QGraphicsProxyWidget \c backItem, and then to set up all animations, states
+ and transitions that control the behavior of the application.
+
+ It starts out simple, by forwarding to QGraphicsView's constructor.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 1
+
+ The first item to be created is \c SplashItem. This is going to be a top-level
+ item in the scene, next to \c FlippablePad, and stacked on top of it, so we
+ assign it a \l{QGraphicsItem::zValue()}{Z-value} of 1.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 2
+
+ Now we construct the \c FlippablePad item, passing its column-row count to
+ its constructor.
+
+ The pad is constrolled by three transformations, and we create one
+ QGraphicsRotation object for each of these.
+
+ \list
+ \o \c flipRotation: Rotates the grid around its Qt::YAxis. This rotation is
+ animated from 0 to 180, and eventually back, when enter is pressed on the
+ keyboard, flipping the pad around.
+ \o \c xRotation: Rotates the grid around its Qt::XAxis. This is used to
+ tilt the pad vertically corresponding to which item is currently selected.
+ This way, the selected item is always kept in front.
+ \o \c yRotation: Rotates the grid around its Qt::YAxis. This is used to
+ tilt the pad horizontally corresponding to which item is selected. This
+ way, the selected item is always kept in front.
+ \endlist
+
+ The combination of all three rotations is assigned via
+ QGraphicsItem::setTransformations().
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 3
+
+ Now we construct the QGraphicsProxyWidget-embedded \c backItem. The proxy
+ widget is created as a child of the pad. We create a new QWidget and
+ populate it with the \c form member. To ensure the \c hostName line edit is
+ the first to receive input focus when this item is shown, we call
+ \l{QWidget::setFocus()}{setFocus()} immediately. This will not give the
+ widget focus right away; it will only prepare the item to automatically
+ receive focus once it is shown.
+
+ The QWidget based form is embedded into the proxy widget. The proxy is
+ hidden initially; we only want to show it when the pad is rotated at least
+ 90 degrees, and we also rotate the proxy itself by 180 degrees. This way we
+ give the impression that the proxy widget is "behind" the flipped pad, when
+ in fact, it's actually \e{on top of it}.
+
+ We enable \l{QGraphicsItem::ItemCoordinateCache}{ItemCoordinateCache} to
+ ensure the flip animation can run smoothly.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 4
+
+ We now create the selection item. This is simply another instance of \c
+ RoundRectItem that is slightly larger than the icons on the pad. We create
+ it as an immediate child of the \c FlippablePad, so the selection item is a
+ sibling to all the icons. By giving it a
+ \l{QGraphicsItem::zValue()}{Z-value} of 0.5 we ensure it will slide beteen
+ the pad and its icons.
+
+ What follows now is a series of animation initializations.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 5
+
+ We begin with the animations that apply to the splash item. The first
+ animation, \c smoothSplashMove, ensures that the "y" property of \c splash
+ will be animated with a 250-millisecond duration
+ \l{QEasingCurve::InQuad}{InQuad} easing function. \c smoothSplashOpacity
+ ensures the opacity of \c splash eases in and out in 250 milliseconds.
+
+ The values are assigned by \c PadNavigator's state machine, which is
+ created later.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 6
+
+ These are the animations that control the selection item's movement and the
+ \c xRotation and \c yRotation QGraphicsRotation objects that tilt the pad.
+ All animations have a duration of 125 milliseconds, and they all use the
+ \l{QEasingCurve::InOutQuad}{InOutQuad} easing function.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 7
+
+ We now create the animations that control the flip-effect when you press
+ the enter key. The main goal is to rotate the pad by 180 degrees or back,
+ but we also need to make sure the selection item's tilt rotations are reset
+ back to 0 when the pad is flipped, and restored back to their original
+ values when flipped back:
+
+ \list
+ \o \c smoothFlipRotation: Animates the main 180 degree rotation of the pad.
+ \o \c smoothFlipScale: Scales the pad out and then in again while the pad is rotating.
+ \o \c smoothFlipXRotation: Animates the selection item's X-tilt to 0 and back.
+ \o \c smoothFlipYRotation: Animates the selection item's Y-tilt to 0 and back.
+ \o \c flipAnimation: A parallel animation group that ensures all the above animations are run in parallel.
+ \endlist
+
+ All animations are given a 500 millisecond duration and an
+ \l{QEasingCurve::InOutQuad}{InOutQuad} easing function.
+
+ It's worth taking a close look at \c smoothFlipScale. This animation's
+ start and end values are both 1.0, but at animation step 0.5 the
+ animation's value is 0.7. This means that after 50% of the animation's
+ duration, or 250 milliseconds, the pad will be scaled down to 0.7x of its
+ original size, which gives a great visual effect while flipping.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 8
+
+ This section uses a trick to ensure that certain properties are assigned
+ precisely when the flip animation passes 50%, or 90 degrees, rotation. In
+ short, the pad's icons and selection item are all hidden, the pad's \c fill
+ property is enabled, and \c backItem is shown when flipping over. When
+ flipping back, the reverse properties are applied.
+
+ The way this is achieved is by running a sequential animation in parallel
+ to the other animations. This sequence, dubbed \c setVariablesSequence,
+ starts with a 250 millisecond pause, and then executes several animations
+ with a duration of 0. Each animation will ensure that properties are set
+ immediate at this point.
+
+ This approach can also be used to call functions or set any other
+ properties at a specific time while an animation is running.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 9
+
+ We will now create the state machine. The whole \c PadNavigator state
+ machinery is controlled by one single state machine that has a
+ straight-forward state structure. The state engine itself is created
+ as a child of the \c PadNavigator itself. We then create three top level
+ states:
+
+ \list
+ \o \c splashState: The initial state where the splash item is visible.
+ \o \c frontState: The base state where the splash is gone and we can see
+ the front side of the pad, and navigate the selection item.
+ \o \c backState: The flipped state where the \c backItem is visible, and we
+ can interact with the QGraphicsProxyWidget-embedded form.
+ \endlist
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 10
+
+ Each state assigns specific properties to objects on entry. Most
+ interesting perhaps is the assignment of the value 0.0 to the pad's \c
+ flipRotation angle property when in \c frontState, and 180.0 when in \c
+ backState. At the end of this section we register default animations with
+ the state engine; these animations will apply to their respective objects
+ and properties for any state transition. Otherwise it's common to assign
+ animations to specific transitions.
+
+ The \c splashState state is set as the initial state. This is required
+ before we start the state engine. We proceed with creating some
+ transitions.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 11
+
+ QEventTransition defines a very flexible transition type. You can use this
+ class to trigger a transition based on an object receiving an event of a
+ specific type. In this case, we would like to transition from \c
+ splashState into \c frontState if \c PadNavigator receives any key press
+ event (QEvent::KeyPress).
+
+ We register the \c splashItem's animations to this transition to ensure they
+ are used to animate the item's movement and opacity.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 12
+
+ We use QKeyEventTransition to capture specific key events. In this case, we
+ detect that the user presses Qt::Key_Return or Qt::Key_Enter, and use this
+ to trigger transitions between \c frontState and backState. We register \c
+ flipAnimation, our complex parallel animation group, with these
+ transitions.
+
+ We continue by defining the states for each of the icons in the grid.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 13
+
+ We will use state groups to control transitions between icons. Each icon
+ represents a \e substate of \c frontState. We will then define transitions
+ between the states by detecting key presses, using QKeyEventTransition.
+
+ We start by creating all the substates, and at the same time we create a
+ temporary grid structure for the states to make it easier to find which
+ states represents icons that are up, down, left and to the right each
+ other.
+
+ Once the first substate is known, we set this up as the initial substate of
+ \c frontState. We will use the (0, 0), or top-left, icon for the initial
+ substate. We initialze the selection item's position to be exactly where
+ the top-left icon is.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 14
+
+ We can now create four transitions for each icon. Each transition ensures
+ that we move to the state corresponding to which arrow key has been
+ pressed. It's clear from this techinique that we could design any other
+ specific transitions to and from each of the sub states depending on these
+ and other keys.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 15
+
+ Also, for each of the icons, we assign suitable values to the \c xRotation
+ and \c yRotation objects' "angle"-properties. If you recall, these
+ properties "tilt" the pad corresponding to which item is currently
+ selected. We ensure each icon is invisible when the pad is flipped, and
+ visible when the pad is not flipped. To ensure the visible property is
+ assigned at the right time, we add property-controlling animations to the
+ \c setVariableSequence animation defined earlier.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 16
+
+ We are now finished with all states, transitions, and animations. We now
+ create the scene that will contain all our items. The scene gets a defined
+ background pixmap, and we disable item indexing (as most items in this
+ scene are animated). We add our \c pad item to the scene, and use its
+ bounding rectangle to fixate the scene rectangle. This rectangle is used by
+ the view to find a suitable size for the application window.
+
+ Then the scene is assigned to the view, or in our case, \c PadNavigator
+ itself.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 17
+
+ Now that the scene has received its final size, we can position the splash
+ item at the very top, find its fade-out position, and add it to the scene.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 18
+
+ The view toggles a few necessary properties:
+
+ \list
+ \o It disables its scroll bars - this application has no use for scroll bars.
+ \o It assigns a minimum size. This is necessary to avoid numerical errors
+ in our fit-in-view \c resizeEvent() implementation.
+ \o It sets \l{QGraphicsView::FullViewportUpdate}{FullViewportUpdate}, to
+ ensure QGraphicsView doesn't spend time figuring out precisely what needs
+ to be redrawn. This application is very simple - if anything changes,
+ everything is updated.
+ \o It enables background caching - this makes no performance difference
+ with OpenGL, but without OpenGL it avoids unnecessary re-scaling of the
+ background pixmap.
+ \o It sets render hints that increase rendering quality.
+ \o If OpenGL is supported, a QGLWidget viewport is assigned to the view.
+ \endlist
+
+ Finally, we start the state engine.
+
+ \snippet examples/graphicsview/padnavigator/padnavigator.cpp 19
+
+ The \l{QGraphicsView::resizeEvent()}{resizeEvent()} implementation calls
+ the base implementation, and then calls QGraphicsView::fitInView() to scale
+ the scene so that it fits perfectly inside the view.
+
+ By resizing the main application window, you can see this effect yourself.
+ The scene contents grow when you make the window larger, and shrink when
+ you make it smaller, while keeping the aspect ratio intact.
+
+ \section1 The main() Function
+
+ \snippet examples/graphicsview/padnavigator/main.cpp 0
+
+ The \c main function creates the QApplication instance, uses
+ Q_INIT_RESOURCE to ensure our compiled-in resources aren't removed by the
+ linker, and then creates a 3x3 \c PadNavigator instance and shows it.
+
+ Our flippable pad shows up with a suitable splash item once control returns
+ to the event loop.
+
+ \section1 Performance Notes
+
+ The example uses OpenGL if this is available, to achieve optimal
+ performance; otherwise perspective tranformations can be quite costly.
+
+ Although this example does use QGraphicsProxyWidget to demonstrate
+ integration of Qt widget components integrated into Graphics View, using
+ QGraphicsProxyWidget comes with a performance penalty, and is therefore not
+ recommended for embedded development.
+
+ This example uses extensive item caching to avoid rerendering of static
+ elements, at the expense of graphics memory.
*/
diff --git a/doc/src/examples/pinchzoom.qdoc b/doc/src/examples/pinchzoom.qdoc
index 726b1b3..867b2b3 100644
--- a/doc/src/examples/pinchzoom.qdoc
+++ b/doc/src/examples/pinchzoom.qdoc
@@ -46,5 +46,5 @@
The Pinch Zoom example shows how to use low-level multi-touch information
to recognize a gesture.
- \image multitouch-pinchzoom.png
+ \image multitouch-pinchzoom-example.png
*/
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index 93e4a46..22113ee 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -40,79 +40,89 @@
****************************************************************************/
/*!
- \title Animations
- \example declarative/animations
+ \title Animation basics
+ \example declarative/animation/basics
This example shows how to use animations in QML.
*/
/*!
- \title AspectRatio
- \example declarative/aspectratio
+ \title Behaviors
+ \example declarative/animation/behaviors
+*/
- This example shows how to implement different aspect ratios in QML.
+/*!
+ \title Easing types
+ \example declarative/animation/easing
+
+ This example shows the different easing modes available for animations.
*/
/*!
- \example declarative/behaviors
- \title Behaviors
+ \title States
+ \example declarative/animation/states
*/
/*!
\title Border Image
- \example declarative/border-image
+ \example declarative/imageelements/borderimage
This example shows how to use a BorderImage in QML.
*/
/*!
- \title Clocks
- \example declarative/clocks
+ \title Image
+ \example declarative/imageelements/image
- This example shows how to create a Clock component and reuse it in a grid.
+ This example shows uses of the \l Image element in QML.
*/
/*!
- \title Connections
- \example declarative/connections
-
- This example shows how to use a Connection element in QML.
+ \title Reference examples
+ \example declarative/cppextensions/referenceexamples
*/
/*!
- \title Dial
- \example declarative/dial
+ \title Plugins
+ \example declarative/cppextensions/plugins
+*/
- This example shows how to implement a dial in QML.
+/*!
+ \title QtWidgets
+ \example declarative/cppextensions/proxywidgets
*/
/*!
- \title Dynamic
- \example declarative/dynamic
+ \title QGraphicsLayouts
+ \example declarative/cppextensions/qgraphicslayouts
+*/
- This example shows how to create dynamic objects QML.
+/*!
+ \title Image Provider
+ \example declarative/cppextensions/imageprovider
*/
/*!
- \example declarative/extending
- \title Extending
+ \title Network access manager
+ \example declarative/cppextensions/proxyviewer
*/
/*!
- \example declarative/fillmode
- \title Fillmode
+ \title Internationlization
+ \example declarative/i18n
*/
/*!
- \title Flipable
- \example declarative/flipable
+ \title Positioners
+ \example declarative/positioners
- This example shows how to use a Flipable element in QML.
+ This example shows how to use positioner elements such as Row, Column,
+ Grid and Flow.
*/
/*!
\title Focus
- \example declarative/focus
+ \example declarative/keyinteraction/focus
This example shows how to handle keys and focus in QML.
@@ -120,141 +130,149 @@
*/
/*!
- \example declarative/fonts
- \title Fonts
+ \title GridView
+ \example declarative/modelviews/gridview
*/
/*!
- \example declarative/gridview
- \title GridView
+ \title ListView
+ \example declarative/modelviews/listview
*/
/*!
- \example declarative/imageprovider
- \title Image Provider
+ \title Object ListModel
+ \example declarative/modelviews/objectlistmodel
*/
/*!
- \example declarative/images
- \title Images
+ \title Package
+ \example declarative/modelviews/package
*/
/*!
- \example declarative/layouts
- \title Layouts
+ \title Parallax
+ \example declarative/modelviews/parallax
*/
/*!
- \example declarative/listmodel-threaded
- \title ListModel Threaded
+ \title String ListModel
+ \example declarative/modelviews/stringlistmodel
*/
/*!
- \example declarative/listview
- \title ListView
+ \title WebView
+ \example declarative/modelviews/webview
*/
/*!
- \example declarative/mousearea
- \title Mouse Area
+ \title SQL Local Storage
+ \example declarative/sqllocalstorage
*/
/*!
- \example declarative/objectlistmodel
- \title Object ListModel
+ \title Fonts
+ \example declarative/text/fonts
*/
/*!
- \example declarative/package
- \title Package
+ \title Threaded ListModel
+ \example declarative/threading/threadedlistmodel
*/
/*!
- \example declarative/parallax
- \title Parallax
+ \title WorkerScript
+ \example declarative/threading/workerscript
*/
/*!
- \example declarative/plugins
- \title Plugins
+ \title Clocks
+ \example declarative/toys/clocks
+
+ This example shows how to create a Clock component and reuse it in a grid.
*/
/*!
- \example declarative/progressbar
- \title Progress Bars
+ \title Dial
+ \example declarative/toys/dial
+
+ This example shows how to implement a dial in QML.
*/
/*!
- \example declarative/proxywidgets
- \title Proxy Widgets
+ \title Dynamic
+ \example declarative/toys/dynamic
+
+ This example shows how to create dynamic objects QML.
*/
/*!
- \example declarative/scrollbar
- \title Scrollbar
+ \title Tic-Tac-Toe
+ \example declarative/toys/tic-tac-toe
*/
/*!
- \example declarative/searchbox
- \title Search Box
+ \title TV Tennis
+ \example declarative/toys/tvtennis
*/
/*!
- \example declarative/slideswitch
- \title Slide Switch
+ \title Velocity
+ \example declarative/toys/velocity
*/
/*!
- \example declarative/sql
- \title SQL
+ \title Gestures
+ \example declarative/touchinteraction/gestures
*/
/*!
- \example declarative/states
- \title States
+ \title Mouse Area
+ \example declarative/touchinteraction/mousearea
*/
/*!
- \example declarative/stringlistmodel
- \title String ListModel
+ \title Flipable
+ \example declarative/ui-components/flipable
+
+ This example shows how to use a Flipable element in QML.
*/
/*!
- \example declarative/tabwidget
- \title Tab Widget
+ \title Progress Bars
+ \example declarative/ui-components/progressbar
*/
/*!
- \example declarative/tic-tac-toe
- \title Tic-Tac-Toe
+ \title Scrollbar
+ \example declarative/ui-components/scrollbar
*/
/*!
- \example declarative/tvtennis
- \title TV Tennis
+ \title Search Box
+ \example declarative/ui-components/searchbox
*/
/*!
- \example declarative/velocity
- \title Velocity
+ \title Slide Switch
+ \example declarative/ui-components/slideswitch
*/
/*!
- \example declarative/webview
- \title WebView
+ \title Spinner
+ \example declarative/ui-components/spinner
*/
/*!
- \example declarative/workerscript
- \title WorkerScript
+ \title Tab Widget
+ \example declarative/ui-components/tabwidget
*/
/*!
- \example declarative/xmldata
\title XML Data
+ \example declarative/xml/xmldata
*/
/*!
- \example declarative/xmlhttprequest
\title XMLHttpRequest
+ \example declarative/xml/xmlhttprequest
*/
diff --git a/doc/src/files-and-resources/datastreamformat.qdoc b/doc/src/files-and-resources/datastreamformat.qdoc
index bab2c2c..c4be7bb 100644
--- a/doc/src/files-and-resources/datastreamformat.qdoc
+++ b/doc/src/files-and-resources/datastreamformat.qdoc
@@ -41,7 +41,8 @@
/*!
\page datastreamformat.html
- \title Format of the QDataStream Operators
+ \title Serializing Qt Data Types
+ \ingroup qt-network
\brief Representations of data types that can be serialized by QDataStream.
The \l QDataStream allows you to serialize some of the Qt data types.
diff --git a/doc/src/files-and-resources/resources.qdoc b/doc/src/files-and-resources/resources.qdoc
index 00646ac..83d74a3 100644
--- a/doc/src/files-and-resources/resources.qdoc
+++ b/doc/src/files-and-resources/resources.qdoc
@@ -54,6 +54,8 @@
/*!
\page resources.html
\title The Qt Resource System
+ \ingroup qt-network
+ \brief A platform-independent mechanism for storing binary files in an application.
\keyword resource system
diff --git a/doc/src/frameworks-technologies/accessible.qdoc b/doc/src/frameworks-technologies/accessible.qdoc
index 101d22a..0aff214 100644
--- a/doc/src/frameworks-technologies/accessible.qdoc
+++ b/doc/src/frameworks-technologies/accessible.qdoc
@@ -47,8 +47,10 @@
/*!
\page accessible.html
\title Accessibility
-
- \ingroup frameworks-technologies
+ \brief How to make your applications accessible to those with disabilities.
+
+ \ingroup technology-apis
+ \ingroup best-practices
\tableofcontents
diff --git a/doc/src/frameworks-technologies/activeqt-container.qdoc b/doc/src/frameworks-technologies/activeqt-container.qdoc
index c1c0947..03cfa8f 100644
--- a/doc/src/frameworks-technologies/activeqt-container.qdoc
+++ b/doc/src/frameworks-technologies/activeqt-container.qdoc
@@ -41,10 +41,11 @@
/*!
\page activeqt-container.html
- \title Using ActiveX controls and COM objects in Qt
+ \title Using ActiveX controls and COM in Qt
+ \ingroup qt-activex
- \brief The QAxContainer module is a Windows-only extension for
- accessing ActiveX controls and COM objects.
+ \brief A Windows-only extension for accessing ActiveX controls and
+ COM objects.
The QAxContainer module is part of the \l ActiveQt framework. It
provides a library implementing a QWidget subclass, QAxWidget,
diff --git a/doc/src/frameworks-technologies/activeqt-server.qdoc b/doc/src/frameworks-technologies/activeqt-server.qdoc
index 4afcee1..900953a 100644
--- a/doc/src/frameworks-technologies/activeqt-server.qdoc
+++ b/doc/src/frameworks-technologies/activeqt-server.qdoc
@@ -41,10 +41,10 @@
/*!
\page activeqt-server.html
- \title Building ActiveX servers and controls with Qt
+ \title Building ActiveX servers in Qt
+ \ingroup qt-activex
- \brief The QAxServer module is a Windows-only static library that
- you can use to turn a standard Qt binary into a COM server.
+ \brief A Windows-only static library for turning a Qt binary into a COM server.
The QAxServer module is part of the \l ActiveQt framework. It
consists of three classes:
diff --git a/doc/src/frameworks-technologies/activeqt.qdoc b/doc/src/frameworks-technologies/activeqt.qdoc
index b752122..6f4ec30 100644
--- a/doc/src/frameworks-technologies/activeqt.qdoc
+++ b/doc/src/frameworks-technologies/activeqt.qdoc
@@ -53,11 +53,10 @@
/*!
\page activeqt.html
- \title ActiveQt Framework
+ \title Qt's ActiveX Framework (ActiveQt)
\brief An overview of Qt's ActiveX and COM integration on Windows.
- \ingroup platform-specific
- \ingroup frameworks-technologies
+ \ingroup qt-activex
\keyword ActiveQt
Qt's ActiveX and COM support allows Qt for Windows developers to:
diff --git a/doc/src/frameworks-technologies/animation.qdoc b/doc/src/frameworks-technologies/animation.qdoc
index 5548b57..dc705ba 100644
--- a/doc/src/frameworks-technologies/animation.qdoc
+++ b/doc/src/frameworks-technologies/animation.qdoc
@@ -47,6 +47,7 @@
/*!
\page animation-overview.html
\title The Animation Framework
+ \ingroup qt-gui-concepts
\brief An overview of the Animation Framework
diff --git a/doc/src/frameworks-technologies/containers.qdoc b/doc/src/frameworks-technologies/containers.qdoc
index 505b65c..5b184fa 100644
--- a/doc/src/frameworks-technologies/containers.qdoc
+++ b/doc/src/frameworks-technologies/containers.qdoc
@@ -58,7 +58,7 @@
/*!
\page containers.html
\title Generic Containers
- \ingroup frameworks-technologies
+ \ingroup technology-apis
\ingroup groups
\keyword container class
\keyword container classes
diff --git a/doc/src/frameworks-technologies/dbus-adaptors.qdoc b/doc/src/frameworks-technologies/dbus-adaptors.qdoc
index 5fc7a79..3dd0e4d 100644
--- a/doc/src/frameworks-technologies/dbus-adaptors.qdoc
+++ b/doc/src/frameworks-technologies/dbus-adaptors.qdoc
@@ -42,7 +42,9 @@
/*!
\page usingadaptors.html
\title Using QtDBus Adaptors
+ \brief How to create and use DBus adaptors in Qt.
+ \ingroup technology-apis
\ingroup best-practices
Adaptors are special classes that are attached to any QObject-derived class
diff --git a/doc/src/frameworks-technologies/dbus-intro.qdoc b/doc/src/frameworks-technologies/dbus-intro.qdoc
index 1fe2ed2..10726e5 100644
--- a/doc/src/frameworks-technologies/dbus-intro.qdoc
+++ b/doc/src/frameworks-technologies/dbus-intro.qdoc
@@ -45,7 +45,7 @@
\brief An introduction to Inter-Process Communication and Remote Procedure Calling with D-Bus.
\keyword QtDBus
- \ingroup frameworks-technologies
+ \ingroup technology-apis
\section1 Introduction
diff --git a/doc/src/frameworks-technologies/desktop-integration.qdoc b/doc/src/frameworks-technologies/desktop-integration.qdoc
index 7f01ae3..59b2570 100644
--- a/doc/src/frameworks-technologies/desktop-integration.qdoc
+++ b/doc/src/frameworks-technologies/desktop-integration.qdoc
@@ -40,16 +40,12 @@
****************************************************************************/
/*!
- \group desktop
- \title Desktop Integration Classes
-*/
-
-/*!
\page desktop-integration.html
\title Desktop Integration
\brief Integrating with the user's desktop environment.
\ingroup best-practices
+ \ingroup qt-gui-concepts
Qt applications behave well in the user's desktop environment, but certain
integrations require additional, and sometimes platform specific, techniques.
diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc
index 49468de..0e952ad 100644
--- a/doc/src/frameworks-technologies/dnd.qdoc
+++ b/doc/src/frameworks-technologies/dnd.qdoc
@@ -40,18 +40,12 @@
****************************************************************************/
/*!
- \group draganddrop
- \title Drag And Drop Classes
-
- \brief Classes dealing with drag and drop and mime type encoding and decoding.
-*/
-
-/*!
\page dnd.html
\title Drag and Drop
\brief An overview of the drag and drop system provided by Qt.
- \ingroup frameworks-technologies
+ \ingroup technology-apis
+ \ingroup qt-gui-concepts
Drag and drop provides a simple visual mechanism which users can use
to transfer information between and within applications. (In the
diff --git a/doc/src/frameworks-technologies/eventsandfilters.qdoc b/doc/src/frameworks-technologies/eventsandfilters.qdoc
index 96ee18c..0cd60b8 100644
--- a/doc/src/frameworks-technologies/eventsandfilters.qdoc
+++ b/doc/src/frameworks-technologies/eventsandfilters.qdoc
@@ -54,7 +54,8 @@
/*!
\page eventsandfilters.html
- \title Events and Event Filters
+ \title The Event System
+ \ingroup qt-basic-concepts
\brief A guide to event handling in Qt.
\ingroup frameworks-technologies
diff --git a/doc/src/frameworks-technologies/gestures.qdoc b/doc/src/frameworks-technologies/gestures.qdoc
index 1b395b0..c999fa6 100644
--- a/doc/src/frameworks-technologies/gestures.qdoc
+++ b/doc/src/frameworks-technologies/gestures.qdoc
@@ -42,12 +42,13 @@
/*!
\page gestures-overview.html
\title Gestures Programming
- \ingroup frameworks-technologies
\startpage index.html Qt Reference Documentation
+ \ingroup technology-apis
+ \ingroup qt-gui-concepts
- \brief An overview of the Qt support for Gesture programming.
+ \brief An overview of Qt support for Gesture programming.
- Qt includes a framework for gesture programming that gives has the ability
+ Qt includes a framework for gesture programming that has the ability
to form gestures from a series of events, independently of the input methods
used. A gesture could be a particular movement of a mouse, a touch screen
action, or a series of events from some other source. The nature of the input,
diff --git a/doc/src/frameworks-technologies/graphicsview.qdoc b/doc/src/frameworks-technologies/graphicsview.qdoc
index 6844aed..681568e 100644
--- a/doc/src/frameworks-technologies/graphicsview.qdoc
+++ b/doc/src/frameworks-technologies/graphicsview.qdoc
@@ -46,12 +46,11 @@
/*!
\page graphicsview.html
- \title The Graphics View Framework
+ \title Graphics View Framework
+ \ingroup qt-graphics
\brief An overview of the Graphics View framework for interactive 2D
graphics.
- \ingroup frameworks-technologies
-
\keyword Graphics View
\keyword GraphicsView
\keyword Graphics
diff --git a/doc/src/frameworks-technologies/implicit-sharing.qdoc b/doc/src/frameworks-technologies/implicit-sharing.qdoc
index e4d6f65..f42ec93 100644
--- a/doc/src/frameworks-technologies/implicit-sharing.qdoc
+++ b/doc/src/frameworks-technologies/implicit-sharing.qdoc
@@ -50,7 +50,7 @@
/*!
\page implicit-sharing.html
\title Implicit Sharing
- \ingroup frameworks-technologies
+ \ingroup qt-basic-concepts
\brief Reference counting for fast copying.
diff --git a/doc/src/frameworks-technologies/ipc.qdoc b/doc/src/frameworks-technologies/ipc.qdoc
index 18a9455..5139f04 100644
--- a/doc/src/frameworks-technologies/ipc.qdoc
+++ b/doc/src/frameworks-technologies/ipc.qdoc
@@ -44,7 +44,8 @@
\title Inter-Process Communication in Qt
\brief Inter-Process communication in Qt applications.
- \ingroup frameworks-technologies
+ \ingroup technology-apis
+ \ingout qt-network
Qt provides several ways to implement Inter-Process Communication
(IPC) in Qt applications.
diff --git a/doc/src/frameworks-technologies/phonon.qdoc b/doc/src/frameworks-technologies/phonon.qdoc
index 2d035c7..61b906e 100644
--- a/doc/src/frameworks-technologies/phonon.qdoc
+++ b/doc/src/frameworks-technologies/phonon.qdoc
@@ -41,8 +41,10 @@
/*!
\page phonon-overview.html
- \title Phonon Overview
- \ingroup frameworks-technologies
+ \title Phonon multimedia framework
+ \brief Using the Phonon multimedia framework in Qt.
+ \ingroup technology-apis
+ \ingroup best-practices
\tableofcontents
diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc
index fd6bebb..f7dde59 100644
--- a/doc/src/frameworks-technologies/threads.qdoc
+++ b/doc/src/frameworks-technologies/threads.qdoc
@@ -47,6 +47,7 @@
/*!
\page threads.html
\title Thread Support in Qt
+ \ingroup qt-basic-concepts
\brief A detailed discussion of thread handling in Qt.
\ingroup frameworks-technologies
diff --git a/doc/src/frameworks-technologies/unicode.qdoc b/doc/src/frameworks-technologies/unicode.qdoc
index 8fa168a..88393a0 100644
--- a/doc/src/frameworks-technologies/unicode.qdoc
+++ b/doc/src/frameworks-technologies/unicode.qdoc
@@ -58,7 +58,7 @@
\keyword Unicode
- \ingroup frameworks-technologies
+ \ingroup technology-apis
Unicode is a multi-byte character set, portable across all major
computing platforms and with decent coverage over most of the world.
diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc
index 6974634..f8c70fe 100644
--- a/doc/src/getting-started/demos.qdoc
+++ b/doc/src/getting-started/demos.qdoc
@@ -53,15 +53,14 @@
\l{Qt Examples} and are used to highlight certain features of
Qt.
- \table 50%
+ \table
\header
\o {2,1} Getting an Overview
\row
\o \inlineimage qtdemo-small.png
- \o
- If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's
+ \o If you run the \l{Examples and Demos Launcher}, you'll see many of Qt's
widgets in action.
-
+
The \l{Qt Widget Gallery} also provides overviews of selected Qt
widgets in each of the styles used on various supported platforms.
\endtable
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index 542f672..2e7f47e 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -50,6 +50,39 @@
*/
/*!
+ \group all-examples
+ \title Qt Examples
+
+ Qt includes a set of examples that cover nearly every aspect of Qt
+ development. They aren't meant to be impressive when you run them,
+ but in each case the source code has been carefully written to
+ illustrate one or more best Qt programming practices.
+
+ You can run the examples from the \l{Examples and Demos Launcher}
+ application (except see \l{QML Examples and Demos} {QML Examples}
+ for special instructions for running thos examples).
+
+ The examples are listed below by functional area. Each example
+ listed in a particular functional area is meant to illustrate how
+ best to use Qt to do some particular task in that functional area,
+ but the examples will often use features from other functional
+ areas as well for completeness.
+
+ If you are new to Qt, you should probably start by going through
+ the \l{Tutorials}, and then begin with the
+ \l{mainwindows/application} {Application} example.
+
+ In addition to these examples and the \l{Tutorials}{tutorials}, Qt
+ includes a \l{Qt Demonstrations}{selection of demos} that
+ deliberately show off Qt's features. You might want to look at
+ these as well.
+
+ \section1 Examples by functional area
+
+ \generatelist{related}
+*/
+
+/*!
\page examples.html
\title Qt Examples
\brief The example programs provided with Qt.
@@ -461,6 +494,8 @@
/*!
\page examples-widgets.html
\title Widgets Examples
+ \ingroup all-examples
+ \brief Lots of examples of how to use different kinds of widgets.
\contentspage Qt Examples
\nextpage Dialog Examples
@@ -509,7 +544,9 @@
/*!
\page examples-dialogs.html
+ \ingroup all-examples
\title Dialog Examples
+ \brief Using Qt's standard dialogs and building and using custom dialogs.
\previouspage Widgets Examples
\contentspage Qt Examples
@@ -539,7 +576,9 @@
/*!
\page examples-mainwindow.html
+ \ingroup all-examples
\title Main Window Examples
+ \building applications around a main window.
\previouspage Dialog Examples
\contentspage Qt Examples
@@ -567,7 +606,9 @@
/*!
\page examples-layouts.html
+ \ingroup all-examples
\title Layout Examples
+ Using Qt's layout-based approach to widget management.
\previouspage Main Window Examples
\contentspage Qt Examples
@@ -594,7 +635,9 @@
/*!
\page examples-itemviews.html
+ \ingroup all-examples
\title Item Views Examples
+ \brief Using the model/view design pattern to separate presentation from data.
\previouspage Layout Examples
\contentspage Qt Examples
@@ -632,7 +675,9 @@
/*!
\page examples-graphicsview.html
+ \ingroup all-examples
\title Graphics View Examples
+ \brief Using Qt to manage and interact with a large (potentially) number of graphics items.
\previouspage Item Views Examples
\contentspage Qt Examples
@@ -651,6 +696,7 @@
\o \l{graphicsview/diagramscene}{Diagram Scene}\raisedaster
\o \l{graphicsview/dragdroprobot}{Drag and Drop Robot}\raisedaster
\o \l{graphicsview/elasticnodes}{Elastic Nodes}\raisedaster
+ \o \l{graphicsview/padnavigator}{Pad Navigator}\raisedaster
\o \l{graphicsview/portedasteroids}{Ported Asteroids}
\o \l{graphicsview/portedcanvas}{Ported Canvas}
\endlist
@@ -677,6 +723,7 @@
/*!
\page examples-painting.html
+ \ingroup all-examples
\title Painting Examples
\previouspage QML Examples and Demos
@@ -709,6 +756,7 @@
/*!
\page examples-richtext.html
+ \ingroup all-examples
\title Rich Text Examples
\previouspage Painting Examples
@@ -732,6 +780,7 @@
/*!
\page examples-desktop.html
+ \ingroup all-examples
\title Desktop Examples
\previouspage Rich Text Examples
@@ -755,6 +804,7 @@
/*!
\page examples-draganddrop.html
+ \ingroup all-examples
\title Drag and Drop Examples
\previouspage Desktop Examples
@@ -783,6 +833,7 @@
/*!
\page examples-threadandconcurrent.html
+ \ingroup all-examples
\title Threading and Concurrent Programming Examples
\previouspage Drag and Drop Examples
@@ -823,6 +874,7 @@
/*!
\page examples.tools.html
+ \ingroup all-examples
\title Tools Examples
\previouspage Threading and Concurrent Programming Examples
@@ -861,6 +913,7 @@
/*!
\page examples-network.html
+ \ingroup all-examples
\title Network Examples
\previouspage Tools Examples
@@ -899,6 +952,7 @@
/*!
\page examples-ipc.html
+ \ingroup all-examples
\title Inter-Process Communication Examples
\previouspage Network Examples
@@ -916,6 +970,7 @@
/*!
\page examples-opengl.html
+ \ingroup all-examples
\title OpenGL Examples
\previouspage Inter-Process Communication Examples
@@ -950,6 +1005,7 @@
/*!
\page examples-openvg.html
+ \ingroup all-examples
\title OpenVG Examples
\previouspage OpenGL Examples
@@ -971,6 +1027,7 @@
/*!
\page examples-multimedia.html
+ \ingroup all-examples
\title Multimedia Examples
\previouspage OpenGL Examples
@@ -1020,6 +1077,7 @@
/*!
\page examples-sql.html
+ \ingroup all-examples
\title SQL Examples
\previouspage Multimedia Examples
@@ -1049,6 +1107,7 @@
/*!
\page examples-xml.html
+ \ingroup all-examples
\title XML Examples
\previouspage SQL Examples
@@ -1085,6 +1144,7 @@
/*!
\page examples-designer.html
+ \ingroup all-examples
\title Qt Designer Examples
\previouspage XML Examples
@@ -1110,6 +1170,7 @@
/*!
\page examples-uitools.html
+ \ingroup all-examples
\title UiTools Examples
\previouspage Qt Designer Examples
@@ -1126,6 +1187,7 @@
/*!
\page examples-linguist.html
+ \ingroup all-examples
\title Qt Linguist Examples
\previouspage UiTools Examples
@@ -1146,6 +1208,7 @@
/*!
\page examples-script.html
+ \ingroup all-examples
\title Qt Script Examples
\previouspage Qt Linguist Examples
@@ -1175,6 +1238,7 @@
/*!
\page examples-webkit.html
+ \ingroup all-examples
\title WebKit Examples
\previouspage Qt Script Examples
@@ -1215,7 +1279,8 @@
*/
/*!
- \page examples-helpsystem.html
+ \page examples-helpsystem.html
+ \ingroup all-examples
\title Help System Examples
\previouspage WebKit Examples
@@ -1239,6 +1304,7 @@
/*!
\page examples-statemachine.html
+ \ingroup all-examples
\title State Machine Examples
\previouspage Help System Examples
@@ -1265,6 +1331,7 @@
/*!
\page examples-animation.html
+ \ingroup all-examples
\title Animation Framework Examples
\previouspage State Machine Examples
@@ -1287,6 +1354,7 @@
/*!
\page examples-multitouch.html
+ \ingroup all-examples
\title Multi-Touch Examples
\previouspage Animation Framework Examples
@@ -1306,6 +1374,7 @@
/*!
\page examples-gestures.html
+ \ingroup all-examples
\title Gestures Examples
\previouspage Multi-Touch Examples
@@ -1322,6 +1391,7 @@
/*!
\page examples-dbus.html
+ \ingroup all-examples
\title D-Bus Examples
\previouspage Gestures Examples
@@ -1341,6 +1411,7 @@
/*!
\page examples-embeddedlinux.html
+ \ingroup all-examples
\title Qt for Embedded Linux Examples
\previouspage D-Bus Examples
@@ -1363,6 +1434,7 @@
/*!
\page examples-activeqt.html
+ \ingroup all-examples
\title ActiveQt Examples
\previouspage Qt for Embedded Linux Examples
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 3ea351e..36abc10 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -703,21 +703,19 @@ If you are using pre-built binaries, follow the instructions given in the
\ingroup qtsymbian
\brief How to install Qt on the Symbian platform using Linux.
-\note Qt for the Symbian platform has some requirements that are given in more detail
-in the \l{Qt for the Symbian platform Requirements} document. TODO list requirements like SDK here.
-
\note \bold {This document describes how to install and configure Qt for
the Symbian platform from scratch, using Linux as the build host.
-Qt does not come with a binary package for Linux yet, but if you want to avoid
-the full build of Qt and start developing applications right away, you can
-download drop-in binaries from here: TODO}
+Qt for Symbian binaries can be downloaded directly so development of
+applications using Qt for Symbian can start right away.}
\list 1
\o Setup the development environment
- TODO Make sure your Symbian development environment is correctly installed and
- patched as explained in the \l{Qt for the Symbian platform Requirements} document.
+ \note 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 machine.
+ See {http://qt.gitorious.org/qt/pages/QtCreatorSymbianLinux} for more details.
\o Install Qt
@@ -770,7 +768,7 @@ download drop-in binaries from here: TODO}
The Qt libraries are built with "All -Tcb" capability, so that
they can support all types of applications. However, these
- capabilities are automatically lowered if you make a selfsigned
+ capabilities are automatically lowered if you make a self-signed
package.
\o Building a Qt package with a Symbian developer certificate
@@ -826,7 +824,7 @@ download drop-in binaries from here: TODO}
Note the identifier on the line where your Symbian device
appears. Then execute the following, using the first and
- second part of the identifier in place of \c XXXX,
+ second part of the identifier in place of \c XXX,
respectively.
\snippet doc/src/snippets/code/doc_src_installation.qdoc 44
diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc
index b73e15d..cedebf9 100644
--- a/doc/src/getting-started/known-issues.qdoc
+++ b/doc/src/getting-started/known-issues.qdoc
@@ -41,15 +41,15 @@
/*!
\page known-issues.html
- \title Known Issues in %VERSION%
+ \title Known Issues in this Qt Version
\ingroup platform-specific
- \brief A summary of known issues in Qt %VERSION% at the time of release.
+ \brief A summary of known issues in this Qt version at the time of release.
- An up-to-date list of known issues with Qt %VERSION% can be found via the
+ An up-to-date list of known issues can be found at
\l{http://bugreports.qt.nokia.com/}{Qt Bug Tracker}.
- For a list list of known bugs in Qt %VERSION%, see the \l{Task Tracker}
- on the Qt website.
+ For a list list of known bugs, see the \l{Task Tracker} at the Qt
+ website.
An overview of known issues may also be found at:
\l{http://qt.gitorious.org/qt/pages/QtKnownIssues}
diff --git a/doc/src/howtos/HWacceleration.qdoc b/doc/src/howtos/HWacceleration.qdoc
index fbc657c..c7b1a72 100644
--- a/doc/src/howtos/HWacceleration.qdoc
+++ b/doc/src/howtos/HWacceleration.qdoc
@@ -41,17 +41,20 @@
/*!
\page HWAcc_rendering.html
- \title Using hardware acceleration on embedded platforms.
+ \title Hardware Acceleration &amp Embedded Platforms.
+ \brief How to use hardware acceleration for fast rendering.
\ingroup best-practices
\section1 Abstract
+
This document describes how to use hardware acceleration for fast
- rendering on embedded platforms supported by Qt. In short, it explains
- how the graphics pipeline works. Since there might be differences to
- how the APIs are being used on different embedded platforms, a table
- links to documentation dedicated to platform specific documentation
- for each supported hardware acceleration API.
+ rendering on embedded platforms supported by Qt. In short, it
+ explains how the graphics pipeline works. Since there might be
+ differences to how the APIs are being used on different embedded
+ platforms, a table links to documentation dedicated to platform
+ specific documentation for each supported hardware acceleration
+ API.
\input platforms/emb-hardwareacceleration.qdocinc
diff --git a/doc/src/howtos/accelerators.qdoc b/doc/src/howtos/accelerators.qdoc
index 65f1def..b6ef5c2 100644
--- a/doc/src/howtos/accelerators.qdoc
+++ b/doc/src/howtos/accelerators.qdoc
@@ -42,6 +42,7 @@
/*!
\page accelerators.html
\title Standard Accelerator Keys
+ \brief Recommended accelerator keys.
\ingroup best-practices
diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc
index dd39509..9377961 100644
--- a/doc/src/howtos/appicon.qdoc
+++ b/doc/src/howtos/appicon.qdoc
@@ -42,6 +42,7 @@
/*!
\page appicon.html
\title Setting the Application Icon
+ \brief How to set your application's icon.
\ingroup best-practices
diff --git a/doc/src/howtos/guibooks.qdoc b/doc/src/howtos/guibooks.qdoc
index 1a70670..bccfbe6 100644
--- a/doc/src/howtos/guibooks.qdoc
+++ b/doc/src/howtos/guibooks.qdoc
@@ -43,6 +43,7 @@
\page guibooks.html
\title Books about GUI Design
\ingroup best-practices
+ \brief Some recommended books about GUI design.
This is not a comprehensive list -- there are many other books worth
buying. Here we mention just a few user interface books that don't
diff --git a/doc/src/howtos/qtdesigner.qdoc b/doc/src/howtos/qtdesigner.qdoc
index 2dd7fcf..92041f0 100644
--- a/doc/src/howtos/qtdesigner.qdoc
+++ b/doc/src/howtos/qtdesigner.qdoc
@@ -42,6 +42,7 @@
/*!
\page qtdesigner-components.html
\title Creating and Using Components for Qt Designer
+ \brief How to create and use custom widget plugins.
\ingroup best-practices
\tableofcontents
diff --git a/doc/src/howtos/restoring-geometry.qdoc b/doc/src/howtos/restoring-geometry.qdoc
index 36c5e4f..e72b993 100644
--- a/doc/src/howtos/restoring-geometry.qdoc
+++ b/doc/src/howtos/restoring-geometry.qdoc
@@ -42,7 +42,7 @@
/*!
\page restoring-geometry.html
\title Restoring a Window's Geometry
-
+ \brief How to save &amp restore window geometry.
\ingroup best-practices
This document describes how to save and restore a \l{Window
diff --git a/doc/src/howtos/session.qdoc b/doc/src/howtos/session.qdoc
index e2e87a8..f53af04 100644
--- a/doc/src/howtos/session.qdoc
+++ b/doc/src/howtos/session.qdoc
@@ -42,7 +42,7 @@
/*!
\page session.html
\title Session Management
-
+ \brief How to do session management with Qt.
\ingroup best-practices
A \e session is a group of running applications, each of which has a
diff --git a/doc/src/howtos/sharedlibrary.qdoc b/doc/src/howtos/sharedlibrary.qdoc
index 70fc4db..ed803ed 100644
--- a/doc/src/howtos/sharedlibrary.qdoc
+++ b/doc/src/howtos/sharedlibrary.qdoc
@@ -42,7 +42,7 @@
/*!
\page sharedlibrary.html
\title Creating Shared Libraries
-
+ \brief How to create shared libraries.
\ingroup best-practices
The following sections list certain things that should be taken into
diff --git a/doc/src/howtos/timers.qdoc b/doc/src/howtos/timers.qdoc
index cfc2fb4..b001916 100644
--- a/doc/src/howtos/timers.qdoc
+++ b/doc/src/howtos/timers.qdoc
@@ -42,7 +42,7 @@
/*!
\page timers.html
\title Timers
- \brief How to use timers in your application.
+ \brief How to use Qt timers in your application.
\ingroup best-practices
diff --git a/doc/src/images/declarative-image_fillMode.gif b/doc/src/images/declarative-image_fillMode.gif
deleted file mode 100644
index eb0a9af..0000000
--- a/doc/src/images/declarative-image_fillMode.gif
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-integrating-graphicswidgets.png b/doc/src/images/declarative-integrating-graphicswidgets.png
deleted file mode 100644
index d57f4b9..0000000
--- a/doc/src/images/declarative-integrating-graphicswidgets.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-preserveaspectcrop.png b/doc/src/images/declarative-qtlogo-preserveaspectcrop.png
new file mode 100644
index 0000000..64fb086
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-preserveaspectcrop.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-preserveaspectfit.png b/doc/src/images/declarative-qtlogo-preserveaspectfit.png
new file mode 100644
index 0000000..2585fa5
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-preserveaspectfit.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-stretch.png b/doc/src/images/declarative-qtlogo-stretch.png
new file mode 100644
index 0000000..32a0114
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-stretch.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tile.png b/doc/src/images/declarative-qtlogo-tile.png
new file mode 100644
index 0000000..7d1b9d0
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tile.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tilehorizontally.png b/doc/src/images/declarative-qtlogo-tilehorizontally.png
new file mode 100644
index 0000000..367a8c7
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tilehorizontally.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo-tilevertically.png b/doc/src/images/declarative-qtlogo-tilevertically.png
new file mode 100644
index 0000000..68afafa
--- /dev/null
+++ b/doc/src/images/declarative-qtlogo-tilevertically.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo1.png b/doc/src/images/declarative-qtlogo.png
index 940d159..940d159 100644
--- a/doc/src/images/declarative-qtlogo1.png
+++ b/doc/src/images/declarative-qtlogo.png
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo2.png b/doc/src/images/declarative-qtlogo2.png
deleted file mode 100644
index b1d128a..0000000
--- a/doc/src/images/declarative-qtlogo2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo3.png b/doc/src/images/declarative-qtlogo3.png
deleted file mode 100644
index d516524..0000000
--- a/doc/src/images/declarative-qtlogo3.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo4.png b/doc/src/images/declarative-qtlogo4.png
deleted file mode 100644
index 7c8aa64..0000000
--- a/doc/src/images/declarative-qtlogo4.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo5.png b/doc/src/images/declarative-qtlogo5.png
deleted file mode 100644
index b7b3513..0000000
--- a/doc/src/images/declarative-qtlogo5.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/declarative-qtlogo6.png b/doc/src/images/declarative-qtlogo6.png
deleted file mode 100644
index 07a078f..0000000
--- a/doc/src/images/declarative-qtlogo6.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/multitouch-fingerpaint-example.png b/doc/src/images/multitouch-fingerpaint-example.png
new file mode 100644
index 0000000..c741b65
--- /dev/null
+++ b/doc/src/images/multitouch-fingerpaint-example.png
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 2e6f9bd..b759435 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -44,16 +44,15 @@
\keyword Qt Reference Documentation
\raw HTML
- <div class="indexbox" >
+ <div class="indexbox guide" >
<div class="heading">
Qt Developer Guide</div>
<div class="indexboxcont indexboxbar">
- <div class="section indexIcon">
- <img src="images/qt_guide.png" alt="" /></div>
+ <div class="section indexIcon"><span></span></div>
<div class="section">
<p>Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code.</p>
</div>
- <div class="section sectionlist lastcol">
+ <div class="section sectionlist">
<ul>
<li><a href="">Getting started</a></li>
<li><a href="installation.html">Installation &amp; first steps</a></li>
@@ -65,50 +64,50 @@
</div>
</div>
</div>
- <div class="indexbox">
+ <div class="indexbox api">
<div class="heading">
Qt API Overviews</div>
- <div class="indexboxcont indexboxbar tricol">
- <div class="sectionlist">
+ <div class="indexboxcont indexboxbar ">
+ <div class="sectionlist tricol">
<ul>
- <li><a href="modules.html">All modules</a></li>
- <li><a href="classes.html">All classes</a></li>
- <li><a href="namespaces.html">All namespaces</a></li>
- <li><a href="functions.html">All functions</a></li>
- <li><a href="platform-specific.html">Platform support &amp; specifics</a></li>
+ <li><a href="classes.html">Class index</a></li>
+ <li><a href="functions.html">Function index</a></li>
+ <li><a href="modules.html">Modules</a></li>
+ <li><a href="namespaces.html">Namespaces</a></li>
+ <li><a href="qtglobal.html">Global stuff</a></li>
+ <li><a href="qdeclarativeelements.html">QML elements</a></li>
</ul>
</div>
- <div class="sectionlist">
+ <div class="sectionlist tricol">
<ul>
- <li><a href="object.html">QObject model</a></li>
- <li><a href="application-windows.html">Window architecture</a></li>
- <li><a href="widgets-and-layouts.html">Styles &amp; layout</a></li>
- <li><a href="eventsandfilters.html">Event handling</a></li>
- <li><a href="paintsystem.html">Paint system</a></li>
+ <li><a href="qt-basic-concepts.html">Basic Qt Architecture</a></li>
+ <li><a href="declarativeui.html">Device UI's &amp; Qt Quick</a></li>
+ <li><a href="qt-gui-concepts.html">Desktop UI components</a></li>
+ <li><a href="platform-specific.html">Platform-specific info</a></li>
+ <li><a href="qt-graphics.html">Graphics, Painting &amp Printing</a></li>
+ <li><a href="qt-network.html">Input/Output &amp networking</a></li>
</ul>
</div>
- <div class="lastcol">
+ <div class="sectionlist">
<ul>
- <li><a href="graphicsview.html">Canvas UI with Graphics View</a></li>
- <li><a href="declarativeui.html">UI design &amp; Qt Quick</a></li>
- <li><a href="io.html">Input/output</a></li>
- <li><a href="webintegration.html">Integrating Web Content</a></li>
- <li><a href="developing-with-qt.html">X-platform, debug &amp; deploy</a></li>
+ <li><a href="model-view-programming.html">Model/View programming</a></li>
+ <li><a href="technology-apis.html">Qt API's for other technologies</a></li>
+ <li><a href="best-practices.html">Qt How-to's &amp best practices</a></li>
+ <li><a href="developing-with-qt.html">Cross-platform development</a></li>
</ul>
</div>
</div>
</div>
- <div class="indexbox">
+ <div class="indexbox tools">
<div class="heading">
Qt Tools</div>
<div class="indexboxcont">
- <div class="section indexIcon">
- <img src="images/qt_tools.png" alt="" /></div>
+ <div class="section indexIcon"><span></span></div>
<div class="section">
<p>Qt offers a selection of development tools for different tasks. Use Qt Creator for
project and code management as well as building powerfull UIs.</p>
</div>
- <div class="section sectionlist lastcol">
+ <div class="section sectionlist">
<ul>
<li><a href="http://doc.qt.nokia.com/qtcreator-1.3/index.html">Qt Creator</a></li>
<li><a href="designer-manual.html">Qt Designer</a></li>
@@ -118,9 +117,8 @@
<li><a href="qvfb.html">Virtual Framebuffer</a></li>
</ul>
</div>
- </div>
- </div>
-
+ </div>
+ </div>
\endraw
*/
diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc
index 1ab1c00..2c0744b 100644
--- a/doc/src/modules.qdoc
+++ b/doc/src/modules.qdoc
@@ -41,7 +41,7 @@
/*!
\group modules
- \title All Qt Modules
+ \title All Modules
\startpage index.html Qt Reference Documentation
\nextpage QtCore
@@ -96,8 +96,8 @@
/*!
\module QtCore
\title QtCore Module
- \contentspage All Qt Modules
- \previouspage All Qt Modules
+ \contentspage All Modules
+ \previouspage All Modules
\nextpage QtGui
\ingroup modules
@@ -115,7 +115,7 @@
/*!
\module QtGui
\title QtGui Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtCore
\nextpage QtNetwork
\ingroup modules
@@ -132,7 +132,7 @@
\module QtMultimedia
\page qtmultimedia-module.html
\title QtMultimedia Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtCore
\nextpage QtNetwork
\ingroup modules
@@ -156,7 +156,7 @@
/*!
\module QtNetwork
\title QtNetwork Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtMultimedia
\nextpage QtOpenGL
\ingroup modules
@@ -178,7 +178,7 @@
/*!
\module QtOpenGL
\title QtOpenGL Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtNetwork
\nextpage QtOpenVG
\ingroup modules
@@ -231,7 +231,7 @@
\module QtOpenVG
\title QtOpenVG Module
\since 4.6
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtOpenGL
\nextpage QtScript
\ingroup modules
@@ -286,7 +286,7 @@
\module QtScript
\title QtScript Module
\since 4.3
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtOpenVG
\nextpage QtScriptTools
\ingroup modules
@@ -346,7 +346,7 @@
\module QtScriptTools
\title QtScriptTools Module
\since 4.5
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtScript
\nextpage QtSql
\ingroup modules
@@ -370,7 +370,7 @@
/*!
\module QtSql
\title QtSql Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtScript
\nextpage QtSvg
\ingroup modules
@@ -393,7 +393,7 @@
\module QtSvg
\title QtSvg Module
\since 4.1
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtSql
\nextpage QtWebKit
\ingroup modules
@@ -444,7 +444,7 @@
/*!
\module QtXml
\title QtXml Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtSvg
\nextpage QtXmlPatterns
\ingroup modules
@@ -471,7 +471,7 @@
\module QtXmlPatterns
\title QtXmlPatterns Module
\since 4.4
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtXml
\nextpage Phonon Module
\ingroup modules
@@ -551,7 +551,7 @@
\page phonon-module.html
\module Phonon
\title Phonon Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtXmlPatterns
\nextpage Qt3Support
\ingroup modules
@@ -621,7 +621,7 @@
/*!
\module Qt3Support
\title Qt3Support Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage Phonon Module
\nextpage QtDesigner
\ingroup modules
@@ -654,7 +654,7 @@
/*!
\module QtDesigner
\title QtDesigner Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage Qt3Support
\nextpage QtUiTools
\ingroup modules
@@ -681,7 +681,7 @@
\module QtUiTools
\title QtUiTools Module
\since 4.1
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtDesigner
\nextpage QtHelp
\ingroup modules
@@ -717,7 +717,7 @@
/*!
\module QtHelp
\title QtHelp Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtUiTools
\nextpage QtTest
\ingroup modules
@@ -776,7 +776,7 @@
/*!
\module QtTest
\title QtTest Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtHelp
\nextpage QAxContainer
\ingroup modules
@@ -806,7 +806,7 @@
/*!
\module QAxContainer
\title QAxContainer Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QtTest
\nextpage QAxServer
\ingroup modules
@@ -858,7 +858,7 @@
/*!
\module QAxServer
\title QAxServer Module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QAxContainer
\nextpage QtDBus module
\ingroup modules
@@ -910,7 +910,7 @@
/*!
\module QtDBus
\title QtDBus module
- \contentspage All Qt Modules
+ \contentspage All Modules
\previouspage QAxServer
\ingroup modules
diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc
index 10d697a..b10481e 100644
--- a/doc/src/network-programming/bearermanagement.qdoc
+++ b/doc/src/network-programming/bearermanagement.qdoc
@@ -40,12 +40,11 @@
****************************************************************************/
/*!
-\page bearer-management.html
+ \page bearer-management.html
-\title Bearer Management
-\brief An API to control the system's connectivity state.
-
-\ingroup network
+ \title Bearer Management
+ \ingroup qt-network
+ \brief An API to control the system's connectivity state.
Bearer Management controls the connectivity state of the system so that
the user can start or stop interfaces or roam transparently between
diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc
index 36f48cf..9134809 100644
--- a/doc/src/network-programming/qtnetwork.qdoc
+++ b/doc/src/network-programming/qtnetwork.qdoc
@@ -50,6 +50,7 @@
/*!
\page network-programming.html
\title Network Programming
+ \ingroup qt-network
\brief An Introduction to Network Programming with Qt
The QtNetwork module offers classes that allow you to write TCP/IP clients
diff --git a/doc/src/network-programming/ssl.qdoc b/doc/src/network-programming/ssl.qdoc
index 2feb7b6..7f365a9 100644
--- a/doc/src/network-programming/ssl.qdoc
+++ b/doc/src/network-programming/ssl.qdoc
@@ -40,11 +40,11 @@
****************************************************************************/
/*!
- \group ssl
+ \page ssl.html
\title Secure Sockets Layer (SSL) Classes
- \ingroup groups
-
\brief Classes for secure communication over network sockets.
+ \ingroup qt-network
+
\keyword SSL
The classes below provide support for secure network communication using
diff --git a/doc/src/objectmodel/metaobjects.qdoc b/doc/src/objectmodel/metaobjects.qdoc
index c1b0ea6..e891183 100644
--- a/doc/src/objectmodel/metaobjects.qdoc
+++ b/doc/src/objectmodel/metaobjects.qdoc
@@ -41,7 +41,8 @@
/*!
\page metaobjects.html
- \title Meta-Object System
+ \title The Meta-Object System
+ \ingroup qt-basic-concepts
\brief An overview of Qt's meta-object system and introspection capabilities.
\keyword meta-object
diff --git a/doc/src/objectmodel/object.qdoc b/doc/src/objectmodel/object.qdoc
index 2f06004..e0ba6ed 100644
--- a/doc/src/objectmodel/object.qdoc
+++ b/doc/src/objectmodel/object.qdoc
@@ -41,7 +41,8 @@
/*!
\page object.html
- \title Qt Object Model
+ \title Object Model
+ \ingroup qt-basic-concepts
\brief A description of the powerful features made possible by Qt's dynamic object model.
\ingroup frameworks-technologies
diff --git a/doc/src/objectmodel/objecttrees.qdoc b/doc/src/objectmodel/objecttrees.qdoc
index 11824ae..97d646a 100644
--- a/doc/src/objectmodel/objecttrees.qdoc
+++ b/doc/src/objectmodel/objecttrees.qdoc
@@ -41,7 +41,8 @@
/*!
\page objecttrees.html
- \title Object Trees and Object Ownership
+ \title Object Trees & Ownership
+ \ingroup qt-basic-concepts
\brief Information about the parent-child pattern used to describe
object ownership in Qt.
diff --git a/doc/src/objectmodel/properties.qdoc b/doc/src/objectmodel/properties.qdoc
index a807caf..bc9554c 100644
--- a/doc/src/objectmodel/properties.qdoc
+++ b/doc/src/objectmodel/properties.qdoc
@@ -41,7 +41,8 @@
/*!
\page properties.html
- \title Qt's Property System
+ \title The Property System
+ \ingroup qt-basic-concepts
\brief An overview of Qt's property system.
Qt provides a sophisticated property system similar to the ones
diff --git a/doc/src/objectmodel/signalsandslots.qdoc b/doc/src/objectmodel/signalsandslots.qdoc
index 0f3f618..f33badf 100644
--- a/doc/src/objectmodel/signalsandslots.qdoc
+++ b/doc/src/objectmodel/signalsandslots.qdoc
@@ -41,7 +41,8 @@
/*!
\page signalsandslots.html
- \title Signals and Slots
+ \title Signals & Slots
+ \ingroup qt-basic-concepts
\brief An overview of Qt's signals and slots inter-object
communication mechanism.
diff --git a/doc/src/overviews.qdoc b/doc/src/overviews.qdoc
index 7302e30..c3c59af 100644
--- a/doc/src/overviews.qdoc
+++ b/doc/src/overviews.qdoc
@@ -48,26 +48,97 @@
*/
/*!
- \group frameworks-technologies
- \title Frameworks and Technologies
+ \group qt-basic-concepts
+ \title Basic Qt Architecture
- \brief Documentation about the frameworks and technologies in Qt
+ \brief The basic architecture of the Qt cross-platform application and UI framework.
- These documents dive into the frameworks of classes that Qt provides,
- and provide background information about the technical solutions used
- in Qt's architecture.
+ Qt is a cross-platform application and UI framework for writing
+ web-enabled applications for desktop, mobile, and embedded
+ operating systems. These pages explain basic architectural
+ concepts of Qt:
+
+ \generatelist {related}
+ */
+
+/*!
+ \group qt-gui-concepts
+ \title Qt Desktop UI Components
+
+ \brief The Qt components for constructing native look & feel desktop UI's.
+
+ These pages are about Qt's traditional set of GUI components for
+ building both native look ^ feel and custom UI's for the desktop
+ environment. Use \l {declarativeui.html} {Qt Quick} for building
+ UI's for mobile devices.
+
+ \generatelist {related}
+ */
+
+/*!
+ \group qt-graphics
+ \title Qt Graphics and Painting
+
+ \brief The Qt components for doing graphics.
+
+ \generatelist {related}
+ */
+
+/*!
+ \group qt-network
+ \title Network programming with Qt
+
+ \brief The these pages are about Qt's support for network programming.
+
+ \generatelist {related}
+ */
+
+/*!
+ \group technology-apis
+ \title Qt API's for other technologies
+
+ These pages document Qt's API's for some widely-used standards and
+ technologies.
\generatelist{related}
*/
/*!
+ \group qt-activex
+ \title Qt For ActiveX
+ \brief Qt API's for using ActiveX controls, servers, and COM.
+ \ingroup technology-apis
+ \ingroup platform-specific
+
+ These pages document Qt's API's for developing with ActiveX
+ controls, servers, and COM.
+
+ \generatelist{related}
+*/
+
+/*!
+ \group qt-sql
+ \title Using SQL in Qt
+ \brief Qt API's for using SQL.
+ \ingroup technology-apis
+ \ingroup best-practices
+
+ These pages document Qt's API's for using SQL database systems
+ in Qt applications.
+
+ \generatelist{related}
+*/
+
+/*!
\group best-practices
\title How-To's and Best Practices
\brief How-To Guides and Best Practices
- These documents provide guidelines and best practices explaining
- how to use Qt to solve specific technical problems.
+ These documents provide guidelines and best practices for using Qt
+ to solve specific technical problems. They are listed
+ alphabetically by the first word in the title, so scan the entire
+ list to find what you want.
\generatelist{related}
*/
diff --git a/doc/src/painting-and-printing/coordsys.qdoc b/doc/src/painting-and-printing/coordsys.qdoc
index 5807f57..b360d0b 100644
--- a/doc/src/painting-and-printing/coordsys.qdoc
+++ b/doc/src/painting-and-printing/coordsys.qdoc
@@ -41,7 +41,8 @@
/*!
\page coordsys.html
- \title The Coordinate System
+ \title Coordinate System
+ \ingroup qt-graphics
\brief Information about the coordinate system used by the paint
system.
diff --git a/doc/src/painting-and-printing/paintsystem.qdoc b/doc/src/painting-and-printing/paintsystem.qdoc
index 802751f..44c84a2 100644
--- a/doc/src/painting-and-printing/paintsystem.qdoc
+++ b/doc/src/painting-and-printing/paintsystem.qdoc
@@ -60,7 +60,9 @@
/*!
\page paintsystem.html
- \title The Paint System
+ \title Paint System
+ \brief A system for painting on the screen or on print devices using the same API
+ \ingroup qt-graphics
\ingroup frameworks-technologies
Qt's paint system enables painting on screen and print devices
diff --git a/doc/src/painting-and-printing/printing.qdoc b/doc/src/painting-and-printing/printing.qdoc
index 3d6ade2..6dad097 100644
--- a/doc/src/painting-and-printing/printing.qdoc
+++ b/doc/src/painting-and-printing/printing.qdoc
@@ -49,6 +49,7 @@
/*!
\page printing.html
\title Printing with Qt
+ \ingroup qt-graphics
\previouspage Styling
\contentspage The Paint System
diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc
index 8f5b6a5..16e0c0f 100644
--- a/doc/src/platforms/platform-notes.qdoc
+++ b/doc/src/platforms/platform-notes.qdoc
@@ -517,7 +517,7 @@
Note that some modules rely on other modules. If your application uses
QtXmlPatterns, QtWebkit or QtScript it may still require \c NetworkServices
- \o as these modules rely on QtNetwork to go online.
+ as these modules rely on QtNetwork to go online.
For more information see the documentation of the individual Qt classes. If
a class does not mention Symbian capabilities, it requires none.
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index 591d6f1..6ffc568 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -191,7 +191,10 @@
\table
\row \o -i \o Install the package right away using PC suite.
\row \o -p \o Only preprocess the template \c .pkg file.
- \row \o -c=<file> \o Read certificate information from a file.
+ \row \o -c <file> \o Read certificate information from a file.
+ \row \o -u \o Preserves unsigned package.
+ \row \o -s \o Generates stub sis for ROM.
+ \row \o -n <name> \o Specifies the final sis name.
\endtable
Execute the \c{createpackage.pl} script without any
diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
index 22ea240..e3ad483 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp
@@ -67,3 +67,23 @@ beginInsertColumns(parent, 6, 8);
//! [5]
beginRemoveColumns(parent, 4, 6);
//! [5]
+
+
+//! [6]
+beginMoveRows(sourceParent, 2, 4, destinationParent, 2);
+//! [6]
+
+
+//! [7]
+beginMoveRows(sourceParent, 2, 4, destinationParent, 6);
+//! [7]
+
+
+//! [8]
+beginMoveRows(parent, 2, 2, parent, 0);
+//! [8]
+
+
+//! [9]
+beginMoveRows(parent, 2, 2, parent, 4);
+//! [9]
diff --git a/doc/src/snippets/declarative/Sprite.qml b/doc/src/snippets/declarative/Sprite.qml
new file mode 100644
index 0000000..6670703
--- /dev/null
+++ b/doc/src/snippets/declarative/Sprite.qml
@@ -0,0 +1,3 @@
+import Qt 4.7
+
+Rectangle { width: 80; height: 50; color: "red" }
diff --git a/doc/src/snippets/declarative/border-image.qml b/doc/src/snippets/declarative/borderimage.qml
index 9c4247e..9c4247e 100644
--- a/doc/src/snippets/declarative/border-image.qml
+++ b/doc/src/snippets/declarative/borderimage.qml
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
new file mode 100644
index 0000000..f6fb379
--- /dev/null
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -0,0 +1,47 @@
+//![0]
+var component;
+var sprite;
+
+function finishCreation() {
+ if (component.status == Component.Ready) {
+ sprite = component.createObject(appWindow);
+ if (sprite == null) {
+ // Error Handling
+ } else {
+ sprite.x = 100;
+ sprite.y = 100;
+ // ...
+ }
+ } else if (component.status == Component.Error) {
+ // Error Handling
+ console.log("Error loading component:", component.errorsString());
+ }
+}
+//![0]
+
+function createSpriteObjects() {
+
+//![1]
+component = Qt.createComponent("Sprite.qml");
+if (component.status == Component.Ready)
+ finishCreation();
+else
+ component.statusChanged.connect(finishCreation);
+//![1]
+
+//![2]
+component = Qt.createComponent("Sprite.qml");
+sprite = component.createObject(appWindow);
+
+if (sprite == null) {
+ // Error Handling
+ console.log("Error loading component:", component.errorsString());
+} else {
+ sprite.x = 100;
+ sprite.y = 100;
+ // ...
+}
+//![2]
+
+}
+
diff --git a/doc/src/snippets/declarative/createComponent.qml b/doc/src/snippets/declarative/createComponent.qml
new file mode 100644
index 0000000..c4a1617
--- /dev/null
+++ b/doc/src/snippets/declarative/createComponent.qml
@@ -0,0 +1,9 @@
+import Qt 4.7
+import "componentCreation.js" as MyModule
+
+Rectangle {
+ id: appWindow
+ width: 300; height: 300
+
+ Component.onCompleted: MyModule.createSpriteObjects();
+}
diff --git a/doc/src/snippets/declarative/createQmlObject.qml b/doc/src/snippets/declarative/createQmlObject.qml
new file mode 100644
index 0000000..6b331c4
--- /dev/null
+++ b/doc/src/snippets/declarative/createQmlObject.qml
@@ -0,0 +1,18 @@
+import Qt 4.7
+
+Rectangle {
+ id: targetItem
+ property QtObject newObject
+
+ width: 100
+ height: 100
+
+ function createIt() {
+//![0]
+newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
+ targetItem, "dynamicSnippet1");
+//![0]
+ }
+
+ Component.onCompleted: createIt()
+}
diff --git a/doc/src/snippets/declarative/drag.qml b/doc/src/snippets/declarative/drag.qml
index 9465efb..79469e3 100644
--- a/doc/src/snippets/declarative/drag.qml
+++ b/doc/src/snippets/declarative/drag.qml
@@ -9,7 +9,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
drag.target: pic
- drag.axis: "XAxis"
+ drag.axis: Drag.XAxis
drag.minimumX: 0
drag.maximumX: blurtest.width-pic.width
}
diff --git a/doc/src/snippets/declarative/dynamicObjects.qml b/doc/src/snippets/declarative/dynamicObjects.qml
new file mode 100644
index 0000000..6a8c927
--- /dev/null
+++ b/doc/src/snippets/declarative/dynamicObjects.qml
@@ -0,0 +1,29 @@
+import Qt 4.7
+
+//![0]
+Rectangle {
+ id: rootItem
+ width: 300
+ height: 300
+
+ Component {
+ id: rectComponent
+
+ Rectangle {
+ id: rect
+ width: 40; height: 40;
+ color: "red"
+
+ NumberAnimation on opacity { from: 1; to: 0; duration: 1000 }
+
+ Component.onCompleted: rect.destroy(1000);
+ }
+ }
+
+ function createRectangle() {
+ var object = rectComponent.createObject(rootItem);
+ }
+
+ Component.onCompleted: createRectangle()
+}
+//![0]
diff --git a/doc/src/snippets/declarative/flickableScrollbar.qml b/doc/src/snippets/declarative/flickableScrollbar.qml
new file mode 100644
index 0000000..147751a
--- /dev/null
+++ b/doc/src/snippets/declarative/flickableScrollbar.qml
@@ -0,0 +1,26 @@
+import Qt 4.7
+
+//![0]
+Rectangle {
+ width: 200; height: 200
+
+ Flickable {
+ id: flickable
+//![0]
+ anchors.fill: parent
+ contentWidth: image.width; contentHeight: image.height
+
+ Image { id: image; source: "pics/qt.png" }
+//![1]
+ }
+
+ Rectangle {
+ id: scrollbar
+ anchors.right: flickable.right
+ y: flickable.visibleArea.yPosition * flickable.height
+ width: 10
+ height: flickable.visibleArea.heightRatio * flickable.height
+ color: "black"
+ }
+}
+//![1]
diff --git a/doc/src/snippets/declarative/focusscopes.qml b/doc/src/snippets/declarative/focusscopes.qml
new file mode 100644
index 0000000..686de29
--- /dev/null
+++ b/doc/src/snippets/declarative/focusscopes.qml
@@ -0,0 +1,27 @@
+import Qt 4.7
+
+//![0]
+Rectangle {
+ color: "lightsteelblue"; width: 240; height: 320
+
+ ListView {
+ anchors.fill: parent
+ focus: true
+
+ model: ListModel {
+ ListElement { name: "Bob" }
+ ListElement { name: "John" }
+ ListElement { name: "Michael" }
+ }
+
+ delegate: FocusScope {
+ width: childrenRect.width; height: childrenRect.height
+ TextInput {
+ focus: true
+ text: name
+ Keys.onReturnPressed: console.log(name)
+ }
+ }
+ }
+ }
+//![0]
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
index 1d3df97..cf345aa 100644
--- a/doc/src/snippets/declarative/gridview/gridview.qml
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -4,7 +4,7 @@ import Qt 4.7
Rectangle {
width: 240; height: 180; color: "white"
// ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
+ // The launcher automatically loads files in dummydata/* to assist
// development without a real data source.
// Define a delegate component. A component will be
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
index 794b3f2..1282f8d 100644
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ b/doc/src/snippets/declarative/listview/highlight.qml
@@ -4,7 +4,7 @@ Rectangle {
width: 180; height: 200; color: "white"
// ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
+ // The launcher automatically loads files in dummydata/* to assist
// development without a real data source.
// Define a delegate component. A component will be
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
index 61bf126..44f0540 100644
--- a/doc/src/snippets/declarative/listview/listview.qml
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -5,7 +5,7 @@ Rectangle {
width: 180; height: 200; color: "white"
// ContactModel model is defined in dummydata/ContactModel.qml
- // The viewer automatically loads files in dummydata/* to assist
+ // The launcher automatically loads files in dummydata/* to assist
// development without a real data source.
// Define a delegate component. A component will be
diff --git a/doc/src/snippets/declarative/mouseregion.qml b/doc/src/snippets/declarative/mouseregion.qml
index a464069..683770b 100644
--- a/doc/src/snippets/declarative/mouseregion.qml
+++ b/doc/src/snippets/declarative/mouseregion.qml
@@ -3,13 +3,21 @@ import Qt 4.7
Rectangle { width: 200; height: 100
Row {
//! [0]
-Rectangle { width: 100; height: 100; color: "green"
- MouseArea { anchors.fill: parent; onClicked: { parent.color = 'red' } }
+Rectangle {
+ width: 100; height: 100
+ color: "green"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: { parent.color = 'red' }
+ }
}
//! [0]
//! [1]
Rectangle {
- width: 100; height: 100; color: "green"
+ width: 100; height: 100
+ color: "green"
+
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
diff --git a/doc/src/declarative/snippets/qtbinding/contextproperties/contextproperties.pro b/doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro
index 68eeaf2..68eeaf2 100644
--- a/doc/src/declarative/snippets/qtbinding/contextproperties/contextproperties.pro
+++ b/doc/src/snippets/declarative/qtbinding/contextproperties/contextproperties.pro
diff --git a/doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp b/doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp
index 4073a6c..4073a6c 100644
--- a/doc/src/declarative/snippets/qtbinding/contextproperties/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/contextproperties/main.cpp
diff --git a/doc/src/declarative/snippets/qtbinding/contextproperties/main.qml b/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml
index 1053f73..1053f73 100644
--- a/doc/src/declarative/snippets/qtbinding/contextproperties/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/contextproperties/main.qml
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h
index d0d253a..d0d253a 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.h
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.h
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.pro b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro
index e6af0d0..e6af0d0 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/custompalette.pro
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/custompalette.pro
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/main.cpp b/doc/src/snippets/declarative/qtbinding/custompalette/main.cpp
index dc651f6..dc651f6 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/main.cpp
diff --git a/doc/src/declarative/snippets/qtbinding/custompalette/main.qml b/doc/src/snippets/declarative/qtbinding/custompalette/main.qml
index f1a3b4f..f1a3b4f 100644
--- a/doc/src/declarative/snippets/qtbinding/custompalette/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/custompalette/main.qml
diff --git a/doc/src/declarative/snippets/qtbinding/resources/example.qrc b/doc/src/snippets/declarative/qtbinding/resources/example.qrc
index 5e49415..5e49415 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/example.qrc
+++ b/doc/src/snippets/declarative/qtbinding/resources/example.qrc
diff --git a/doc/src/declarative/snippets/qtbinding/resources/images/background.png b/doc/src/snippets/declarative/qtbinding/resources/images/background.png
index e69de29..e69de29 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/images/background.png
+++ b/doc/src/snippets/declarative/qtbinding/resources/images/background.png
diff --git a/doc/src/declarative/snippets/qtbinding/resources/main.cpp b/doc/src/snippets/declarative/qtbinding/resources/main.cpp
index 5459b9e..5459b9e 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.cpp
diff --git a/doc/src/declarative/snippets/qtbinding/resources/main.qml b/doc/src/snippets/declarative/qtbinding/resources/main.qml
index dfe923f..dfe923f 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/resources/main.qml
diff --git a/doc/src/declarative/snippets/qtbinding/resources/resources.pro b/doc/src/snippets/declarative/qtbinding/resources/resources.pro
index cc01ee1..cc01ee1 100644
--- a/doc/src/declarative/snippets/qtbinding/resources/resources.pro
+++ b/doc/src/snippets/declarative/qtbinding/resources/resources.pro
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp b/doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp
index 537a288..537a288 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/main.cpp
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/main.cpp
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/main.qml b/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
index 2efa542..2efa542 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/main.qml
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/main.qml
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.cpp b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp
index 4954a5f..4954a5f 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.cpp
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.cpp
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h
index 8d17121..8d17121 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.h
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.h
diff --git a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.pro b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro
index d803e6a..d803e6a 100644
--- a/doc/src/declarative/snippets/qtbinding/stopwatch/stopwatch.pro
+++ b/doc/src/snippets/declarative/qtbinding/stopwatch/stopwatch.pro
diff --git a/doc/src/sql-programming/qsqldatatype-table.qdoc b/doc/src/sql-programming/qsqldatatype-table.qdoc
index fc961f5..fb5fb49 100644
--- a/doc/src/sql-programming/qsqldatatype-table.qdoc
+++ b/doc/src/sql-programming/qsqldatatype-table.qdoc
@@ -41,19 +41,20 @@
/*!
\page sql-types.html
- \title Recommended Use of Data Types in Databases
+ \title Data Types for Qt-supported Database Systems
+ \brief Recommended data types for database systems
- \ingroup best-practices
+ \ingroup qt-sql
- \section1 Recommended Use of Types in Qt Supported Databases
+ \section1 Data Types for Qt Supported Database Systems
- This table shows the recommended data types used when extracting data
- from the databases supported in Qt. It is important to note that the
- types used in Qt are not necessarily valid as input to the specific
- database. One example could be that a double would work perfectly as
- input for floating point records in a database, but not necessarily
- as a storage format for output from the database since it would be stored
- with 64-bit precision in C++.
+ This table shows the recommended data types for extracting data from
+ the databases supported in Qt. Note that types used in Qt are not
+ necessarily valid as input types to a specific database
+ system. e.g., A double might work perfectly as input for floating
+ point records in a particular database, but not necessarily as a
+ storage format for output from that database, because it would be
+ stored with 64-bit precision in C++.
\tableofcontents
diff --git a/doc/src/sql-programming/sql-driver.qdoc b/doc/src/sql-programming/sql-driver.qdoc
index 6bccd83..f0e4e52 100644
--- a/doc/src/sql-programming/sql-driver.qdoc
+++ b/doc/src/sql-programming/sql-driver.qdoc
@@ -44,7 +44,7 @@
\title SQL Database Drivers
\brief How to configure and install QtSql drivers for supported databases.
- \ingroup best-practices
+ \ingroup qt-sql
The QtSql module uses driver \l{How to Create Qt
Plugins}{plugins} to communicate with the different database
diff --git a/doc/src/sql-programming/sql-programming.qdoc b/doc/src/sql-programming/sql-programming.qdoc
index f1f3e5e..b34810c 100644
--- a/doc/src/sql-programming/sql-programming.qdoc
+++ b/doc/src/sql-programming/sql-programming.qdoc
@@ -49,6 +49,7 @@
/*!
\page sql-programming.html
\title SQL Programming
+ \ingroup qt-sql
\nextpage Connecting to Databases
\brief Database integration for Qt applications.
@@ -118,6 +119,7 @@
/*!
\page sql-connecting.html
\title Connecting to Databases
+ \ingroup qt-sql
\contentspage SQL Programming
\previouspage SQL Programming
@@ -187,6 +189,7 @@
/*!
\page sql-sqlstatements.html
\title Executing SQL Statements
+ \ingroup qt-sql
\previouspage Connecting to Databases
\contentspage SQL Programming
@@ -337,6 +340,7 @@
/*!
\page sql-model.html
\title Using the SQL Model Classes
+ \ingroup qt-sql
\previouspage Executing SQL Statements
\contentspage SQL Programming
@@ -483,6 +487,7 @@
/*!
\page sql-presenting.html
\title Presenting Data in a Table View
+ \ingroup qt-sql
\previouspage Using the SQL Model Classes
\contentspage SQL Programming
@@ -587,6 +592,7 @@
/*!
\page sql-forms.html
\title Creating Data-Aware Forms
+ \ingroup qt-sql
\previouspage Presenting Data in a Table View
\contentspage SQL Programming
diff --git a/doc/src/template/images/api_examples.png b/doc/src/template/images/api_examples.png
deleted file mode 100755
index 1fcbc96..0000000
--- a/doc/src/template/images/api_examples.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/api_lookup.png b/doc/src/template/images/api_lookup.png
deleted file mode 100755
index 1cffd5e..0000000
--- a/doc/src/template/images/api_lookup.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/api_topics.png b/doc/src/template/images/api_topics.png
deleted file mode 100755
index a76a6c3..0000000
--- a/doc/src/template/images/api_topics.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_l.png b/doc/src/template/images/bg_l.png
index 95470c7..90b1da1 100755
--- a/doc/src/template/images/bg_l.png
+++ b/doc/src/template/images/bg_l.png
Binary files differ
diff --git a/doc/src/template/images/bg_l_blank.png b/doc/src/template/images/bg_l_blank.png
index e0eca3f..5a9673d 100755
--- a/doc/src/template/images/bg_l_blank.png
+++ b/doc/src/template/images/bg_l_blank.png
Binary files differ
diff --git a/doc/src/template/images/bg_ll.png b/doc/src/template/images/bg_ll.png
deleted file mode 100755
index 99796e7..0000000
--- a/doc/src/template/images/bg_ll.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ll_blank.png b/doc/src/template/images/bg_ll_blank.png
deleted file mode 100755
index 95a1c45..0000000
--- a/doc/src/template/images/bg_ll_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_lr.png b/doc/src/template/images/bg_lr.png
deleted file mode 100755
index fef1d17..0000000
--- a/doc/src/template/images/bg_lr.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_r.png b/doc/src/template/images/bg_r.png
index 42a35a5..f0fb121 100755
--- a/doc/src/template/images/bg_r.png
+++ b/doc/src/template/images/bg_r.png
Binary files differ
diff --git a/doc/src/template/images/bg_ul.png b/doc/src/template/images/bg_ul.png
deleted file mode 100755
index 303181f..0000000
--- a/doc/src/template/images/bg_ul.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ul_blank.png b/doc/src/template/images/bg_ul_blank.png
deleted file mode 100755
index 7051261..0000000
--- a/doc/src/template/images/bg_ul_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ur.png b/doc/src/template/images/bg_ur.png
deleted file mode 100755
index bfa51a4..0000000
--- a/doc/src/template/images/bg_ur.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/bg_ur_blank.png b/doc/src/template/images/bg_ur_blank.png
deleted file mode 100755
index 5779961..0000000
--- a/doc/src/template/images/bg_ur_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/box_bg.png b/doc/src/template/images/box_bg.png
index 232655a..3322f92 100755
--- a/doc/src/template/images/box_bg.png
+++ b/doc/src/template/images/box_bg.png
Binary files differ
diff --git a/doc/src/template/images/breadcrumb.png b/doc/src/template/images/breadcrumb.png
index f0571ce..0ded551 100755
--- a/doc/src/template/images/breadcrumb.png
+++ b/doc/src/template/images/breadcrumb.png
Binary files differ
diff --git a/doc/src/template/images/bullet_gt.png b/doc/src/template/images/bullet_gt.png
index 8875925..7561b4e 100755
--- a/doc/src/template/images/bullet_gt.png
+++ b/doc/src/template/images/bullet_gt.png
Binary files differ
diff --git a/doc/src/template/images/bullet_sq.png b/doc/src/template/images/bullet_sq.png
index db85ee3..a84845e 100755
--- a/doc/src/template/images/bullet_sq.png
+++ b/doc/src/template/images/bullet_sq.png
Binary files differ
diff --git a/doc/src/template/images/content_bg.png b/doc/src/template/images/content_bg.png
deleted file mode 100755
index 416397d..0000000
--- a/doc/src/template/images/content_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/form_bg.png b/doc/src/template/images/form_bg.png
deleted file mode 100755
index bf2ee54..0000000
--- a/doc/src/template/images/form_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/header.png b/doc/src/template/images/header.png
deleted file mode 100644
index 141488b..0000000
--- a/doc/src/template/images/header.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/page.png b/doc/src/template/images/page.png
new file mode 100644
index 0000000..1db151b
--- /dev/null
+++ b/doc/src/template/images/page.png
Binary files differ
diff --git a/doc/src/template/images/page_bg.png b/doc/src/template/images/page_bg.png
index fb7d051..9b3bd99 100755
--- a/doc/src/template/images/page_bg.png
+++ b/doc/src/template/images/page_bg.png
Binary files differ
diff --git a/doc/src/template/images/print.png b/doc/src/template/images/print.png
deleted file mode 100755
index 4581da1..0000000
--- a/doc/src/template/images/print.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_guide.png b/doc/src/template/images/qt_guide.png
deleted file mode 100755
index 9f53a05..0000000
--- a/doc/src/template/images/qt_guide.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_icon.png b/doc/src/template/images/qt_icon.png
deleted file mode 100755
index fbaee35..0000000
--- a/doc/src/template/images/qt_icon.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_ref_doc.png b/doc/src/template/images/qt_ref_doc.png
deleted file mode 100755
index 141488b..0000000
--- a/doc/src/template/images/qt_ref_doc.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/qt_tools.png b/doc/src/template/images/qt_tools.png
deleted file mode 100755
index cc24179..0000000
--- a/doc/src/template/images/qt_tools.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/sep.png b/doc/src/template/images/sep.png
deleted file mode 100755
index c895646..0000000
--- a/doc/src/template/images/sep.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/template/images/spinner.gif b/doc/src/template/images/spinner.gif
new file mode 100644
index 0000000..1ed786f
--- /dev/null
+++ b/doc/src/template/images/spinner.gif
Binary files differ
diff --git a/doc/src/template/images/sprites-combined.png b/doc/src/template/images/sprites-combined.png
index 4186022..3a48b21 100755
--- a/doc/src/template/images/sprites-combined.png
+++ b/doc/src/template/images/sprites-combined.png
Binary files differ
diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js
index fa454e3..7d93486 100755
--- a/doc/src/template/scripts/functions.js
+++ b/doc/src/template/scripts/functions.js
@@ -1,10 +1,8 @@
-
/* START non link areas where cursor should change to pointing hand */
$('.t_button').mouseover(function() {
$('.t_button').css('cursor','pointer');
/*document.getElementById(this.id).style.cursor='pointer';*/
});
-
/* END non link areas */
$('#smallA').click(function() {
$('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller');
@@ -35,27 +33,139 @@ $('#bigA').click(function() {
$(this).addClass('active')
});
-function doSearch(str){
-
-if (str.length>3)
- {
- alert('Search is not yet activated.');
- // document.getElementById("refWrapper").innerHTML="";
- return;
- }
- else
- return;
-
-// var url="indexSearch.php";
-// url=url+"?q="+str;
- // url=url+"&sid="+Math.random();
- // var url="http://localhost:8983/solr/select?";
- // url=url+"&q="+str;
- // url=url+"&fq=&start=0&rows=10&fl=&qt=&wt=&explainOther=&hl.fl=";
-
- // $.get(url, function(data){
- // alert(data);
- // document.getElementById("refWrapper").innerHTML=data;
- //});
-
-} \ No newline at end of file
+
+var lookupCount = 0;
+var articleCount = 0;
+var exampleCount = 0;
+var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links
+
+function processNokiaData(response){
+$('.sidebar .search form input').addClass('loading');
+ // debug $('.content').prepend('<li>handling search results</li>'); // debuging
+ var propertyTags = response.getElementsByTagName('page');
+
+ for (var i=0; i< propertyTags.length; i++) {
+ var linkStart = "<li class=\"liveResult\"><a href='"+qturl+"";
+ var linkEnd = "</a></li>";
+
+ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){
+ lookupCount++;
+ //$('.live001').css('display','block');
+
+
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
+ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd;
+
+ $('#ul001').append(full_li_element);
+ $('#ul001 .defaultLink').css('display','none');
+
+ }
+ }
+
+ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){
+ articleCount++;
+ //$('.live002').css('display','block');
+
+
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
+ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
+
+ $('#ul002').append(full_li_element);
+ $('#ul002 .defaultLink').css('display','none');
+
+ }
+ }
+ if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){
+ exampleCount++;
+ //$('.live003').css('display','block');
+
+
+ for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){
+ full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
+ full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ;
+
+ $('#ul003').append(full_li_element);
+ $('#ul003 .defaultLink').css('display','none');
+
+ }
+ }
+ }
+
+ if(lookupCount == 0){$('#ul001').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');
+}
+ if(articleCount == 0){$('#ul002').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul002 li').css('display','block');}
+ if(exampleCount == 0){$('#ul003').prepend('<li class=\"liveResult noMatch\">Found no result</li>');$('#ul003 li').css('display','block');}
+ // reset count variables;
+ lookupCount=0;
+ articleCount = 0;
+ exampleCount = 0;
+
+}
+
+//build regular expression object to find empty string or any number of blank
+var blankRE=/^\s*$/;
+function CheckEmptyAndLoadList()
+{
+ $('.liveResult').remove();
+ var value = document.getElementById('pageType').value;
+ if((blankRE.test(value)) || (value.length < 3))
+ {
+ //empty inputbox
+ // load default li elements into the ul if empty
+ // loadAllList(); // replaced
+ $('.defaultLink').css('display','block');
+ // $('.liveResult').css('display','none');
+ }else{
+ $('.defaultLink').css('display','none');
+ }
+}
+/*
+$(window).resize(function(){
+if($(window).width()<400)
+ $('body').addClass('offline');
+else
+ $('body').removeClass('offline');
+ });
+ */
+// Loads on doc ready
+ $(document).ready(function () {
+ var pageTitle = $('title').html();
+ $('#feedform').append('<input id="page" name="pageVal" value="'+pageTitle+'" style="display:none;">');
+ var currentString = $('#pageType').val() ;
+ if(currentString.length < 1){
+ $('.defaultLink').css('display','block');
+ CheckEmptyAndLoadList();
+ }
+
+ $('#pageType').keyup(function () {
+ var searchString = $('#pageType').val() ;
+ if ((searchString == null) || (searchString.length < 3)) {
+ $('.liveResult').remove(); // replaces removeResults();
+ CheckEmptyAndLoadList();
+ $('.report').remove();
+ // debug$('.content').prepend('<li>too short or blank</li>'); // debug
+ return;
+ }
+ if (this.timer) clearTimeout(this.timer);
+ this.timer = setTimeout(function () {
+ // debug$('.content').prepend('<li>new search started </li>');// debug
+ // debug$('.content').prepend('<p class=\"report\">Search string ' +searchString +'</p>'); // debug
+
+ $.ajax({
+ contentType: "application/x-www-form-urlencoded",
+ url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
+ data: 'searchString='+searchString,
+ dataType:'xml',
+ type: 'post',
+ success: function (response, textStatus) {
+
+ $('.liveResult').remove(); // replaces removeResults();
+ processNokiaData(response);
+
+ }
+ });
+ }, 500);
+ });
+ });
diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index d5920b9..5ad90e3 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -58,6 +58,23 @@
{
vertical-align: baseline;
}
+ tt, .qmlreadonly span, .qmldefault span
+ {
+ word-spacing:5px;
+ }
+ .heading
+ {
+ font: normal 600 16px/1.0 Arial;
+ padding-bottom: 15px;
+ }
+ .subtitle
+ {
+ font-size: 13px;
+ }
+ .small-subtitle
+ {
+ font-size: 13px;
+ }
legend
{
color: #000000;
@@ -73,7 +90,6 @@
{
font-size: 100%;
}
- /* Page style */
html
{
background-color: #e5e5e5;
@@ -92,6 +108,11 @@
{
font-style: italic;
}
+ a
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
.header, .footer, .wrapper
{
min-width: 600px;
@@ -106,23 +127,19 @@
{
padding-left: 216px;
height: 15px;
- background: url(../images/bg_ul.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 0;
overflow: hidden;
}
.offline .wrapper .hd
{
- background: url(../images/bg_ul_blank.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -15px;
}
.wrapper .hd span
{
height: 15px;
display: block;
- background: url(../images/bg_ur.png) no-repeat 100% 0;
overflow: hidden;
- }
- .offline .wrapper .hd span
- {
- /* background: url(../images/bg_ur_blank.png) no-repeat 100% 0; */
+ background: url(../images/page.png) no-repeat 100% -30px;
}
.wrapper .bd
{
@@ -137,18 +154,18 @@
{
padding-left: 216px;
height: 15px;
- background: url(../images/bg_ll.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -75px;
overflow: hidden;
}
.offline .wrapper .ft
{
- background: url(../images/bg_ll_blank.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -90px;
}
.wrapper .ft span
{
height: 15px;
display: block;
- background: url(../images/bg_lr.png) no-repeat 100% 0;
+ background: url(../images/page.png) no-repeat 100% -60px;
overflow: hidden;
}
.header, .footer
@@ -182,186 +199,9 @@
width: 302px;
height: 22px;
text-indent: -999em;
- background: url(../images/qt_ref_doc.png) no-repeat 0 0;
- }
- /* header elements */
- #nav-topright
- {
- height: 70px;
- }
-
- #nav-topright ul
- {
- list-style-type: none;
- float: right;
- width: 370px;
- margin-top: 11px;
- }
-
- #nav-topright li
- {
- display: inline-block;
- margin-right: 20px;
- float: left;
- }
-
- #nav-topright li.nav-topright-last
- {
- margin-right: 0;
- }
-
- #nav-topright li a
- {
- background: transparent url(../images/sprites-combined.png) no-repeat;
- height: 18px;
- display: block;
- overflow: hidden;
- text-indent: -9999px;
- }
-
- #nav-topright li.nav-topright-home a
- {
- width: 65px;
- background-position: -2px -91px;
- }
-
- #nav-topright li.nav-topright-home a:hover
- {
- background-position: -2px -117px;
- }
-
-
- #nav-topright li.nav-topright-dev a
- {
- width: 30px;
- background-position: -76px -91px;
- }
-
- #nav-topright li.nav-topright-dev a:hover
- {
- background-position: -76px -117px;
- }
-
-
- #nav-topright li.nav-topright-labs a
- {
- width: 40px;
- background-position: -114px -91px;
- }
-
- #nav-topright li.nav-topright-labs a:hover
- {
- background-position: -114px -117px;
- }
-
- #nav-topright li.nav-topright-doc a
- {
- width: 32px;
- background-position: -162px -91px;
- }
-
- #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
- {
- background-position: -162px -117px;
- }
-
- #nav-topright li.nav-topright-blog a
- {
- width: 40px;
- background-position: -203px -91px;
- }
-
- #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
- {
- background-position: -203px -117px;
- }
-
- #nav-topright li.nav-topright-shop a
- {
- width: 40px;
- background-position: -252px -91px;
- }
-
- #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
- {
- background-position: -252px -117px;
+ background: url(../images/sprites-combined.png) no-repeat -78px -235px;
}
- #nav-logo
- {
- background: transparent url( "../images/sprites-combined.png" ) no-repeat 0 -225px;
- left: -3px;
- position: absolute;
- width: 75px;
- height: 75px;
- top: 13px;
- }
- #nav-logo a
- {
- width: 75px;
- height: 75px;
- display: block;
- text-indent: -9999px;
- overflow: hidden;
- }
- /* Clearing */
- .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
- /* ^ Clearing */
-
-
-
- .shortCut-topleft-inactive
- {
- padding-left: 3px;
- background: transparent url( "../images/sprites-combined.png" ) no-repeat 0px -58px;
- height: 20px;
- width: 93px;
- }
- .shortCut-topleft-inactive span
- {
- font-variant: normal;
- }
- #shortCut
- {
- padding-top: 10px;
- font-weight: bolder;
- color: #b0adab;
- }
- #shortCut ul
- {
- list-style-type: none;
- float: left;
- width: 347px;
- margin-left: 100px;
- }
- #shortCut li
- {
- display: inline-block;
- margin-right: 25px;
- float: left;
- white-space: nowrap;
- }
- #shortCut li a
- {
- color: #b0adab;
- text-decoration: none;
- }
- #shortCut li a:hover
- {
- color: #44a51c;
- text-decoration: none;
- }
-
- /* end of header elements */
-
- /* menu element */
.sidebar
{
float: left;
@@ -369,32 +209,32 @@
width: 200px;
font-size: 11px;
}
- .sidebar a
- {
- color: #00732f;
- text-decoration: none;
- }
- .offline .sidebar, .offline .feedback
+
+ .offline .sidebar, .offline .feedback, .offline .t_button
{
display: none;
}
+
.sidebar .searchlabel
{
padding: 0 0 2px 17px;
font: normal bold 11px/1.2 Verdana;
}
+
.sidebar .search
{
padding: 0 15px 0 16px;
}
+
.sidebar .search form
{
- width: 167px;
- height: 21px;
- padding: 2px 0 0 5px;
- background: url(../images/form_bg.png) no-repeat 0 0;
+ background: url(../images/sprites-combined.png) no-repeat -6px -348px;
+ height:21px;
+ padding:2px 0 0 5px;
+ width:167px;
}
- .sidebar .search form fieldset input#searchstring
+
+ .sidebar .search form input#pageType
{
width: 158px;
height: 19px;
@@ -403,35 +243,68 @@
outline: none;
font: 13px/1.2 Verdana;
}
+
.sidebar .box
{
padding: 17px 15px 5px 16px;
}
+
.sidebar .box .first
{
background-image: none;
}
+
.sidebar .box h2
{
font: normal 18px/1.2 Arial;
- padding: 15px 0 0 40px;
+ padding: 0;
min-height: 32px;
}
+ .sidebar .box h2 span
+ {
+ overflow: hidden;
+ display: inline-block;
+ }
.sidebar .box#lookup h2
{
- background: url(../images/api_lookup.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #lookup.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -6px -311px;
+ width: 27px;
+ height: 35px;
+ margin-right: 13px;
}
.sidebar .box#topics h2
{
- background: url(../images/api_topics.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #topics.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -94px -311px;
+ width: 27px;
+ height: 32px;
+ margin-right: 13px;
}
.sidebar .box#examples h2
{
- background: url(../images/api_examples.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #examples.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -48px -311px;
+ width: 30px;
+ height: 31px;
+ margin-right: 9px;
}
+
.sidebar .box .list
{
display: block;
+ max-height:200px;
+ overflow-y:auto;
+ overflow-x:none;
}
.sidebar .box .live
{
@@ -443,33 +316,34 @@
{
text-decoration: underline;
}
+ .sidebar .box ul
+ {
+ padding:10px;
+ }
.sidebar .box ul li
{
padding-left: 12px;
background: url(../images/bullet_gt.png) no-repeat 0 5px;
- margin-bottom: 15px;
+ margin-bottom: 5px;
}
.sidebar .bottombar
{
background: url(../images/box_bg.png) repeat-x 0 bottom;
}
- /* content elements */
.wrap
{
- overflow: hidden;
+ margin: 0 5px 0 208px;
+ overflow: visible;
}
.offline .wrap
{
margin: 0 5px 0 5px;
}
- /* tool bar */
.wrap .toolbar
{
background-color: #fafafa;
border-bottom: 1px solid #d1d1d1;
- height: 20px;
- margin-left: 3px;
- margin-right: 5px;
+ height: 20px;
position: relative;
}
.wrap .toolbar .toolblock
@@ -487,7 +361,7 @@
{
padding: 0 0 10px 21px;
right: 5px;
- vertical-align: top;
+ vertical-align: middle;
overflow: hidden;
}
.wrap .toolbar .toolbuttons .active
@@ -507,32 +381,56 @@
font-weight: bold;
color: #B0ADAB;
}
- #smallA
+
+ .toolbuttons #print
+ {
+ border-left: 1px solid #c5c4c4;
+ margin-top: 0;
+ padding-left: 7px;
+ text-indent: 0;
+ }
+ .toolbuttons #print a
+ {
+ width: 16px;
+ height: 16px;
+ }
+
+ .toolbuttons #print a span
+ {
+ width: 16px;
+ height: 16px;
+ text-indent: -999em;
+ display: block;
+ overflow: hidden;
+ background: url(../images/sprites-combined.png) no-repeat -137px -311px;
+ }
+
+ .toolbuttons #smallA
{
font-size: 10pt;
}
- #medA
+ .toolbuttons #medA
{
font-size: 12pt;
}
- #bigA
+ .toolbuttons #bigA
{
font-size: 14pt;
+ margin-right: 7px;
}
+
#smallA:hover, #medA:hover, #bigA:hover
{
color: #00732F;
}
- #print
+
+ .offline .wrap .breadcrumb
{
- font-size: 14pt;
- line-height: 20pt;
}
- #printIcon
+
+ .wrap .breadcrumb ul
{
- margin-left: 5px;
}
- /* bread crumbs */
.wrap .breadcrumb ul li
{
float: left;
@@ -545,6 +443,10 @@
{
font-weight: normal;
}
+ .wrap .breadcrumb ul li a
+ {
+ color: #363534;
+ }
.wrap .breadcrumb ul li.first
{
background-image: none;
@@ -554,29 +456,29 @@
.wrap .content
{
padding: 30px;
- position: relative;
}
- /* text elements */
- .heading
+
+ .wrap .content li
{
- font: normal 600 16px/1.0 Arial;
- padding-bottom: 15px;
+ padding-left: 12px;
+ background: url(../images/bullet_sq.png) no-repeat 0 5px;
+ font: normal 400 10pt/1 Verdana;
+ /* color: #44a51c;*/
+ margin-bottom: 10px;
}
-
- .subtitle
+ .content li:hover
{
- font-size: 13px;
+ /* text-decoration: underline;*/
}
- .small-subtitle
+ .offline .wrap .content
{
- font-size: 13px;
+ padding-top: 15px;
}
-
+
.wrap .content h1
{
font: 600 18px/1.2 Arial;
- padding-bottom: 15px;
}
.wrap .content h2
{
@@ -588,25 +490,18 @@
}
.wrap .content p
{
- line-height:20px;
- padding:10px 5px 10px 5px;
+ line-height: 20px;
+ padding: 5px;
}
+ .wrap .content table p
+ {
+ line-height: 20px;
+ padding: 0px;
+ }
.wrap .content ul
{
padding-left: 25px;
- }
- .wrap .content li
- {
- padding-left: 12px;
- background: url(../images/bullet_sq.png) no-repeat 0 5px;
- font: normal 400 10pt/1 Verdana;
- margin-bottom: 10px;
- line-height: 14px;
- }
- a
- {
- color: #00732F;
- text-decoration: none;
+ padding-top: 10px;
}
a:hover
{
@@ -618,22 +513,26 @@
color: #4c0033;
text-decoration: none;
}
- .offline .wrap .content
+ .content a:visited:hover
{
- padding-top: 15px;
- }
- .footer
+ color: #4c0033;
+ text-decoration: underline;
+ } .footer
{
min-height: 100px;
color: #797775;
font: normal 9px/1 Verdana;
text-align: center;
padding-top: 40px;
+ background-color: #E6E7E8;
+ margin: 0;
}
.feedback
{
- float: right;
- padding-right: 10px;
+ float: none;
+ position: absolute;
+ right: 15px;
+ bottom: 10px;
font: normal 8px/1 Verdana;
color: #B0ADAB;
}
@@ -644,37 +543,244 @@
color: #00732F;
text-decoration: underline;
}
+ .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+ #nav-topright
+ {
+ height: 70px;
+ }
+
+ #nav-topright ul
+ {
+ list-style-type: none;
+ float: right;
+ width: 370px;
+ margin-top: 11px;
+ }
+
+ #nav-topright li
+ {
+ display: inline-block;
+ margin-right: 20px;
+ float: left;
+ }
+
+ #nav-topright li.nav-topright-last
+ {
+ margin-right: 0;
+ }
+
+ #nav-topright li a
+ {
+ background: transparent url(../images/sprites-combined.png) no-repeat;
+ height: 18px;
+ display: block;
+ overflow: hidden;
+ text-indent: -9999px;
+ }
+
+ #nav-topright li.nav-topright-home a
+ {
+ width: 65px;
+ background-position: -2px -91px;
+ }
+
+ #nav-topright li.nav-topright-home a:hover
+ {
+ background-position: -2px -117px;
+ }
+
+
+ #nav-topright li.nav-topright-dev a
+ {
+ width: 30px;
+ background-position: -76px -91px;
+ }
+
+ #nav-topright li.nav-topright-dev a:hover
+ {
+ background-position: -76px -117px;
+ }
+
+
+ #nav-topright li.nav-topright-labs a
+ {
+ width: 40px;
+ background-position: -114px -91px;
+ }
+
+ #nav-topright li.nav-topright-labs a:hover
+ {
+ background-position: -114px -117px;
+ }
+
+ #nav-topright li.nav-topright-doc a
+ {
+ width: 32px;
+ background-position: -162px -91px;
+ }
+
+ #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
+ {
+ background-position: -162px -117px;
+ }
+
+ #nav-topright li.nav-topright-blog a
+ {
+ width: 40px;
+ background-position: -203px -91px;
+ }
+
+ #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
+ {
+ background-position: -203px -117px;
+ }
+
+ #nav-topright li.nav-topright-shop a
+ {
+ width: 40px;
+ background-position: -252px -91px;
+ }
+
+ #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
+ {
+ background-position: -252px -117px;
+ }
+
+ #nav-logo
+ {
+ background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
+ left: -3px;
+ position: absolute;
+ width: 75px;
+ height: 75px;
+ top: 13px;
+ }
+ #nav-logo a
+ {
+ width: 75px;
+ height: 75px;
+ display: block;
+ text-indent: -9999px;
+ overflow: hidden;
+ }
+
+
+ .shortCut-topleft-inactive
+ {
+ padding-left: 3px;
+ background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
+ height: 20px;
+ width: 47px;
+ }
+ .shortCut-topleft-inactive span
+ {
+ font-variant: normal;
+ }
+ .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover
+ {
+ text-decoration:none;
+ }
+ #shortCut
+ {
+ padding-top: 10px;
+ font-weight: bolder;
+ color: #b0adab;
+ }
+ #shortCut ul
+ {
+ list-style-type: none;
+ float: left;
+ width: 347px;
+ margin-left: 100px;
+ }
+ #shortCut li
+ {
+ display: inline-block;
+ margin-right: 25px;
+ float: left;
+ white-space: nowrap;
+ }
+ #shortCut li a
+ {
+ color: #b0adab;
+ }
+ #shortCut li a:hover
+ {
+ color: #44a51c;
+ }
+
hr
{
- background-color: #e0e0e0;
+ background-color: #E6E6E6;
+ border: 1px solid #E6E6E6;
height: 1px;
width: 100%;
text-align: left;
margin: 15px 0px 15px 0px;
}
-
+
.content .alignedsummary
{
margin: 15px;
}
- /* tables */
+ pre
+ {
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
+ overflow-x: auto;
+ }
table, pre
{
-moz-border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
- font-size: 11px;
- min-width: 395px;
+ font-size: 11px;
+ /*min-width: 395px;*/
margin-bottom: 25px;
+ display: inline-block;
+ }
+ thead
+ {
+ margin-top: 5px;
+ font:600 12px/1.2 Arial;
+ }
+ th
+ {
+ padding: 5px 15px 5px 15px;
+ background-color: #E1E1E1;
+ /* border-bottom: 1px solid #E6E6E6;*/
+ border-left: 1px solid #E6E6E6;
+ /* border-right: 1px solid #E6E6E6;*/
+ }
+ td
+ {
+ padding: 3px 15px 3px 20px;
+ /* border-left: 1px solid #E6E6E6;
+ border-right: 1px solid #E6E6E6;*/
}
- thead{margin-top: 5px;}
- th{ padding: 3px 15px 3px 15px;}
- td{padding: 3px 15px 3px 20px;}
+ tr.odd td:hover, tr.even td:hover
+ {
+ /* border-right: 1px solid #C3C3C3;
+ border-left: 1px solid #C3C3C3;*/
+ }
+
+ td.rightAlign
+ {
+ padding: 3px 15px 3px 10px;
+ }
table tr.odd
{
border-left: 1px solid #E6E6E6;
- background-color: #F6F6F6;
+ background-color: #F6F6F6;
color: #66666E;
}
table tr.even
@@ -683,14 +789,11 @@
background-color: #ffffff;
color: #66666E;
}
- table tr.odd:hover
- {
- background-color: #E6E6E6;
- }
- table tr.even:hover
+ table tr.odd td:hover, table tr.even td:hover
{
background-color: #E6E6E6;
}
+
span.comment
{
color: #8B0000;
@@ -700,15 +803,7 @@
{
color: #254117;
}
- pre
- {
- -moz-border-radius:7px 7px 7px 7px;
- background-color:#F6F6F6;
- border:1px solid #DDDDDD;
- margin:0 20px 10px 10px;
- padding:20px 15px 20px 20px;
- overflow-x:auto;
- }
+
.qmltype
{
text-align: center;
@@ -736,11 +831,11 @@
#feedbackBox
{
- display:none;
- -moz-border-radius:7px 7px 7px 7px;
- border:1px solid #DDDDDD;
- position:fixed;
- top:100px;
+ display: none;
+ -moz-border-radius: 7px 7px 7px 7px;
+ border: 1px solid #DDDDDD;
+ position: fixed;
+ top: 100px;
left: 33%;
height: 190px;
width: 400px;
@@ -750,27 +845,27 @@
}
#feedcloseX a
{
- display:inline;
+ display: inline;
padding: 5px 5px 0 0;
- margin-bottom:3px;
+ margin-bottom: 3px;
color: #363534;
- font-weight:600;
+ font-weight: 600;
float: right;
text-decoration: none;
}
+
#feedbox
- /* here */
{
- display:inline;
+ display: inline;
width: 370px;
height: 120px;
- margin:0px 25px 10px 15px;
+ margin: 0px 25px 10px 15px;
}
#feedsubmit
{
- display:inline;
- float:right;
- margin:4px 32px 0 0;
+ display: inline;
+ float: right;
+ margin: 4px 32px 0 0;
}
#blurpage
{
@@ -786,36 +881,72 @@
}
.toc
{
- float: right;
- -moz-border-radius:7px 7px 7px 7px;
- background-color:#F6F6F6;
- border:1px solid #DDDDDD;
- margin:0 20px 10px 10px;
- padding:20px 15px 20px 20px;
+ float: right;
+ -moz-border-radius: 7px 7px 7px 7px;
+ background-color: #F6F6F6;
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
height: auto;
width: 200px;
}
- .toc h3
+ .toc h3, .generic a
{
- font:600 12px/1.2 Arial;
+ font: 600 12px/1.2 Arial;
}
+
+ .generic{
+ max-width:75%;
+ }
+ .generic td{
+ padding:0;
+ }
+
+ .generic .odd .alphaChar{
+ background-color: #F6F6F6;
+ }
+
+ .generic .even .alphaChar{
+ background-color: #FFFFFF;
+ }
+
+ .alignedsummary{}
+ .propsummary{}
+ .memItemLeft{}
+ .memItemRight{}
+ .bottomAlign{}
+ .highlightedCode
+ {
+ margin:10px;
+ }
+ .LegaleseLeft{}
+ .valuelist{}
+ .annotated{}
+ .obsolete{}
+ .compat{}
+ .flags{}
+ .qmlsummary{}
+ .qmlitem{}
+ .qmlproto{}
+ .qmlname{}
+ .qmlreadonly{}
+ .qmldefault{}
+ .qmldoc{}
+ .qt-style{}
+ .redFont{}
+ code{}
.wrap .content .toc ul
{
- /* float: left;*/
padding-left: 0px;
-
}
.wrap .content .toc .level2
{
- /* float: left;*/
- padding-left: 15px;
-
+ margin-left: 15px;
}
-
.content .toc li
{
@@ -823,133 +954,191 @@
background: url(../images/bullet_dn.png) no-repeat 0 5px;
}
- .relpage
+ .relpage
{
-moz-border-radius: 7px 7px 7px 7px;
border: 1px solid #DDDDDD;
padding: 25px 25px;
- clear:both;
+ clear: both;
}
.relpage ul
{
float: none;
padding: 15px;
}
- .content .relpage li
+ .content .relpage li
{
font: normal 11px/1.2 Verdana;
}
- /* edit */
h3.fn, span.fn
{
background-color: #F6F6F6;
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
- font-weight: bold;
- /* padding: 6px 0px 6px 10px;*/
- /* margin: 42px 0px 0px 0px;*/
+ font-weight: bold;
+ word-spacing:3px;
}
- /* edit */
- .indexbox
- {
- width: 100%;
- }
- .content .indexboxcont li
- {
- font: normal 600 13px/1 Verdana;
- }
+ .functionIndex {
+ font-size:12pt;
+ word-spacing:10px;
+ margin-bottom:10px;
+ background-color: #F6F6F6;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #E6E6E6;
+ }
+
+ .centerAlign
+ {
+ text-align:center;
+ }
+
+ .rightAlign
+ {
+ text-align:right;
+ }
- /* .indexbox a
- {
- color: #00732f;
- text-decoration: none;
- }*/
- .indexbox a:hover, .indexbox a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
- .indexbox a:visited
+
+ .leftAlign
+ {
+ text-align:left;
+ }
+
+ .topAlign{
+ vertical-align:top
+ }
+
+ .functionIndex a{
+ display:inline-block;
+ }
+
+ /* start index box */
+ .indexbox
{
- color: #00732f;
- text-decoration: none;
+ width: 100%;
+ display:inline-block;
}
.indexboxcont
{
display: block;
+ /* overflow: hidden;*/
}
.indexboxbar
{
- background: transparent url( "../images/horBar.png" ) repeat-x left bottom;
+ background: transparent url(../images/horBar.png ) repeat-x left bottom;
margin-bottom: 25px;
+ /* background-image: none;
+ border-bottom: 1px solid #e2e2e2;*/
}
.indexboxcont .section
{
- display: inline-block;
+ display: inline-block;
width: 49%;
*width:42%;
_width:42%;
padding:0 2% 0 1%;
vertical-align:top;
+
}
.indexboxcont .indexIcon
- {
+ {
width: 11%;
*width:18%;
_width:18%;
overflow:hidden;
+
}
+
+.indexboxcont .section {
+ float: left;
+}
+
.indexboxcont .section p
- {
+ {
padding-top: 20px;
padding-bottom: 20px;
}
-
.indexboxcont .sectionlist
{
display: inline-block;
- width: 33%;
- margin-right: -2px;
- vertical-align: top;
+ width: 32.5%;
padding: 0;
}
- .tricol
- {
-
- }
.indexboxcont .sectionlist ul
{
- padding-left: 15px;
margin-bottom: 20px;
}
-/*
+
.indexboxcont .sectionlist ul li
{
line-height: 12px;
}
-*/
- .lastcol
+
+ .content .indexboxcont li
{
- display: inline-block;
- vertical-align: top;
- padding: 0;
- max-width: 25%;
+ font: normal 600 13px/1 Verdana;
}
- .tricol .lastcol
+ .indexbox a:hover, .indexbox a:visited:hover
{
- margin-left:-6px;
+ color: #4c0033;
+ text-decoration: underline;
}
- /*.toc ul*/
+ .indexbox a:visited
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
+
+ .indexbox .indexIcon {
+ width: 11%;
+ }
- /* end page elements */
+
+ .indexbox .indexIcon span
+ {
+ display: block;
+ }
+
+ .indexbox.guide .indexIcon span
+ {
+ width: 96px;
+ height: 137px;
+ background: url(../images/sprites-combined.png) no-repeat -5px -376px;
+ padding: 0;
+ }
+
+ .indexbox.tools .indexIcon span
+ {
+ width: 115px;
+ height: 137px;
+ background: url(../images/sprites-combined.png) no-repeat -111px -376px;
+ padding: 0;
+ }
+ .indexboxcont:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+
+.sidebar .search form input.loading
+{
+ background:url("../images/spinner.gif") no-repeat scroll right center transparent;
+}
+
+ /* end of screen media */
+
+
}
/* end of screen media */
@@ -957,7 +1146,7 @@
@media print
{
- .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
+ input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
{
display: none;
background: none;
diff --git a/doc/src/widgets-and-layouts/layout.qdoc b/doc/src/widgets-and-layouts/layout.qdoc
index 0cfde22..2ca202f 100644
--- a/doc/src/widgets-and-layouts/layout.qdoc
+++ b/doc/src/widgets-and-layouts/layout.qdoc
@@ -47,6 +47,7 @@
/*!
\page layout.html
\title Layout Management
+ \ingroup qt-gui-concepts
\brief A tour of the standard layout managers and an introduction to custom
layouts.
diff --git a/doc/src/widgets-and-layouts/styles.qdoc b/doc/src/widgets-and-layouts/styles.qdoc
index 9a28715..31dfe40 100644
--- a/doc/src/widgets-and-layouts/styles.qdoc
+++ b/doc/src/widgets-and-layouts/styles.qdoc
@@ -47,14 +47,9 @@
/*!
\page style-reference.html
- \title Implementing Styles and Style Aware Widgets
- \brief An overview of styles and the styling of widgets.
-
- \ingroup frameworks-technologies
-
- \previouspage Widget Classes
- \contentspage Widgets and Layouts
- \nextpage {Qt Style Sheets}{Style sheets}
+ \title Styles and Style Aware Widgets
+ \ingroup qt-gui-concepts
+ \brief Styles and the styling of widgets.
Styles (classes that inherit QStyle) draw on behalf of widgets
and encapsulate the look and feel of a GUI. The QStyle class is
@@ -90,8 +85,6 @@
current style. This document shows how widgets draw themselves
and which possibilities the style gives them.
- \tableofcontents
-
\section1 Classes for Widget Styling
These classes are used to customize an application's appearance and
diff --git a/doc/src/widgets-and-layouts/widgets.qdoc b/doc/src/widgets-and-layouts/widgets.qdoc
index 7bd27b6..9fe2d69 100644
--- a/doc/src/widgets-and-layouts/widgets.qdoc
+++ b/doc/src/widgets-and-layouts/widgets.qdoc
@@ -40,130 +40,121 @@
****************************************************************************/
/*!
- \page widgets-and-layouts.html
- \title Widgets and Layouts
-
- \ingroup frameworks-technologies
-
- \nextpage Widget Classes
-
- The primary elements for designing user interfaces in Qt are widgets and layouts.
-
- \section1 Widgets
-
- \l{Widget Classes}{Widgets} can display data and status information, receive
- user input, and provide a container for other widgets that should be grouped
- together. A widget that is not embedded in a parent widget is called a
- \l{Application Windows and Dialogs}{window}.
-
- \image parent-child-widgets.png A parent widget containing various child widgets.
-
- The QWidget class provides the basic capability to render to the screen, and to
- handle user input events. All UI elements that Qt provides are either subclasses
- of QWidget, or are used in connection with a QWidget subclass. Creating custom
- widgets is done by subclassing QWidget or a suitable subclass and reimplementing
- the virtual event handlers.
-
- \section1 Layouts
-
- \l{Layout Management}{Layouts} are an elegant and flexible way to automatically
- arrange child widgets within their container. Each widget reports its size requirements
- to the layout through the \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy}
- properties, and the layout distributes the available space accordingly.
-
- \table
- \row
- \o \image qgridlayout-with-5-children.png
- \o \image qformlayout-with-6-children.png
- \endtable
-
- \l{Qt Designer Manual}{\QD} is a powerful tool for interactively creating and
- arranging widgets in layouts.
-
- \section1 Widget Styles
-
- \l{Implementing Styles and Style Aware Widgets}{Styles} draw on behalf of widgets
- and encapsulate the look and feel of a GUI. Qt's built-in widgets use the QStyle
- class to perform nearly all of their drawing, ensuring that they look exactly like
- the equivalent native widgets.
+ \page widgets-and-layouts.html
+ \title Widgets and Layouts
+ \ingroup qt-gui-concepts
+ \brief The primary elements for designing user interfaces in Qt.
+
+ \section1 Widgets
+
+ Widgets are the primary elements for creating user interfaces in Qt.
+ \l{Widget Classes}{Widgets} can display data and status information,
+ receive user input, and provide a container for other widgets that
+ should be grouped together. A widget that is not embedded in a
+ parent widget is called a \l{Application Windows and
+ Dialogs}{window}.
+
+ \image parent-child-widgets.png A parent widget containing various child widgets.
+
+ The QWidget class provides the basic capability to render to the
+ screen, and to handle user input events. All UI elements that Qt
+ provides are either subclasses of QWidget, or are used in connection
+ with a QWidget subclass. Creating custom widgets is done by
+ subclassing QWidget or a suitable subclass and reimplementing the
+ virtual event handlers.
+
+ \section1 Layouts
+
+ \l{Layout Management}{Layouts} are an elegant and flexible way to
+ automatically arrange child widgets within their container. Each
+ widget reports its size requirements to the layout through the
+ \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy} properties,
+ and the layout distributes the available space accordingly.
+
+ \table
+ \row
+ \o \image qgridlayout-with-5-children.png
+ \o \image qformlayout-with-6-children.png
+ \endtable
+
+ \l{Qt Designer Manual}{\QD} is a powerful tool for interactively creating and
+ arranging widgets in layouts.
+
+ \section1 Widget Styles
+
+ \l{Implementing Styles and Style Aware Widgets}{Styles} draw on
+ behalf of widgets and encapsulate the look and feel of a GUI. Qt's
+ built-in widgets use the QStyle class to perform nearly all of their
+ drawing, ensuring that they look exactly like the equivalent native
+ widgets.
- \table
- \row
- \o \image windowsxp-tabwidget.png
- \o \image plastique-tabwidget.png
- \o \image macintosh-tabwidget.png
- \endtable
-
- \l{Qt Style Sheets} are a powerful mechanism that allows you to customize the
- appearance of widgets, in addition to what is already possible by subclassing QStyle.
-*/
-
-/*!
- \page widget-classes.html
- \title Widget Classes
+ \table
+ \row
+ \o \image windowsxp-tabwidget.png
+ \o \image plastique-tabwidget.png
+ \o \image macintosh-tabwidget.png
+ \endtable
- \contentspage Widgets and Layouts
- \nextpage Layout Management
+ \l{Qt Style Sheets} are a powerful mechanism that allows you to customize the
+ appearance of widgets, in addition to what is already possible by subclassing QStyle.
- Below you find a list of all widget classes in Qt. You can also browse the
- widget classes Qt provides in the various supported styles in the
- \l{Qt Widget Gallery}.
+ \section1 The Widget Classes
- \tableofcontents
+ The following sections list the widget classes. See the \l{Qt Widget
+ Gallery} for some examples.
- \section1 Basic Widgets
+ \section2 Basic Widgets
- These basic widgets (controls), such as buttons, comboboxes and scroll bars, are
- designed for direct use.
+ These basic widgets (controls), e.g. buttons, comboboxes and
+ scroll bars, are designed for direct use.
- \table
- \row
- \o \image windows-label.png
- \o \image windowsvista-pushbutton.png
- \o \image gtk-progressbar.png
- \row
- \o \image plastique-combobox.png
- \o \image macintosh-radiobutton.png
- \o \image cde-lineedit.png
- \endtable
+ \table
+ \row
+ \o \image windows-label.png
+ \o \image windowsvista-pushbutton.png
+ \o \image gtk-progressbar.png
+ \row
+ \o \image plastique-combobox.png
+ \o \image macintosh-radiobutton.png
+ \o \image cde-lineedit.png
+ \endtable
- \annotatedlist basicwidgets
+ \annotatedlist basicwidgets
- \section1 Advanced Widgets
+ \section2 Advanced Widgets
- Advanced GUI widgets such as tab widgets and progress bars provide more
- complex user interface controls.
+ Advanced GUI widgets, e.g. tab widgets and progress bars, provide
+ more complex user interface controls.
- \table
- \row
- \o \image windowsxp-treeview.png
- \o \image gtk-calendarwidget.png
- \o \image qundoview.png
- \endtable
+ \table
+ \row
+ \o \image windowsxp-treeview.png
+ \o \image gtk-calendarwidget.png
+ \o \image qundoview.png
+ \endtable
- \annotatedlist advanced
+ \annotatedlist advanced
- \table
- \row
- \o \image windowsvista-tabwidget.png
- \o \image macintosh-groupbox.png
- \endtable
+ \table
+ \row
+ \o \image windowsvista-tabwidget.png
+ \o \image macintosh-groupbox.png
+ \endtable
- \section1 Organizer Widgets
+ \section2 Organizer Widgets
- Classes like splitters, tab bars, button groups, etc are used to
- organize and group GUI primitives into more complex applications or
- dialogs.
+ Classes like splitters, tab bars, button groups, etc are used for
+ organizing and grouping GUI primitives into more complex
+ applications and dialogs.
- \annotatedlist organizers
+ \annotatedlist organizers
- \section1 Abstract Widget Classes
+ \section2 Abstract Widget Classes
- Abstract widget classes usable through subclassing. They are generally
- not usable in themselves, but provide functionality that can be used
- by inheriting these classes.
+ The abstract widget classes are base classes. They are not usable as
+ standalone classes but provide functionality when they are subclassed.
- \annotatedlist abstractwidgets
+ \annotatedlist abstractwidgets
*/
/*!
diff --git a/doc/src/windows-and-dialogs/dialogs.qdoc b/doc/src/windows-and-dialogs/dialogs.qdoc
index acee0c5..0b0a842 100644
--- a/doc/src/windows-and-dialogs/dialogs.qdoc
+++ b/doc/src/windows-and-dialogs/dialogs.qdoc
@@ -52,6 +52,7 @@
/*!
\page dialogs.html
\title Dialog Windows
+ \ingroup qt-gui-concepts
\brief An overview over dialog windows.
\previouspage The Application Main Window
diff --git a/doc/src/windows-and-dialogs/mainwindow.qdoc b/doc/src/windows-and-dialogs/mainwindow.qdoc
index 6adfa75..c1e66d9 100644
--- a/doc/src/windows-and-dialogs/mainwindow.qdoc
+++ b/doc/src/windows-and-dialogs/mainwindow.qdoc
@@ -46,11 +46,11 @@
/*!
\page application-windows.html
- \title Application Windows and Dialogs
+ \title Window and Dialog Widgets
+ \brief Windows and Dialogs in Qt.
+ \ingroup qt-gui-concepts
\ingroup frameworks-technologies
- \nextpage The Application Main Window
-
A \l{Widgets Tutorial}{widget} that is not embedded in a parent widget is called a window.
Usually, windows have a frame and a title bar, although it is also possible to create
windows without such decoration using suitable window flags). In Qt, QMainWindow
@@ -164,12 +164,9 @@
/*!
\page mainwindow.html
- \title The Application Main Window
- \brief Everything you need for a typical modern main application window,
- including menus, toolbars, workspace, etc.
-
- \contentspage Application Windows and Dialogs
- \nextpage Dialog Windows
+ \title Application Main Window
+ \ingroup qt-gui-concepts
+ \brief Creating the application window.
\tableofcontents
diff --git a/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject b/examples/declarative/animation/animation.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject
+++ b/examples/declarative/animation/animation.qmlproject
diff --git a/examples/declarative/xmldata/xmldata.qmlproject b/examples/declarative/animation/basics/basics.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/xmldata/xmldata.qmlproject
+++ b/examples/declarative/animation/basics/basics.qmlproject
diff --git a/examples/declarative/animations/color-animation.qml b/examples/declarative/animation/basics/color-animation.qml
index 3616a31..61737e9 100644
--- a/examples/declarative/animations/color-animation.qml
+++ b/examples/declarative/animation/basics/color-animation.qml
@@ -31,15 +31,14 @@ Item {
// the sun, moon, and stars
Item {
width: parent.width; height: 2 * parent.height
- transformOrigin: Item.Center
NumberAnimation on rotation { from: 0; to: 360; duration: 10000; loops: Animation.Infinite }
Image {
source: "images/sun.png"; y: 10; anchors.horizontalCenter: parent.horizontalCenter
- transformOrigin: Item.Center; rotation: -3 * parent.rotation
+ rotation: -3 * parent.rotation
}
Image {
source: "images/moon.png"; y: parent.height - 74; anchors.horizontalCenter: parent.horizontalCenter
- transformOrigin: Item.Center; rotation: -parent.rotation
+ rotation: -parent.rotation
}
Particles {
x: 0; y: parent.height/2; width: parent.width; height: parent.height/2
diff --git a/examples/declarative/parallax/pics/face-smile.png b/examples/declarative/animation/basics/images/face-smile.png
index 3d66d72..3d66d72 100644
--- a/examples/declarative/parallax/pics/face-smile.png
+++ b/examples/declarative/animation/basics/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/animations/images/moon.png b/examples/declarative/animation/basics/images/moon.png
index 9407b2b..9407b2b 100644
--- a/examples/declarative/animations/images/moon.png
+++ b/examples/declarative/animation/basics/images/moon.png
Binary files differ
diff --git a/examples/declarative/parallax/pics/shadow.png b/examples/declarative/animation/basics/images/shadow.png
index 8270565..8270565 100644
--- a/examples/declarative/parallax/pics/shadow.png
+++ b/examples/declarative/animation/basics/images/shadow.png
Binary files differ
diff --git a/examples/declarative/dynamic/images/star.png b/examples/declarative/animation/basics/images/star.png
index 27ef924..27ef924 100644
--- a/examples/declarative/dynamic/images/star.png
+++ b/examples/declarative/animation/basics/images/star.png
Binary files differ
diff --git a/examples/declarative/dynamic/images/sun.png b/examples/declarative/animation/basics/images/sun.png
index 7713ca5..7713ca5 100644
--- a/examples/declarative/dynamic/images/sun.png
+++ b/examples/declarative/animation/basics/images/sun.png
Binary files differ
diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animation/basics/property-animation.qml
index 5afe8ef..87ac8ec 100644
--- a/examples/declarative/animations/property-animation.qml
+++ b/examples/declarative/animation/basics/property-animation.qml
@@ -26,7 +26,6 @@ Item {
Image {
anchors.horizontalCenter: parent.horizontalCenter
source: "images/shadow.png"; y: smiley.minHeight + 58
- transformOrigin: Item.Center
// The scale property depends on the y position of the smiley face.
scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight)
@@ -48,13 +47,13 @@ Item {
// Move from minHeight to maxHeight in 300ms, using the OutExpo easing function
NumberAnimation {
from: smiley.minHeight; to: smiley.maxHeight
- easing.type: "OutExpo"; duration: 300
+ easing.type: Easing.OutExpo; duration: 300
}
// Then move back to minHeight in 1 second, using the OutBounce easing function
NumberAnimation {
from: smiley.maxHeight; to: smiley.minHeight
- easing.type: "OutBounce"; duration: 1000
+ easing.type: Easing.OutBounce; duration: 1000
}
// Then pause for 500ms
diff --git a/examples/declarative/behaviors/SideRect.qml b/examples/declarative/animation/behaviors/SideRect.qml
index d32bd7b..d32bd7b 100644
--- a/examples/declarative/behaviors/SideRect.qml
+++ b/examples/declarative/animation/behaviors/SideRect.qml
diff --git a/examples/declarative/behaviors/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example.qml
index b7bae6c..1f17b81 100644
--- a/examples/declarative/behaviors/behavior-example.qml
+++ b/examples/declarative/animation/behaviors/behavior-example.qml
@@ -49,12 +49,12 @@ Rectangle {
// Setting an 'elastic' behavior on the focusRect's x property.
Behavior on x {
- NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
+ NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
}
// Setting an 'elastic' behavior on the focusRect's y property.
Behavior on y {
- NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
+ NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
}
Text {
diff --git a/examples/declarative/behaviors/behaviors.qmlproject b/examples/declarative/animation/behaviors/behaviors.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/behaviors/behaviors.qmlproject
+++ b/examples/declarative/animation/behaviors/behaviors.qmlproject
diff --git a/examples/declarative/animation/easing/easing.qml b/examples/declarative/animation/easing/easing.qml
new file mode 100644
index 0000000..939d43b
--- /dev/null
+++ b/examples/declarative/animation/easing/easing.qml
@@ -0,0 +1,105 @@
+import Qt 4.7
+
+Rectangle {
+ id: window
+ width: 600; height: 460; color: "#232323"
+
+ ListModel {
+ id: easingTypes
+ ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" }
+ ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" }
+ ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" }
+ ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" }
+ ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" }
+ ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" }
+ ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" }
+ ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" }
+ ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" }
+ ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" }
+ ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" }
+ ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" }
+ ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" }
+ ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" }
+ ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" }
+ ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" }
+ ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" }
+ ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" }
+ ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" }
+ ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" }
+ ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" }
+ ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" }
+ ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" }
+ ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" }
+ ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" }
+ ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" }
+ ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" }
+ ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" }
+ ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" }
+ ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" }
+ ListElement { name: "Easing.InElastic"; type: Easing.OutElastic; ballColor: "Chocolate" }
+ ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" }
+ ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" }
+ ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" }
+ ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" }
+ ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" }
+ ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" }
+ ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" }
+ ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" }
+ ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" }
+ ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" }
+ }
+
+ Component {
+ id: delegate
+
+ Item {
+ height: 42; width: window.width
+
+ Text { text: name; anchors.centerIn: parent; color: "White" }
+
+ Rectangle {
+ id: slot1; color: "#121212"; x: 30; height: 32; width: 32
+ border.color: "#343434"; border.width: 1; radius: 8
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32
+ border.color: "#343434"; border.width: 1; radius: 8
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Rectangle {
+ id: rect; x: 30; color: "#454545"
+ border.color: "White"; border.width: 2
+ height: 32; width: 32; radius: 8
+ anchors.verticalCenter: parent.verticalCenter
+
+ MouseArea {
+ onClicked: if (rect.state == '') rect.state = "right"; else rect.state = ''
+ anchors.fill: parent
+ }
+
+ states : State {
+ name: "right"
+ PropertyChanges { target: rect; x: window.width - 62; color: ballColor }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: type; duration: 1000 }
+ ColorAnimation { properties: "color"; easing.type: type; duration: 1000 }
+ }
+ }
+ }
+ }
+
+ Flickable {
+ anchors.fill: parent; contentHeight: layout.height
+
+ Column {
+ id: layout
+ anchors.left: parent.left; anchors.right: parent.right
+ Repeater { model: easingTypes; delegate: delegate }
+ }
+ }
+}
diff --git a/examples/declarative/workerscript/workerscript.qmlproject b/examples/declarative/animation/easing/easing.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/workerscript/workerscript.qmlproject
+++ b/examples/declarative/animation/easing/easing.qmlproject
diff --git a/examples/declarative/states/states.qml b/examples/declarative/animation/states/states.qml
index 4429e78..4429e78 100644
--- a/examples/declarative/states/states.qml
+++ b/examples/declarative/animation/states/states.qml
diff --git a/examples/declarative/states/states.qmlproject b/examples/declarative/animation/states/states.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/states/states.qmlproject
+++ b/examples/declarative/animation/states/states.qmlproject
diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/animation/states/transitions.qml
index d1b1dd6..ccc7060 100644
--- a/examples/declarative/states/transitions.qml
+++ b/examples/declarative/animation/states/transitions.qml
@@ -72,14 +72,14 @@ Rectangle {
// with OutBounce easing function.
Transition {
from: "*"; to: "middleRight"
- NumberAnimation { properties: "x,y"; easing.type: "OutBounce"; duration: 1000 }
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; duration: 1000 }
},
// When transitioning to 'bottomLeft' move x,y over a duration of 2 seconds,
// with InOutQuad easing function.
Transition {
from: "*"; to: "bottomLeft"
- NumberAnimation { properties: "x,y"; easing.type: "InOutQuad"; duration: 2000 }
+ NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 2000 }
},
// For any other state changes move x,y linearly over duration of 200ms.
diff --git a/examples/declarative/states/user.png b/examples/declarative/animation/states/user.png
index dd7d7a2..dd7d7a2 100644
--- a/examples/declarative/states/user.png
+++ b/examples/declarative/animation/states/user.png
Binary files differ
diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml
deleted file mode 100644
index b0f9669..0000000
--- a/examples/declarative/animations/easing.qml
+++ /dev/null
@@ -1,99 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- id: window
- width: 600; height: 460; color: "#232323"
-
- ListModel {
- id: easingTypes
- ListElement { type: "Linear"; ballColor: "DarkRed" }
- ListElement { type: "InQuad"; ballColor: "IndianRed" }
- ListElement { type: "OutQuad"; ballColor: "Salmon" }
- ListElement { type: "InOutQuad"; ballColor: "Tomato" }
- ListElement { type: "OutInQuad"; ballColor: "DarkOrange" }
- ListElement { type: "InCubic"; ballColor: "Gold" }
- ListElement { type: "OutCubic"; ballColor: "Yellow" }
- ListElement { type: "InOutCubic"; ballColor: "PeachPuff" }
- ListElement { type: "OutInCubic"; ballColor: "Thistle" }
- ListElement { type: "InQuart"; ballColor: "Orchid" }
- ListElement { type: "OutQuart"; ballColor: "Purple" }
- ListElement { type: "InOutQuart"; ballColor: "SlateBlue" }
- ListElement { type: "OutInQuart"; ballColor: "Chartreuse" }
- ListElement { type: "InQuint"; ballColor: "LimeGreen" }
- ListElement { type: "OutQuint"; ballColor: "SeaGreen" }
- ListElement { type: "InOutQuint"; ballColor: "DarkGreen" }
- ListElement { type: "OutInQuint"; ballColor: "Olive" }
- ListElement { type: "InSine"; ballColor: "DarkSeaGreen" }
- ListElement { type: "OutSine"; ballColor: "Teal" }
- ListElement { type: "InOutSine"; ballColor: "Turquoise" }
- ListElement { type: "OutInSine"; ballColor: "SteelBlue" }
- ListElement { type: "InExpo"; ballColor: "SkyBlue" }
- ListElement { type: "OutExpo"; ballColor: "RoyalBlue" }
- ListElement { type: "InOutExpo"; ballColor: "MediumBlue" }
- ListElement { type: "OutInExpo"; ballColor: "MidnightBlue" }
- ListElement { type: "InCirc"; ballColor: "CornSilk" }
- ListElement { type: "OutCirc"; ballColor: "Bisque" }
- ListElement { type: "InOutCirc"; ballColor: "RosyBrown" }
- ListElement { type: "OutInCirc"; ballColor: "SandyBrown" }
- ListElement { type: "InElastic"; ballColor: "DarkGoldenRod" }
- ListElement { type: "OutElastic"; ballColor: "Chocolate" }
- ListElement { type: "InOutElastic"; ballColor: "SaddleBrown" }
- ListElement { type: "OutInElastic"; ballColor: "Brown" }
- ListElement { type: "InBack"; ballColor: "Maroon" }
- ListElement { type: "OutBack"; ballColor: "LavenderBlush" }
- ListElement { type: "InOutBack"; ballColor: "MistyRose" }
- ListElement { type: "OutInBack"; ballColor: "Gainsboro" }
- ListElement { type: "OutBounce"; ballColor: "Silver" }
- ListElement { type: "InBounce"; ballColor: "DimGray" }
- ListElement { type: "InOutBounce"; ballColor: "SlateGray" }
- ListElement { type: "OutInBounce"; ballColor: "DarkSlateGray" }
- }
-
- Component {
- id: delegate
-
- Item {
- height: 42; width: window.width
- Text { text: type; anchors.centerIn: parent; color: "White" }
- Rectangle {
- id: slot1; color: "#121212"; x: 30; height: 32; width: 32
- border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter
- }
- Rectangle {
- id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32
- border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter
- }
- Rectangle {
- id: rect; x: 30; color: "#454545"
- border.color: "White"; border.width: 2
- height: 32; width: 32; radius: 8; anchors.verticalCenter: parent.verticalCenter
-
- MouseArea {
- onClicked: if (rect.state == '') rect.state = "right"; else rect.state = ''
- anchors.fill: parent
- }
-
- states : State {
- name: "right"
- PropertyChanges { target: rect; x: window.width - 62; color: ballColor }
- }
-
- transitions: Transition {
- // ParallelAnimation {
- NumberAnimation { properties: "x"; easing.type: type; duration: 1000 }
- ColorAnimation { properties: "color"; easing.type: type; duration: 1000 }
- // }
- }
- }
- }
- }
-
- Flickable {
- anchors.fill: parent; contentHeight: layout.height
- Column {
- id: layout
- anchors.left: parent.left; anchors.right: parent.right
- Repeater { model: easingTypes; delegate: delegate }
- }
- }
-}
diff --git a/examples/declarative/border-image/animated.qml b/examples/declarative/border-image/animated.qml
deleted file mode 100644
index c3ff9ef..0000000
--- a/examples/declarative/border-image/animated.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-import Qt 4.7
-import "content"
-
-Rectangle {
- id: page
- width: 1030; height: 540
-
- MyBorderImage {
- x: 20; y: 20; minWidth: 120; maxWidth: 240
- minHeight: 120; maxHeight: 240
- source: "content/colors.png"; margin: 30
- }
- MyBorderImage {
- x: 270; y: 20; minWidth: 120; maxWidth: 240
- minHeight: 120; maxHeight: 240
- source: "content/colors.png"; margin: 30
- horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
- }
- MyBorderImage {
- x: 520; y: 20; minWidth: 120; maxWidth: 240
- minHeight: 120; maxHeight: 240
- source: "content/colors.png"; margin: 30
- horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
- }
- MyBorderImage {
- x: 770; y: 20; minWidth: 120; maxWidth: 240
- minHeight: 120; maxHeight: 240
- source: "content/colors.png"; margin: 30
- horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
- }
- MyBorderImage {
- x: 20; y: 280; minWidth: 60; maxWidth: 200
- minHeight: 40; maxHeight: 200
- source: "content/bw.png"; margin: 10
- }
- MyBorderImage {
- x: 270; y: 280; minWidth: 60; maxWidth: 200
- minHeight: 40; maxHeight: 200
- source: "content/bw.png"; margin: 10
- horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
- }
- MyBorderImage {
- x: 520; y: 280; minWidth: 60; maxWidth: 200
- minHeight: 40; maxHeight: 200
- source: "content/bw.png"; margin: 10
- horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
- }
- MyBorderImage {
- x: 770; y: 280; minWidth: 60; maxWidth: 200
- minHeight: 40; maxHeight: 200
- source: "content/bw.png"; margin: 10
- horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
- }
-}
diff --git a/examples/declarative/border-image/borders.qml b/examples/declarative/border-image/borders.qml
deleted file mode 100644
index 3743f7e..0000000
--- a/examples/declarative/border-image/borders.qml
+++ /dev/null
@@ -1,17 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- id: page
- width: 520; height: 280
-
- BorderImage {
- x: 20; y: 20; width: 230; height: 240
- smooth: true
- source: "content/colors-stretch.sci"
- }
- BorderImage {
- x: 270; y: 20; width: 230; height: 240
- smooth: true
- source: "content/colors-round.sci"
- }
-}
diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml
deleted file mode 100644
index f65f093..0000000
--- a/examples/declarative/border-image/content/MyBorderImage.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-import Qt 4.7
-
-Item {
- property alias horizontalMode: image.horizontalTileMode
- property alias verticalMode: image.verticalTileMode
- property alias source: image.source
-
- property int minWidth
- property int minHeight
- property int maxWidth
- property int maxHeight
- property int margin
-
- id: container
- width: 240; height: 240
-
- BorderImage {
- id: image; x: container.width / 2 - width / 2; y: container.height / 2 - height / 2
-
- SequentialAnimation on width {
- loops: Animation.Infinite
- NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing.type: "InOutQuad"}
- NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing.type: "InOutQuad" }
- }
-
- SequentialAnimation on height {
- loops: Animation.Infinite
- NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing.type: "InOutQuad"}
- NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing.type: "InOutQuad" }
- }
-
- border.top: container.margin
- border.left: container.margin
- border.bottom: container.margin
- border.right: container.margin
- }
-}
diff --git a/examples/declarative/connections/connections-example.qml b/examples/declarative/connections/connections-example.qml
deleted file mode 100644
index fbef968..0000000
--- a/examples/declarative/connections/connections-example.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-import Qt 4.7
-import "content"
-
-Rectangle {
- id: window
-
- property int angle: 0
-
- width: 640; height: 480
- color: "#646464"
-
- Image {
- id: image
- source: "content/bg1.jpg"
- anchors.centerIn: parent
- transformOrigin: Item.Center
- rotation: window.angle
-
- Behavior on rotation {
- NumberAnimation { easing.type: "OutCubic"; duration: 300 }
- }
- }
-
- Button {
- id: leftButton
- image: "content/rotate-left.png"
- anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 10 }
- }
-
- Button {
- id: rightButton
- image: "content/rotate-right.png"
- anchors { right: parent.right; bottom: parent.bottom; rightMargin: 10; bottomMargin: 10 }
- }
-
- Connections { target: leftButton; onClicked: window.angle -= 90 }
- Connections { target: rightButton; onClicked: window.angle += 90 }
-}
diff --git a/examples/declarative/connections/content/Button.qml b/examples/declarative/connections/content/Button.qml
deleted file mode 100644
index f95afbb..0000000
--- a/examples/declarative/connections/content/Button.qml
+++ /dev/null
@@ -1,12 +0,0 @@
-import Qt 4.7
-
-Item {
- id: button
- width: 48; height: 48
-
- property alias image: icon.source
- signal clicked
-
- Image { id: icon }
- MouseArea { anchors.fill: icon; onClicked: button.clicked() }
-}
diff --git a/examples/declarative/connections/content/bg1.jpg b/examples/declarative/connections/content/bg1.jpg
deleted file mode 100644
index dfc7cee..0000000
--- a/examples/declarative/connections/content/bg1.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/connections/content/rotate-left.png b/examples/declarative/connections/content/rotate-left.png
deleted file mode 100644
index c30387e..0000000
--- a/examples/declarative/connections/content/rotate-left.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/connections/content/rotate-right.png b/examples/declarative/connections/content/rotate-right.png
deleted file mode 100644
index 1b05674..0000000
--- a/examples/declarative/connections/content/rotate-right.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/cppextensions/cppextensions.pro b/examples/declarative/cppextensions/cppextensions.pro
new file mode 100644
index 0000000..caa6092
--- /dev/null
+++ b/examples/declarative/cppextensions/cppextensions.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ imageprovider \
+ plugins \
+ proxyviewer \
+ proxywidgets \
+ qgraphicslayouts \
+ referenceexamples
+
diff --git a/examples/declarative/webview/webview.qmlproject b/examples/declarative/cppextensions/cppextensions.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/webview/webview.qmlproject
+++ b/examples/declarative/cppextensions/cppextensions.qmlproject
diff --git a/examples/declarative/imageprovider/ImageProviderCore/qmldir b/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir
index 1028590..1028590 100644
--- a/examples/declarative/imageprovider/ImageProviderCore/qmldir
+++ b/examples/declarative/cppextensions/imageprovider/ImageProviderCore/qmldir
diff --git a/examples/declarative/imageprovider/imageprovider-example.qml b/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml
index d774112..d774112 100644
--- a/examples/declarative/imageprovider/imageprovider-example.qml
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml
diff --git a/examples/declarative/imageprovider/imageprovider.cpp b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
index 4c4aa94..4c4aa94 100644
--- a/examples/declarative/imageprovider/imageprovider.cpp
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.cpp
diff --git a/examples/declarative/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index 945a301..945a301 100644
--- a/examples/declarative/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
diff --git a/examples/declarative/imageprovider/imageprovider.qmlproject b/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/imageprovider/imageprovider.qmlproject
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.qmlproject
diff --git a/examples/declarative/plugins/README b/examples/declarative/cppextensions/plugins/README
index fe519f8..fe519f8 100644
--- a/examples/declarative/plugins/README
+++ b/examples/declarative/cppextensions/plugins/README
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml
index 0048372..0048372 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/Clock.qml
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/center.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png
index 7fbd802..7fbd802 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/center.png
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/center.png
Binary files differ
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/clock.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png
index 462edac..462edac 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/clock.png
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/clock.png
Binary files differ
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/hour.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png
index f8061a1..f8061a1 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/hour.png
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/hour.png
Binary files differ
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/minute.png b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png
index 1297ec7..1297ec7 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/minute.png
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/minute.png
Binary files differ
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/qmldir b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
index e9ef115..e9ef115 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/qmldir
+++ b/examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
diff --git a/examples/declarative/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
index fb51b0c..fb51b0c 100644
--- a/examples/declarative/plugins/plugin.cpp
+++ b/examples/declarative/cppextensions/plugins/plugin.cpp
diff --git a/examples/declarative/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro
index b501ae3..b501ae3 100644
--- a/examples/declarative/plugins/plugins.pro
+++ b/examples/declarative/cppextensions/plugins/plugins.pro
diff --git a/examples/declarative/plugins/plugins.qml b/examples/declarative/cppextensions/plugins/plugins.qml
index 449cd9a..449cd9a 100644
--- a/examples/declarative/plugins/plugins.qml
+++ b/examples/declarative/cppextensions/plugins/plugins.qml
diff --git a/examples/declarative/plugins/plugins.qmlproject b/examples/declarative/cppextensions/plugins/plugins.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/plugins/plugins.qmlproject
+++ b/examples/declarative/cppextensions/plugins/plugins.qmlproject
diff --git a/examples/declarative/cppextensions/proxyviewer/main.cpp b/examples/declarative/cppextensions/proxyviewer/main.cpp
new file mode 100644
index 0000000..b82d2c9
--- /dev/null
+++ b/examples/declarative/cppextensions/proxyviewer/main.cpp
@@ -0,0 +1,109 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QNetworkAccessManager>
+#include <QNetworkProxy>
+
+#include <QDeclarativeEngine>
+#include <QDeclarativeNetworkAccessManagerFactory>
+#include <QDeclarativeView>
+
+
+/*
+ This example illustrates using a QNetworkAccessManagerFactory to
+ create a QNetworkAccessManager with a proxy.
+
+ Usage:
+ proxyviewer [-host <proxy> -port <port>] [file]
+*/
+
+static QString proxyHost;
+static int proxyPort = 0;
+
+class MyNetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
+{
+public:
+ virtual QNetworkAccessManager *create(QObject *parent);
+};
+
+QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent)
+{
+ QNetworkAccessManager *nam = new QNetworkAccessManager(parent);
+ if (!proxyHost.isEmpty()) {
+ qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort));
+ QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort);
+ nam->setProxy(proxy);
+ }
+
+ return nam;
+}
+
+int main(int argc, char ** argv)
+{
+ QUrl source("qrc:view.qml");
+
+ QApplication app(argc, argv);
+
+ for (int i = 1; i < argc; ++i) {
+ QString arg(argv[i]);
+ if (arg == "-host" && i < argc-1) {
+ proxyHost = argv[++i];
+ } else if (arg == "-port" && i < argc-1) {
+ arg = argv[++i];
+ proxyPort = arg.toInt();
+ } else if (arg[0] != '-') {
+ source = QUrl::fromLocalFile(arg);
+ } else {
+ qWarning() << "Usage: proxyviewer [-host <proxy> -port <port>] [file]";
+ exit(1);
+ }
+ }
+
+ QDeclarativeView view;
+ view.engine()->setNetworkAccessManagerFactory(new MyNetworkAccessManagerFactory);
+
+ view.setSource(source);
+ view.show();
+
+ return app.exec();
+}
+
diff --git a/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro b/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro
new file mode 100644
index 0000000..b6bfa7f
--- /dev/null
+++ b/examples/declarative/cppextensions/proxyviewer/proxyviewer.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = proxyviewer
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative network
+
+# Input
+SOURCES += main.cpp
+RESOURCES += proxyviewer.qrc
diff --git a/examples/declarative/stringlistmodel/stringlistmodel.qrc b/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc
index 17e9301..17e9301 100644
--- a/examples/declarative/stringlistmodel/stringlistmodel.qrc
+++ b/examples/declarative/cppextensions/proxyviewer/proxyviewer.qrc
diff --git a/examples/declarative/cppextensions/proxyviewer/view.qml b/examples/declarative/cppextensions/proxyviewer/view.qml
new file mode 100644
index 0000000..7f1bdef
--- /dev/null
+++ b/examples/declarative/cppextensions/proxyviewer/view.qml
@@ -0,0 +1,7 @@
+import Qt 4.7
+
+Image {
+ width: 100
+ height: 100
+ source: "http://qt.nokia.com/logo.png"
+}
diff --git a/examples/declarative/proxywidgets/ProxyWidgets/qmldir b/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir
index e55267c..e55267c 100644
--- a/examples/declarative/proxywidgets/ProxyWidgets/qmldir
+++ b/examples/declarative/cppextensions/proxywidgets/ProxyWidgets/qmldir
diff --git a/examples/declarative/proxywidgets/README b/examples/declarative/cppextensions/proxywidgets/README
index f50fa22..f50fa22 100644
--- a/examples/declarative/proxywidgets/README
+++ b/examples/declarative/cppextensions/proxywidgets/README
diff --git a/examples/declarative/proxywidgets/proxywidgets.cpp b/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp
index 067eb2c..067eb2c 100644
--- a/examples/declarative/proxywidgets/proxywidgets.cpp
+++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.cpp
diff --git a/examples/declarative/proxywidgets/proxywidgets.pro b/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro
index cb07d80..cb07d80 100644
--- a/examples/declarative/proxywidgets/proxywidgets.pro
+++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.pro
diff --git a/examples/declarative/proxywidgets/proxywidgets.qml b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml
index 46dcf99..88de37f 100644
--- a/examples/declarative/proxywidgets/proxywidgets.qml
+++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qml
@@ -63,7 +63,7 @@ Rectangle {
transitions: Transition {
ParallelAnimation {
- NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: "OutQuad" }
+ NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad }
ColorAnimation { target: window; duration: 600 }
}
}
diff --git a/examples/declarative/proxywidgets/proxywidgets.qmlproject b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/proxywidgets/proxywidgets.qmlproject
+++ b/examples/declarative/cppextensions/proxywidgets/proxywidgets.qmlproject
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro
new file mode 100644
index 0000000..e5d91b2
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicsLayouts.pro
@@ -0,0 +1,13 @@
+TEMPLATE = app
+TARGET = graphicslayouts
+QT += declarative
+
+SOURCES += \
+ graphicslayouts.cpp \
+ main.cpp
+
+HEADERS += \
+ graphicslayouts_p.h
+
+RESOURCES += \
+ graphicslayouts.qrc
diff --git a/src/imports/widgets/graphicslayouts.cpp b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp
index 25cf994..25cf994 100644
--- a/src/imports/widgets/graphicslayouts.cpp
+++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.cpp
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml
new file mode 100644
index 0000000..fcd78d5
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qml
@@ -0,0 +1,77 @@
+import Qt 4.7
+import GraphicsLayouts 4.7
+
+Item {
+ id: resizable
+
+ width: 800
+ height: 400
+
+ QGraphicsWidget {
+ size.width: parent.width/2
+ size.height: parent.height
+
+ layout: QGraphicsLinearLayout {
+ LayoutItem {
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { color: "yellow"; anchors.fill: parent }
+ }
+ LayoutItem {
+ minimumSize: "100x100"
+ maximumSize: "400x400"
+ preferredSize: "200x200"
+ Rectangle { color: "green"; anchors.fill: parent }
+ }
+ }
+ }
+ QGraphicsWidget {
+ x: parent.width/2
+ size.width: parent.width/2
+ size.height: parent.height
+
+ layout: QGraphicsGridLayout {
+ LayoutItem {
+ QGraphicsGridLayout.row: 0
+ QGraphicsGridLayout.column: 0
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { color: "red"; anchors.fill: parent }
+ }
+ LayoutItem {
+ QGraphicsGridLayout.row: 1
+ QGraphicsGridLayout.column: 0
+ minimumSize: "100x100"
+ maximumSize: "200x200"
+ preferredSize: "100x100"
+ Rectangle { color: "orange"; anchors.fill: parent }
+ }
+ LayoutItem {
+ QGraphicsGridLayout.row: 2
+ QGraphicsGridLayout.column: 0
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "200x200"
+ Rectangle { color: "yellow"; anchors.fill: parent }
+ }
+ LayoutItem {
+ QGraphicsGridLayout.row: 0
+ QGraphicsGridLayout.column: 1
+ minimumSize: "100x100"
+ maximumSize: "200x200"
+ preferredSize: "200x200"
+ Rectangle { color: "green"; anchors.fill: parent }
+ }
+ LayoutItem {
+ QGraphicsGridLayout.row: 1
+ QGraphicsGridLayout.column: 1
+ minimumSize: "100x100"
+ maximumSize: "400x400"
+ preferredSize: "200x200"
+ Rectangle { color: "blue"; anchors.fill: parent }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc
new file mode 100644
index 0000000..a199f8d
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>graphicslayouts.qml</file>
+</qresource>
+</RCC>
diff --git a/src/imports/widgets/graphicslayouts_p.h b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h
index ea9c614..ea9c614 100644
--- a/src/imports/widgets/graphicslayouts_p.h
+++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/graphicslayouts_p.h
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp
new file mode 100644
index 0000000..89b69bf
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/graphicsLayouts/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QtDeclarative/qdeclarative.h>
+#include "graphicslayouts_p.h"
+#include <QtDeclarative/QDeclarativeView>
+
+int main(int argc, char* argv[])
+{
+ QApplication app(argc, argv);
+ QDeclarativeView view;
+ qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem");
+ qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout");
+ qmlRegisterType<QGraphicsLinearLayoutStretchItemObject>("GraphicsLayouts",4,7,"QGraphicsLinearLayoutStretchItem");
+ qmlRegisterType<QGraphicsLinearLayoutObject>("GraphicsLayouts",4,7,"QGraphicsLinearLayout");
+ qmlRegisterType<QGraphicsGridLayoutObject>("GraphicsLayouts",4,7,"QGraphicsGridLayout");
+ view.setSource(QUrl(":graphicslayouts.qml"));
+ view.show();
+ return app.exec();
+};
+
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro
new file mode 100644
index 0000000..4a3fc73
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.pro
@@ -0,0 +1,13 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Tue May 4 13:36:26 2010
+######################################################################
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative
+
+# Input
+SOURCES += main.cpp
+RESOURCES += layoutItem.qrc
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml
new file mode 100644
index 0000000..460c564
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qml
@@ -0,0 +1,15 @@
+import Qt 4.7
+
+LayoutItem {//Sized by the layout
+ id: resizable
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "100x100"
+ Rectangle { color: "yellow"; anchors.fill: parent }
+ Rectangle {
+ width: 100; height: 100;
+ anchors.top: parent.top;
+ anchors.right: parent.right;
+ color: "green";
+ }
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc
new file mode 100644
index 0000000..deb0fba
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/layoutItem.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>layoutItem.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp
new file mode 100644
index 0000000..a104251
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/layoutItem/main.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QGraphicsView>
+#include <QGraphicsScene>
+#include <QGraphicsWidget>
+#include <QGraphicsLinearLayout>
+#include <QDeclarativeComponent>
+#include <QDeclarativeEngine>
+
+/* This example demonstrates using a LayoutItem to let QML snippets integrate
+ nicely with existing QGraphicsView applications designed with GraphicsLayouts
+*/
+int main(int argc, char* argv[])
+{
+ QApplication app(argc, argv);
+ //Set up a graphics scene with a QGraphicsWidget and Layout
+ QGraphicsView view;
+ QGraphicsScene scene;
+ QGraphicsWidget *widget = new QGraphicsWidget();
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
+ widget->setLayout(layout);
+ scene.addItem(widget);
+ view.setScene(&scene);
+ //Add the QML snippet into the layout
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl(":layoutItem.qml"));
+ QGraphicsLayoutItem* obj = qobject_cast<QGraphicsLayoutItem*>(c.create());
+ layout->addItem(obj);
+
+ widget->setGeometry(QRectF(0,0, 400,400));
+ view.show();
+ return app.exec();
+}
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro
new file mode 100644
index 0000000..d92a6f4
--- /dev/null
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ graphicsLayouts \
+ layoutItem
diff --git a/examples/declarative/velocity/velocity.qmlproject b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/velocity/velocity.qmlproject
+++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslayouts.qmlproject
diff --git a/examples/declarative/extending/adding/adding.pro b/examples/declarative/cppextensions/referenceexamples/adding/adding.pro
index 6072de4..6072de4 100644
--- a/examples/declarative/extending/adding/adding.pro
+++ b/examples/declarative/cppextensions/referenceexamples/adding/adding.pro
diff --git a/examples/declarative/extending/adding/adding.qrc b/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/adding/adding.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/adding/adding.qrc
diff --git a/examples/declarative/extending/adding/example.qml b/examples/declarative/cppextensions/referenceexamples/adding/example.qml
index dc891e7..dc891e7 100644
--- a/examples/declarative/extending/adding/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/adding/example.qml
diff --git a/examples/declarative/extending/adding/main.cpp b/examples/declarative/cppextensions/referenceexamples/adding/main.cpp
index 7b33895..7b33895 100644
--- a/examples/declarative/extending/adding/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/adding/main.cpp
diff --git a/examples/declarative/extending/adding/person.cpp b/examples/declarative/cppextensions/referenceexamples/adding/person.cpp
index cdf08e0..cdf08e0 100644
--- a/examples/declarative/extending/adding/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/adding/person.cpp
diff --git a/examples/declarative/extending/adding/person.h b/examples/declarative/cppextensions/referenceexamples/adding/person.h
index d6de9a9..d6de9a9 100644
--- a/examples/declarative/extending/adding/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/adding/person.h
diff --git a/examples/declarative/extending/attached/attached.pro b/examples/declarative/cppextensions/referenceexamples/attached/attached.pro
index f6d76ed..f6d76ed 100644
--- a/examples/declarative/extending/attached/attached.pro
+++ b/examples/declarative/cppextensions/referenceexamples/attached/attached.pro
diff --git a/examples/declarative/extending/attached/attached.qrc b/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/attached/attached.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/attached/attached.qrc
diff --git a/examples/declarative/extending/attached/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp
index 7fa1748..7fa1748 100644
--- a/examples/declarative/extending/attached/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.cpp
diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h
index 1c66f8c..1c66f8c 100644
--- a/examples/declarative/extending/attached/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h
diff --git a/examples/declarative/extending/attached/example.qml b/examples/declarative/cppextensions/referenceexamples/attached/example.qml
index 50f0a32..50f0a32 100644
--- a/examples/declarative/extending/attached/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/attached/example.qml
diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/cppextensions/referenceexamples/attached/main.cpp
index f1055ae..f1055ae 100644
--- a/examples/declarative/extending/attached/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/attached/main.cpp
diff --git a/examples/declarative/extending/valuesource/person.cpp b/examples/declarative/cppextensions/referenceexamples/attached/person.cpp
index 0a9e508..0a9e508 100644
--- a/examples/declarative/extending/valuesource/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/attached/person.cpp
diff --git a/examples/declarative/extending/valuesource/person.h b/examples/declarative/cppextensions/referenceexamples/attached/person.h
index 2f444c5..2f444c5 100644
--- a/examples/declarative/extending/valuesource/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/attached/person.h
diff --git a/examples/declarative/extending/binding/binding.pro b/examples/declarative/cppextensions/referenceexamples/binding/binding.pro
index 896ce25..896ce25 100644
--- a/examples/declarative/extending/binding/binding.pro
+++ b/examples/declarative/cppextensions/referenceexamples/binding/binding.pro
diff --git a/examples/declarative/extending/binding/binding.qrc b/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/binding/binding.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/binding/binding.qrc
diff --git a/examples/declarative/extending/binding/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp
index 000bb1f..000bb1f 100644
--- a/examples/declarative/extending/binding/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.cpp
diff --git a/examples/declarative/extending/binding/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h
index c3f033e..c3f033e 100644
--- a/examples/declarative/extending/binding/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h
diff --git a/examples/declarative/extending/binding/example.qml b/examples/declarative/cppextensions/referenceexamples/binding/example.qml
index 82eb3be..82eb3be 100644
--- a/examples/declarative/extending/binding/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/binding/example.qml
diff --git a/examples/declarative/extending/binding/happybirthdaysong.cpp b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp
index a40e7fb..a40e7fb 100644
--- a/examples/declarative/extending/binding/happybirthdaysong.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.cpp
diff --git a/examples/declarative/extending/binding/happybirthdaysong.h b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h
index e825b86..e825b86 100644
--- a/examples/declarative/extending/binding/happybirthdaysong.h
+++ b/examples/declarative/cppextensions/referenceexamples/binding/happybirthdaysong.h
diff --git a/examples/declarative/extending/binding/main.cpp b/examples/declarative/cppextensions/referenceexamples/binding/main.cpp
index 2495676..2495676 100644
--- a/examples/declarative/extending/binding/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/binding/main.cpp
diff --git a/examples/declarative/extending/binding/person.cpp b/examples/declarative/cppextensions/referenceexamples/binding/person.cpp
index 9a2248f..9a2248f 100644
--- a/examples/declarative/extending/binding/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/binding/person.cpp
diff --git a/examples/declarative/extending/binding/person.h b/examples/declarative/cppextensions/referenceexamples/binding/person.h
index 2a68da0..2a68da0 100644
--- a/examples/declarative/extending/binding/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/binding/person.h
diff --git a/examples/declarative/extending/grouped/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp
index 4f415a3..4f415a3 100644
--- a/examples/declarative/extending/grouped/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.cpp
diff --git a/examples/declarative/extending/coercion/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h
index ee77e9a..ee77e9a 100644
--- a/examples/declarative/extending/coercion/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/birthdayparty.h
diff --git a/examples/declarative/extending/coercion/coercion.pro b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro
index c8daed8..c8daed8 100644
--- a/examples/declarative/extending/coercion/coercion.pro
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.pro
diff --git a/examples/declarative/extending/coercion/coercion.qrc b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/coercion/coercion.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/coercion.qrc
diff --git a/examples/declarative/extending/coercion/example.qml b/examples/declarative/cppextensions/referenceexamples/coercion/example.qml
index 7b45950..7b45950 100644
--- a/examples/declarative/extending/coercion/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/example.qml
diff --git a/examples/declarative/extending/coercion/main.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp
index 2c7b545..2c7b545 100644
--- a/examples/declarative/extending/coercion/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/main.cpp
diff --git a/examples/declarative/extending/coercion/person.cpp b/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp
index 5b5203a..5b5203a 100644
--- a/examples/declarative/extending/coercion/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/person.cpp
diff --git a/examples/declarative/extending/coercion/person.h b/examples/declarative/cppextensions/referenceexamples/coercion/person.h
index 1c95da7..1c95da7 100644
--- a/examples/declarative/extending/coercion/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/coercion/person.h
diff --git a/examples/declarative/extending/default/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp
index 4f415a3..4f415a3 100644
--- a/examples/declarative/extending/default/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.cpp
diff --git a/examples/declarative/extending/default/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h
index 9741040..9741040 100644
--- a/examples/declarative/extending/default/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/default/birthdayparty.h
diff --git a/examples/declarative/extending/default/default.pro b/examples/declarative/cppextensions/referenceexamples/default/default.pro
index 32aff0b..32aff0b 100644
--- a/examples/declarative/extending/default/default.pro
+++ b/examples/declarative/cppextensions/referenceexamples/default/default.pro
diff --git a/examples/declarative/extending/default/default.qrc b/examples/declarative/cppextensions/referenceexamples/default/default.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/default/default.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/default/default.qrc
diff --git a/examples/declarative/extending/default/example.qml b/examples/declarative/cppextensions/referenceexamples/default/example.qml
index c0f3cbb..c0f3cbb 100644
--- a/examples/declarative/extending/default/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/default/example.qml
diff --git a/examples/declarative/extending/default/main.cpp b/examples/declarative/cppextensions/referenceexamples/default/main.cpp
index 2ffd180..2ffd180 100644
--- a/examples/declarative/extending/default/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/default/main.cpp
diff --git a/examples/declarative/extending/default/person.cpp b/examples/declarative/cppextensions/referenceexamples/default/person.cpp
index 69216d3..69216d3 100644
--- a/examples/declarative/extending/default/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/default/person.cpp
diff --git a/examples/declarative/extending/default/person.h b/examples/declarative/cppextensions/referenceexamples/default/person.h
index 3e56860..3e56860 100644
--- a/examples/declarative/extending/default/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/default/person.h
diff --git a/examples/declarative/extending/extended/example.qml b/examples/declarative/cppextensions/referenceexamples/extended/example.qml
index 985ce20..985ce20 100644
--- a/examples/declarative/extending/extended/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/extended/example.qml
diff --git a/examples/declarative/extending/extended/extended.pro b/examples/declarative/cppextensions/referenceexamples/extended/extended.pro
index 97af286..97af286 100644
--- a/examples/declarative/extending/extended/extended.pro
+++ b/examples/declarative/cppextensions/referenceexamples/extended/extended.pro
diff --git a/examples/declarative/extending/extended/extended.qrc b/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/extended/extended.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/extended/extended.qrc
diff --git a/examples/declarative/extending/extended/lineedit.cpp b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp
index 0e521ec..0e521ec 100644
--- a/examples/declarative/extending/extended/lineedit.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.cpp
diff --git a/examples/declarative/extending/extended/lineedit.h b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h
index 3a464b0..3a464b0 100644
--- a/examples/declarative/extending/extended/lineedit.h
+++ b/examples/declarative/cppextensions/referenceexamples/extended/lineedit.h
diff --git a/examples/declarative/extending/extended/main.cpp b/examples/declarative/cppextensions/referenceexamples/extended/main.cpp
index ca7242d..ca7242d 100644
--- a/examples/declarative/extending/extended/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/extended/main.cpp
diff --git a/examples/declarative/extending/coercion/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp
index 4f415a3..4f415a3 100644
--- a/examples/declarative/extending/coercion/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.cpp
diff --git a/examples/declarative/extending/grouped/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h
index 31d21b2..31d21b2 100644
--- a/examples/declarative/extending/grouped/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/birthdayparty.h
diff --git a/examples/declarative/extending/grouped/example.qml b/examples/declarative/cppextensions/referenceexamples/grouped/example.qml
index 91b7a06..91b7a06 100644
--- a/examples/declarative/extending/grouped/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/example.qml
diff --git a/examples/declarative/extending/grouped/grouped.pro b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro
index 576e1d2..576e1d2 100644
--- a/examples/declarative/extending/grouped/grouped.pro
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.pro
diff --git a/examples/declarative/extending/grouped/grouped.qrc b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/grouped/grouped.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/grouped.qrc
diff --git a/examples/declarative/extending/grouped/main.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp
index baf32cf..baf32cf 100644
--- a/examples/declarative/extending/grouped/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/main.cpp
diff --git a/examples/declarative/extending/signal/person.cpp b/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp
index 0a9e508..0a9e508 100644
--- a/examples/declarative/extending/signal/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/person.cpp
diff --git a/examples/declarative/extending/grouped/person.h b/examples/declarative/cppextensions/referenceexamples/grouped/person.h
index a031e69..a031e69 100644
--- a/examples/declarative/extending/grouped/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/grouped/person.h
diff --git a/examples/declarative/extending/properties/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp
index 27d17a1..27d17a1 100644
--- a/examples/declarative/extending/properties/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.cpp
diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h
index 39ce9ba..39ce9ba 100644
--- a/examples/declarative/extending/properties/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h
diff --git a/examples/declarative/extending/properties/example.qml b/examples/declarative/cppextensions/referenceexamples/properties/example.qml
index 35abdd6..35abdd6 100644
--- a/examples/declarative/extending/properties/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/properties/example.qml
diff --git a/examples/declarative/extending/properties/main.cpp b/examples/declarative/cppextensions/referenceexamples/properties/main.cpp
index 85e9584..85e9584 100644
--- a/examples/declarative/extending/properties/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/properties/main.cpp
diff --git a/examples/declarative/extending/properties/person.cpp b/examples/declarative/cppextensions/referenceexamples/properties/person.cpp
index 92c54f5..92c54f5 100644
--- a/examples/declarative/extending/properties/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/properties/person.cpp
diff --git a/examples/declarative/extending/properties/person.h b/examples/declarative/cppextensions/referenceexamples/properties/person.h
index 0029b09..0029b09 100644
--- a/examples/declarative/extending/properties/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/properties/person.h
diff --git a/examples/declarative/extending/properties/properties.pro b/examples/declarative/cppextensions/referenceexamples/properties/properties.pro
index a8f4301..a8f4301 100644
--- a/examples/declarative/extending/properties/properties.pro
+++ b/examples/declarative/cppextensions/referenceexamples/properties/properties.pro
diff --git a/examples/declarative/extending/properties/properties.qrc b/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/properties/properties.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/properties/properties.qrc
diff --git a/examples/declarative/extending/extending.pro b/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro
index 169c7ab..169c7ab 100644
--- a/examples/declarative/extending/extending.pro
+++ b/examples/declarative/cppextensions/referenceexamples/referenceexamples.pro
diff --git a/examples/declarative/tvtennis/tvtennis.qmlproject b/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/tvtennis/tvtennis.qmlproject
+++ b/examples/declarative/cppextensions/referenceexamples/referenceexamples.qmlproject
diff --git a/examples/declarative/extending/signal/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp
index 740c8c9..740c8c9 100644
--- a/examples/declarative/extending/signal/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.cpp
diff --git a/examples/declarative/extending/signal/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h
index ae4dd39..ae4dd39 100644
--- a/examples/declarative/extending/signal/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h
diff --git a/examples/declarative/extending/signal/example.qml b/examples/declarative/cppextensions/referenceexamples/signal/example.qml
index 83d6a23..83d6a23 100644
--- a/examples/declarative/extending/signal/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/signal/example.qml
diff --git a/examples/declarative/extending/signal/main.cpp b/examples/declarative/cppextensions/referenceexamples/signal/main.cpp
index 453f688..453f688 100644
--- a/examples/declarative/extending/signal/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/signal/main.cpp
diff --git a/examples/declarative/extending/grouped/person.cpp b/examples/declarative/cppextensions/referenceexamples/signal/person.cpp
index 0a9e508..0a9e508 100644
--- a/examples/declarative/extending/grouped/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/signal/person.cpp
diff --git a/examples/declarative/extending/signal/person.h b/examples/declarative/cppextensions/referenceexamples/signal/person.h
index 2f444c5..2f444c5 100644
--- a/examples/declarative/extending/signal/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/signal/person.h
diff --git a/examples/declarative/extending/signal/signal.pro b/examples/declarative/cppextensions/referenceexamples/signal/signal.pro
index 6367a38..6367a38 100644
--- a/examples/declarative/extending/signal/signal.pro
+++ b/examples/declarative/cppextensions/referenceexamples/signal/signal.pro
diff --git a/examples/declarative/extending/signal/signal.qrc b/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/signal/signal.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/signal/signal.qrc
diff --git a/examples/declarative/extending/valuesource/birthdayparty.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp
index b915f4f..b915f4f 100644
--- a/examples/declarative/extending/valuesource/birthdayparty.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.cpp
diff --git a/examples/declarative/extending/valuesource/birthdayparty.h b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h
index 5f25781..5f25781 100644
--- a/examples/declarative/extending/valuesource/birthdayparty.h
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h
diff --git a/examples/declarative/extending/valuesource/example.qml b/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml
index 5b8c8af..5b8c8af 100644
--- a/examples/declarative/extending/valuesource/example.qml
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/example.qml
diff --git a/examples/declarative/extending/valuesource/happybirthdaysong.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp
index 8ea5c2b..8ea5c2b 100644
--- a/examples/declarative/extending/valuesource/happybirthdaysong.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.cpp
diff --git a/examples/declarative/extending/valuesource/happybirthdaysong.h b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h
index 3d07909..3d07909 100644
--- a/examples/declarative/extending/valuesource/happybirthdaysong.h
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h
diff --git a/examples/declarative/extending/valuesource/main.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp
index 00840ee..00840ee 100644
--- a/examples/declarative/extending/valuesource/main.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/main.cpp
diff --git a/examples/declarative/extending/attached/person.cpp b/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp
index 0a9e508..0a9e508 100644
--- a/examples/declarative/extending/attached/person.cpp
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/person.cpp
diff --git a/examples/declarative/extending/attached/person.h b/examples/declarative/cppextensions/referenceexamples/valuesource/person.h
index 2f444c5..2f444c5 100644
--- a/examples/declarative/extending/attached/person.h
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/person.h
diff --git a/examples/declarative/extending/valuesource/valuesource.pro b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro
index 0626c98..0626c98 100644
--- a/examples/declarative/extending/valuesource/valuesource.pro
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.pro
diff --git a/examples/declarative/extending/valuesource/valuesource.qrc b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc
index e2fa01d..e2fa01d 100644
--- a/examples/declarative/extending/valuesource/valuesource.qrc
+++ b/examples/declarative/cppextensions/referenceexamples/valuesource/valuesource.qrc
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
index e37c3d4..e3d922c 100644
--- a/examples/declarative/declarative.pro
+++ b/examples/declarative/declarative.pro
@@ -2,51 +2,28 @@ TEMPLATE = subdirs
# These examples contain some C++ and need to be built
SUBDIRS = \
- extending \
- imageprovider \
- objectlistmodel \
- stringlistmodel \
- plugins \
- proxywidgets
+ cppextensions \
+ modelviews \
+ tutorials
# plugins uses a 'Time' class that conflicts with symbian e32std.h also defining a class of the same name
symbian:SUBDIRS -= plugins
# These examples contain no C++ and can simply be copied
sources.files = \
- animations \
- aspectratio \
- behaviors \
- border-image \
- clocks \
- connections \
- dial \
- dynamic \
- effects \
- fillmode \
- focus \
- fonts \
- gridview \
- layouts \
- listview \
- mousearea \
- package \
- parallax \
- progressbar \
- scrollbar \
- searchbox \
- slideswitch \
- sql \
- states \
- tabwidget \
- tic-tac-toe \
- tutorials \
- tvtennis \
- velocity \
- webview \
- workerlistmodel \
- workerscript \
- xmldata \
- xmlhttprequest
+ animation \
+ cppextensions \
+ i18n \
+ imageelements \
+ keyinteraction \
+ positioners \
+ sqllocalstorage \
+ text \
+ threading \
+ touchinteraction \
+ toys \
+ ui-components \
+ xml
+
sources.path = $$[QT_INSTALL_EXAMPLES]/declarative
INSTALLS += sources
diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml
deleted file mode 100644
index 0e6e197..0000000
--- a/examples/declarative/dynamic/dynamic.qml
+++ /dev/null
@@ -1,157 +0,0 @@
-import Qt 4.7
-import Qt.labs.particles 1.0
-import "qml"
-
-Item {
- id: window
- //This is a desktop-sized example
- width: 1024; height: 512
- property int activeSuns: 0
-
- //This is the message that pops up when there's an error
- Rectangle{
- id: dialog
- opacity: 0
- anchors.centerIn: parent
- width: dialogText.width + 6
- height: dialogText.height + 6
- border.color: 'black'
- color: 'lightsteelblue'
- z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones.
- function show(str){
- dialogText.text = str;
- dialogAnim.start();
- }
- Text{
- id: dialogText
- x:3
- y:3
- font.pixelSize: 14
- }
- SequentialAnimation{
- id: dialogAnim
- NumberAnimation{target: dialog; property:"opacity"; to: 1; duration: 1000}
- PauseAnimation{duration: 5000}
- NumberAnimation{target: dialog; property:"opacity"; to: 0; duration: 1000}
- }
- }
-
- // sky
- Rectangle { id: sky
- anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter }
- gradient: Gradient {
- GradientStop { id: stopA; position: 0.0; color: "#0E1533" }
- GradientStop { id: stopB; position: 1.0; color: "#437284" }
- }
- }
-
- // stars (when there's no sun)
- Particles {
- id: stars
- x: 0; y: 0; width: parent.width; height: parent.height / 2
- source: "images/star.png"; angleDeviation: 360; velocity: 0
- velocityDeviation: 0; count: parent.width / 10; fadeInDuration: 2800
- opacity: 1
- }
-
- // ground, which has a z such that the sun can set behind it
- Rectangle {
- id: ground
- z: 2
- anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.right; bottom: parent.bottom }
- gradient: Gradient {
- GradientStop { position: 0.0; color: "ForestGreen" }
- GradientStop { position: 1.0; color: "DarkGreen" }
- }
- }
-
- //Day state, for when you place a sun
- states: State {
- name: "Day"; when: window.activeSuns > 0
- PropertyChanges { target: stopA; color: "DeepSkyBlue"}
- PropertyChanges { target: stopB; color: "SkyBlue"}
- PropertyChanges { target: stars; opacity: 0 }
- }
-
- transitions: Transition {
- PropertyAnimation { duration: 3000 }
- ColorAnimation { duration: 3000 }
- }
-
- SystemPalette { id: activePalette }
-
- // toolbox
- Rectangle {
- id: toolbox
- z: 3 //Above ground
- color: activePalette.window;
- width: 480
- anchors { right: parent.right; top:parent.top; bottom: parent.bottom }
- Rectangle { //Not a child of any positioner
- border.color: "black";
- width: toolRow.width + 4
- height: toolRow.height + 4
- x: toolboxPositioner.x + toolRow.x - 2
- y: toolboxPositioner.y + toolRow.y - 2
- }
- Column {
- id: toolboxPositioner
- anchors.centerIn: parent
- spacing: 8
- Text { text: "Drag an item into the scene." }
- Row {
- id: toolRow
- spacing: 8;
- PaletteItem {
- anchors.verticalCenter: parent.verticalCenter
- file: "Sun.qml";
- image: "../images/sun.png"
- }
- PaletteItem {
- file: "GenericItem.qml"
- image: "../images/moon.png"
- }
- PaletteItem {
- anchors.verticalCenter: parent.verticalCenter
- file: "PerspectiveItem.qml"
- image: "../images/tree_s.png"
- }
- PaletteItem {
- anchors.verticalCenter: parent.verticalCenter
- file: "PerspectiveItem.qml"
- image: "../images/rabbit_brown.png"
- }
- PaletteItem {
- anchors.verticalCenter: parent.verticalCenter
- file: "PerspectiveItem.qml"
- image: "../images/rabbit_bw.png"
- }
- }
- Text { text: "Active Suns: " + activeSuns }
- Rectangle { width: 440; height: 1; color: "black" }
- Text { text: "Arbitrary QML: " }
- TextEdit {
- id: qmlText
- width: 460
- height: 220
- readOnly: false
- focusOnPress: true
- font.pixelSize: 14
-
- text: "import Qt 4.7\nImage {\n id: smile;\n x: 500*Math.random();\n y: 200*Math.random(); \n source: 'images/face-smile.png';\n NumberAnimation on opacity { \n to: 0; duration: 1500;\n }\n Component.onCompleted: smile.destroy(1500);\n}"
- }
- Button {
- text: "Create"
- function makeCustom() {
- try{
- Qt.createQmlObject(qmlText.text, window, 'CustomObject');
- }catch(err){
- dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message );
- }
- }
- onClicked: makeCustom();
- }
- }
- }
-
-}
diff --git a/examples/declarative/dynamic/qml/Button.qml b/examples/declarative/dynamic/qml/Button.qml
deleted file mode 100644
index 53588bb..0000000
--- a/examples/declarative/dynamic/qml/Button.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- id: container
-
- property variant text
- signal clicked
-
- SystemPalette { id: activePalette }
- height: text.height + 10
- width: text.width + 20
- border.width: 1
- radius: 4; smooth: true
- gradient: Gradient {
- GradientStop { position: 0.0;
- color: if(!mr.pressed){activePalette.light;}else{activePalette.button;}
- }
- GradientStop { position: 1.0;
- color: if(!mr.pressed){activePalette.button;}else{activePalette.dark;}
- }
- }
- MouseArea { id:mr; anchors.fill: parent; onClicked: container.clicked() }
- Text { id: text; anchors.centerIn:parent; font.pointSize: 10; text: parent.text; color: activePalette.buttonText }
-}
diff --git a/examples/declarative/dynamic/qml/GenericItem.qml b/examples/declarative/dynamic/qml/GenericItem.qml
deleted file mode 100644
index faac06d..0000000
--- a/examples/declarative/dynamic/qml/GenericItem.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import Qt 4.7
-
-Item{
- property bool created: false
- property string image
- width: imageItem.width
- height: imageItem.height
- z: 2
- Image{
- id: imageItem
- source: image;
- }
-}
diff --git a/examples/declarative/dynamic/qml/PaletteItem.qml b/examples/declarative/dynamic/qml/PaletteItem.qml
deleted file mode 100644
index e8f2ed4..0000000
--- a/examples/declarative/dynamic/qml/PaletteItem.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import Qt 4.7
-import "itemCreation.js" as Code
-
-GenericItem {
- id: itemButton
- property string file
- MouseArea {
- anchors.fill: parent;
- onPressed: Code.startDrag(mouse);
- onPositionChanged: Code.moveDrag(mouse);
- onReleased: Code.endDrag(mouse);
- }
-}
diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml
deleted file mode 100644
index 3cbe64a..0000000
--- a/examples/declarative/dynamic/qml/PerspectiveItem.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import Qt 4.7
-
-Image {
- id: tree
- property bool created: false
- property double scaleFactor: Math.max((y+height-250)*0.01, 0.3)
- property double scaledBottom: y + (height+height*scaleFactor)/2
- property bool onLand: scaledBottom > window.height/2
- property string image //Needed for compatibility with GenericItem
- opacity: onLand ? 1 : 0.25
- onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom }
- scale: scaleFactor
- transformOrigin: "Center"
- source: image; smooth: true
- onYChanged: z = scaledBottom
-}
diff --git a/examples/declarative/dynamic/qml/Sun.qml b/examples/declarative/dynamic/qml/Sun.qml
deleted file mode 100644
index 3627964..0000000
--- a/examples/declarative/dynamic/qml/Sun.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-import Qt 4.7
-
-Image {
- id: sun
- property bool created: false
- property string image: "../images/sun.png"
- onCreatedChanged: if(created){window.activeSuns++;}else{window.activeSuns--;}
-
- source: image;
- z: 1
-
- //x and y get set when instantiated
- //head offscreen
- NumberAnimation on y {
- to: window.height / 2;
- running: created
- onRunningChanged: if (running) duration = (window.height - sun.y) * 10; else state = "OffScreen";
- }
-
- states: State {
- name: "OffScreen";
- StateChangeScript { script: { sun.created = false; sun.destroy() } }
- }
-}
diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js
deleted file mode 100644
index 98d48a8..0000000
--- a/examples/declarative/dynamic/qml/itemCreation.js
+++ /dev/null
@@ -1,82 +0,0 @@
-var itemComponent = null;
-var draggedItem = null;
-var startingMouse;
-var startingZ;
-//Until QT-2385 is resolved we need to convert to scene coordinates manually
-var xOffset;
-var yOffset;
-function setSceneOffset()
-{
- xOffset = 0;
- yOffset = 0;
- var p = itemButton;
- while(p != window){
- xOffset += p.x;
- yOffset += p.y;
- p = p.parent;
- }
-}
-
-function startDrag(mouse)
-{
- setSceneOffset();
- startingMouse = { x: mouse.x, y: mouse.y }
- loadComponent();
-}
-
-//Creation is split into two functions due to an asyncronous wait while
-//possible external files are loaded.
-
-function loadComponent() {
- if (itemComponent != null) //Already loaded the component
- createItem();
-
- itemComponent = Qt.createComponent(itemButton.file);
- //console.log(itemButton.file)
- if(itemComponent.isLoading){
- component.statusChanged.connect(finishCreation);
- }else{//Depending on the content, it can be ready or error immediately
- createItem();
- }
-}
-
-function createItem() {
- if (itemComponent.isReady && draggedItem == null) {
- draggedItem = itemComponent.createObject();
- draggedItem.parent = window;
- draggedItem.image = itemButton.image;
- draggedItem.x = xOffset;
- draggedItem.y = yOffset;
- startingZ = draggedItem.z;
- draggedItem.z = 4;//On top
- } else if (itemComponent.isError) {
- draggedItem = null;
- console.log("error creating component");
- console.log(component.errorsString());
- }
-}
-
-function moveDrag(mouse)
-{
- if(draggedItem == null)
- return;
-
- draggedItem.x = mouse.x + xOffset - startingMouse.x;
- draggedItem.y = mouse.y + yOffset - startingMouse.y;
-}
-
-function endDrag(mouse)
-{
- if(draggedItem == null)
- return;
-
- if(draggedItem.x + draggedItem.width > toolbox.x){ //Don't drop it in the toolbox
- draggedItem.destroy();
- draggedItem = null;
- }else{
- draggedItem.z = startingZ;
- draggedItem.created = true;
- draggedItem = null;
- }
-}
-
diff --git a/examples/declarative/fillmode/content/QtLogo.qml b/examples/declarative/fillmode/content/QtLogo.qml
deleted file mode 100644
index 6dd714d..0000000
--- a/examples/declarative/fillmode/content/QtLogo.qml
+++ /dev/null
@@ -1,30 +0,0 @@
-import Qt 4.7
-
-Item {
- id: qtLogo
-
- property alias fillMode: image.fillMode
- property alias label: labelText.text
-
- width: ((window.width - 20) - ((grid.columns - 1) * grid.spacing)) / grid.columns
- height: ((window.height - 20) - ((grid.rows - 1) * grid.spacing)) / grid.rows
-
- Column {
- anchors.fill: parent
-
- Rectangle {
- height: qtLogo.height - 30; width: qtLogo.width
- border.color: "black"; clip: true
-
- Image {
- id: image
- anchors.fill: parent; smooth: true; source: "qt-logo.png"
- }
- }
-
- Text {
- id: labelText; anchors.horizontalCenter: parent.horizontalCenter
- height: 30; verticalAlignment: Text.AlignVCenter
- }
- }
-}
diff --git a/examples/declarative/fillmode/content/qt-logo.png b/examples/declarative/fillmode/content/qt-logo.png
deleted file mode 100644
index 14ddf2a..0000000
--- a/examples/declarative/fillmode/content/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/fillmode/fillmode.qml b/examples/declarative/fillmode/fillmode.qml
deleted file mode 100644
index e5b0336..0000000
--- a/examples/declarative/fillmode/fillmode.qml
+++ /dev/null
@@ -1,22 +0,0 @@
-import Qt 4.7
-import "content"
-
-Rectangle {
- id: window
-
- width: 800; height: 480
- color: "#cdcdcd"
-
- Grid {
- id: grid
- anchors { fill: parent; topMargin: 10; leftMargin: 10; rightMargin: 10; bottomMargin: 10 }
- columns: 3; rows: 2; spacing: 20
-
- QtLogo { fillMode: Image.Stretch; label: "Stretch" }
- QtLogo { fillMode: Image.PreserveAspectFit; label: "PreserveAspectFit" }
- QtLogo { fillMode: Image.PreserveAspectCrop; label: "PreserveAspectCrop" }
- QtLogo { fillMode: Image.Tile; label: "Tile" }
- QtLogo { fillMode: Image.TileHorizontally; label: "TileHorizontally" }
- QtLogo { fillMode: Image.TileVertically; label: "TileVertically" }
- }
-}
diff --git a/examples/declarative/i18n/i18n.qml b/examples/declarative/i18n/i18n.qml
new file mode 100644
index 0000000..c3030b2
--- /dev/null
+++ b/examples/declarative/i18n/i18n.qml
@@ -0,0 +1,37 @@
+import Qt 4.7
+
+//
+// The QML runtime automatically loads a translation from the i18n subdirectory of the root
+// QML file, based on the system language.
+//
+// The files are created/updated by running:
+//
+// lupdate i18n.qml -ts i18n/base.ts
+//
+// Translations for new languages are created by copying i18n/base.ts to i18n/qml_<lang>.ts
+// The .ts files can then be edited with Linguist:
+//
+// linguist i18n/qml_fr.ts
+//
+// The run-time translation files are then generaeted by running:
+//
+// lrelease i18n/*.ts
+//
+
+Rectangle {
+ width: 640; height: 480
+
+ Column {
+ anchors.fill: parent; spacing: 20
+
+ Text {
+ text: "If a translation is available for the system language (eg. French) then the string below will translated (eg. 'Bonjour'). Otherwise is will show 'Hello'."
+ width: parent.width; wrapMode: Text.WordWrap
+ }
+
+ Text {
+ text: qsTr("Hello")
+ font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+}
diff --git a/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject b/examples/declarative/i18n/i18n.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject
+++ b/examples/declarative/i18n/i18n.qmlproject
diff --git a/examples/declarative/i18n/i18n/base.ts b/examples/declarative/i18n/i18n/base.ts
new file mode 100644
index 0000000..82547a1
--- /dev/null
+++ b/examples/declarative/i18n/i18n/base.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" sourcelanguage="en">
+<context>
+ <name>i18n</name>
+ <message>
+ <location filename="../i18n.qml" line="30"/>
+ <source>Hello</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/i18n/i18n/qml_en_AU.qm b/examples/declarative/i18n/i18n/qml_en_AU.qm
new file mode 100644
index 0000000..fb8b710
--- /dev/null
+++ b/examples/declarative/i18n/i18n/qml_en_AU.qm
Binary files differ
diff --git a/examples/declarative/i18n/i18n/qml_en_AU.ts b/examples/declarative/i18n/i18n/qml_en_AU.ts
new file mode 100644
index 0000000..e991aff
--- /dev/null
+++ b/examples/declarative/i18n/i18n/qml_en_AU.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_AU" sourcelanguage="en">
+<context>
+ <name>i18n</name>
+ <message>
+ <location filename="../i18n.qml" line="30"/>
+ <source>Hello</source>
+ <translation>G&apos;day</translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/i18n/i18n/qml_fr.qm b/examples/declarative/i18n/i18n/qml_fr.qm
new file mode 100644
index 0000000..583562e
--- /dev/null
+++ b/examples/declarative/i18n/i18n/qml_fr.qm
Binary files differ
diff --git a/examples/declarative/i18n/i18n/qml_fr.ts b/examples/declarative/i18n/i18n/qml_fr.ts
new file mode 100644
index 0000000..365abd9
--- /dev/null
+++ b/examples/declarative/i18n/i18n/qml_fr.ts
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr" sourcelanguage="en">
+<context>
+ <name>i18n</name>
+ <message>
+ <location filename="../i18n.qml" line="30"/>
+ <source>Hello</source>
+ <translation>Bonjour</translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/declarative/imageelements/borderimage/borderimage.qml b/examples/declarative/imageelements/borderimage/borderimage.qml
new file mode 100644
index 0000000..c334cea
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/borderimage.qml
@@ -0,0 +1,57 @@
+import Qt 4.7
+import "content"
+
+Rectangle {
+ id: page
+ width: 1030; height: 540
+
+ Grid {
+ anchors.centerIn: parent; spacing: 20
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 120; maxWidth: 240; minHeight: 120; maxHeight: 240
+ source: "content/colors.png"; margin: 30
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Repeat; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Stretch; verticalMode: BorderImage.Repeat
+ }
+
+ MyBorderImage {
+ minWidth: 60; maxWidth: 200; minHeight: 40; maxHeight: 200
+ source: "content/bw.png"; margin: 10
+ horizontalMode: BorderImage.Round; verticalMode: BorderImage.Round
+ }
+ }
+}
diff --git a/examples/declarative/tabwidget/tabwidget.qmlproject b/examples/declarative/imageelements/borderimage/borderimage.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/tabwidget/tabwidget.qmlproject
+++ b/examples/declarative/imageelements/borderimage/borderimage.qmlproject
diff --git a/examples/declarative/imageelements/borderimage/content/MyBorderImage.qml b/examples/declarative/imageelements/borderimage/content/MyBorderImage.qml
new file mode 100644
index 0000000..b47df7b
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/content/MyBorderImage.qml
@@ -0,0 +1,50 @@
+import Qt 4.7
+
+Item {
+ id: container
+
+ property alias horizontalMode: image.horizontalTileMode
+ property alias verticalMode: image.verticalTileMode
+ property alias source: image.source
+
+ property int minWidth
+ property int minHeight
+ property int maxWidth
+ property int maxHeight
+ property int margin
+
+ width: 240; height: 240
+
+ BorderImage {
+ id: image; anchors.centerIn: parent
+
+ SequentialAnimation on width {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minWidth; to: container.maxWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxWidth; to: container.minWidth
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ SequentialAnimation on height {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: container.minHeight; to: container.maxHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ from: container.maxHeight; to: container.minHeight
+ duration: 2000; easing.type: Easing.InOutQuad
+ }
+ }
+
+ border.top: container.margin
+ border.left: container.margin
+ border.bottom: container.margin
+ border.right: container.margin
+ }
+}
diff --git a/examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml b/examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml
new file mode 100644
index 0000000..629478b
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/content/ShadowRectangle.qml
@@ -0,0 +1,14 @@
+import Qt 4.7
+
+Item {
+ property alias color : rectangle.color
+
+ BorderImage {
+ anchors.fill: rectangle
+ anchors { leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+ source: "shadow.png"; smooth: true
+ }
+
+ Rectangle { id: rectangle; anchors.fill: parent }
+}
diff --git a/examples/declarative/border-image/content/bw.png b/examples/declarative/imageelements/borderimage/content/bw.png
index 486eaae..486eaae 100644
--- a/examples/declarative/border-image/content/bw.png
+++ b/examples/declarative/imageelements/borderimage/content/bw.png
Binary files differ
diff --git a/examples/declarative/border-image/content/colors-round.sci b/examples/declarative/imageelements/borderimage/content/colors-round.sci
index 506f6f5..506f6f5 100644
--- a/examples/declarative/border-image/content/colors-round.sci
+++ b/examples/declarative/imageelements/borderimage/content/colors-round.sci
diff --git a/examples/declarative/border-image/content/colors-stretch.sci b/examples/declarative/imageelements/borderimage/content/colors-stretch.sci
index e4989a7..e4989a7 100644
--- a/examples/declarative/border-image/content/colors-stretch.sci
+++ b/examples/declarative/imageelements/borderimage/content/colors-stretch.sci
diff --git a/examples/declarative/border-image/content/colors.png b/examples/declarative/imageelements/borderimage/content/colors.png
index dfb62f3..dfb62f3 100644
--- a/examples/declarative/border-image/content/colors.png
+++ b/examples/declarative/imageelements/borderimage/content/colors.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/content/shadow.png b/examples/declarative/imageelements/borderimage/content/shadow.png
new file mode 100644
index 0000000..431af85
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/content/shadow.png
Binary files differ
diff --git a/examples/declarative/imageelements/borderimage/shadows.qml b/examples/declarative/imageelements/borderimage/shadows.qml
new file mode 100644
index 0000000..a08d133
--- /dev/null
+++ b/examples/declarative/imageelements/borderimage/shadows.qml
@@ -0,0 +1,24 @@
+import Qt 4.7
+import "content"
+
+Rectangle {
+ id: window
+
+ width: 480; height: 320
+ color: "gray"
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 250; height: 250
+ color: "lightsteelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 200; height: 200
+ color: "steelblue"
+ }
+
+ ShadowRectangle {
+ anchors.centerIn: parent; width: 150; height: 150
+ color: "thistle"
+ }
+}
diff --git a/examples/declarative/aspectratio/face_fit.qml b/examples/declarative/imageelements/image/face_fit.qml
index 52cd4c2..52cd4c2 100644
--- a/examples/declarative/aspectratio/face_fit.qml
+++ b/examples/declarative/imageelements/image/face_fit.qml
diff --git a/examples/declarative/aspectratio/face_fit_animated.qml b/examples/declarative/imageelements/image/face_fit_animated.qml
index 63fc9c6..63fc9c6 100644
--- a/examples/declarative/aspectratio/face_fit_animated.qml
+++ b/examples/declarative/imageelements/image/face_fit_animated.qml
diff --git a/examples/declarative/sql/sql.qmlproject b/examples/declarative/imageelements/image/image.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/sql/sql.qmlproject
+++ b/examples/declarative/imageelements/image/image.qmlproject
diff --git a/examples/declarative/aspectratio/pics/face.png b/examples/declarative/imageelements/image/pics/face.png
index 3d66d72..3d66d72 100644
--- a/examples/declarative/aspectratio/pics/face.png
+++ b/examples/declarative/imageelements/image/pics/face.png
Binary files differ
diff --git a/examples/declarative/aspectratio/scale_and_crop.qml b/examples/declarative/imageelements/image/scale_and_crop.qml
index a438104..a438104 100644
--- a/examples/declarative/aspectratio/scale_and_crop.qml
+++ b/examples/declarative/imageelements/image/scale_and_crop.qml
diff --git a/examples/declarative/aspectratio/scale_and_crop_simple.qml b/examples/declarative/imageelements/image/scale_and_crop_simple.qml
index 1160ec5..1160ec5 100644
--- a/examples/declarative/aspectratio/scale_and_crop_simple.qml
+++ b/examples/declarative/imageelements/image/scale_and_crop_simple.qml
diff --git a/examples/declarative/aspectratio/scale_and_sidecrop.qml b/examples/declarative/imageelements/image/scale_and_sidecrop.qml
index 5593ab8..5593ab8 100644
--- a/examples/declarative/aspectratio/scale_and_sidecrop.qml
+++ b/examples/declarative/imageelements/image/scale_and_sidecrop.qml
diff --git a/examples/declarative/aspectratio/scale_to_fit.qml b/examples/declarative/imageelements/image/scale_to_fit.qml
index 724a36e..724a36e 100644
--- a/examples/declarative/aspectratio/scale_to_fit.qml
+++ b/examples/declarative/imageelements/image/scale_to_fit.qml
diff --git a/examples/declarative/aspectratio/scale_to_fit_simple.qml b/examples/declarative/imageelements/image/scale_to_fit_simple.qml
index 0e960b4..0e960b4 100644
--- a/examples/declarative/aspectratio/scale_to_fit_simple.qml
+++ b/examples/declarative/imageelements/image/scale_to_fit_simple.qml
diff --git a/examples/declarative/slideswitch/slideswitch.qmlproject b/examples/declarative/imageelements/imageelements.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/slideswitch/slideswitch.qmlproject
+++ b/examples/declarative/imageelements/imageelements.qmlproject
diff --git a/examples/declarative/images/content/lemonade.jpg b/examples/declarative/images/content/lemonade.jpg
deleted file mode 100644
index db445c9..0000000
--- a/examples/declarative/images/content/lemonade.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/images/images.qml b/examples/declarative/images/images.qml
deleted file mode 100644
index e48ad50..0000000
--- a/examples/declarative/images/images.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- color: "white"
- width: grid.width + 50
- height: grid.height + 50
-
- Grid {
- id: grid
- x: 25; y: 25
- columns: 3
-
- Image {
- source: "content/lemonade.jpg"
- }
-
- Image {
- sourceSize.width: 50
- sourceSize.height: 50
- source: "content/lemonade.jpg"
- }
-
- Image {
- sourceSize.width: 50
- sourceSize.height: 50
- smooth: true
- source: "content/lemonade.jpg"
- }
-
- Image {
- scale: 1/3
- source: "content/lemonade.jpg"
- }
-
- Image {
- scale: 1/3
- sourceSize.width: 50
- sourceSize.height: 50
- source: "content/lemonade.jpg"
- }
-
- Image {
- scale: 1/3
- sourceSize.width: 50
- sourceSize.height: 50
- smooth: true
- source: "content/lemonade.jpg"
- }
-
- Image {
- width: 50; height: 50
- transform: Translate { x: 50 }
- source: "content/lemonade.jpg"
- }
-
- Image {
- width: 50; height: 50
- transform: Translate { x: 50 }
- sourceSize.width: 50
- sourceSize.height: 50
- source: "content/lemonade.jpg"
- }
-
- Image {
- width: 50; height: 50
- transform: Translate { x: 50 }
- sourceSize: "50x50" // syntactic sugar
- smooth: true
- source: "content/lemonade.jpg"
- }
- }
-}
diff --git a/examples/declarative/focus/Core/ContextMenu.qml b/examples/declarative/keyinteraction/focus/Core/ContextMenu.qml
index 49a54bc..49a54bc 100644
--- a/examples/declarative/focus/Core/ContextMenu.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ContextMenu.qml
diff --git a/examples/declarative/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
index 3f727fd..3f727fd 100644
--- a/examples/declarative/focus/Core/GridMenu.qml
+++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
diff --git a/examples/declarative/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
index 14e2548..14e2548 100644
--- a/examples/declarative/focus/Core/ListViewDelegate.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
diff --git a/examples/declarative/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
index 089f821..32a5d4c 100644
--- a/examples/declarative/focus/Core/ListViews.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
@@ -14,7 +14,7 @@ FocusScope {
delegate: ListViewDelegate {}
Behavior on y {
- NumberAnimation { duration: 600; easing.type: "OutQuint" }
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
}
}
@@ -26,7 +26,7 @@ FocusScope {
delegate: ListViewDelegate {}
Behavior on y {
- NumberAnimation { duration: 600; easing.type: "OutQuint" }
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
}
}
@@ -38,7 +38,7 @@ FocusScope {
delegate: ListViewDelegate {}
Behavior on y {
- NumberAnimation { duration: 600; easing.type: "OutQuint" }
+ NumberAnimation { duration: 600; easing.type: Easing.OutQuint }
}
}
diff --git a/examples/declarative/focus/Core/images/arrow.png b/examples/declarative/keyinteraction/focus/Core/images/arrow.png
index 14978c2..14978c2 100644
--- a/examples/declarative/focus/Core/images/arrow.png
+++ b/examples/declarative/keyinteraction/focus/Core/images/arrow.png
Binary files differ
diff --git a/examples/declarative/focus/Core/images/qt-logo.png b/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png
index 14ddf2a..14ddf2a 100644
--- a/examples/declarative/focus/Core/images/qt-logo.png
+++ b/examples/declarative/keyinteraction/focus/Core/images/qt-logo.png
Binary files differ
diff --git a/examples/declarative/focus/Core/qmldir b/examples/declarative/keyinteraction/focus/Core/qmldir
index e25d63c..e25d63c 100644
--- a/examples/declarative/focus/Core/qmldir
+++ b/examples/declarative/keyinteraction/focus/Core/qmldir
diff --git a/examples/declarative/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml
index 22b0e50..8c992ae 100644
--- a/examples/declarative/focus/focus.qml
+++ b/examples/declarative/keyinteraction/focus/focus.qml
@@ -38,7 +38,7 @@ Rectangle {
}
transitions: Transition {
- NumberAnimation { properties: "y"; duration: 600; easing.type: "OutQuint" }
+ NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint }
}
}
@@ -64,6 +64,6 @@ Rectangle {
}
transitions: Transition {
- NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: "OutQuint" }
+ NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint }
}
}
diff --git a/examples/declarative/focus/focus.qmlproject b/examples/declarative/keyinteraction/focus/focus.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/focus/focus.qmlproject
+++ b/examples/declarative/keyinteraction/focus/focus.qmlproject
diff --git a/examples/declarative/searchbox/searchbox.qmlproject b/examples/declarative/keyinteraction/keyinteraction.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/searchbox/searchbox.qmlproject
+++ b/examples/declarative/keyinteraction/keyinteraction.qmlproject
diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml
deleted file mode 100644
index 0f08893..0000000
--- a/examples/declarative/layouts/Button.qml
+++ /dev/null
@@ -1,22 +0,0 @@
-import Qt 4.7
-
-Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page
- property string text
- property string icon
- signal clicked
-
- Image { id: pix; x: 5; y:5; source: parent.icon}
- Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;}
- MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}}
-
- states:
- State{ name:"pressed"; when:mr.pressed
- PropertyChanges {target:textelement; x: 5}
- PropertyChanges {target:pix; x:textelement.x+textelement.width + 3}
- }
-
- transitions:
- Transition{
- NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 }
- }
-}
diff --git a/examples/declarative/layouts/layouts.qml b/examples/declarative/layouts/layouts.qml
deleted file mode 100644
index 391eab7..0000000
--- a/examples/declarative/layouts/layouts.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import Qt 4.7
-import Qt.widgets 4.7
-
-Item {
- id: resizable
-
- width: 400
- height: 400
-
- QGraphicsWidget {
- size.width: parent.width
- size.height: parent.height
-
- layout: QGraphicsLinearLayout {
- LayoutItem {
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { color: "yellow"; anchors.fill: parent }
- }
- LayoutItem {
- minimumSize: "100x100"
- maximumSize: "400x400"
- preferredSize: "200x200"
- Rectangle { color: "green"; anchors.fill: parent }
- }
- }
- }
-}
diff --git a/examples/declarative/gridview/gridview-example.qml b/examples/declarative/modelviews/gridview/gridview-example.qml
index a5f41fb..a5f41fb 100644
--- a/examples/declarative/gridview/gridview-example.qml
+++ b/examples/declarative/modelviews/gridview/gridview-example.qml
diff --git a/examples/declarative/gridview/gridview.qmlproject b/examples/declarative/modelviews/gridview/gridview.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/gridview/gridview.qmlproject
+++ b/examples/declarative/modelviews/gridview/gridview.qmlproject
diff --git a/examples/declarative/gridview/pics/AddressBook_48.png b/examples/declarative/modelviews/gridview/pics/AddressBook_48.png
index 1ab7c8e..1ab7c8e 100644
--- a/examples/declarative/gridview/pics/AddressBook_48.png
+++ b/examples/declarative/modelviews/gridview/pics/AddressBook_48.png
Binary files differ
diff --git a/examples/declarative/gridview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png
index f4b8689..f4b8689 100644
--- a/examples/declarative/gridview/pics/AudioPlayer_48.png
+++ b/examples/declarative/modelviews/gridview/pics/AudioPlayer_48.png
Binary files differ
diff --git a/examples/declarative/gridview/pics/Camera_48.png b/examples/declarative/modelviews/gridview/pics/Camera_48.png
index c76b524..c76b524 100644
--- a/examples/declarative/gridview/pics/Camera_48.png
+++ b/examples/declarative/modelviews/gridview/pics/Camera_48.png
Binary files differ
diff --git a/examples/declarative/gridview/pics/DateBook_48.png b/examples/declarative/modelviews/gridview/pics/DateBook_48.png
index 58f5787..58f5787 100644
--- a/examples/declarative/gridview/pics/DateBook_48.png
+++ b/examples/declarative/modelviews/gridview/pics/DateBook_48.png
Binary files differ
diff --git a/examples/declarative/gridview/pics/EMail_48.png b/examples/declarative/modelviews/gridview/pics/EMail_48.png
index d6d84a6..d6d84a6 100644
--- a/examples/declarative/gridview/pics/EMail_48.png
+++ b/examples/declarative/modelviews/gridview/pics/EMail_48.png
Binary files differ
diff --git a/examples/declarative/gridview/pics/TodoList_48.png b/examples/declarative/modelviews/gridview/pics/TodoList_48.png
index 0988448..0988448 100644
--- a/examples/declarative/gridview/pics/TodoList_48.png
+++ b/examples/declarative/modelviews/gridview/pics/TodoList_48.png
Binary files differ
diff --git a/examples/declarative/gridview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png
index 52638c5..52638c5 100644
--- a/examples/declarative/gridview/pics/VideoPlayer_48.png
+++ b/examples/declarative/modelviews/gridview/pics/VideoPlayer_48.png
Binary files differ
diff --git a/examples/declarative/listview/content/ClickAutoRepeating.qml b/examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml
index f65c2b3..f65c2b3 100644
--- a/examples/declarative/listview/content/ClickAutoRepeating.qml
+++ b/examples/declarative/modelviews/listview/content/ClickAutoRepeating.qml
diff --git a/examples/declarative/listview/content/MediaButton.qml b/examples/declarative/modelviews/listview/content/MediaButton.qml
index a625b4c..a625b4c 100644
--- a/examples/declarative/listview/content/MediaButton.qml
+++ b/examples/declarative/modelviews/listview/content/MediaButton.qml
diff --git a/examples/declarative/listview/content/pics/add.png b/examples/declarative/modelviews/listview/content/pics/add.png
index f29d84b..f29d84b 100644
--- a/examples/declarative/listview/content/pics/add.png
+++ b/examples/declarative/modelviews/listview/content/pics/add.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/archive-insert.png b/examples/declarative/modelviews/listview/content/pics/archive-insert.png
index b706248..b706248 100644
--- a/examples/declarative/listview/content/pics/archive-insert.png
+++ b/examples/declarative/modelviews/listview/content/pics/archive-insert.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/archive-remove.png b/examples/declarative/modelviews/listview/content/pics/archive-remove.png
index 9640f6b..9640f6b 100644
--- a/examples/declarative/listview/content/pics/archive-remove.png
+++ b/examples/declarative/modelviews/listview/content/pics/archive-remove.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/button-pressed.png b/examples/declarative/modelviews/listview/content/pics/button-pressed.png
index e434d32..e434d32 100644
--- a/examples/declarative/listview/content/pics/button-pressed.png
+++ b/examples/declarative/modelviews/listview/content/pics/button-pressed.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/button.png b/examples/declarative/modelviews/listview/content/pics/button.png
index 56a63ce..56a63ce 100644
--- a/examples/declarative/listview/content/pics/button.png
+++ b/examples/declarative/modelviews/listview/content/pics/button.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/del.png b/examples/declarative/modelviews/listview/content/pics/del.png
index 1d753a3..1d753a3 100644
--- a/examples/declarative/listview/content/pics/del.png
+++ b/examples/declarative/modelviews/listview/content/pics/del.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/fruit-salad.jpg b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg
index da5a6b1..da5a6b1 100644
--- a/examples/declarative/listview/content/pics/fruit-salad.jpg
+++ b/examples/declarative/modelviews/listview/content/pics/fruit-salad.jpg
Binary files differ
diff --git a/examples/declarative/listview/content/pics/go-down.png b/examples/declarative/modelviews/listview/content/pics/go-down.png
index 63331a5..63331a5 100644
--- a/examples/declarative/listview/content/pics/go-down.png
+++ b/examples/declarative/modelviews/listview/content/pics/go-down.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/go-up.png b/examples/declarative/modelviews/listview/content/pics/go-up.png
index 4459024..4459024 100644
--- a/examples/declarative/listview/content/pics/go-up.png
+++ b/examples/declarative/modelviews/listview/content/pics/go-up.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/hamburger.jpg b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg
index d0a15be..d0a15be 100644
--- a/examples/declarative/listview/content/pics/hamburger.jpg
+++ b/examples/declarative/modelviews/listview/content/pics/hamburger.jpg
Binary files differ
diff --git a/examples/declarative/listview/content/pics/lemonade.jpg b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg
index db445c9..db445c9 100644
--- a/examples/declarative/listview/content/pics/lemonade.jpg
+++ b/examples/declarative/modelviews/listview/content/pics/lemonade.jpg
Binary files differ
diff --git a/examples/declarative/listview/content/pics/list-add.png b/examples/declarative/modelviews/listview/content/pics/list-add.png
index e029787..e029787 100644
--- a/examples/declarative/listview/content/pics/list-add.png
+++ b/examples/declarative/modelviews/listview/content/pics/list-add.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/list-remove.png b/examples/declarative/modelviews/listview/content/pics/list-remove.png
index 2bb1a59..2bb1a59 100644
--- a/examples/declarative/listview/content/pics/list-remove.png
+++ b/examples/declarative/modelviews/listview/content/pics/list-remove.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/moreDown.png b/examples/declarative/modelviews/listview/content/pics/moreDown.png
index 31a35d5..31a35d5 100644
--- a/examples/declarative/listview/content/pics/moreDown.png
+++ b/examples/declarative/modelviews/listview/content/pics/moreDown.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/moreUp.png b/examples/declarative/modelviews/listview/content/pics/moreUp.png
index fefb9c9..fefb9c9 100644
--- a/examples/declarative/listview/content/pics/moreUp.png
+++ b/examples/declarative/modelviews/listview/content/pics/moreUp.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/pancakes.jpg b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg
index 60c4396..60c4396 100644
--- a/examples/declarative/listview/content/pics/pancakes.jpg
+++ b/examples/declarative/modelviews/listview/content/pics/pancakes.jpg
Binary files differ
diff --git a/examples/declarative/listview/content/pics/trash.png b/examples/declarative/modelviews/listview/content/pics/trash.png
index 2042595..2042595 100644
--- a/examples/declarative/listview/content/pics/trash.png
+++ b/examples/declarative/modelviews/listview/content/pics/trash.png
Binary files differ
diff --git a/examples/declarative/listview/content/pics/vegetable-soup.jpg b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg
index 9dce332..9dce332 100644
--- a/examples/declarative/listview/content/pics/vegetable-soup.jpg
+++ b/examples/declarative/modelviews/listview/content/pics/vegetable-soup.jpg
Binary files differ
diff --git a/examples/declarative/listview/dummydata/MyPetsModel.qml b/examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml
index f15dda3..f15dda3 100644
--- a/examples/declarative/listview/dummydata/MyPetsModel.qml
+++ b/examples/declarative/modelviews/listview/dummydata/MyPetsModel.qml
diff --git a/examples/declarative/listview/dummydata/Recipes.qml b/examples/declarative/modelviews/listview/dummydata/Recipes.qml
index f707c82..f707c82 100644
--- a/examples/declarative/listview/dummydata/Recipes.qml
+++ b/examples/declarative/modelviews/listview/dummydata/Recipes.qml
diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/modelviews/listview/dynamic.qml
index 236a9c5..693e88a 100644
--- a/examples/declarative/listview/dynamic.qml
+++ b/examples/declarative/modelviews/listview/dynamic.qml
@@ -1,6 +1,6 @@
import Qt 4.7
import "content"
-import "../scrollbar"
+import "../../ui-components/scrollbar"
Rectangle {
id: container
@@ -56,7 +56,7 @@ Rectangle {
Item {
width: container.width; height: 55
-
+
Column {
id: moveButtons
x: 5; width: childrenRect.width; anchors.verticalCenter: parent.verticalCenter
@@ -84,7 +84,7 @@ Rectangle {
spacing: 5
Repeater {
model: attributes
- Component {
+ Component {
Text { text: description; color: "White" }
}
}
@@ -95,13 +95,12 @@ Rectangle {
id: itemButtons
anchors { right: removeButton.left; rightMargin: 35; verticalCenter: parent.verticalCenter }
- width: childrenRect.width
+ width: childrenRect.width
spacing: 10
Image {
source: "content/pics/list-add.png"
scale: clickUp.isPressed ? 0.9 : 1
- transformOrigin: Item.Center
ClickAutoRepeating {
id: clickUp
@@ -115,9 +114,8 @@ Rectangle {
Image {
source: "content/pics/list-remove.png"
scale: clickDown.isPressed ? 0.9 : 1
- transformOrigin: Item.Center
- ClickAutoRepeating {
+ ClickAutoRepeating {
id: clickDown
anchors.fill: parent
onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
@@ -147,18 +145,18 @@ Rectangle {
width: 8; height: view.height; anchors.right: view.right
opacity: 0
- orientation: "Vertical"
+ orientation: Qt.Vertical
position: view.visibleArea.yPosition
pageSize: view.visibleArea.heightRatio
// Only show the scrollbar when the view is moving.
states: State {
- name: "ShowBars"; when: view.moving
+ name: "ShowBars"; when: view.movingVertically
PropertyChanges { target: verticalScrollBar; opacity: 1 }
}
transitions: Transition {
NumberAnimation { properties: "opacity"; duration: 400 }
- }
+ }
}
Row {
@@ -198,10 +196,10 @@ Rectangle {
}
}
- Image {
+ Image {
source: "content/pics/archive-remove.png"
- MouseArea {
+ MouseArea {
anchors.fill: parent
onClicked: fruitModel.clear()
}
diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/modelviews/listview/highlight.qml
index 50ba2f7..ade355d 100644
--- a/examples/declarative/listview/highlight.qml
+++ b/examples/declarative/modelviews/listview/highlight.qml
@@ -4,7 +4,7 @@ Rectangle {
width: 400; height: 300
// MyPets model is defined in dummydata/MyPetsModel.qml
- // The viewer automatically loads files in dummydata/* to assist
+ // The launcher automatically loads files in dummydata/* to assist
// development without a real data source.
// This one contains my pets.
diff --git a/examples/declarative/listview/itemlist.qml b/examples/declarative/modelviews/listview/itemlist.qml
index e387f28..b73b3a3 100644
--- a/examples/declarative/listview/itemlist.qml
+++ b/examples/declarative/modelviews/listview/itemlist.qml
@@ -33,7 +33,7 @@ Rectangle {
anchors { fill: parent; bottomMargin: 30 }
model: itemModel
preferredHighlightBegin: 0; preferredHighlightEnd: 0
- highlightRangeMode: "StrictlyEnforceRange"
+ highlightRangeMode: ListView.StrictlyEnforceRange
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem; flickDeceleration: 2000
}
@@ -55,7 +55,7 @@ Rectangle {
radius: 3
color: view.currentIndex == index ? "blue" : "white"
- MouseArea {
+ MouseArea {
width: 20; height: 20
anchors.centerIn: parent
onClicked: view.currentIndex = index
diff --git a/examples/declarative/listview/listview-example.qml b/examples/declarative/modelviews/listview/listview-example.qml
index 6feedf6..2e8cdda 100644
--- a/examples/declarative/listview/listview-example.qml
+++ b/examples/declarative/modelviews/listview/listview-example.qml
@@ -75,7 +75,7 @@ Rectangle {
highlight: petHighlight
currentIndex: list1.currentIndex
preferredHighlightBegin: 80; preferredHighlightEnd: 220
- highlightRangeMode: "ApplyRange"
+ highlightRangeMode: ListView.ApplyRange
}
ListView {
@@ -87,7 +87,7 @@ Rectangle {
highlight: Rectangle { color: "lightsteelblue" }
currentIndex: list1.currentIndex
preferredHighlightBegin: 125; preferredHighlightEnd: 125
- highlightRangeMode: "StrictlyEnforceRange"
+ highlightRangeMode: ListView.StrictlyEnforceRange
flickDeceleration: 1000
}
}
diff --git a/examples/declarative/listview/listview.qmlproject b/examples/declarative/modelviews/listview/listview.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/listview/listview.qmlproject
+++ b/examples/declarative/modelviews/listview/listview.qmlproject
diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/modelviews/listview/recipes.qml
index 990e272..990e272 100644
--- a/examples/declarative/listview/recipes.qml
+++ b/examples/declarative/modelviews/listview/recipes.qml
diff --git a/examples/declarative/listview/sections.qml b/examples/declarative/modelviews/listview/sections.qml
index 0a81f63..21f9f03 100644
--- a/examples/declarative/listview/sections.qml
+++ b/examples/declarative/modelviews/listview/sections.qml
@@ -61,7 +61,7 @@ Rectangle {
height: 20
Text {
x: 2; height: parent.height
- verticalAlignment: 'AlignVCenter'
+ verticalAlignment: Text.AlignVCenter
text: section
font.bold: true
}
diff --git a/examples/declarative/modelviews/modelviews.pro b/examples/declarative/modelviews/modelviews.pro
new file mode 100644
index 0000000..b811e44
--- /dev/null
+++ b/examples/declarative/modelviews/modelviews.pro
@@ -0,0 +1,7 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ objectlistmodel \
+ stringlistmodel
+
+
diff --git a/examples/declarative/scrollbar/scrollbar.qmlproject b/examples/declarative/modelviews/modelviews.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/scrollbar/scrollbar.qmlproject
+++ b/examples/declarative/modelviews/modelviews.qmlproject
diff --git a/examples/declarative/objectlistmodel/dataobject.cpp b/examples/declarative/modelviews/objectlistmodel/dataobject.cpp
index 4c44ee4..14be1b9 100644
--- a/examples/declarative/objectlistmodel/dataobject.cpp
+++ b/examples/declarative/modelviews/objectlistmodel/dataobject.cpp
@@ -59,7 +59,10 @@ QString DataObject::name() const
void DataObject::setName(const QString &name)
{
- m_name = name;
+ if (name != m_name) {
+ m_name = name;
+ emit nameChanged();
+ }
}
QString DataObject::color() const
@@ -69,5 +72,8 @@ QString DataObject::color() const
void DataObject::setColor(const QString &color)
{
- m_color = color;
+ if (color != m_color) {
+ m_color = color;
+ emit colorChanged();
+ }
}
diff --git a/examples/declarative/objectlistmodel/dataobject.h b/examples/declarative/modelviews/objectlistmodel/dataobject.h
index 6804474..852110d 100644
--- a/examples/declarative/objectlistmodel/dataobject.h
+++ b/examples/declarative/modelviews/objectlistmodel/dataobject.h
@@ -48,8 +48,8 @@ class DataObject : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE setName)
- Q_PROPERTY(QString color READ color WRITE setColor)
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged)
public:
DataObject(QObject *parent=0);
@@ -61,6 +61,10 @@ public:
QString color() const;
void setColor(const QString &color);
+signals:
+ void nameChanged();
+ void colorChanged();
+
private:
QString m_name;
QString m_color;
diff --git a/examples/declarative/objectlistmodel/main.cpp b/examples/declarative/modelviews/objectlistmodel/main.cpp
index b210570..b210570 100644
--- a/examples/declarative/objectlistmodel/main.cpp
+++ b/examples/declarative/modelviews/objectlistmodel/main.cpp
diff --git a/examples/declarative/objectlistmodel/objectlistmodel.pro b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro
index 869cde3..869cde3 100644
--- a/examples/declarative/objectlistmodel/objectlistmodel.pro
+++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.pro
diff --git a/examples/declarative/objectlistmodel/objectlistmodel.qmlproject b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/objectlistmodel/objectlistmodel.qmlproject
+++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qmlproject
diff --git a/examples/declarative/objectlistmodel/objectlistmodel.qrc b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qrc
index 17e9301..17e9301 100644
--- a/examples/declarative/objectlistmodel/objectlistmodel.qrc
+++ b/examples/declarative/modelviews/objectlistmodel/objectlistmodel.qrc
diff --git a/examples/declarative/objectlistmodel/view.qml b/examples/declarative/modelviews/objectlistmodel/view.qml
index 908e388..2b8383f 100644
--- a/examples/declarative/objectlistmodel/view.qml
+++ b/examples/declarative/modelviews/objectlistmodel/view.qml
@@ -9,7 +9,7 @@ ListView {
Rectangle {
height: 25
width: 100
- color: model.color
+ color: model.modelData.color
Text { text: name }
}
}
diff --git a/examples/declarative/package/Delegate.qml b/examples/declarative/modelviews/package/Delegate.qml
index 785fde6..785fde6 100644
--- a/examples/declarative/package/Delegate.qml
+++ b/examples/declarative/modelviews/package/Delegate.qml
diff --git a/examples/declarative/package/package.qmlproject b/examples/declarative/modelviews/package/package.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/package/package.qmlproject
+++ b/examples/declarative/modelviews/package/package.qmlproject
diff --git a/examples/declarative/package/view.qml b/examples/declarative/modelviews/package/view.qml
index 67f896b..67f896b 100644
--- a/examples/declarative/package/view.qml
+++ b/examples/declarative/modelviews/package/view.qml
diff --git a/examples/declarative/parallax/parallax.qml b/examples/declarative/modelviews/parallax/parallax.qml
index cb0437d..110f17e 100644
--- a/examples/declarative/parallax/parallax.qml
+++ b/examples/declarative/modelviews/parallax/parallax.qml
@@ -1,5 +1,5 @@
import Qt 4.7
-import "../clocks/content"
+import "../../toys/clocks/content"
import "qml"
Rectangle {
@@ -31,8 +31,8 @@ Rectangle {
Loader {
anchors { top: parent.top; topMargin: 10; horizontalCenter: parent.horizontalCenter }
width: 300; height: 400
- clip: true; resizeMode: Loader.SizeItemToLoader
- source: "../../../demos/declarative/samegame/samegame.qml"
+ clip: true;
+ source: "../../../../demos/declarative/samegame/samegame.qml"
}
}
diff --git a/examples/declarative/parallax/parallax.qmlproject b/examples/declarative/modelviews/parallax/parallax.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/parallax/parallax.qmlproject
+++ b/examples/declarative/modelviews/parallax/parallax.qmlproject
diff --git a/examples/declarative/parallax/pics/background.jpg b/examples/declarative/modelviews/parallax/pics/background.jpg
index 61cca2f..61cca2f 100644
--- a/examples/declarative/parallax/pics/background.jpg
+++ b/examples/declarative/modelviews/parallax/pics/background.jpg
Binary files differ
diff --git a/examples/declarative/dynamic/images/face-smile.png b/examples/declarative/modelviews/parallax/pics/face-smile.png
index 3d66d72..3d66d72 100644
--- a/examples/declarative/dynamic/images/face-smile.png
+++ b/examples/declarative/modelviews/parallax/pics/face-smile.png
Binary files differ
diff --git a/examples/declarative/parallax/pics/home-page.svg b/examples/declarative/modelviews/parallax/pics/home-page.svg
index 4f16958..4f16958 100644
--- a/examples/declarative/parallax/pics/home-page.svg
+++ b/examples/declarative/modelviews/parallax/pics/home-page.svg
diff --git a/examples/declarative/animations/images/shadow.png b/examples/declarative/modelviews/parallax/pics/shadow.png
index 8270565..8270565 100644
--- a/examples/declarative/animations/images/shadow.png
+++ b/examples/declarative/modelviews/parallax/pics/shadow.png
Binary files differ
diff --git a/examples/declarative/parallax/pics/yast-joystick.png b/examples/declarative/modelviews/parallax/pics/yast-joystick.png
index 858cea0..858cea0 100644
--- a/examples/declarative/parallax/pics/yast-joystick.png
+++ b/examples/declarative/modelviews/parallax/pics/yast-joystick.png
Binary files differ
diff --git a/examples/declarative/parallax/pics/yast-wol.png b/examples/declarative/modelviews/parallax/pics/yast-wol.png
index 7712180..7712180 100644
--- a/examples/declarative/parallax/pics/yast-wol.png
+++ b/examples/declarative/modelviews/parallax/pics/yast-wol.png
Binary files differ
diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/modelviews/parallax/qml/ParallaxView.qml
index 4b38d45..e869a21 100644
--- a/examples/declarative/parallax/qml/ParallaxView.qml
+++ b/examples/declarative/modelviews/parallax/qml/ParallaxView.qml
@@ -18,9 +18,9 @@ Item {
id: list
currentIndex: root.currentIndex
- onCurrentIndexChanged: root.currentIndex = currentIndex
+ onCurrentIndexChanged: root.currentIndex = currentIndex
- orientation: "Horizontal"
+ orientation: Qt.Horizontal
boundsBehavior: Flickable.DragOverBounds
anchors.fill: parent
model: VisualItemModel { id: visualModel }
@@ -45,10 +45,10 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(count * 50, parent.width - 20)
interactive: width == parent.width - 20
- orientation: "Horizontal"
+ orientation: Qt.Horizontal
- delegate: Item {
- width: 50; height: 50
+ delegate: Item {
+ width: 50; height: 50
id: delegateRoot
Image {
@@ -56,7 +56,6 @@ Item {
source: modelData.icon
smooth: true
scale: 0.8
- transformOrigin: "Center"
}
MouseArea {
@@ -64,10 +63,10 @@ Item {
onClicked: { root.currentIndex = index }
}
- states: State {
+ states: State {
name: "Selected"
when: delegateRoot.ListView.isCurrentItem == true
- PropertyChanges {
+ PropertyChanges {
target: image
scale: 1
y: -5
diff --git a/examples/declarative/parallax/qml/Smiley.qml b/examples/declarative/modelviews/parallax/qml/Smiley.qml
index b1e1ae8..662addc 100644
--- a/examples/declarative/parallax/qml/Smiley.qml
+++ b/examples/declarative/modelviews/parallax/qml/Smiley.qml
@@ -8,7 +8,6 @@ Item {
Image {
anchors.horizontalCenter: parent.horizontalCenter
source: "../pics/shadow.png"; y: smiley.minHeight + 58
- transformOrigin: Item.Center
// The scale property depends on the y position of the smiley face.
scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight)
@@ -30,13 +29,13 @@ Item {
// Move from minHeight to maxHeight in 300ms, using the OutExpo easing function
NumberAnimation {
from: smiley.minHeight; to: smiley.maxHeight
- easing.type: "OutExpo"; duration: 300
+ easing.type: Easing.OutExpo; duration: 300
}
-
+
// Then move back to minHeight in 1 second, using the OutBounce easing function
NumberAnimation {
from: smiley.maxHeight; to: smiley.minHeight
- easing.type: "OutBounce"; duration: 1000
+ easing.type: Easing.OutBounce; duration: 1000
}
// Then pause for 500ms
diff --git a/examples/declarative/stringlistmodel/main.cpp b/examples/declarative/modelviews/stringlistmodel/main.cpp
index abbffa7..abbffa7 100644
--- a/examples/declarative/stringlistmodel/main.cpp
+++ b/examples/declarative/modelviews/stringlistmodel/main.cpp
diff --git a/examples/declarative/stringlistmodel/stringlistmodel.pro b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
index 23dc481..23dc481 100644
--- a/examples/declarative/stringlistmodel/stringlistmodel.pro
+++ b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.pro
diff --git a/examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc
new file mode 100644
index 0000000..17e9301
--- /dev/null
+++ b/examples/declarative/modelviews/stringlistmodel/stringlistmodel.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>view.qml</file>
+</qresource>
+</RCC>
diff --git a/examples/declarative/stringlistmodel/view.qml b/examples/declarative/modelviews/stringlistmodel/view.qml
index 41c03d9..41c03d9 100644
--- a/examples/declarative/stringlistmodel/view.qml
+++ b/examples/declarative/modelviews/stringlistmodel/view.qml
diff --git a/examples/declarative/webview/alerts.html b/examples/declarative/modelviews/webview/alerts.html
index 82caddf..82caddf 100644
--- a/examples/declarative/webview/alerts.html
+++ b/examples/declarative/modelviews/webview/alerts.html
diff --git a/examples/declarative/webview/alerts.qml b/examples/declarative/modelviews/webview/alerts.qml
index 6a5a0d2..7684c3e 100644
--- a/examples/declarative/webview/alerts.qml
+++ b/examples/declarative/modelviews/webview/alerts.qml
@@ -52,7 +52,7 @@ WebView {
font.pixelSize: 20
width: webView.width*0.75
wrapMode: Text.WordWrap
- horizontalAlignment: "AlignHCenter"
+ horizontalAlignment: Text.AlignHCenter
}
}
}
diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/modelviews/webview/autosize.qml
index 9632883..9632883 100644
--- a/examples/declarative/webview/autosize.qml
+++ b/examples/declarative/modelviews/webview/autosize.qml
diff --git a/examples/declarative/webview/content/FieldText.qml b/examples/declarative/modelviews/webview/content/FieldText.qml
index d1d003f..d1d003f 100644
--- a/examples/declarative/webview/content/FieldText.qml
+++ b/examples/declarative/modelviews/webview/content/FieldText.qml
diff --git a/examples/declarative/webview/content/Mapping/Map.qml b/examples/declarative/modelviews/webview/content/Mapping/Map.qml
index 5d3ba81..5d3ba81 100644
--- a/examples/declarative/webview/content/Mapping/Map.qml
+++ b/examples/declarative/modelviews/webview/content/Mapping/Map.qml
diff --git a/examples/declarative/webview/content/Mapping/map.html b/examples/declarative/modelviews/webview/content/Mapping/map.html
index a8726fd..a8726fd 100755
--- a/examples/declarative/webview/content/Mapping/map.html
+++ b/examples/declarative/modelviews/webview/content/Mapping/map.html
diff --git a/examples/declarative/webview/content/SpinSquare.qml b/examples/declarative/modelviews/webview/content/SpinSquare.qml
index dba48d4..dba48d4 100644
--- a/examples/declarative/webview/content/SpinSquare.qml
+++ b/examples/declarative/modelviews/webview/content/SpinSquare.qml
diff --git a/examples/declarative/webview/content/pics/cancel.png b/examples/declarative/modelviews/webview/content/pics/cancel.png
index ecc9533..ecc9533 100644
--- a/examples/declarative/webview/content/pics/cancel.png
+++ b/examples/declarative/modelviews/webview/content/pics/cancel.png
Binary files differ
diff --git a/examples/declarative/webview/content/pics/ok.png b/examples/declarative/modelviews/webview/content/pics/ok.png
index 5795f04..5795f04 100644
--- a/examples/declarative/webview/content/pics/ok.png
+++ b/examples/declarative/modelviews/webview/content/pics/ok.png
Binary files differ
diff --git a/examples/declarative/webview/googleMaps.qml b/examples/declarative/modelviews/webview/googleMaps.qml
index 5506012..5506012 100644
--- a/examples/declarative/webview/googleMaps.qml
+++ b/examples/declarative/modelviews/webview/googleMaps.qml
diff --git a/examples/declarative/webview/inline-html.qml b/examples/declarative/modelviews/webview/inline-html.qml
index eec7fc6..eec7fc6 100644
--- a/examples/declarative/webview/inline-html.qml
+++ b/examples/declarative/modelviews/webview/inline-html.qml
diff --git a/examples/declarative/webview/newwindows.html b/examples/declarative/modelviews/webview/newwindows.html
index f169599..f169599 100644
--- a/examples/declarative/webview/newwindows.html
+++ b/examples/declarative/modelviews/webview/newwindows.html
diff --git a/examples/declarative/webview/newwindows.qml b/examples/declarative/modelviews/webview/newwindows.qml
index 2e4a72e..2e4a72e 100644
--- a/examples/declarative/webview/newwindows.qml
+++ b/examples/declarative/modelviews/webview/newwindows.qml
diff --git a/examples/declarative/webview/transparent.qml b/examples/declarative/modelviews/webview/transparent.qml
index e4efc31..e4efc31 100644
--- a/examples/declarative/webview/transparent.qml
+++ b/examples/declarative/modelviews/webview/transparent.qml
diff --git a/examples/declarative/progressbar/progressbar.qmlproject b/examples/declarative/modelviews/webview/webview.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/progressbar/progressbar.qmlproject
+++ b/examples/declarative/modelviews/webview/webview.qmlproject
diff --git a/examples/declarative/positioners/Button.qml b/examples/declarative/positioners/Button.qml
new file mode 100644
index 0000000..d03eeb5
--- /dev/null
+++ b/examples/declarative/positioners/Button.qml
@@ -0,0 +1,38 @@
+import Qt 4.7
+
+Rectangle {
+ id: page
+
+ property string text
+ property string icon
+ signal clicked
+
+ border.color: "black"; color: "steelblue"; radius: 5
+ width: pix.width + textelement.width + 13
+ height: pix.height + 10
+
+ Image { id: pix; x: 5; y:5; source: parent.icon }
+
+ Text {
+ id: textelement
+ text: page.text; color: "white"
+ x: pix.width + pix.x + 3
+ anchors.verticalCenter: pix.verticalCenter
+ }
+
+ MouseArea {
+ id: mr
+ anchors.fill: parent
+ onClicked: { parent.focus = true; page.clicked() }
+ }
+
+ states: State {
+ name: "pressed"; when: mr.pressed
+ PropertyChanges { target: textelement; x: 5 }
+ PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 }
+ }
+}
diff --git a/examples/declarative/layouts/add.png b/examples/declarative/positioners/add.png
index f29d84b..f29d84b 100644
--- a/examples/declarative/layouts/add.png
+++ b/examples/declarative/positioners/add.png
Binary files differ
diff --git a/examples/declarative/layouts/del.png b/examples/declarative/positioners/del.png
index 1d753a3..1d753a3 100644
--- a/examples/declarative/layouts/del.png
+++ b/examples/declarative/positioners/del.png
Binary files differ
diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/positioners/positioners.qml
index 3703b59..2cb0b8b 100644
--- a/examples/declarative/layouts/positioners.qml
+++ b/examples/declarative/positioners/positioners.qml
@@ -8,10 +8,10 @@ Rectangle {
id: layout1
y: 0
move: Transition {
- NumberAnimation { properties: "y"; easing.type: "OutBounce" }
+ NumberAnimation { properties: "y"; easing.type: Easing.OutBounce }
}
add: Transition {
- NumberAnimation { properties: "y"; easing.type: "OutQuad" }
+ NumberAnimation { properties: "y"; easing.type: Easing.OutQuad }
}
Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 }
@@ -43,10 +43,10 @@ Rectangle {
id: layout2
y: 300
move: Transition {
- NumberAnimation { properties: "x"; easing.type: "OutBounce" }
+ NumberAnimation { properties: "x"; easing.type: Easing.OutBounce }
}
add: Transition {
- NumberAnimation { properties: "x"; easing.type: "OutQuad" }
+ NumberAnimation { properties: "x"; easing.type: Easing.OutQuad }
}
Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
@@ -117,11 +117,11 @@ Rectangle {
columns: 3
move: Transition {
- NumberAnimation { properties: "x,y"; easing.type: "OutBounce" }
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
}
add: Transition {
- NumberAnimation { properties: "x,y"; easing.type: "OutBounce" }
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
}
Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
@@ -167,11 +167,11 @@ Rectangle {
x: 260; y: 250; width: 150
move: Transition {
- NumberAnimation { properties: "x,y"; easing.type: "OutBounce" }
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
}
add: Transition {
- NumberAnimation { properties: "x,y"; easing.type: "OutBounce" }
+ NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
}
Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 }
diff --git a/examples/declarative/positioners/positioners.qmlproject b/examples/declarative/positioners/positioners.qmlproject
new file mode 100644
index 0000000..e526217
--- /dev/null
+++ b/examples/declarative/positioners/positioners.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/positioners/positioners.qmlproject.user b/examples/declarative/positioners/positioners.qmlproject.user
new file mode 100644
index 0000000..593479d
--- /dev/null
+++ b/examples/declarative/positioners/positioners.qmlproject.user
@@ -0,0 +1,41 @@
+<!DOCTYPE QtCreatorProject>
+<qtcreator>
+ <data>
+ <variable>ProjectExplorer.Project.ActiveTarget</variable>
+ <value type="int">0</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.EditorSettings</variable>
+ <valuemap type="QVariantMap">
+ <value key="EditorConfiguration.Codec" type="QByteArray">UTF-8</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.0</variable>
+ <valuemap type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Runtime</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">-1</value>
+ <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">0</value>
+ <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">QML Runtime</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QmlProjectManager.QmlRunConfiguration</value>
+ <value key="QmlProjectManager.QmlRunConfiguration.DebugServerAddress" type="QString">127.0.0.1</value>
+ <value key="QmlProjectManager.QmlRunConfiguration.DebugServerPort" type="int">3768</value>
+ <value key="QmlProjectManager.QmlRunConfiguration.MainScript" type="QString">positioners.qml</value>
+ <value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer" type="QString"></value>
+ <value key="QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.TargetCount</variable>
+ <value type="int">1</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+ <value type="int">4</value>
+ </data>
+</qtcreator>
diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml
deleted file mode 100644
index 5433156..0000000
--- a/examples/declarative/scrollbar/ScrollBar.qml
+++ /dev/null
@@ -1,33 +0,0 @@
-import Qt 4.7
-
-Item {
- id: scrollBar
-
- // The properties that define the scrollbar's state.
- // position and pageSize are in the range 0.0 - 1.0. They are relative to the
- // height of the page, i.e. a pageSize of 0.5 means that you can see 50%
- // of the height of the view.
- // orientation can be either 'Vertical' or 'Horizontal'
- property real position
- property real pageSize
- property variant orientation : "Vertical"
-
- // A light, semi-transparent background
- Rectangle {
- id: background
- anchors.fill: parent
- radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1)
- color: "white"
- opacity: 0.3
- }
- // Size the bar to the required size, depending upon the orientation.
- Rectangle {
- x: orientation == 'Vertical' ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)
- y: orientation == 'Vertical' ? (scrollBar.position * (scrollBar.height-2) + 1) : 1
- width: orientation == 'Vertical' ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))
- height: orientation == 'Vertical' ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)
- radius: orientation == 'Vertical' ? (width/2 - 1) : (height/2 - 1)
- color: "black"
- opacity: 0.7
- }
-}
diff --git a/examples/declarative/sql/hello.qml b/examples/declarative/sqllocalstorage/hello.qml
index 8b021b7..8b021b7 100644
--- a/examples/declarative/sql/hello.qml
+++ b/examples/declarative/sqllocalstorage/hello.qml
diff --git a/examples/declarative/mousearea/mousearea.qmlproject b/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/mousearea/mousearea.qmlproject
+++ b/examples/declarative/sqllocalstorage/sqllocalstorage.qmlproject
diff --git a/examples/declarative/text/fonts/availableFonts.qml b/examples/declarative/text/fonts/availableFonts.qml
new file mode 100644
index 0000000..defa4ce
--- /dev/null
+++ b/examples/declarative/text/fonts/availableFonts.qml
@@ -0,0 +1,17 @@
+import Qt 4.7
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/fonts/banner.qml b/examples/declarative/text/fonts/banner.qml
index 353354a..353354a 100644
--- a/examples/declarative/fonts/banner.qml
+++ b/examples/declarative/text/fonts/banner.qml
diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/text/fonts/fonts.qml
index ae31b03..f3eac48 100644
--- a/examples/declarative/fonts/fonts.qml
+++ b/examples/declarative/text/fonts/fonts.qml
@@ -51,9 +51,9 @@ Rectangle {
}
Text {
text: {
- if (webFont.status == 1) myText
- else if (webFont.status == 2) "Loading..."
- else if (webFont.status == 3) "Error loading font"
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
}
color: "lightsteelblue"
width: parent.width
diff --git a/examples/declarative/fonts/fonts.qmlproject b/examples/declarative/text/fonts/fonts.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/fonts/fonts.qmlproject
+++ b/examples/declarative/text/fonts/fonts.qmlproject
diff --git a/examples/declarative/fonts/fonts/tarzeau_ocr_a.ttf b/examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf
index cf93f96..cf93f96 100644
--- a/examples/declarative/fonts/fonts/tarzeau_ocr_a.ttf
+++ b/examples/declarative/text/fonts/fonts/tarzeau_ocr_a.ttf
Binary files differ
diff --git a/examples/declarative/fonts/hello.qml b/examples/declarative/text/fonts/hello.qml
index d4d0e4c..0d6f4cd 100644
--- a/examples/declarative/fonts/hello.qml
+++ b/examples/declarative/text/fonts/hello.qml
@@ -19,7 +19,7 @@ Rectangle {
SequentialAnimation on font.letterSpacing {
loops: Animation.Infinite;
- NumberAnimation { from: 100; to: 300; easing.type: "InQuad"; duration: 3000 }
+ NumberAnimation { from: 100; to: 300; easing.type: Easing.InQuad; duration: 3000 }
ScriptAction {
script: {
container.y = (screen.height / 4) + (Math.random() * screen.height / 2)
diff --git a/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject b/examples/declarative/text/text.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject
+++ b/examples/declarative/text/text.qmlproject
diff --git a/examples/declarative/listmodel-threaded/dataloader.js b/examples/declarative/threading/threadedlistmodel/dataloader.js
index d720f09..d720f09 100644
--- a/examples/declarative/listmodel-threaded/dataloader.js
+++ b/examples/declarative/threading/threadedlistmodel/dataloader.js
diff --git a/examples/declarative/layouts/layouts.qmlproject b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/layouts/layouts.qmlproject
+++ b/examples/declarative/threading/threadedlistmodel/threadedlistmodel.qmlproject
diff --git a/examples/declarative/listmodel-threaded/timedisplay.qml b/examples/declarative/threading/threadedlistmodel/timedisplay.qml
index bad7010..bad7010 100644
--- a/examples/declarative/listmodel-threaded/timedisplay.qml
+++ b/examples/declarative/threading/threadedlistmodel/timedisplay.qml
diff --git a/examples/declarative/images/images.qmlproject b/examples/declarative/threading/threading.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/images/images.qmlproject
+++ b/examples/declarative/threading/threading.qmlproject
diff --git a/examples/declarative/workerscript/workerscript.js b/examples/declarative/threading/workerscript/workerscript.js
index f76471f..f76471f 100644
--- a/examples/declarative/workerscript/workerscript.js
+++ b/examples/declarative/threading/workerscript/workerscript.js
diff --git a/examples/declarative/workerscript/workerscript.qml b/examples/declarative/threading/workerscript/workerscript.qml
index 2294a81..2294a81 100644
--- a/examples/declarative/workerscript/workerscript.qml
+++ b/examples/declarative/threading/workerscript/workerscript.qml
diff --git a/examples/declarative/gestures/gestures.qmlproject b/examples/declarative/threading/workerscript/workerscript.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/gestures/gestures.qmlproject
+++ b/examples/declarative/threading/workerscript/workerscript.qmlproject
diff --git a/examples/declarative/gestures/experimental-gestures.qml b/examples/declarative/touchinteraction/gestures/experimental-gestures.qml
index cb190ea..cb190ea 100644
--- a/examples/declarative/gestures/experimental-gestures.qml
+++ b/examples/declarative/touchinteraction/gestures/experimental-gestures.qml
diff --git a/examples/declarative/flipable/flipable.qmlproject b/examples/declarative/touchinteraction/gestures/gestures.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/flipable/flipable.qmlproject
+++ b/examples/declarative/touchinteraction/gestures/gestures.qmlproject
diff --git a/examples/declarative/mousearea/mouse.qml b/examples/declarative/touchinteraction/mousearea/mouse.qml
index 67302a8..06134b7 100644
--- a/examples/declarative/mousearea/mouse.qml
+++ b/examples/declarative/touchinteraction/mousearea/mouse.qml
@@ -33,7 +33,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
drag.target: parent
- drag.axis: "XAxis"
+ drag.axis: Drag.XAxis
drag.minimumX: 0
drag.maximumX: 150
diff --git a/examples/declarative/fillmode/fillmode.qmlproject b/examples/declarative/touchinteraction/mousearea/mousearea.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/fillmode/fillmode.qmlproject
+++ b/examples/declarative/touchinteraction/mousearea/mousearea.qmlproject
diff --git a/examples/declarative/extending/extending.qmlproject b/examples/declarative/touchinteraction/touchinteraction.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/extending/extending.qmlproject
+++ b/examples/declarative/touchinteraction/touchinteraction.qmlproject
diff --git a/examples/declarative/clocks/clocks.qml b/examples/declarative/toys/clocks/clocks.qml
index 22cf820..22cf820 100644
--- a/examples/declarative/clocks/clocks.qml
+++ b/examples/declarative/toys/clocks/clocks.qml
diff --git a/examples/declarative/clocks/clocks.qmlproject b/examples/declarative/toys/clocks/clocks.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/clocks/clocks.qmlproject
+++ b/examples/declarative/toys/clocks/clocks.qmlproject
diff --git a/examples/declarative/clocks/content/Clock.qml b/examples/declarative/toys/clocks/content/Clock.qml
index 3426e6a..3426e6a 100644
--- a/examples/declarative/clocks/content/Clock.qml
+++ b/examples/declarative/toys/clocks/content/Clock.qml
diff --git a/examples/declarative/clocks/content/background.png b/examples/declarative/toys/clocks/content/background.png
index a885950..a885950 100644
--- a/examples/declarative/clocks/content/background.png
+++ b/examples/declarative/toys/clocks/content/background.png
Binary files differ
diff --git a/examples/declarative/clocks/content/center.png b/examples/declarative/toys/clocks/content/center.png
index 7fbd802..7fbd802 100755
--- a/examples/declarative/clocks/content/center.png
+++ b/examples/declarative/toys/clocks/content/center.png
Binary files differ
diff --git a/examples/declarative/clocks/content/clock-night.png b/examples/declarative/toys/clocks/content/clock-night.png
index cc7151a..cc7151a 100755
--- a/examples/declarative/clocks/content/clock-night.png
+++ b/examples/declarative/toys/clocks/content/clock-night.png
Binary files differ
diff --git a/examples/declarative/clocks/content/clock.png b/examples/declarative/toys/clocks/content/clock.png
index 462edac..462edac 100755
--- a/examples/declarative/clocks/content/clock.png
+++ b/examples/declarative/toys/clocks/content/clock.png
Binary files differ
diff --git a/examples/declarative/clocks/content/hour.png b/examples/declarative/toys/clocks/content/hour.png
index f8061a1..f8061a1 100755
--- a/examples/declarative/clocks/content/hour.png
+++ b/examples/declarative/toys/clocks/content/hour.png
Binary files differ
diff --git a/examples/declarative/clocks/content/minute.png b/examples/declarative/toys/clocks/content/minute.png
index 1297ec7..1297ec7 100755
--- a/examples/declarative/clocks/content/minute.png
+++ b/examples/declarative/toys/clocks/content/minute.png
Binary files differ
diff --git a/examples/declarative/clocks/content/second.png b/examples/declarative/toys/clocks/content/second.png
index 4aa9fb5..4aa9fb5 100755
--- a/examples/declarative/clocks/content/second.png
+++ b/examples/declarative/toys/clocks/content/second.png
Binary files differ
diff --git a/examples/declarative/dial/content/Dial.qml b/examples/declarative/toys/dial/content/Dial.qml
index f9ab3e3..6f24801 100644
--- a/examples/declarative/dial/content/Dial.qml
+++ b/examples/declarative/toys/dial/content/Dial.qml
@@ -8,6 +8,7 @@ Item {
Image { source: "background.png" }
+//! [needle_shadow]
Image {
x: 93
y: 35
@@ -17,6 +18,8 @@ Item {
angle: needleRotation.angle
}
}
+//! [needle_shadow]
+//! [needle]
Image {
id: needle
x: 95; y: 33
@@ -33,5 +36,8 @@ Item {
}
}
}
+//! [needle]
+//! [overlay]
Image { x: 21; y: 18; source: "overlay.png" }
+//! [overlay]
}
diff --git a/examples/declarative/dial/content/background.png b/examples/declarative/toys/dial/content/background.png
index 75d555d..75d555d 100644
--- a/examples/declarative/dial/content/background.png
+++ b/examples/declarative/toys/dial/content/background.png
Binary files differ
diff --git a/examples/declarative/dial/content/needle.png b/examples/declarative/toys/dial/content/needle.png
index 2d19f75..2d19f75 100644
--- a/examples/declarative/dial/content/needle.png
+++ b/examples/declarative/toys/dial/content/needle.png
Binary files differ
diff --git a/examples/declarative/dial/content/needle_shadow.png b/examples/declarative/toys/dial/content/needle_shadow.png
index 8d8a928..8d8a928 100644
--- a/examples/declarative/dial/content/needle_shadow.png
+++ b/examples/declarative/toys/dial/content/needle_shadow.png
Binary files differ
diff --git a/examples/declarative/dial/content/overlay.png b/examples/declarative/toys/dial/content/overlay.png
index 3860a7b..3860a7b 100644
--- a/examples/declarative/dial/content/overlay.png
+++ b/examples/declarative/toys/dial/content/overlay.png
Binary files differ
diff --git a/examples/declarative/dial/dial-example.qml b/examples/declarative/toys/dial/dial-example.qml
index fd899a5..900954f 100644
--- a/examples/declarative/dial/dial-example.qml
+++ b/examples/declarative/toys/dial/dial-example.qml
@@ -1,6 +1,7 @@
import Qt 4.7
import "content"
+//! [0]
Rectangle {
color: "#545454"
width: 300; height: 300
@@ -14,7 +15,10 @@ Rectangle {
Rectangle {
id: container
- anchors { bottom: parent.bottom; left: parent.left; right: parent.right; leftMargin: 20; rightMargin: 20; bottomMargin: 10 }
+ anchors { bottom: parent.bottom; left: parent.left
+ right: parent.right; leftMargin: 20; rightMargin: 20
+ bottomMargin: 10
+ }
height: 16
radius: 8
@@ -37,8 +41,10 @@ Rectangle {
MouseArea {
anchors.fill: parent
- drag.target: parent; drag.axis: "XAxis"; drag.minimumX: 2; drag.maximumX: container.width - 32
+ drag.target: parent; drag.axis: Drag.XAxis
+ drag.minimumX: 2; drag.maximumX: container.width - 32
}
}
}
}
+//! [0] \ No newline at end of file
diff --git a/examples/declarative/dial/dial.qmlproject b/examples/declarative/toys/dial/dial.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/dial/dial.qmlproject
+++ b/examples/declarative/toys/dial/dial.qmlproject
diff --git a/examples/declarative/toys/dynamic/dynamic.qml b/examples/declarative/toys/dynamic/dynamic.qml
new file mode 100644
index 0000000..52c7c1e
--- /dev/null
+++ b/examples/declarative/toys/dynamic/dynamic.qml
@@ -0,0 +1,176 @@
+import Qt 4.7
+import Qt.labs.particles 1.0
+import "qml"
+
+Item {
+ id: window
+
+ property int activeSuns: 0
+
+ //This is a desktop-sized example
+ width: 1024; height: 512
+
+ //This is the message box that pops up when there's an error
+ Rectangle {
+ id: dialog
+
+ opacity: 0
+ anchors.centerIn: parent
+ width: dialogText.width + 6; height: dialogText.height + 6
+ border.color: 'black'
+ color: 'lightsteelblue'
+ z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones.
+
+ function show(str){
+ dialogText.text = str;
+ dialogAnim.start();
+ }
+
+ Text {
+ id: dialogText
+ x: 3; y: 3
+ font.pixelSize: 14
+ }
+
+ SequentialAnimation {
+ id: dialogAnim
+ NumberAnimation { target: dialog; property:"opacity"; to: 1; duration: 1000 }
+ PauseAnimation { duration: 5000 }
+ NumberAnimation { target: dialog; property:"opacity"; to: 0; duration: 1000 }
+ }
+ }
+
+ // sky
+ Rectangle {
+ id: sky
+ anchors { left: parent.left; top: parent.top; right: toolbox.right; bottom: parent.verticalCenter }
+ gradient: Gradient {
+ GradientStop { id: gradientStopA; position: 0.0; color: "#0E1533" }
+ GradientStop { id: gradientStopB; position: 1.0; color: "#437284" }
+ }
+ }
+
+ // stars (when there's no sun)
+ Particles {
+ id: stars
+ x: 0; y: 0; width: parent.width; height: parent.height / 2
+ source: "images/star.png"
+ angleDeviation: 360
+ velocity: 0; velocityDeviation: 0
+ count: parent.width / 10
+ fadeInDuration: 2800
+ opacity: 1
+ }
+
+ // ground
+ Rectangle {
+ id: ground
+ z: 2 // just above the sun so that the sun can set behind it
+ anchors { left: parent.left; top: parent.verticalCenter; right: toolbox.left; bottom: parent.bottom }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "ForestGreen" }
+ GradientStop { position: 1.0; color: "DarkGreen" }
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ // right-hand panel
+ Rectangle {
+ id: toolbox
+
+ width: 480
+ color: activePalette.window
+ anchors { right: parent.right; top: parent.top; bottom: parent.bottom }
+
+ Column {
+ anchors.centerIn: parent
+ spacing: 8
+
+ Text { text: "Drag an item into the scene." }
+
+ Rectangle {
+ width: childrenRect.width + 10; height: childrenRect.height + 10
+ border.color: "black"
+
+ Row {
+ anchors.centerIn: parent
+ spacing: 8
+
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "Sun.qml"
+ image: "../images/sun.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "GenericSceneItem.qml"
+ image: "../images/moon.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "../images/tree_s.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "../images/rabbit_brown.png"
+ }
+ PaletteItem {
+ anchors.verticalCenter: parent.verticalCenter
+ componentFile: "PerspectiveItem.qml"
+ image: "../images/rabbit_bw.png"
+ }
+ }
+ }
+
+ Text { text: "Active Suns: " + activeSuns }
+
+ Rectangle { width: parent.width; height: 1; color: "black" }
+
+ Text { text: "Arbitrary QML:" }
+
+ Rectangle {
+ width: 460; height: 240
+
+ TextEdit {
+ id: qmlText
+ anchors.fill: parent; anchors.margins: 5
+ readOnly: false
+ focusOnPress: true
+ font.pixelSize: 14
+
+ text: "import Qt 4.7\nImage {\n id: smile\n x: 500 * Math.random()\n y: 200 * Math.random() \n source: 'images/face-smile.png'\n\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n\n Component.onCompleted: smile.destroy(1500);\n}"
+ }
+ }
+
+ Button {
+ text: "Create"
+ onClicked: {
+ try {
+ Qt.createQmlObject(qmlText.text, window, 'CustomObject');
+ } catch(err) {
+ dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message);
+ }
+ }
+ }
+ }
+ }
+
+ //Day state, for when a sun is added to the scene
+ states: State {
+ name: "Day"
+ when: window.activeSuns > 0
+
+ PropertyChanges { target: gradientStopA; color: "DeepSkyBlue" }
+ PropertyChanges { target: gradientStopB; color: "SkyBlue" }
+ PropertyChanges { target: stars; opacity: 0 }
+ }
+
+ transitions: Transition {
+ PropertyAnimation { duration: 3000 }
+ ColorAnimation { duration: 3000 }
+ }
+
+}
diff --git a/examples/declarative/dynamic/dynamic.qmlproject b/examples/declarative/toys/dynamic/dynamic.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/dynamic/dynamic.qmlproject
+++ b/examples/declarative/toys/dynamic/dynamic.qmlproject
diff --git a/examples/declarative/dynamic/images/NOTE b/examples/declarative/toys/dynamic/images/NOTE
index fcd87f9..fcd87f9 100644
--- a/examples/declarative/dynamic/images/NOTE
+++ b/examples/declarative/toys/dynamic/images/NOTE
diff --git a/examples/declarative/animations/images/face-smile.png b/examples/declarative/toys/dynamic/images/face-smile.png
index 3d66d72..3d66d72 100644
--- a/examples/declarative/animations/images/face-smile.png
+++ b/examples/declarative/toys/dynamic/images/face-smile.png
Binary files differ
diff --git a/examples/declarative/dynamic/images/moon.png b/examples/declarative/toys/dynamic/images/moon.png
index 1c0d606..1c0d606 100644
--- a/examples/declarative/dynamic/images/moon.png
+++ b/examples/declarative/toys/dynamic/images/moon.png
Binary files differ
diff --git a/examples/declarative/dynamic/images/rabbit_brown.png b/examples/declarative/toys/dynamic/images/rabbit_brown.png
index ebfdeed..ebfdeed 100644
--- a/examples/declarative/dynamic/images/rabbit_brown.png
+++ b/examples/declarative/toys/dynamic/images/rabbit_brown.png
Binary files differ
diff --git a/examples/declarative/dynamic/images/rabbit_bw.png b/examples/declarative/toys/dynamic/images/rabbit_bw.png
index 7bff9b9..7bff9b9 100644
--- a/examples/declarative/dynamic/images/rabbit_bw.png
+++ b/examples/declarative/toys/dynamic/images/rabbit_bw.png
Binary files differ
diff --git a/examples/declarative/animations/images/star.png b/examples/declarative/toys/dynamic/images/star.png
index 27ef924..27ef924 100644
--- a/examples/declarative/animations/images/star.png
+++ b/examples/declarative/toys/dynamic/images/star.png
Binary files differ
diff --git a/examples/declarative/animations/images/sun.png b/examples/declarative/toys/dynamic/images/sun.png
index 7713ca5..7713ca5 100644
--- a/examples/declarative/animations/images/sun.png
+++ b/examples/declarative/toys/dynamic/images/sun.png
Binary files differ
diff --git a/examples/declarative/dynamic/images/tree_s.png b/examples/declarative/toys/dynamic/images/tree_s.png
index 6eac35a..6eac35a 100644
--- a/examples/declarative/dynamic/images/tree_s.png
+++ b/examples/declarative/toys/dynamic/images/tree_s.png
Binary files differ
diff --git a/examples/declarative/toys/dynamic/qml/Button.qml b/examples/declarative/toys/dynamic/qml/Button.qml
new file mode 100644
index 0000000..963a850
--- /dev/null
+++ b/examples/declarative/toys/dynamic/qml/Button.qml
@@ -0,0 +1,40 @@
+import Qt 4.7
+
+Rectangle {
+ id: container
+
+ property variant text
+ signal clicked
+
+ height: text.height + 10; width: text.width + 20
+ border.width: 1
+ radius: 4
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: !mouseArea.pressed ? activePalette.light : activePalette.button
+ }
+ GradientStop {
+ position: 1.0
+ color: !mouseArea.pressed ? activePalette.button : activePalette.dark
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+
+ Text {
+ id: text
+ anchors.centerIn:parent
+ font.pointSize: 10
+ text: parent.text
+ color: activePalette.buttonText
+ }
+}
diff --git a/examples/declarative/toys/dynamic/qml/PaletteItem.qml b/examples/declarative/toys/dynamic/qml/PaletteItem.qml
new file mode 100644
index 0000000..dcb5cc3
--- /dev/null
+++ b/examples/declarative/toys/dynamic/qml/PaletteItem.qml
@@ -0,0 +1,19 @@
+import Qt 4.7
+import "itemCreation.js" as Code
+
+Image {
+ id: paletteItem
+
+ property string componentFile
+ property string image
+
+ source: image
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: Code.startDrag(mouse);
+ onPositionChanged: Code.continueDrag(mouse);
+ onReleased: Code.endDrag(mouse);
+ }
+}
diff --git a/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml b/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml
new file mode 100644
index 0000000..c04d3dc
--- /dev/null
+++ b/examples/declarative/toys/dynamic/qml/PerspectiveItem.qml
@@ -0,0 +1,25 @@
+import Qt 4.7
+
+Image {
+ id: rootItem
+
+ property bool created: false
+ property string image
+
+ property double scaledBottom: y + (height + height*scale) / 2
+ property bool onLand: scaledBottom > window.height / 2
+
+ source: image
+ opacity: onLand ? 1 : 0.25
+ scale: Math.max((y + height - 250) * 0.01, 0.3)
+ smooth: true
+
+ onCreatedChanged: {
+ if (created && !onLand)
+ rootItem.destroy();
+ else
+ z = scaledBottom;
+ }
+
+ onYChanged: z = scaledBottom;
+}
diff --git a/examples/declarative/toys/dynamic/qml/Sun.qml b/examples/declarative/toys/dynamic/qml/Sun.qml
new file mode 100644
index 0000000..43dcb9a
--- /dev/null
+++ b/examples/declarative/toys/dynamic/qml/Sun.qml
@@ -0,0 +1,38 @@
+import Qt 4.7
+
+Image {
+ id: sun
+
+ property bool created: false
+ property string image: "../images/sun.png"
+
+ source: image
+
+ // once item is created, start moving offscreen
+ NumberAnimation on y {
+ to: window.height / 2
+ running: created
+ onRunningChanged: {
+ if (running)
+ duration = (window.height - sun.y) * 10;
+ else
+ state = "OffScreen"
+ }
+ }
+
+ states: State {
+ name: "OffScreen"
+ StateChangeScript {
+ script: { sun.created = false; sun.destroy() }
+ }
+ }
+
+ onCreatedChanged: {
+ if (created) {
+ sun.z = 1; // above the sky but below the ground layer
+ window.activeSuns++;
+ } else {
+ window.activeSuns--;
+ }
+ }
+}
diff --git a/examples/declarative/toys/dynamic/qml/itemCreation.js b/examples/declarative/toys/dynamic/qml/itemCreation.js
new file mode 100644
index 0000000..59750f3
--- /dev/null
+++ b/examples/declarative/toys/dynamic/qml/itemCreation.js
@@ -0,0 +1,65 @@
+var itemComponent = null;
+var draggedItem = null;
+var startingMouse;
+var posnInWindow;
+
+function startDrag(mouse)
+{
+ posnInWindow = paletteItem.mapToItem(null, 0, 0);
+ startingMouse = { x: mouse.x, y: mouse.y }
+ loadComponent();
+}
+
+//Creation is split into two functions due to an asynchronous wait while
+//possible external files are loaded.
+
+function loadComponent() {
+ if (itemComponent != null) { // component has been previously loaded
+ createItem();
+ return;
+ }
+
+ itemComponent = Qt.createComponent(paletteItem.componentFile);
+ if (itemComponent.status == Component.Loading) //Depending on the content, it can be ready or error immediately
+ component.statusChanged.connect(createItem);
+ else
+ createItem();
+}
+
+function createItem() {
+ if (itemComponent.status == Component.Ready && draggedItem == null) {
+ draggedItem = itemComponent.createObject(window);
+ draggedItem.image = paletteItem.image;
+ draggedItem.x = posnInWindow.x;
+ draggedItem.y = posnInWindow.y;
+ draggedItem.z = 3; // make sure created item is above the ground layer
+ } else if (itemComponent.status == Component.Error) {
+ draggedItem = null;
+ console.log("error creating component");
+ console.log(component.errorsString());
+ }
+}
+
+function continueDrag(mouse)
+{
+ if (draggedItem == null)
+ return;
+
+ draggedItem.x = mouse.x + posnInWindow.x - startingMouse.x;
+ draggedItem.y = mouse.y + posnInWindow.y - startingMouse.y;
+}
+
+function endDrag(mouse)
+{
+ if (draggedItem == null)
+ return;
+
+ if (draggedItem.x + draggedItem.width > toolbox.x) { //Don't drop it in the toolbox
+ draggedItem.destroy();
+ draggedItem = null;
+ } else {
+ draggedItem.created = true;
+ draggedItem = null;
+ }
+}
+
diff --git a/examples/declarative/tic-tac-toe/content/Button.qml b/examples/declarative/toys/tic-tac-toe/content/Button.qml
index ecf18cd..ecf18cd 100644
--- a/examples/declarative/tic-tac-toe/content/Button.qml
+++ b/examples/declarative/toys/tic-tac-toe/content/Button.qml
diff --git a/examples/declarative/tic-tac-toe/content/TicTac.qml b/examples/declarative/toys/tic-tac-toe/content/TicTac.qml
index d247943..d247943 100644
--- a/examples/declarative/tic-tac-toe/content/TicTac.qml
+++ b/examples/declarative/toys/tic-tac-toe/content/TicTac.qml
diff --git a/examples/declarative/tic-tac-toe/content/pics/board.png b/examples/declarative/toys/tic-tac-toe/content/pics/board.png
index 7e5b7ba..7e5b7ba 100644
--- a/examples/declarative/tic-tac-toe/content/pics/board.png
+++ b/examples/declarative/toys/tic-tac-toe/content/pics/board.png
Binary files differ
diff --git a/examples/declarative/tic-tac-toe/content/pics/o.png b/examples/declarative/toys/tic-tac-toe/content/pics/o.png
index abc7ee0..abc7ee0 100644
--- a/examples/declarative/tic-tac-toe/content/pics/o.png
+++ b/examples/declarative/toys/tic-tac-toe/content/pics/o.png
Binary files differ
diff --git a/examples/declarative/tic-tac-toe/content/pics/x.png b/examples/declarative/toys/tic-tac-toe/content/pics/x.png
index ddc65c8..ddc65c8 100644
--- a/examples/declarative/tic-tac-toe/content/pics/x.png
+++ b/examples/declarative/toys/tic-tac-toe/content/pics/x.png
Binary files differ
diff --git a/examples/declarative/tic-tac-toe/content/tic-tac-toe.js b/examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js
index f8d6d9f..f8d6d9f 100644
--- a/examples/declarative/tic-tac-toe/content/tic-tac-toe.js
+++ b/examples/declarative/toys/tic-tac-toe/content/tic-tac-toe.js
diff --git a/examples/declarative/tic-tac-toe/tic-tac-toe.qml b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml
index dd13052..dd13052 100644
--- a/examples/declarative/tic-tac-toe/tic-tac-toe.qml
+++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qml
diff --git a/examples/declarative/connections/connections.qmlproject b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/connections/connections.qmlproject
+++ b/examples/declarative/toys/tic-tac-toe/tic-tac-toe.qmlproject
diff --git a/examples/declarative/border-image/border-image.qmlproject b/examples/declarative/toys/toys.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/border-image/border-image.qmlproject
+++ b/examples/declarative/toys/toys.qmlproject
diff --git a/examples/declarative/tvtennis/tvtennis.qml b/examples/declarative/toys/tvtennis/tvtennis.qml
index 354a16f..c90d9c5 100644
--- a/examples/declarative/tvtennis/tvtennis.qml
+++ b/examples/declarative/toys/tvtennis/tvtennis.qml
@@ -1,5 +1,4 @@
import Qt 4.7
-import Qt.multimedia 4.7
Rectangle {
id: page
@@ -17,17 +16,12 @@ Rectangle {
x: 20; width: 20; height: 20; z: 1
color: "Lime"
- SoundEffect { id: paddle; source: "paddle.wav" }
- SoundEffect { id: wall; source: "click.wav" }
-
// Move the ball to the right and back to the left repeatedly
SequentialAnimation on x {
loops: Animation.Infinite
NumberAnimation { to: page.width - 40; duration: 2000 }
- ScriptAction { script: paddle.play() }
PropertyAction { target: ball; property: "direction"; value: "left" }
NumberAnimation { to: 20; duration: 2000 }
- ScriptAction { script: paddle.play() }
PropertyAction { target: ball; property: "direction"; value: "right" }
}
@@ -37,10 +31,8 @@ Rectangle {
// Detect the ball hitting the top or bottom of the view and bounce it
onYChanged: {
if (y <= 0) {
- wall.play();
targetY = page.height - 20;
} else if (y >= page.height - 20) {
- wall.play();
targetY = 0;
}
}
diff --git a/examples/declarative/aspectratio/aspectratio.qmlproject b/examples/declarative/toys/tvtennis/tvtennis.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/aspectratio/aspectratio.qmlproject
+++ b/examples/declarative/toys/tvtennis/tvtennis.qmlproject
diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/toys/velocity/Day.qml
index 433295b..350c1c4 100644
--- a/examples/declarative/velocity/Day.qml
+++ b/examples/declarative/toys/velocity/Day.qml
@@ -61,7 +61,7 @@ Component {
id: mouse
anchors.fill: parent
drag.target: stickyPage
- drag.axis: "XandYAxis"
+ drag.axis: Drag.XandYAxis
drag.minimumY: 0
drag.maximumY: page.height - 80
drag.minimumX: 100
diff --git a/examples/declarative/velocity/cork.jpg b/examples/declarative/toys/velocity/cork.jpg
index 160bc00..160bc00 100644
--- a/examples/declarative/velocity/cork.jpg
+++ b/examples/declarative/toys/velocity/cork.jpg
Binary files differ
diff --git a/examples/declarative/velocity/note-yellow.png b/examples/declarative/toys/velocity/note-yellow.png
index 8ddecc8..8ddecc8 100644
--- a/examples/declarative/velocity/note-yellow.png
+++ b/examples/declarative/toys/velocity/note-yellow.png
Binary files differ
diff --git a/examples/declarative/velocity/tack.png b/examples/declarative/toys/velocity/tack.png
index cef2d1c..cef2d1c 100644
--- a/examples/declarative/velocity/tack.png
+++ b/examples/declarative/toys/velocity/tack.png
Binary files differ
diff --git a/examples/declarative/velocity/velocity.qml b/examples/declarative/toys/velocity/velocity.qml
index 871bafc..871bafc 100644
--- a/examples/declarative/velocity/velocity.qml
+++ b/examples/declarative/toys/velocity/velocity.qml
diff --git a/examples/declarative/animations/animations.qmlproject b/examples/declarative/toys/velocity/velocity.qmlproject
index d4909f8..d4909f8 100644
--- a/examples/declarative/animations/animations.qmlproject
+++ b/examples/declarative/toys/velocity/velocity.qmlproject
diff --git a/examples/declarative/tutorials/extending/extending.pro b/examples/declarative/tutorials/extending/extending.pro
new file mode 100644
index 0000000..0c86fed
--- /dev/null
+++ b/examples/declarative/tutorials/extending/extending.pro
@@ -0,0 +1,9 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ chapter1-basics \
+ chapter2-methods \
+ chapter3-bindings \
+ chapter4-customPropertyTypes \
+ chapter5-plugins
+
diff --git a/examples/declarative/tutorials/helloworld/tutorial1.qml b/examples/declarative/tutorials/helloworld/tutorial1.qml
index 5e27b45..04cd155 100644
--- a/examples/declarative/tutorials/helloworld/tutorial1.qml
+++ b/examples/declarative/tutorials/helloworld/tutorial1.qml
@@ -14,8 +14,9 @@ Rectangle {
Text {
id: helloText
text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
font.pointSize: 24; font.bold: true
- y: 30; anchors.horizontalCenter: page.horizontalCenter
}
//![2]
}
diff --git a/examples/declarative/tutorials/helloworld/tutorial2.qml b/examples/declarative/tutorials/helloworld/tutorial2.qml
index 085efa4..66be509 100644
--- a/examples/declarative/tutorials/helloworld/tutorial2.qml
+++ b/examples/declarative/tutorials/helloworld/tutorial2.qml
@@ -9,8 +9,9 @@ Rectangle {
Text {
id: helloText
text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
font.pointSize: 24; font.bold: true
- y: 30; anchors.horizontalCenter: page.horizontalCenter
}
Grid {
diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml
index 4bf4970..0da762c 100644
--- a/examples/declarative/tutorials/helloworld/tutorial3.qml
+++ b/examples/declarative/tutorials/helloworld/tutorial3.qml
@@ -9,8 +9,9 @@ Rectangle {
Text {
id: helloText
text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
font.pointSize: 24; font.bold: true
- y: 30; anchors.horizontalCenter: page.horizontalCenter
//![1]
MouseArea { id: mouseArea; anchors.fill: parent }
@@ -27,7 +28,7 @@ Rectangle {
transitions: Transition {
from: ""; to: "down"; reversible: true
ParallelAnimation {
- NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: "InOutQuad" }
+ NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: Easing.InOutQuad }
ColorAnimation { duration: 500 }
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame1/Block.qml b/examples/declarative/tutorials/samegame/samegame1/Block.qml
index a23654b..11fd844 100644
--- a/examples/declarative/tutorials/samegame/samegame1/Block.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/Block.qml
@@ -7,7 +7,7 @@ Item {
Image {
id: img
anchors.fill: parent
- source: "../shared/pics/redStone.png";
+ source: "../shared/pics/redStone.png"
}
}
//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml
index e84b1ce..96a80eb 100644
--- a/examples/declarative/tutorials/samegame/samegame1/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml
@@ -8,9 +8,9 @@ Rectangle {
signal clicked
- width: buttonLabel.width + 20; height: buttonLabel.height + 6
- smooth: true
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
radius: 8
// color the button with a gradient
@@ -27,8 +27,17 @@ Rectangle {
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked();
+ }
- Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText }
+ Text {
+ id: buttonLabel
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
}
//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
index b6e01fd..f2974be 100644
--- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
@@ -22,21 +22,20 @@ Rectangle {
Rectangle {
id: toolBar
- width: parent.width; height: 32
+ width: parent.width; height: 30
color: activePalette.window
anchors.bottom: screen.bottom
Button {
- anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
text: "New Game"
onClicked: console.log("This doesn't do anything yet...")
}
Text {
id: score
- anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
text: "Score: Who knows?"
- font.bold: true
}
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame2/Block.qml b/examples/declarative/tutorials/samegame/samegame2/Block.qml
index 4e71e60..39da84e 100644
--- a/examples/declarative/tutorials/samegame/samegame2/Block.qml
+++ b/examples/declarative/tutorials/samegame/samegame2/Block.qml
@@ -6,6 +6,6 @@ Item {
Image {
id: img
anchors.fill: parent
- source: "../shared/pics/redStone.png";
+ source: "../shared/pics/redStone.png"
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml
index 737d886..4ed856b 100644
--- a/examples/declarative/tutorials/samegame/samegame2/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml
@@ -7,9 +7,9 @@ Rectangle {
signal clicked
- width: buttonLabel.width + 20; height: buttonLabel.height + 6
- smooth: true
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
radius: 8
// color the button with a gradient
@@ -26,7 +26,16 @@ Rectangle {
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked();
+ }
- Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText }
+ Text {
+ id: buttonLabel
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
}
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js
index e5c790d..0dbe6a6 100644
--- a/examples/declarative/tutorials/samegame/samegame2/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js
@@ -37,17 +37,16 @@ function createBlock(column, row) {
if (component == null)
component = Qt.createComponent("Block.qml");
- // Note that if Block.qml was not a local file, component.isReady would be
- // false and we should wait for the component's statusChanged() signal to
- // know when the file is downloaded and fully loaded before calling createObject().
- if (component.isReady) {
- var dynamicObject = component.createObject();
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(background);
if (dynamicObject == null) {
console.log("error creating block");
console.log(component.errorsString());
return false;
}
- dynamicObject.parent = background;
dynamicObject.x = column * blockSize;
dynamicObject.y = row * blockSize;
dynamicObject.width = blockSize;
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml
index a7d1fba..9b4d4d5 100644
--- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml
@@ -30,7 +30,7 @@ Rectangle {
//![1]
Button {
- anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
text: "New Game"
onClicked: SameGame.startNewGame()
}
@@ -38,9 +38,8 @@ Rectangle {
Text {
id: score
- anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
text: "Score: Who knows?"
- font.bold: true
}
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml
index 737d886..4ed856b 100644
--- a/examples/declarative/tutorials/samegame/samegame3/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml
@@ -7,9 +7,9 @@ Rectangle {
signal clicked
- width: buttonLabel.width + 20; height: buttonLabel.height + 6
- smooth: true
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
radius: 8
// color the button with a gradient
@@ -26,7 +26,16 @@ Rectangle {
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked();
+ }
- Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText }
+ Text {
+ id: buttonLabel
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
}
diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
index 15b3b2f..3efed2f 100644
--- a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
+++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
@@ -2,31 +2,30 @@
import Qt 4.7
Rectangle {
- id: page
+ id: container
- signal closed
-
- function forceClose() {
- page.closed();
- page.opacity = 0;
+ function show(text) {
+ dialogText.text = text;
+ container.opacity = 1;
}
- function show(txt) {
- dialogText.text = txt;
- page.opacity = 1;
+ function hide() {
+ container.opacity = 0;
}
- width: dialogText.width + 20; height: dialogText.height + 20
- color: "white"
- border.width: 1
+ width: dialogText.width + 20
+ height: dialogText.height + 20
opacity: 0
- Behavior on opacity {
- NumberAnimation { duration: 1000 }
+ Text {
+ id: dialogText
+ anchors.centerIn: parent
+ text: ""
}
- Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" }
-
- MouseArea { anchors.fill: parent; onClicked: forceClose(); }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: hide();
+ }
}
//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js
index da0f76e..3e97264 100644
--- a/examples/declarative/tutorials/samegame/samegame3/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js
@@ -17,7 +17,7 @@ function startNewGame() {
maxIndex = maxRow * maxColumn;
//Close dialogs
- dialog.forceClose();
+ dialog.hide();
//Initialize Board
board = new Array(maxIndex);
@@ -34,18 +34,17 @@ function createBlock(column, row) {
if (component == null)
component = Qt.createComponent("Block.qml");
- // Note that if Block.qml was not a local file, component.isReady would be
- // false and we should wait for the component's statusChanged() signal to
- // know when the file is downloaded and fully loaded before calling createObject().
- if (component.isReady) {
- var dynamicObject = component.createObject();
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(gameCanvas);
if (dynamicObject == null) {
console.log("error creating block");
console.log(component.errorsString());
return false;
}
dynamicObject.type = Math.floor(Math.random() * 3);
- dynamicObject.parent = gameCanvas;
dynamicObject.x = column * gameCanvas.blockSize;
dynamicObject.y = row * gameCanvas.blockSize;
dynamicObject.width = gameCanvas.blockSize;
@@ -59,10 +58,9 @@ function createBlock(column, row) {
return true;
}
-var fillFound;
-//Set after a floodFill call to the number of blocks found
-var floodBoard;
-//Set to 1 if the floodFill reaches off that node
+var fillFound; //Set after a floodFill call to the number of blocks found
+var floodBoard; //Set to 1 if the floodFill reaches off that node
+
//![1]
function handleClick(xPos, yPos) {
var column = Math.floor(xPos / gameCanvas.blockSize);
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml
index 50f9d5d..ac93eb1 100644
--- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml
@@ -30,7 +30,6 @@ Rectangle {
width: parent.width - (parent.width % blockSize)
height: parent.height - (parent.height % blockSize)
anchors.centerIn: parent
- z: 20
MouseArea {
anchors.fill: parent
@@ -41,26 +40,29 @@ Rectangle {
}
//![2]
- Dialog { id: dialog; anchors.centerIn: parent; z: 21 }
+ Dialog {
+ id: dialog
+ anchors.centerIn: parent
+ z: 100
+ }
//![2]
Rectangle {
id: toolBar
- width: parent.width; height: 32
+ width: parent.width; height: 30
color: activePalette.window
anchors.bottom: screen.bottom
Button {
- anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
text: "New Game"
onClicked: SameGame.startNewGame()
}
Text {
id: score
- anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
text: "Score: Who knows?"
- font.bold: true
}
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
index 737d886..4ed856b 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
@@ -7,9 +7,9 @@ Rectangle {
signal clicked
- width: buttonLabel.width + 20; height: buttonLabel.height + 6
- smooth: true
+ width: buttonLabel.width + 20; height: buttonLabel.height + 5
border { width: 1; color: Qt.darker(activePalette.button) }
+ smooth: true
radius: 8
// color the button with a gradient
@@ -26,7 +26,16 @@ Rectangle {
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked();
+ }
- Text { id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText }
+ Text {
+ id: buttonLabel
+ anchors.centerIn: container
+ color: activePalette.buttonText
+ text: container.text
+ }
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
index 6848534..2f45362 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
@@ -1,30 +1,59 @@
import Qt 4.7
+//![0]
Rectangle {
- id: page
+ id: container
+//![0]
+//![1]
+ property string inputText: textInput.text
signal closed
- function forceClose() {
- page.closed();
- page.opacity = 0;
+ function show(text) {
+ dialogText.text = text;
+ container.opacity = 1;
+ textInput.opacity = 0;
}
- function show(txt) {
- dialogText.text = txt;
- page.opacity = 1;
+ function showWithInput(text) {
+ show(text);
+ textInput.opacity = 1;
+ textInput.text = ""
}
- width: dialogText.width + 20; height: dialogText.height + 20
- color: "white"
- border.width: 1
+ function hide() {
+ container.opacity = 0;
+ container.closed();
+ }
+//![1]
+
+ width: dialogText.width + textInput.width + 20
+ height: dialogText.height + 20
opacity: 0
- Behavior on opacity {
- NumberAnimation { duration: 1000 }
+ Text {
+ id: dialogText
+ anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 }
+ text: ""
+ }
+
+//![2]
+ TextInput {
+ id: textInput
+ anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }
+ width: 80
+ focus: true
+ text: ""
+
+ onAccepted: container.hide() // close dialog when Enter is pressed
}
+//![2]
- Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: hide();
+ }
- MouseArea { anchors.fill: parent; onClicked: forceClose(); }
+//![3]
}
+//![3]
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
index 1454f0b..0505b8d 100755
--- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -25,8 +25,8 @@ function startNewGame() {
maxIndex = maxRow * maxColumn;
//Close dialogs
- nameInputDialog.forceClose();
- dialog.forceClose();
+ nameInputDialog.hide();
+ dialog.hide();
//Initialize Board
board = new Array(maxIndex);
@@ -45,18 +45,17 @@ function createBlock(column, row) {
if (component == null)
component = Qt.createComponent("content/BoomBlock.qml");
- // Note that if Block.qml was not a local file, component.isReady would be
- // false and we should wait for the component's statusChanged() signal to
- // know when the file is downloaded and fully loaded before calling createObject().
- if (component.isReady) {
- var dynamicObject = component.createObject();
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(gameCanvas);
if (dynamicObject == null) {
console.log("error creating block");
console.log(component.errorsString());
return false;
}
dynamicObject.type = Math.floor(Math.random() * 3);
- dynamicObject.parent = gameCanvas;
dynamicObject.x = column * gameCanvas.blockSize;
dynamicObject.targetX = column * gameCanvas.blockSize;
dynamicObject.targetY = row * gameCanvas.blockSize;
@@ -72,10 +71,9 @@ function createBlock(column, row) {
return true;
}
-var fillFound;
-//Set after a floodFill call to the number of blocks found
-var floodBoard;
-//Set to 1 if the floodFill reaches off that node
+var fillFound; //Set after a floodFill call to the number of blocks found
+var floodBoard; //Set to 1 if the floodFill reaches off that node
+
function handleClick(xPos, yPos) {
var column = Math.floor(xPos / gameCanvas.blockSize);
var row = Math.floor(yPos / gameCanvas.blockSize);
@@ -157,7 +155,9 @@ function shuffleDown() {
}
}
+//![3]
function victoryCheck() {
+//![3]
//Award bonus points if no blocks left
var deservesBonus = true;
for (var column = maxColumn - 1; column >= 0; column--)
@@ -166,12 +166,14 @@ function victoryCheck() {
if (deservesBonus)
gameCanvas.score += 500;
+//![4]
//Check whether game has finished
if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) {
gameDuration = new Date() - gameDuration;
- nameInputDialog.show("You won! Please enter your name: ");
+ nameInputDialog.showWithInput("You won! Please enter your name: ");
}
}
+//![4]
//only floods up and right, to see if it can find adjacent same-typed blocks
function floodMoveCheck(column, row, type) {
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
index 404af0a..feb61fd 100644
--- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
@@ -25,7 +25,7 @@ Rectangle {
property int score: 0
property int blockSize: 40
- z: 20; anchors.centerIn: parent
+ anchors.centerIn: parent
width: parent.width - (parent.width % blockSize);
height: parent.height - (parent.height % blockSize);
@@ -35,53 +35,41 @@ Rectangle {
}
}
- Dialog { id: dialog; anchors.centerIn: parent; z: 21 }
+ Dialog {
+ id: dialog
+ anchors.centerIn: parent
+ z: 100
+ }
//![0]
Dialog {
id: nameInputDialog
-
anchors.centerIn: parent
- z: 22
+ z: 100
- Text {
- id: dialogText
- opacity: 0
- text: " You won! Please enter your name:"
- }
-
- TextInput {
- id: nameInput
- width: 72
- anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }
- focus: true
-
- onAccepted: {
- if (nameInputDialog.opacity == 1 && nameInput.text != "")
- SameGame.saveHighScore(nameInput.text);
- nameInputDialog.forceClose();
- }
+ onClosed: {
+ if (nameInputDialog.inputText != "")
+ SameGame.saveHighScore(nameInputDialog.inputText);
}
}
//![0]
Rectangle {
id: toolBar
- width: parent.width; height: 32
+ width: parent.width; height: 30
color: activePalette.window
anchors.bottom: screen.bottom
Button {
- anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { left: parent.left; verticalCenter: parent.verticalCenter }
text: "New Game"
onClicked: SameGame.startNewGame()
}
Text {
id: score
- anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter }
+ anchors { right: parent.right; verticalCenter: parent.verticalCenter }
text: "Score: " + gameCanvas.score
- font.bold: true
}
}
}
diff --git a/examples/declarative/tutorials/tutorials.pro b/examples/declarative/tutorials/tutorials.pro
new file mode 100644
index 0000000..0a82c1e
--- /dev/null
+++ b/examples/declarative/tutorials/tutorials.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ extending
+
diff --git a/examples/declarative/tvtennis/click.wav b/examples/declarative/tvtennis/click.wav
deleted file mode 100644
index 26c46f8..0000000
--- a/examples/declarative/tvtennis/click.wav
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/tvtennis/paddle.wav b/examples/declarative/tvtennis/paddle.wav
deleted file mode 100644
index 604e0e5..0000000
--- a/examples/declarative/tvtennis/paddle.wav
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/flipable/content/5_heart.png b/examples/declarative/ui-components/flipable/content/5_heart.png
index fb59d81..fb59d81 100644
--- a/examples/declarative/flipable/content/5_heart.png
+++ b/examples/declarative/ui-components/flipable/content/5_heart.png
Binary files differ
diff --git a/examples/declarative/flipable/content/9_club.png b/examples/declarative/ui-components/flipable/content/9_club.png
index 2545001..2545001 100644
--- a/examples/declarative/flipable/content/9_club.png
+++ b/examples/declarative/ui-components/flipable/content/9_club.png
Binary files differ
diff --git a/examples/declarative/flipable/content/Card.qml b/examples/declarative/ui-components/flipable/content/Card.qml
index 2577d89..2577d89 100644
--- a/examples/declarative/flipable/content/Card.qml
+++ b/examples/declarative/ui-components/flipable/content/Card.qml
diff --git a/examples/declarative/flipable/content/back.png b/examples/declarative/ui-components/flipable/content/back.png
index f715d74..f715d74 100644
--- a/examples/declarative/flipable/content/back.png
+++ b/examples/declarative/ui-components/flipable/content/back.png
Binary files differ
diff --git a/examples/declarative/flipable/flipable-example.qml b/examples/declarative/ui-components/flipable/flipable-example.qml
index 4e09569..4e09569 100644
--- a/examples/declarative/flipable/flipable-example.qml
+++ b/examples/declarative/ui-components/flipable/flipable-example.qml
diff --git a/examples/declarative/ui-components/flipable/flipable.qmlproject b/examples/declarative/ui-components/flipable/flipable.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/flipable/flipable.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/progressbar/content/ProgressBar.qml b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
index bc36df5..bc36df5 100644
--- a/examples/declarative/progressbar/content/ProgressBar.qml
+++ b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
diff --git a/examples/declarative/progressbar/content/background.png b/examples/declarative/ui-components/progressbar/content/background.png
index 9044226..9044226 100644
--- a/examples/declarative/progressbar/content/background.png
+++ b/examples/declarative/ui-components/progressbar/content/background.png
Binary files differ
diff --git a/examples/declarative/ui-components/progressbar/progressbar.qmlproject b/examples/declarative/ui-components/progressbar/progressbar.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/progressbar/progressbar.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/progressbar/progressbars.qml b/examples/declarative/ui-components/progressbar/progressbars.qml
index 55fd682..55fd682 100644
--- a/examples/declarative/progressbar/progressbars.qml
+++ b/examples/declarative/ui-components/progressbar/progressbars.qml
diff --git a/examples/declarative/ui-components/scrollbar/ScrollBar.qml b/examples/declarative/ui-components/scrollbar/ScrollBar.qml
new file mode 100644
index 0000000..c628a20
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/ScrollBar.qml
@@ -0,0 +1,33 @@
+import Qt 4.7
+
+Item {
+ id: scrollBar
+
+ // The properties that define the scrollbar's state.
+ // position and pageSize are in the range 0.0 - 1.0. They are relative to the
+ // height of the page, i.e. a pageSize of 0.5 means that you can see 50%
+ // of the height of the view.
+ // orientation can be either Qt.Vertical or Qt.Horizontal
+ property real position
+ property real pageSize
+ property variant orientation : Qt.Vertical
+
+ // A light, semi-transparent background
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "white"
+ opacity: 0.3
+ }
+ // Size the bar to the required size, depending upon the orientation.
+ Rectangle {
+ x: orientation == Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1)
+ y: orientation == Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1
+ width: orientation == Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2))
+ height: orientation == Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2)
+ radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1)
+ color: "black"
+ opacity: 0.7
+ }
+}
diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/ui-components/scrollbar/display.qml
index cb1da16..6b12d85 100644
--- a/examples/declarative/scrollbar/display.qml
+++ b/examples/declarative/ui-components/scrollbar/display.qml
@@ -20,7 +20,7 @@ Rectangle {
// Only show the scrollbars when the view is moving.
states: State {
name: "ShowBars"
- when: view.moving
+ when: view.movingVertically || view.movingHorizontally
PropertyChanges { target: verticalScrollBar; opacity: 1 }
PropertyChanges { target: horizontalScrollBar; opacity: 1 }
}
@@ -37,7 +37,7 @@ Rectangle {
width: 12; height: view.height-12
anchors.right: view.right
opacity: 0
- orientation: "Vertical"
+ orientation: Qt.Vertical
position: view.visibleArea.yPosition
pageSize: view.visibleArea.heightRatio
}
@@ -47,7 +47,7 @@ Rectangle {
width: view.width-12; height: 12
anchors.bottom: view.bottom
opacity: 0
- orientation: "Horizontal"
+ orientation: Qt.Horizontal
position: view.visibleArea.xPosition
pageSize: view.visibleArea.widthRatio
}
diff --git a/examples/declarative/scrollbar/pics/niagara_falls.jpg b/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg
index 618d808..618d808 100644
--- a/examples/declarative/scrollbar/pics/niagara_falls.jpg
+++ b/examples/declarative/ui-components/scrollbar/pics/niagara_falls.jpg
Binary files differ
diff --git a/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject b/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/scrollbar/scrollbar.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/searchbox/SearchBox.qml b/examples/declarative/ui-components/searchbox/SearchBox.qml
index aae7ee9..aae7ee9 100644
--- a/examples/declarative/searchbox/SearchBox.qml
+++ b/examples/declarative/ui-components/searchbox/SearchBox.qml
diff --git a/examples/declarative/searchbox/images/edit-clear-locationbar-rtl.png b/examples/declarative/ui-components/searchbox/images/edit-clear-locationbar-rtl.png
index 91eb270..91eb270 100644
--- a/examples/declarative/searchbox/images/edit-clear-locationbar-rtl.png
+++ b/examples/declarative/ui-components/searchbox/images/edit-clear-locationbar-rtl.png
Binary files differ
diff --git a/examples/declarative/searchbox/images/lineedit-bg-focus.png b/examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png
index bbfac38..bbfac38 100644
--- a/examples/declarative/searchbox/images/lineedit-bg-focus.png
+++ b/examples/declarative/ui-components/searchbox/images/lineedit-bg-focus.png
Binary files differ
diff --git a/examples/declarative/searchbox/images/lineedit-bg.png b/examples/declarative/ui-components/searchbox/images/lineedit-bg.png
index 9044226..9044226 100644
--- a/examples/declarative/searchbox/images/lineedit-bg.png
+++ b/examples/declarative/ui-components/searchbox/images/lineedit-bg.png
Binary files differ
diff --git a/examples/declarative/searchbox/main.qml b/examples/declarative/ui-components/searchbox/main.qml
index 9f73473..9f73473 100644
--- a/examples/declarative/searchbox/main.qml
+++ b/examples/declarative/ui-components/searchbox/main.qml
diff --git a/examples/declarative/ui-components/searchbox/searchbox.qmlproject b/examples/declarative/ui-components/searchbox/searchbox.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/searchbox/searchbox.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/ui-components/slideswitch/content/Switch.qml
index a8fa6ef..526a171 100644
--- a/examples/declarative/slideswitch/content/Switch.qml
+++ b/examples/declarative/ui-components/slideswitch/content/Switch.qml
@@ -45,7 +45,7 @@ Item {
MouseArea {
anchors.fill: parent
- drag.target: knob; drag.axis: "XAxis"; drag.minimumX: 1; drag.maximumX: 78
+ drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78
onClicked: toggle()
onReleased: dorelease()
}
@@ -69,7 +69,7 @@ Item {
//![7]
transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: "InOutQuad"; duration: 200 }
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 }
}
//![7]
}
diff --git a/examples/declarative/slideswitch/content/background.svg b/examples/declarative/ui-components/slideswitch/content/background.svg
index f920d3e..f920d3e 100644
--- a/examples/declarative/slideswitch/content/background.svg
+++ b/examples/declarative/ui-components/slideswitch/content/background.svg
diff --git a/examples/declarative/slideswitch/content/knob.svg b/examples/declarative/ui-components/slideswitch/content/knob.svg
index fb69337..fb69337 100644
--- a/examples/declarative/slideswitch/content/knob.svg
+++ b/examples/declarative/ui-components/slideswitch/content/knob.svg
diff --git a/examples/declarative/slideswitch/slideswitch.qml b/examples/declarative/ui-components/slideswitch/slideswitch.qml
index 51c3c77..51c3c77 100644
--- a/examples/declarative/slideswitch/slideswitch.qml
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.qml
diff --git a/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject b/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/slideswitch/slideswitch.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/spinner/content/Spinner.qml b/examples/declarative/ui-components/spinner/content/Spinner.qml
new file mode 100644
index 0000000..8145a28
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/content/Spinner.qml
@@ -0,0 +1,25 @@
+import Qt 4.7
+
+Image {
+ property alias model: view.model
+ property alias delegate: view.delegate
+ property alias currentIndex: view.currentIndex
+ property real itemHeight: 30
+ source: "spinner-bg.png"
+ clip: true
+ PathView {
+ id: view
+ anchors.fill: parent
+ pathItemCount: height/itemHeight
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ highlight: Image { source: "spinner-select.png"; width: view.width; height: itemHeight+4 }
+ dragMargin: view.width/2
+ path: Path {
+ startX: view.width/2; startY: -itemHeight/2
+ PathLine { x: view.width/2; y: view.pathItemCount*itemHeight + itemHeight }
+ }
+ }
+ Keys.onDownPressed: view.incrementCurrentIndex()
+ Keys.onUpPressed: view.decrementCurrentIndex()
+}
diff --git a/examples/declarative/ui-components/spinner/content/spinner-bg.png b/examples/declarative/ui-components/spinner/content/spinner-bg.png
new file mode 100644
index 0000000..b3556f1
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/content/spinner-bg.png
Binary files differ
diff --git a/examples/declarative/ui-components/spinner/content/spinner-select.png b/examples/declarative/ui-components/spinner/content/spinner-select.png
new file mode 100644
index 0000000..95a17a1
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/content/spinner-select.png
Binary files differ
diff --git a/examples/declarative/ui-components/spinner/main.qml b/examples/declarative/ui-components/spinner/main.qml
new file mode 100644
index 0000000..6be567a
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/main.qml
@@ -0,0 +1,18 @@
+import Qt 4.7
+import "content"
+
+Rectangle {
+ width: 240; height: 320
+ Column {
+ y: 20; x: 20; spacing: 20
+ Spinner {
+ id: spinner
+ width: 200; height: 240
+ focus: true
+ model: 20
+ itemHeight: 30
+ delegate: Text { font.pixelSize: 25; text: index; height: 30 }
+ }
+ Text { text: "Current item index: " + spinner.currentIndex }
+ }
+}
diff --git a/examples/declarative/ui-components/spinner/spinner.qmlproject b/examples/declarative/ui-components/spinner/spinner.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/spinner/spinner.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/tabwidget/TabWidget.qml b/examples/declarative/ui-components/tabwidget/TabWidget.qml
index 26d25b4..26d25b4 100644
--- a/examples/declarative/tabwidget/TabWidget.qml
+++ b/examples/declarative/ui-components/tabwidget/TabWidget.qml
diff --git a/examples/declarative/tabwidget/tab.png b/examples/declarative/ui-components/tabwidget/tab.png
index ad80216..ad80216 100644
--- a/examples/declarative/tabwidget/tab.png
+++ b/examples/declarative/ui-components/tabwidget/tab.png
Binary files differ
diff --git a/examples/declarative/tabwidget/tabs.qml b/examples/declarative/ui-components/tabwidget/tabs.qml
index fba203c..fba203c 100644
--- a/examples/declarative/tabwidget/tabs.qml
+++ b/examples/declarative/ui-components/tabwidget/tabs.qml
diff --git a/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject b/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/tabwidget/tabwidget.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/ui-components/ui-components.qmlproject b/examples/declarative/ui-components/ui-components.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/ui-components/ui-components.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/xml/xml.qmlproject b/examples/declarative/xml/xml.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/xml/xml.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/xmlhttprequest/test.qml b/examples/declarative/xml/xmlhttprequest/test.qml
index c7e7e6d..c7e7e6d 100644
--- a/examples/declarative/xmlhttprequest/test.qml
+++ b/examples/declarative/xml/xmlhttprequest/test.qml
diff --git a/examples/declarative/xmlhttprequest/test.xml b/examples/declarative/xml/xmlhttprequest/test.xml
index 8b7f1e1..8b7f1e1 100644
--- a/examples/declarative/xmlhttprequest/test.xml
+++ b/examples/declarative/xml/xmlhttprequest/test.xml
diff --git a/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject b/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/xml/xmlhttprequest/xmlhttprequest.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/xmldata/daringfireball.qml b/examples/declarative/xmldata/daringfireball.qml
deleted file mode 100644
index a1df809..0000000
--- a/examples/declarative/xmldata/daringfireball.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- color: "white"
- width: 600; height: 600
-
- XmlListModel {
- id: feedModel
- source: "http://daringfireball.net/index.xml"
- query: "/feed/entry"
- namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "tagline"; query: "author/name/string()" }
- XmlRole { name: "content"; query: "content/string()" }
- }
-
- Component {
- id: feedDelegate
- Item {
- height: childrenRect.height + 20
- Text {
- id: titleText
- x: 10
- text: title; font.bold: true
- }
- Text {
- anchors { left: titleText.right; leftMargin: 10 }
- text: 'by ' + tagline
- font.italic: true
- }
- Text {
- x: 10
- width: 580
- anchors.top: titleText.bottom
- text: content
- wrapMode: Text.WordWrap
-
- onLinkActivated: { console.log('link clicked: ' + link) }
- }
- }
- }
-
- ListView {
- anchors.fill: parent
- model: feedModel
- delegate: feedDelegate
- }
-}
diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml
deleted file mode 100644
index 668778e..0000000
--- a/examples/declarative/xmldata/yahoonews.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-import Qt 4.7
-
-Rectangle {
- width: 600; height: 600
-
- gradient: Gradient {
- GradientStop { position: 0; color: "black" }
- GradientStop { position: 1.0; color: "#AAAAAA" }
- }
-
- XmlListModel {
- id: feedModel
- source: "http://rss.news.yahoo.com/rss/oceania"
- query: "/rss/channel/item"
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "link"; query: "link/string()" }
- XmlRole { name: "description"; query: "description/string()" }
- }
-
- Component {
- id: feedDelegate
-
- Item {
- id: delegate
- height: wrapper.height + 10
-
- MouseArea {
- anchors.fill: wrapper
- onPressed: delegate.ListView.view.currentIndex = index;
- onClicked: if (wrapper.state == 'Details') wrapper.state = ''; else wrapper.state = 'Details';
- }
-
- Rectangle {
- id: wrapper
-
- width: 580; y: 5; height: titleText.height + 10
- color: "#F0F0F0"
- radius: 5
-
- Text {
- id: titleText
- x: 10; y: 5
- text: '<a href=\'' + link + '\'>' + title + '</a>'
- font { bold: true; family: "Helvetica"; pointSize: 14 }
-
- onLinkActivated: { console.log('link clicked: ' + link) }
- }
-
- Text {
- id: descriptionText
- x: 10; width: 560
- anchors.top: titleText.bottom; anchors.topMargin: 5
- text: description
- wrapMode: Text.WordWrap
- font.family: "Helvetica"
- opacity: 0
- }
-
- states: State {
- name: "Details"
- PropertyChanges { target: wrapper; height: childrenRect.height + 10 }
- PropertyChanges { target: descriptionText; opacity: 1 }
- }
-
- transitions: Transition {
- from: "*"; to: "Details"; reversible: true
- SequentialAnimation {
- NumberAnimation { duration: 200; properties: "height"; easing.type: "OutQuad" }
- NumberAnimation { duration: 200; properties: "opacity" }
- }
- }
- }
- }
- }
-
- ListView {
- id: list
- x: 10; y: 10
- width: parent.width - 20; height: parent.height - 20
- model: feedModel
- delegate: feedDelegate
- }
-}
diff --git a/examples/graphicsview/padnavigator/flippablepad.cpp b/examples/graphicsview/padnavigator/flippablepad.cpp
new file mode 100644
index 0000000..58aea00
--- /dev/null
+++ b/examples/graphicsview/padnavigator/flippablepad.cpp
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "flippablepad.h"
+
+#include <QtGui/QtGui>
+
+//! [0]
+static QRectF boundsFromSize(const QSize &size)
+{
+ return QRectF((-size.width() / 2.0) * 150, (-size.height() / 2.0) * 150,
+ size.width() * 150, size.height() * 150);
+}
+//! [0]
+
+//! [1]
+static QPointF posForLocation(int column, int row, const QSize &size)
+{
+ return QPointF(column * 150, row * 150)
+ - QPointF((size.width() - 1) * 75, (size.height() - 1) * 75);
+}
+//! [1]
+
+//! [2]
+FlippablePad::FlippablePad(const QSize &size, QGraphicsItem *parent)
+ : RoundRectItem(boundsFromSize(size), QColor(226, 255, 92, 64), parent)
+{
+//! [2]
+//! [3]
+ int numIcons = size.width() * size.height();
+ QList<QPixmap> pixmaps;
+ QDirIterator it(":/images", QStringList() << "*.png");
+ while (it.hasNext() && pixmaps.size() < numIcons)
+ pixmaps << it.next();
+//! [3]
+
+//! [4]
+ const QRectF iconRect(-54, -54, 108, 108);
+ const QColor iconColor(214, 240, 110, 128);
+ iconGrid.resize(size.height());
+ int n = 0;
+
+ for (int y = 0; y < size.height(); ++y) {
+ iconGrid[y].resize(size.width());
+ for (int x = 0; x < size.width(); ++x) {
+ RoundRectItem *rect = new RoundRectItem(iconRect, iconColor, this);
+ rect->setZValue(1);
+ rect->setPos(posForLocation(x, y, size));
+ rect->setPixmap(pixmaps.at(n++ % pixmaps.size()));
+ iconGrid[y][x] = rect;
+ }
+ }
+}
+//! [4]
+
+//! [5]
+RoundRectItem *FlippablePad::iconAt(int column, int row) const
+{
+ return iconGrid[row][column];
+}
+//! [5]
diff --git a/examples/graphicsview/padnavigator/flippablepad.h b/examples/graphicsview/padnavigator/flippablepad.h
new file mode 100644
index 0000000..7d99536
--- /dev/null
+++ b/examples/graphicsview/padnavigator/flippablepad.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef FLIPPABLEPAD_H
+#define FLIPPABLEPAD_H
+
+#include "roundrectitem.h"
+
+#include <QGraphicsObject>
+#include <QLinearGradient>
+#include <QVector>
+
+//! [0]
+class FlippablePad : public RoundRectItem
+{
+public:
+ FlippablePad(const QSize &size, QGraphicsItem *parent = 0);
+
+ RoundRectItem *iconAt(int column, int row) const;
+
+private:
+ QVector<QVector<RoundRectItem *> > iconGrid;
+};
+//! [0]
+
+#endif // FLIPPABLEPAD_H
diff --git a/examples/graphicsview/padnavigator/backside.ui b/examples/graphicsview/padnavigator/form.ui
index afa488c..fc7d123 100644
--- a/examples/graphicsview/padnavigator/backside.ui
+++ b/examples/graphicsview/padnavigator/form.ui
@@ -1,6 +1,6 @@
<ui version="4.0" >
- <class>BackSide</class>
- <widget class="QWidget" name="BackSide" >
+ <class>Form</class>
+ <widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp
index fb6c120..984b976 100644
--- a/examples/graphicsview/padnavigator/main.cpp
+++ b/examples/graphicsview/padnavigator/main.cpp
@@ -39,21 +39,19 @@
**
****************************************************************************/
-#include <QtGui>
-#ifndef QT_NO_OPENGL
-# include <QtOpenGL>
-#endif
+#include "padnavigator.h"
-#include "panel.h"
+#include <QtGui/QtGui>
+//! [0]
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Q_INIT_RESOURCE(padnavigator);
- Panel panel(3, 3);
- panel.setFocus();
- panel.show();
+ PadNavigator navigator(QSize(3, 3));
+ navigator.show();
return app.exec();
}
+//! [0]
diff --git a/examples/graphicsview/padnavigator/padnavigator.cpp b/examples/graphicsview/padnavigator/padnavigator.cpp
new file mode 100644
index 0000000..b1d19f6
--- /dev/null
+++ b/examples/graphicsview/padnavigator/padnavigator.cpp
@@ -0,0 +1,307 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "flippablepad.h"
+#include "padnavigator.h"
+#include "splashitem.h"
+
+#include <QtGui/QtGui>
+#ifndef QT_NO_OPENGL
+#include <QtOpenGL/QtOpenGL>
+#endif
+
+//! [0]
+PadNavigator::PadNavigator(const QSize &size, QWidget *parent)
+ : QGraphicsView(parent)
+{
+//! [0]
+//! [1]
+ // Splash item
+ SplashItem *splash = new SplashItem;
+ splash->setZValue(1);
+//! [1]
+
+//! [2]
+ // Pad item
+ FlippablePad *pad = new FlippablePad(size);
+ QGraphicsRotation *flipRotation = new QGraphicsRotation(pad);
+ QGraphicsRotation *xRotation = new QGraphicsRotation(pad);
+ QGraphicsRotation *yRotation = new QGraphicsRotation(pad);
+ flipRotation->setAxis(Qt::YAxis);
+ xRotation->setAxis(Qt::YAxis);
+ yRotation->setAxis(Qt::XAxis);
+ pad->setTransformations(QList<QGraphicsTransform *>()
+ << flipRotation
+ << xRotation << yRotation);
+//! [2]
+
+//! [3]
+ // Back (proxy widget) item
+ QGraphicsProxyWidget *backItem = new QGraphicsProxyWidget(pad);
+ QWidget *widget = new QWidget;
+ form.setupUi(widget);
+ form.hostName->setFocus();
+ backItem->setWidget(widget);
+ backItem->setVisible(false);
+ backItem->setFocus();
+ backItem->setCacheMode(QGraphicsItem::ItemCoordinateCache);
+ const QRectF r = backItem->rect();
+ backItem->setTransform(QTransform()
+ .rotate(180, Qt::YAxis)
+ .translate(-r.width()/2, -r.height()/2));
+//! [3]
+
+//! [4]
+ // Selection item
+ RoundRectItem *selectionItem = new RoundRectItem(QRectF(-60, -60, 120, 120),
+ Qt::gray, pad);
+ selectionItem->setZValue(0.5);
+//! [4]
+
+//! [5]
+ // Splash animations
+ QPropertyAnimation *smoothSplashMove = new QPropertyAnimation(splash, "y");
+ QPropertyAnimation *smoothSplashOpacity = new QPropertyAnimation(splash, "opacity");
+ smoothSplashMove->setEasingCurve(QEasingCurve::InQuad);
+ smoothSplashMove->setDuration(250);
+ smoothSplashOpacity->setDuration(250);
+//! [5]
+
+//! [6]
+ // Selection animation
+ QPropertyAnimation *smoothXSelection = new QPropertyAnimation(selectionItem, "x");
+ QPropertyAnimation *smoothYSelection = new QPropertyAnimation(selectionItem, "y");
+ QPropertyAnimation *smoothXRotation = new QPropertyAnimation(xRotation, "angle");
+ QPropertyAnimation *smoothYRotation = new QPropertyAnimation(yRotation, "angle");
+ smoothXSelection->setDuration(125);
+ smoothYSelection->setDuration(125);
+ smoothXRotation->setDuration(125);
+ smoothYRotation->setDuration(125);
+ smoothXSelection->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothYSelection->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothXRotation->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothYRotation->setEasingCurve(QEasingCurve::InOutQuad);
+//! [6]
+
+//! [7]
+ // Flip animation setup
+ QPropertyAnimation *smoothFlipRotation = new QPropertyAnimation(flipRotation, "angle");
+ QPropertyAnimation *smoothFlipScale = new QPropertyAnimation(pad, "scale");
+ QPropertyAnimation *smoothFlipXRotation = new QPropertyAnimation(xRotation, "angle");
+ QPropertyAnimation *smoothFlipYRotation = new QPropertyAnimation(yRotation, "angle");
+ QParallelAnimationGroup *flipAnimation = new QParallelAnimationGroup(this);
+ smoothFlipScale->setDuration(500);
+ smoothFlipRotation->setDuration(500);
+ smoothFlipXRotation->setDuration(500);
+ smoothFlipYRotation->setDuration(500);
+ smoothFlipScale->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothFlipRotation->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothFlipXRotation->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothFlipYRotation->setEasingCurve(QEasingCurve::InOutQuad);
+ smoothFlipScale->setKeyValueAt(0, qVariantValue<qreal>(1.0));
+ smoothFlipScale->setKeyValueAt(0.5, qVariantValue<qreal>(0.7));
+ smoothFlipScale->setKeyValueAt(1, qVariantValue<qreal>(1.0));
+ flipAnimation->addAnimation(smoothFlipRotation);
+ flipAnimation->addAnimation(smoothFlipScale);
+ flipAnimation->addAnimation(smoothFlipXRotation);
+ flipAnimation->addAnimation(smoothFlipYRotation);
+//! [7]
+
+//! [8]
+ // Flip animation delayed property assignment
+ QSequentialAnimationGroup *setVariablesSequence = new QSequentialAnimationGroup;
+ QPropertyAnimation *setFillAnimation = new QPropertyAnimation(pad, "fill");
+ QPropertyAnimation *setBackItemVisibleAnimation = new QPropertyAnimation(backItem, "visible");
+ QPropertyAnimation *setSelectionItemVisibleAnimation = new QPropertyAnimation(selectionItem, "visible");
+ setFillAnimation->setDuration(0);
+ setBackItemVisibleAnimation->setDuration(0);
+ setSelectionItemVisibleAnimation->setDuration(0);
+ setVariablesSequence->addPause(250);
+ setVariablesSequence->addAnimation(setBackItemVisibleAnimation);
+ setVariablesSequence->addAnimation(setSelectionItemVisibleAnimation);
+ setVariablesSequence->addAnimation(setFillAnimation);
+ flipAnimation->addAnimation(setVariablesSequence);
+//! [8]
+
+//! [9]
+ // Build the state machine
+ QStateMachine *stateMachine = new QStateMachine(this);
+ QState *splashState = new QState(stateMachine);
+ QState *frontState = new QState(stateMachine);
+ QHistoryState *historyState = new QHistoryState(frontState);
+ QState *backState = new QState(stateMachine);
+//! [9]
+//! [10]
+ frontState->assignProperty(pad, "fill", false);
+ frontState->assignProperty(splash, "opacity", 0.0);
+ frontState->assignProperty(backItem, "visible", false);
+ frontState->assignProperty(flipRotation, "angle", qVariantValue<qreal>(0.0));
+ frontState->assignProperty(selectionItem, "visible", true);
+ backState->assignProperty(pad, "fill", true);
+ backState->assignProperty(backItem, "visible", true);
+ backState->assignProperty(xRotation, "angle", qVariantValue<qreal>(0.0));
+ backState->assignProperty(yRotation, "angle", qVariantValue<qreal>(0.0));
+ backState->assignProperty(flipRotation, "angle", qVariantValue<qreal>(180.0));
+ backState->assignProperty(selectionItem, "visible", false);
+ stateMachine->addDefaultAnimation(smoothXRotation);
+ stateMachine->addDefaultAnimation(smoothYRotation);
+ stateMachine->addDefaultAnimation(smoothXSelection);
+ stateMachine->addDefaultAnimation(smoothYSelection);
+ stateMachine->setInitialState(splashState);
+//! [10]
+
+//! [11]
+ // Transitions
+ QEventTransition *anyKeyTransition = new QEventTransition(this, QEvent::KeyPress, splashState);
+ anyKeyTransition->setTargetState(frontState);
+ anyKeyTransition->addAnimation(smoothSplashMove);
+ anyKeyTransition->addAnimation(smoothSplashOpacity);
+//! [11]
+
+//! [12]
+ QKeyEventTransition *enterTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Enter, backState);
+ QKeyEventTransition *returnTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Return, backState);
+ QKeyEventTransition *backEnterTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Enter, frontState);
+ QKeyEventTransition *backReturnTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Return, frontState);
+ enterTransition->setTargetState(historyState);
+ returnTransition->setTargetState(historyState);
+ backEnterTransition->setTargetState(backState);
+ backReturnTransition->setTargetState(backState);
+ enterTransition->addAnimation(flipAnimation);
+ returnTransition->addAnimation(flipAnimation);
+ backEnterTransition->addAnimation(flipAnimation);
+ backReturnTransition->addAnimation(flipAnimation);
+//! [12]
+
+//! [13]
+ // Create substates for each icon; store in temporary grid.
+ int columns = size.width();
+ int rows = size.height();
+ QVector< QVector< QState * > > stateGrid;
+ stateGrid.resize(rows);
+ for (int y = 0; y < rows; ++y) {
+ stateGrid[y].resize(columns);
+ for (int x = 0; x < columns; ++x)
+ stateGrid[y][x] = new QState(frontState);
+ }
+ frontState->setInitialState(stateGrid[0][0]);
+ selectionItem->setPos(pad->iconAt(0, 0)->pos());
+//! [13]
+
+//! [14]
+ // Enable key navigation using state transitions
+ for (int y = 0; y < rows; ++y) {
+ for (int x = 0; x < columns; ++x) {
+ QState *state = stateGrid[y][x];
+ QKeyEventTransition *rightTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Right, state);
+ QKeyEventTransition *leftTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Left, state);
+ QKeyEventTransition *downTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Down, state);
+ QKeyEventTransition *upTransition = new QKeyEventTransition(this, QEvent::KeyPress,
+ Qt::Key_Up, state);
+ rightTransition->setTargetState(stateGrid[y][(x + 1) % columns]);
+ leftTransition->setTargetState(stateGrid[y][((x - 1) + columns) % columns]);
+ downTransition->setTargetState(stateGrid[(y + 1) % rows][x]);
+ upTransition->setTargetState(stateGrid[((y - 1) + rows) % rows][x]);
+//! [14]
+//! [15]
+ RoundRectItem *icon = pad->iconAt(x, y);
+ state->assignProperty(xRotation, "angle", -icon->x() / 6.0);
+ state->assignProperty(yRotation, "angle", icon->y() / 6.0);
+ state->assignProperty(selectionItem, "x", icon->x());
+ state->assignProperty(selectionItem, "y", icon->y());
+ frontState->assignProperty(icon, "visible", true);
+ backState->assignProperty(icon, "visible", false);
+
+ QPropertyAnimation *setIconVisibleAnimation = new QPropertyAnimation(icon, "visible");
+ setIconVisibleAnimation->setDuration(0);
+ setVariablesSequence->addAnimation(setIconVisibleAnimation);
+ }
+ }
+//! [15]
+
+//! [16]
+ // Scene
+ QGraphicsScene *scene = new QGraphicsScene(this);
+ scene->setBackgroundBrush(QPixmap(":/images/blue_angle_swirl.jpg"));
+ scene->setItemIndexMethod(QGraphicsScene::NoIndex);
+ scene->addItem(pad);
+ scene->setSceneRect(scene->itemsBoundingRect());
+ setScene(scene);
+//! [16]
+
+//! [17]
+ // Adjust splash item to scene contents
+ const QRectF sbr = splash->boundingRect();
+ splash->setPos(-sbr.width() / 2, scene->sceneRect().top() - 2);
+ frontState->assignProperty(splash, "y", splash->y() - 100.0);
+ scene->addItem(splash);
+//! [17]
+
+//! [18]
+ // View
+ setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setMinimumSize(50, 50);
+ setViewportUpdateMode(FullViewportUpdate);
+ setCacheMode(CacheBackground);
+ setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);
+#ifndef QT_NO_OPENGL
+ setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
+#endif
+
+ stateMachine->start();
+//! [18]
+}
+
+//! [19]
+void PadNavigator::resizeEvent(QResizeEvent *event)
+{
+ QGraphicsView::resizeEvent(event);
+ fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);
+}
+//! [19]
diff --git a/examples/graphicsview/padnavigator/padnavigator.h b/examples/graphicsview/padnavigator/padnavigator.h
new file mode 100644
index 0000000..d9298ae
--- /dev/null
+++ b/examples/graphicsview/padnavigator/padnavigator.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PADNAVIGATOR_H
+#define PADNAVIGATOR_H
+
+#include <QGraphicsView>
+#include "ui_form.h"
+
+QT_BEGIN_NAMESPACE
+
+class QState;
+class QStateMachine;
+class Ui_Form;
+
+QT_END_NAMESPACE
+
+//! [0]
+class PadNavigator : public QGraphicsView
+{
+ Q_OBJECT
+public:
+ explicit PadNavigator(const QSize &size, QWidget *parent = 0);
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+
+private:
+ Ui_Form form;
+};
+//! [0]
+
+#endif // PADNAVIGATOR_H
diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro
index d6f536c..93ea293 100644
--- a/examples/graphicsview/padnavigator/padnavigator.pro
+++ b/examples/graphicsview/padnavigator/padnavigator.pro
@@ -1,19 +1,20 @@
-HEADERS += \
- panel.h \
- roundrectitem.h \
- splashitem.h
+SOURCES += main.cpp \
+ roundrectitem.cpp \
+ flippablepad.cpp \
+ padnavigator.cpp \
+ splashitem.cpp
-SOURCES += \
- panel.cpp \
- roundrectitem.cpp \
- splashitem.cpp \
- main.cpp
+HEADERS += \
+ roundrectitem.h \
+ flippablepad.h \
+ padnavigator.h \
+ splashitem.h
RESOURCES += \
- padnavigator.qrc
+ padnavigator.qrc
FORMS += \
- backside.ui
+ form.ui
contains(QT_CONFIG, opengl):QT += opengl
diff --git a/examples/graphicsview/padnavigator/panel.cpp b/examples/graphicsview/padnavigator/panel.cpp
deleted file mode 100644
index c4a5cd9..0000000
--- a/examples/graphicsview/padnavigator/panel.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "panel.h"
-#include "roundrectitem.h"
-#include "splashitem.h"
-#include "ui_backside.h"
-
-#ifndef QT_NO_OPENGL
-#include <QtOpenGL/QtOpenGL>
-#else
-#endif
-#include <QtGui/QtGui>
-
-#include <math.h>
-
-Panel::Panel(int width, int height)
- : selectedX(0),
- selectedY(0),
- width(width),
- height(height),
- flipped(false),
- flipLeft(true)
-{
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setCacheMode(CacheBackground);
- setViewportUpdateMode(FullViewportUpdate);
- setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform
- | QPainter::TextAntialiasing);
- setBackgroundBrush(QPixmap(":/images/blue_angle_swirl.jpg"));
-#ifndef QT_NO_OPENGL
- setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
-#endif
- setMinimumSize(50, 50);
-
- selectionTimeLine = new QTimeLine(150, this);
- flipTimeLine = new QTimeLine(500, this);
-
- QRectF bounds((-width / 2.0) * 150, (-height / 2.0) * 150, width * 150, height * 150);
-
- scene = new QGraphicsScene(bounds, this);
- scene->setItemIndexMethod(QGraphicsScene::NoIndex);
- setScene(scene);
-
- baseItem = new RoundRectItem(bounds, QColor(226, 255, 92, 64));
- scene->addItem(baseItem);
-
- QWidget *embed = new QWidget;
- ui = new Ui_BackSide;
- ui->setupUi(embed);
- ui->hostName->setFocus();
-
- backItem = new RoundRectItem(bounds, embed->palette().window(), embed);
- backItem->setTransform(QTransform().rotate(180, Qt::YAxis));
- backItem->setParentItem(baseItem);
-
- selectionItem = new RoundRectItem(QRectF(-60, -60, 120, 120), Qt::gray);
- selectionItem->setParentItem(baseItem);
- selectionItem->setZValue(-1);
- selectionItem->setPos(posForLocation(0, 0));
- startPos = selectionItem->pos();
-
- grid = new QGraphicsItem **[height];
-
- for (int y = 0; y < height; ++y) {
- grid[y] = new QGraphicsItem *[width];
-
- for (int x = 0; x < width; ++x) {
- RoundRectItem *item = new RoundRectItem(QRectF(-54, -54, 108, 108),
- QColor(214, 240, 110, 128));
- item->setPos(posForLocation(x, y));
-
- item->setParentItem(baseItem);
- item->setFlag(QGraphicsItem::ItemIsFocusable);
- grid[y][x] = item;
-
- switch (qrand() % 9) {
- case 0: item->setPixmap(QPixmap(":/images/kontact_contacts.png")); break;
- case 1: item->setPixmap(QPixmap(":/images/kontact_journal.png")); break;
- case 2: item->setPixmap(QPixmap(":/images/kontact_notes.png")); break;
- case 3: item->setPixmap(QPixmap(":/images/kopeteavailable.png")); break;
- case 4: item->setPixmap(QPixmap(":/images/metacontact_online.png")); break;
- case 5: item->setPixmap(QPixmap(":/images/minitools.png")); break;
- case 6: item->setPixmap(QPixmap(":/images/kontact_journal.png")); break;
- case 7: item->setPixmap(QPixmap(":/images/kontact_contacts.png")); break;
- case 8: item->setPixmap(QPixmap(":/images/kopeteavailable.png")); break;
- default:
- break;
- }
-
- connect(item, SIGNAL(activated()), this, SLOT(flip()));
- }
- }
-
- grid[0][0]->setFocus();
-
- connect(backItem, SIGNAL(activated()),
- this, SLOT(flip()));
- connect(selectionTimeLine, SIGNAL(valueChanged(qreal)),
- this, SLOT(updateSelectionStep(qreal)));
- connect(flipTimeLine, SIGNAL(valueChanged(qreal)),
- this, SLOT(updateFlipStep(qreal)));
-
- splash = new SplashItem;
- splash->setZValue(5);
- splash->setPos(-splash->rect().width() / 2, scene->sceneRect().top());
- scene->addItem(splash);
-
- splash->grabKeyboard();
-
- updateSelectionStep(0);
-
- setWindowTitle(tr("Pad Navigator Example"));
-}
-
-Panel::~Panel()
-{
- for (int y = 0; y < height; ++y)
- delete [] grid[y];
- delete [] grid;
-}
-
-void Panel::keyPressEvent(QKeyEvent *event)
-{
- if (splash->isVisible() || event->key() == Qt::Key_Return || flipped) {
- QGraphicsView::keyPressEvent(event);
- return;
- }
-
- selectedX = (selectedX + width + (event->key() == Qt::Key_Right) - (event->key() == Qt::Key_Left)) % width;
- selectedY = (selectedY + height + (event->key() == Qt::Key_Down) - (event->key() == Qt::Key_Up)) % height;
- grid[selectedY][selectedX]->setFocus();
-
- selectionTimeLine->stop();
- startPos = selectionItem->pos();
- endPos = posForLocation(selectedX, selectedY);
- selectionTimeLine->start();
-}
-
-void Panel::resizeEvent(QResizeEvent *event)
-{
- QGraphicsView::resizeEvent(event);
- fitInView(scene->sceneRect(), Qt::KeepAspectRatio);
-}
-
-void Panel::updateSelectionStep(qreal val)
-{
- QPointF newPos(startPos.x() + (endPos - startPos).x() * val,
- startPos.y() + (endPos - startPos).y() * val);
- selectionItem->setPos(newPos);
-
- QTransform transform;
- yrot = newPos.x() / 6.0;
- xrot = newPos.y() / 6.0;
- transform.rotate(newPos.x() / 6.0, Qt::YAxis);
- transform.rotate(newPos.y() / 6.0, Qt::XAxis);
- baseItem->setTransform(transform);
-}
-
-void Panel::updateFlipStep(qreal val)
-{
- qreal finalxrot = xrot - xrot * val;
- qreal finalyrot;
- if (flipLeft)
- finalyrot = yrot - yrot * val - 180 * val;
- else
- finalyrot = yrot - yrot * val + 180 * val;
- QTransform transform;
- transform.rotate(finalyrot, Qt::YAxis);
- transform.rotate(finalxrot, Qt::XAxis);
- qreal scale = 1 - sin(3.14 * val) * 0.3;
- transform.scale(scale, scale);
- baseItem->setTransform(transform);
- if (val == 0)
- grid[selectedY][selectedX]->setFocus();
-}
-
-void Panel::flip()
-{
- if (flipTimeLine->state() == QTimeLine::Running)
- return;
-
- if (flipTimeLine->currentValue() == 0) {
- flipTimeLine->setDirection(QTimeLine::Forward);
- flipTimeLine->start();
- flipped = true;
- flipLeft = selectionItem->pos().x() < 0;
- } else {
- flipTimeLine->setDirection(QTimeLine::Backward);
- flipTimeLine->start();
- flipped = false;
- }
-}
-
-QPointF Panel::posForLocation(int x, int y) const
-{
- return QPointF(x * 150, y * 150)
- - QPointF((width - 1) * 75, (height - 1) * 75);
-}
diff --git a/examples/graphicsview/padnavigator/panel.h b/examples/graphicsview/padnavigator/panel.h
deleted file mode 100644
index 908092b..0000000
--- a/examples/graphicsview/padnavigator/panel.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/qgraphicsview.h>
-
-QT_BEGIN_NAMESPACE
-class QTimeLine;
-class Ui_BackSide;
-QT_END_NAMESPACE
-
-class RoundRectItem;
-
-class Panel : public QGraphicsView
-{
- Q_OBJECT
-public:
- Panel(int width, int height);
- ~Panel();
-
-protected:
- void keyPressEvent(QKeyEvent *event);
- void resizeEvent(QResizeEvent *event);
-
-private Q_SLOTS:
- void updateSelectionStep(qreal val);
- void updateFlipStep(qreal val);
- void flip();
-
-private:
- QPointF posForLocation(int x, int y) const;
-
- QGraphicsScene *scene;
- RoundRectItem *selectionItem;
- RoundRectItem *baseItem;
- RoundRectItem *backItem;
- QGraphicsWidget *splash;
- QTimeLine *selectionTimeLine;
- QTimeLine *flipTimeLine;
- int selectedX, selectedY;
-
- QGraphicsItem ***grid;
-
- QPointF startPos;
- QPointF endPos;
- qreal xrot, yrot;
- qreal xrot2, yrot2;
-
- int width;
- int height;
- bool flipped;
- bool flipLeft;
-
- Ui_BackSide *ui;
-};
diff --git a/examples/graphicsview/padnavigator/roundrectitem.cpp b/examples/graphicsview/padnavigator/roundrectitem.cpp
index d53eea4..7a0b279 100644
--- a/examples/graphicsview/padnavigator/roundrectitem.cpp
+++ b/examples/graphicsview/padnavigator/roundrectitem.cpp
@@ -43,122 +43,72 @@
#include <QtGui/QtGui>
-RoundRectItem::RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget)
- : QGraphicsRectItem(rect),
- brush(brush),
- timeLine(75),
- lastVal(0),
- opa(1),
- proxyWidget(0)
+//! [0]
+RoundRectItem::RoundRectItem(const QRectF &bounds, const QColor &color,
+ QGraphicsItem *parent)
+ : QGraphicsObject(parent), fillRect(false), bounds(bounds)
{
- connect(&timeLine, SIGNAL(valueChanged(qreal)),
- this, SLOT(updateValue(qreal)));
-
- if (embeddedWidget) {
- proxyWidget = new QGraphicsProxyWidget(this);
- proxyWidget->setFocusPolicy(Qt::StrongFocus);
- proxyWidget->setWidget(embeddedWidget);
- proxyWidget->setGeometry(boundingRect().adjusted(25, 25, -25, -25));
- }
+ gradient.setStart(bounds.topLeft());
+ gradient.setFinalStop(bounds.bottomRight());
+ gradient.setColorAt(0, color);
+ gradient.setColorAt(1, color.dark(200));
+ setCacheMode(ItemCoordinateCache);
}
+//! [0]
-void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+//! [1]
+QPixmap RoundRectItem::pixmap() const
{
- QTransform x = painter->worldTransform();
-
- QLineF unit = x.map(QLineF(0, 0, 1, 1));
- if (unit.p1().x() > unit.p2().x() || unit.p1().y() > unit.p2().y()) {
- if (proxyWidget && proxyWidget->isVisible()) {
- proxyWidget->hide();
- proxyWidget->setGeometry(rect());
- }
- return;
- }
-
- if (proxyWidget && !proxyWidget->isVisible()) {
- proxyWidget->show();
- proxyWidget->setFocus();
- }
- if (proxyWidget && proxyWidget->pos() != QPoint())
- proxyWidget->setGeometry(boundingRect().adjusted(25, 25, -25, -25));
-
- painter->setOpacity(opacity());
- painter->setPen(Qt::NoPen);
- painter->setBrush(QColor(0, 0, 0, 64));
- painter->drawRoundRect(rect().translated(2, 2));
-
- if (!proxyWidget) {
- QLinearGradient gradient(rect().topLeft(), rect().bottomRight());
- const QColor col = brush.color();
- gradient.setColorAt(0, col);
- gradient.setColorAt(1, col.dark(int(200 + lastVal * 50)));
- painter->setBrush(gradient);
- } else {
- painter->setBrush(brush);
- }
-
- painter->setPen(QPen(Qt::black, 1));
- painter->drawRoundRect(rect());
- if (!pix.isNull()) {
- painter->scale(1.95, 1.95);
- painter->drawPixmap(-pix.width() / 2, -pix.height() / 2, pix);;
- }
+ return pix;
}
-
-QRectF RoundRectItem::boundingRect() const
-{
- qreal penW = 0.5;
- qreal shadowW = 2.0;
- return rect().adjusted(-penW, -penW, penW + shadowW, penW + shadowW);
-}
-
void RoundRectItem::setPixmap(const QPixmap &pixmap)
{
pix = pixmap;
- if (scene() && isVisible())
- update();
-}
-
-qreal RoundRectItem::opacity() const
-{
- RoundRectItem *parent = parentItem() ? (RoundRectItem *)parentItem() : 0;
- return opa + (parent ? parent->opacity() : 0);
+ update();
}
+//! [1]
-void RoundRectItem::setOpacity(qreal opacity)
+//! [2]
+QRectF RoundRectItem::boundingRect() const
{
- opa = opacity;
- update();
+ return bounds.adjusted(0, 0, 2, 2);
}
+//! [2]
-void RoundRectItem::keyPressEvent(QKeyEvent *event)
+//! [3]
+void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
{
- if (event->isAutoRepeat() || event->key() != Qt::Key_Return
- || (timeLine.state() == QTimeLine::Running && timeLine.direction() == QTimeLine::Forward)) {
- QGraphicsRectItem::keyPressEvent(event);
- return;
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(QColor(0, 0, 0, 64));
+ painter->drawRoundRect(bounds.translated(2, 2));
+//! [3]
+//! [4]
+ if (fillRect)
+ painter->setBrush(QApplication::palette().brush(QPalette::Window));
+ else
+ painter->setBrush(gradient);
+ painter->setPen(QPen(Qt::black, 1));
+ painter->drawRoundRect(bounds);
+//! [4]
+//! [5]
+ if (!pix.isNull()) {
+ painter->scale(1.95, 1.95);
+ painter->drawPixmap(-pix.width() / 2, -pix.height() / 2, pix);
}
-
- timeLine.stop();
- timeLine.setDirection(QTimeLine::Forward);
- timeLine.start();
- emit activated();
}
+//! [5]
-void RoundRectItem::keyReleaseEvent(QKeyEvent *event)
+//! [6]
+bool RoundRectItem::fill() const
{
- if (event->key() != Qt::Key_Return) {
- QGraphicsRectItem::keyReleaseEvent(event);
- return;
- }
- timeLine.stop();
- timeLine.setDirection(QTimeLine::Backward);
- timeLine.start();
+ return fillRect;
}
-
-void RoundRectItem::updateValue(qreal value)
+void RoundRectItem::setFill(bool fill)
{
- lastVal = value;
- if (!proxyWidget)
- setTransform(QTransform().scale(1 - value / 10.0, 1 - value / 10.0));
+ fillRect = fill;
+ update();
}
+//! [6]
diff --git a/examples/graphicsview/padnavigator/roundrectitem.h b/examples/graphicsview/padnavigator/roundrectitem.h
index 683c09f..bc58cec 100644
--- a/examples/graphicsview/padnavigator/roundrectitem.h
+++ b/examples/graphicsview/padnavigator/roundrectitem.h
@@ -39,45 +39,38 @@
**
****************************************************************************/
-#include <QtCore/qobject.h>
-#include <QtCore/qtimeline.h>
-#include <QtGui/qgraphicsitem.h>
-#include <QtGui/qbrush.h>
+#ifndef ROUNDRECTITEM_H
+#define ROUNDRECTITEM_H
-QT_BEGIN_NAMESPACE
-class QGraphicsProxyWidget;
-QT_END_NAMESPACE
+#include <QGraphicsObject>
+#include <QLinearGradient>
-class RoundRectItem : public QObject, public QGraphicsRectItem
+//! [0]
+class RoundRectItem : public QGraphicsObject
{
Q_OBJECT
+ Q_PROPERTY(bool fill READ fill WRITE setFill)
public:
- RoundRectItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget = 0);
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
- QRectF boundingRect() const;
+ RoundRectItem(const QRectF &bounds, const QColor &color,
+ QGraphicsItem *parent = 0);
+ QPixmap pixmap() const;
void setPixmap(const QPixmap &pixmap);
- qreal opacity() const;
- void setOpacity(qreal opacity);
-
-Q_SIGNALS:
- void activated();
-
-protected:
- void keyPressEvent(QKeyEvent *event);
- void keyReleaseEvent(QKeyEvent *event);
+ QRectF boundingRect() const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-private slots:
- void updateValue(qreal value);
+ bool fill() const;
+ void setFill(bool fill);
+//! [0]
+//! [1]
private:
- QBrush brush;
QPixmap pix;
- QTimeLine timeLine;
- qreal lastVal;
- qreal opa;
-
- QGraphicsProxyWidget *proxyWidget;
+ bool fillRect;
+ QRectF bounds;
+ QLinearGradient gradient;
};
+//! [1]
+
+#endif // ROUNDRECTITEM_H
diff --git a/examples/graphicsview/padnavigator/splashitem.cpp b/examples/graphicsview/padnavigator/splashitem.cpp
index b5b03d4..cd7074a 100644
--- a/examples/graphicsview/padnavigator/splashitem.cpp
+++ b/examples/graphicsview/padnavigator/splashitem.cpp
@@ -43,31 +43,36 @@
#include <QtGui/QtGui>
+//! [0]
SplashItem::SplashItem(QGraphicsItem *parent)
- : QGraphicsWidget(parent)
+ : QGraphicsObject(parent)
{
- opacity = 1.0;
-
-
- timeLine = new QTimeLine(350);
- timeLine->setCurveShape(QTimeLine::EaseInCurve);
- connect(timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(setValue(qreal)));
-
text = tr("Welcome to the Pad Navigator Example. You can use the"
" keyboard arrows to navigate the icons, and press enter"
- " to activate an item. Please press any key to continue.");
- resize(400, 175);
+ " to activate an item. Press any key to begin.");
+ setCacheMode(DeviceCoordinateCache);
+}
+//! [0]
+
+//! [1]
+QRectF SplashItem::boundingRect() const
+{
+ return QRectF(0, 0, 400, 175);
}
+//! [1]
-void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+//! [2]
+void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
{
- painter->setOpacity(opacity);
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
painter->setPen(QPen(Qt::black, 2));
painter->setBrush(QColor(245, 245, 255, 220));
- painter->setClipRect(rect());
+ painter->setClipRect(boundingRect());
painter->drawRoundRect(3, -100 + 3, 400 - 6, 250 - 6);
- QRectF textRect = rect().adjusted(10, 10, -10, -10);
+ QRectF textRect = boundingRect().adjusted(10, 10, -10, -10);
int flags = Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap;
QFont font;
@@ -76,17 +81,4 @@ void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWid
painter->setFont(font);
painter->drawText(textRect, flags, text);
}
-
-void SplashItem::keyPressEvent(QKeyEvent * /* event */)
-{
- if (timeLine->state() == QTimeLine::NotRunning)
- timeLine->start();
-}
-
-void SplashItem::setValue(qreal value)
-{
- opacity = 1 - value;
- setPos(x(), scene()->sceneRect().top() - rect().height() * value);
- if (value == 1)
- hide();
-}
+//! [2]
diff --git a/examples/graphicsview/padnavigator/splashitem.h b/examples/graphicsview/padnavigator/splashitem.h
index 7a33bee..98c4a1f 100644
--- a/examples/graphicsview/padnavigator/splashitem.h
+++ b/examples/graphicsview/padnavigator/splashitem.h
@@ -39,25 +39,24 @@
**
****************************************************************************/
-#include <QtCore/qobject.h>
-#include <QtCore/qtimeline.h>
-#include <QtGui/qgraphicswidget.h>
+#ifndef SPLASHITEM_H
+#define SPLASHITEM_H
-class SplashItem : public QGraphicsWidget
+#include <QGraphicsObject>
+
+//! [0]
+class SplashItem : public QGraphicsObject
{
Q_OBJECT
public:
- SplashItem(QGraphicsItem *parent = 0);
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
-protected:
- void keyPressEvent(QKeyEvent *event);
+ explicit SplashItem(QGraphicsItem *parent = 0);
-private Q_SLOTS:
- void setValue(qreal value);
+ QRectF boundingRect() const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
private:
- QTimeLine *timeLine;
QString text;
- qreal opacity;
};
+//! [0]
+
+#endif // SPLASHITEM_H
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 4a6c6ff..0d98eff 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -255,6 +255,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline)
void BearerMonitor::registerNetwork()
{
QTreeWidgetItem *item = treeWidget->currentItem();
+ if (!item) return;
QNetworkConfiguration configuration =
manager.configurationFromIdentifier(item->data(0, Qt::UserRole).toString());
@@ -276,6 +277,7 @@ void BearerMonitor::registerNetwork()
void BearerMonitor::unregisterNetwork()
{
QTreeWidgetItem *item = treeWidget->currentItem();
+ if (!item) return;
QNetworkConfiguration configuration =
manager.configurationFromIdentifier(item->data(0, Qt::UserRole).toString());
@@ -384,6 +386,7 @@ void BearerMonitor::createSessionFor(QTreeWidgetItem *item)
void BearerMonitor::createNewSession()
{
QTreeWidgetItem *item = treeWidget->currentItem();
+ if (!item) return;
createSessionFor(item);
}
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index 443f4b2..3a8e5ea 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -59,7 +59,7 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren
connect(session, SIGNAL(stateChanged(QNetworkSession::State)),
this, SLOT(updateSession()));
connect(session, SIGNAL(error(QNetworkSession::SessionError)),
- this, SLOT(updateSession()));
+ this, SLOT(updateSessionError(QNetworkSession::SessionError)));
updateSession();
@@ -105,7 +105,6 @@ void SessionWidget::deleteSession()
void SessionWidget::updateSession()
{
updateSessionState(session->state());
- updateSessionError(session->error());
if (session->state() == QNetworkSession::Connected)
statsTimer = startTimer(1000);
@@ -128,12 +127,14 @@ void SessionWidget::updateSession()
void SessionWidget::openSession()
{
+ clearError();
session->open();
updateSession();
}
void SessionWidget::openSyncSession()
{
+ clearError();
session->open();
session->waitForOpened();
updateSession();
@@ -141,12 +142,14 @@ void SessionWidget::openSyncSession()
void SessionWidget::closeSession()
{
+ clearError();
session->close();
updateSession();
}
void SessionWidget::stopSession()
{
+ clearError();
session->stop();
updateSession();
}
@@ -195,3 +198,8 @@ void SessionWidget::updateSessionError(QNetworkSession::SessionError error)
errorString->setText(session->errorString());
}
+void SessionWidget::clearError()
+{
+ lastError->clear();
+ errorString->clear();
+}
diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index 5e9d62c..b299b47 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -63,7 +63,7 @@ public:
private:
void updateSessionState(QNetworkSession::State state);
- void updateSessionError(QNetworkSession::SessionError error);
+ void clearError();
private Q_SLOTS:
void openSession();
@@ -71,9 +71,12 @@ private Q_SLOTS:
void closeSession();
void stopSession();
void updateSession();
+ void updateSessionError(QNetworkSession::SessionError error);
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
void deleteSession();
#endif
+
+
private:
QNetworkSession *session;
int statsTimer;
diff --git a/examples/network/bearermonitor/sessionwidget.ui b/examples/network/bearermonitor/sessionwidget.ui
index 45135f5..56a2d0e 100644
--- a/examples/network/bearermonitor/sessionwidget.ui
+++ b/examples/network/bearermonitor/sessionwidget.ui
@@ -195,7 +195,7 @@
<item>
<widget class="QLabel" name="errorStringLabel">
<property name="text">
- <string>Error String</string>
+ <string>Error String:</string>
</property>
</widget>
</item>
diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf
index 3801eff..2397c96 100644
--- a/mkspecs/common/symbian/symbian-makefile.conf
+++ b/mkspecs/common/symbian/symbian-makefile.conf
@@ -13,7 +13,13 @@ QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-QMAKE_ELF2E32_FLAGS +=
+QMAKE_ELF2E32_FLAGS = --dlldata \
+ --heap=0x00020000,0x00800000 \
+ --stack=0x00014000 \
+ --fpu=softvfp \
+ --unfrozen \
+ --compressionmethod bytepair \
+ --unpaged
include(../../common/unix.conf)
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 0bd0bf2..89034ca 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -66,7 +66,7 @@ QMAKE_LINK_OBJECT_MAX =
QMAKE_LINK_OBJECT_SCRIPT=
QMAKE_LIBS = -llibc -llibm -leuser -llibdl
-QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv -lhal
+QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv -lhal -lbafl
QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lcentralrepository
QMAKE_LIBS_NETWORK =
QMAKE_LIBS_EGL = -llibEGL
diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf
index e3faef1..d2011d0 100644
--- a/mkspecs/features/qttest_p4.prf
+++ b/mkspecs/features/qttest_p4.prf
@@ -6,7 +6,7 @@ qtAddLibrary(QtTest)
symbian:{
TARGET.EPOCHEAPSIZE = 0x100000 0x2000000
# DEFINES += QTEST_NO_SPECIALIZATIONS
- TARGET.CAPABILITY="ALL -TCB"
+ TARGET.CAPABILITY="None"
RSS_RULES ="group_name=\"QtTests\";"
}
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index b0cc6f2..802adde 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -100,13 +100,19 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
# The comparison of dso files is to avoid extra building of modules that depend on this dso, in
# case it has not changed.
QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \
- && elf2e32 --version=$$decVersion --sid=$$TARGET.SID --uid1=0x10000079 \
- --uid2=$$TARGET.UID2 --uid3=$$TARGET.UID3 --dlldata --heap=0x00020000,0x00800000 \
- --stack=0x00014000 --fpu=softvfp --targettype=DLL \
- --elfinput=$${symbianDestdir}/$${TARGET}.sym --output=$${symbianDestdir}/$${TARGET}.dll \
- --dso=$$symbianObjdir/$${TARGET}.dso --defoutput=$$symbianObjdir/$${TARGET}.def \
- --unfrozen --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
- --compressionmethod bytepair $$elf2e32_LIBPATH --unpaged $$capability \
+ && elf2e32 --version=$$decVersion \
+ --sid=$$TARGET.SID \
+ --uid1=0x10000079 \
+ --uid2=$$TARGET.UID2 \
+ --uid3=$$TARGET.UID3 \
+ --targettype=DLL \
+ --elfinput=$${symbianDestdir}/$${TARGET}.sym \
+ --output=$${symbianDestdir}/$${TARGET}.dll \
+ --dso=$$symbianObjdir/$${TARGET}.dso \
+ --defoutput=$$symbianObjdir/$${TARGET}.def \
+ --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+ $$elf2e32_LIBPATH \
+ $$capability \
$$QMAKE_ELF2E32_FLAGS \
| tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
&& if ! diff -q $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso \
@@ -120,9 +126,10 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def
linux-armcc: {
- QMAKE_LIBS += -ledllstub.lib -ledll.lib\\(uc_dll_.o\\)
+ LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
+ LIBS += -ledllstub.lib -ledll.lib\\(uc_dll_.o\\)
} else :linux-gcce {
- QMAKE_LIBS += \
+ LIBS += \
-l:edll.lib \
-l:usrt2_2.lib \
-l:dfpaeabi.dso \
@@ -144,12 +151,17 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
}
# the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error
QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
- && elf2e32 --version $$decVersion --sid=$$TARGET.SID --uid1=0x1000007a \
- --uid2=$$TARGET.UID2 --uid3=$$TARGET.UID3 --dlldata --heap=0x00020000,0x00800000 \
- --stack=0x00014000 --fpu=softvfp --targettype=EXE \
- --elfinput=$${symbianDestdir}/$${TARGET}.sym --output=$${symbianDestdir}/$${TARGET}.exe \
- --unfrozen --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
- --compressionmethod bytepair $$elf2e32_LIBPATH --unpaged $$capability \
+ && elf2e32 --version $$decVersion \
+ --sid=$$TARGET.SID \
+ --uid1=0x1000007a \
+ --uid2=$$TARGET.UID2 \
+ --uid3=$$TARGET.UID3 \
+ --targettype=EXE \
+ --elfinput=$${symbianDestdir}/$${TARGET}.sym \
+ --output=$${symbianDestdir}/$${TARGET}.exe \
+ --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+ $$elf2e32_LIBPATH \
+ $$capability \
$$QMAKE_ELF2E32_FLAGS \
| tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
&& ln "$${symbianDestdir}/$${TARGET}.exe" "$${symbianDestdir}/$$TARGET" \
@@ -159,6 +171,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
linux-armcc: {
+ QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\)
contains(CONFIG, "qt"):contains(QT, "core") { #if linking with QtCore
QMAKE_LIBS += -lqtmain$${QT_LIBINFIX}.lib
diff --git a/mkspecs/symbian/linux-armcc/qmake.conf b/mkspecs/symbian/linux-armcc/qmake.conf
index 599e552..77fb1ea 100644
--- a/mkspecs/symbian/linux-armcc/qmake.conf
+++ b/mkspecs/symbian/linux-armcc/qmake.conf
@@ -6,8 +6,6 @@ include(../../common/symbian/symbian-makefile.conf)
include(../../common/armcc.conf)
-QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
-
QMAKE_RVCT_LINKSTYLE = 1
# notice that the middle part of the following set of vars matches the TARGET content of the libs
@@ -33,8 +31,8 @@ QMAKE_QtWebKit_CXXFLAGS = --arm
# Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000.
QMAKE_QtWebKit_LFLAGS = --rw-base 0xE00000
-QMAKE_CFLAGS += --dllimport_runtime --preinclude rvct2_2.h --diag_suppress 186,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --export_all_vtbl --no_vfe --apcs /inter $$QMAKE_CFLAGS.ARMCC
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --no_parse_templates $$QMAKE_CXXFLAGS.ARMCC
+QMAKE_CFLAGS += --dllimport_runtime --preinclude rvct2_2.h --diag_suppress 186,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --no_vfe --apcs /inter $$QMAKE_CFLAGS.ARMCC
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS.ARMCC
QMAKE_LFLAGS += --symver_soname --diag_suppress 6331,6780 --bpabi --reloc --datacompressor=off --split --dll --no_scanlib
QMAKE_LFLAGS_APP += --entry _E32Startup
QMAKE_LFLAGS_SHLIB += --entry _E32Dll
diff --git a/mkspecs/symbian/linux-gcce/qmake.conf b/mkspecs/symbian/linux-gcce/qmake.conf
index 57bb56a..faac2f1 100644
--- a/mkspecs/symbian/linux-gcce/qmake.conf
+++ b/mkspecs/symbian/linux-gcce/qmake.conf
@@ -83,13 +83,13 @@ for(line, QMAKE_GCC_SEARCH_DIRS) {
}
}
-QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib
-
-INCLUDEPATH = ${EPOCROOT}epoc32/include/ \
- $${EPOCROOT}epoc32/include/variant \
- $${EPOCROOT}epoc32/include/stdapis \
- $${EPOCROOT}epoc32/include/gcce \
- ${EPOCROOT}epoc32/include/stdapis/sys \
- ${EPOCROOT}epoc32/include/stdapis/stlport \
+QMAKE_LIBDIR += $${EPOCROOT}/epoc32/release/armv5/lib
+
+INCLUDEPATH = ${EPOCROOT}/epoc32/include/ \
+ $${EPOCROOT}/epoc32/include/variant \
+ $${EPOCROOT}/epoc32/include/stdapis \
+ $${EPOCROOT}/epoc32/include/gcce \
+ ${EPOCROOT}/epoc32/include/stdapis/sys \
+ ${EPOCROOT}/epoc32/include/stdapis/stlport \
$$INCLUDEPATH
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 3f60a13..97f8570 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -59,7 +59,7 @@ enum DotNET {
NET2003 = 0x71,
NET2005 = 0x80,
NET2008 = 0x90,
- NET2010 = 0x91
+ NET2010 = 0xa0
};
/*
diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp
index da93fe3..05c1511 100644
--- a/qmake/generators/win32/msvc_vcxproj.cpp
+++ b/qmake/generators/win32/msvc_vcxproj.cpp
@@ -89,7 +89,6 @@ bool VcxprojGenerator::writeMakefile(QTextStream &t)
return true;
}
return project->isActiveConfig("build_pass");
- return true;
}
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index 0163839..6e0f8a2 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -13,7 +13,8 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
generators/xmloutput.cpp generators/win32/borland_bmake.cpp \
generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \
generators/win32/msvc_vcproj.cpp \
- generators/win32/msvc_objectmodel.cpp \
+ generators/win32/msvc_vcxproj.cpp \
+ generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp \
generators/symbian/symbiancommon.cpp \
generators/symbian/symmake.cpp \
generators/symbian/symmake_abld.cpp \
@@ -24,11 +25,12 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
HEADERS += project.h property.h generators/makefile.h \
generators/unix/unixmake.h meta.h option.h cachekeys.h \
- generators/win32/winmakefile.h generators/projectgenerator.h \
+ generators/win32/winmakefile.h generators/win32/mingw_make.h generators/projectgenerator.h \
generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \
generators/xmloutput.h generators/win32/borland_bmake.h generators/win32/msvc_nmake.h \
generators/win32/msvc_vcproj.h \
- generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h \
+ generators/win32/msvc_vcxproj.h \
+ generators/win32/msvc_objectmodel.h generators/win32/msbuild_objectmodel.h \
generators/symbian/symbiancommon.h \
generators/symbian/symmake.h \
generators/symbian/symmake_abld.h \
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index b6feeb1..9d754a4 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-992e57ee469bd8c6a2afef6b15896a161ab8aeb3
+3d774b9df1f963452b1cfe34f9fafad0d399372a
diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog
index 70eff7d..a0cf2d0 100644
--- a/src/3rdparty/webkit/ChangeLog
+++ b/src/3rdparty/webkit/ChangeLog
@@ -1,3 +1,12 @@
+2010-05-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Detect debug mode consistently
+ https://bugs.webkit.org/show_bug.cgi?id=38863
+
+ * WebKit.pri:
+
2010-04-09 Simon Hausmann <simon.hausmann@nokia.com>
Unreviewed crash fix.
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index eb22ea0..a3e6586 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,38 @@
+2010-05-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Detect debug mode consistently
+ https://bugs.webkit.org/show_bug.cgi?id=38863
+
+ * JavaScriptCore.pri:
+ * JavaScriptCore.pro:
+ * jsc.pro:
+ * qt/api/QtScript.pro:
+
+2010-05-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ [Qt] Disable JIT support for mingw-w64
+ https://bugs.webkit.org/show_bug.cgi?id=38747
+
+ Disale JIT for mingw-w64 as it is reportedly
+ unstable.
+
+ Thanks for Vanboxem Rruben for the investigation.
+
+ * wtf/Platform.h:
+
+2010-05-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable YARR_JIT for X86 Mac for QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=38668
+
+ * wtf/Platform.h:
+
2010-04-28 Simon Hausmann <simon.hausmann@nokia.com>, Kent Hansen <kent.hansen@nokia.com>
Reviewed by Darin Adler.
diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
index b7f6665..b3f74a9 100644
--- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
@@ -1,6 +1,6 @@
# JavaScriptCore - Qt4 build info
VPATH += $$PWD
-CONFIG(debug, debug|release) {
+!CONFIG(release, debug|release) {
# Output in JavaScriptCore/<config>
JAVASCRIPTCORE_DESTDIR = debug
# Use a config-specific target to prevent parallel builds file clashes on Mac
diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
index 8e086b3..22fcc91 100644
--- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
+++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro
@@ -21,7 +21,7 @@ CONFIG(QTDIR_build) {
# This line was extracted from qbase.pri instead of including the whole file
win32|mac:!macx-xcode:CONFIG += debug_and_release
} else {
- CONFIG(debug, debug|release) {
+ !CONFIG(release, debug|release) {
OBJECTS_DIR = obj/debug
} else { # Release
OBJECTS_DIR = obj/release
diff --git a/src/3rdparty/webkit/JavaScriptCore/qt/api/QtScript.pro b/src/3rdparty/webkit/JavaScriptCore/qt/api/QtScript.pro
index 88629c7..3c2691e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/qt/api/QtScript.pro
+++ b/src/3rdparty/webkit/JavaScriptCore/qt/api/QtScript.pro
@@ -7,7 +7,7 @@ INCLUDEPATH += $$PWD
CONFIG += building-libs
isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = ../../generated
-CONFIG(debug, debug|release) {
+!CONFIG(release, debug|release) {
OBJECTS_DIR = obj/debug
} else { # Release
OBJECTS_DIR = obj/release
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
index 96ed9bd..fac477e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
@@ -927,8 +927,6 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100
#define ENABLE_JIT 1
#define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
-#elif CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100
- #define ENABLE_JIT 1
#elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)
#define ENABLE_JIT 1
#define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
@@ -1008,7 +1006,9 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
|| (CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100) \
|| (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \
|| (CPU(ARM_TRADITIONAL) && OS(LINUX)) \
- || (CPU(MIPS) && OS(LINUX))
+ || (CPU(MIPS) && OS(LINUX)) \
+ || (CPU(X86) && OS(DARWIN)) \
+ || (CPU(X86_64) && OS(DARWIN))
#define ENABLE_YARR 1
#define ENABLE_YARR_JIT 1
#endif
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index c3d6314..a440c03 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- 3f0f51f4c87e65bfe04165c6af4c00934b0ca1e2
+ 5cf023650a8da206a8cf3130e9d4820b95e1bc7c
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 05fc2af..93d00e4 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,452 @@
+2010-05-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Detect debug mode consistently
+ https://bugs.webkit.org/show_bug.cgi?id=38863
+
+ No new tests as there is no new functionality.
+
+ * WebCore.pro:
+
+2010-05-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Ignore invalid values for various CanvasRenderingContext2D properties
+ (lineWidth, miterLimit, shadowOffsetX, shadowOffsetY and shadowBlur)
+
+ https://bugs.webkit.org/show_bug.cgi?id=38841
+
+ Test: fast/canvas/canvas-invalid-values.html
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setLineWidth):
+ (WebCore::CanvasRenderingContext2D::setMiterLimit):
+ (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
+ (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
+ (WebCore::CanvasRenderingContext2D::setShadowBlur):
+
+2010-05-12 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] GraphicsLayer: depth-test causes flicker in certain situations
+
+ This patch removes the simplistic 2D depth test as it leads to flickering side effects.
+ https://bugs.webkit.org/show_bug.cgi?id=38370
+
+ Tested by http://webkit.org/blog-files/3d-transforms/morphing-cubes.html
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::updateTransform):
+
+2010-04-29 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Calls FrameView::scrollPositionChanged whenever a ScrollView is scrolled
+ https://bugs.webkit.org/show_bug.cgi?id=38286
+
+ When a ScrollView's scroll position is changed, we have to call
+ FrameView::scrollPositionChanged to generate repaint invalidation for
+ fixed position elements. This ends up getting called indirectly when
+ the ScrollView has a platformWidget through the port layer
+ (see WebHTMLView.mm's _frameOrBoundsChanged method for how the mac
+ port does it) but not when there is no platformWidget.
+
+ This is tested by the fast/repaint/fixed-* tests when run in pixel
+ mode.
+
+ Test: fast/repaint/fixed-move-after-keyboard-scroll.html
+
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::valueChanged):
+ * platform/ScrollView.h:
+ (WebCore::ScrollView::scrollPositionChanged):
+
+2010-04-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed build fix.
+
+ Change Media to StyleMedia
+
+ * DerivedSources.make:
+
+2010-04-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ Rename window.media to window.styleMedia
+ https://bugs.webkit.org/show_bug.cgi?id=36187
+
+ Rename the interface Media to StyleMedia as required by the
+ new CSSOM View spec.
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/Media.cpp: Removed.
+ * css/Media.h: Removed.
+ * css/Media.idl: Removed.
+ * css/StyleMedia.cpp: Added.
+ (WebCore::StyleMedia::StyleMedia):
+ (WebCore::StyleMedia::type):
+ (WebCore::StyleMedia::matchMedium):
+ * css/StyleMedia.h: Added.
+ (WebCore::StyleMedia::create):
+ (WebCore::StyleMedia::disconnectFrame):
+ * css/StyleMedia.idl: Added.
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::styleMedia):
+ * page/DOMWindow.h:
+ (WebCore::DOMWindow::optionalMedia):
+ * page/DOMWindow.idl:
+
+2010-04-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ Rename window.media to window.styleMedia
+ https://bugs.webkit.org/show_bug.cgi?id=36187
+
+ It has been defined that the AbstractView media extension
+ defined in the CSSOM View spec should be renamed to styleMedia.
+ This patch does that and updates the current layout tests
+ making use of it.
+
+ * page/AbstractView.idl:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::styleMedia):
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+
+2010-05-11 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] fast/text/find-hidden-text.html
+ https://bugs.webkit.org/show_bug.cgi?id=32922
+
+ Use the real page step for populating the QStyleOption otherwhise
+ the size can be negative, which can break the QStyle used.
+
+ * platform/qt/ScrollbarThemeQt.cpp:
+ (WebCore::styleOptionSlider):
+
+2010-05-03 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Spatial Navigation: create a getter for the "fudgeFactor"
+ https://bugs.webkit.org/show_bug.cgi?id=38488
+
+ A couple of places in the Spatial Navigation code make use of a "fudge factor"
+ to improve precision by working around outline focus metrics and such. Patch adds
+ a helper method for unify getter operations of this value, instead of having it
+ declared locally in the various methods it is used.
+
+ No behaviour change.
+
+ * page/SpatialNavigation.cpp:
+ (WebCore::scrollIntoView):
+ (WebCore::deflateIfOverlapped):
+ * page/SpatialNavigation.h:
+ (WebCore::fudgeFactor):
+
+2010-05-10 Markus Goetz <Markus.Goetz@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Qt after 4.6.3 has its integrated DNS cache. Therefore some
+ code is not necessary anymore.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38834
+
+ * platform/network/qt/DnsPrefetchHelper.h:
+ (WebCore::DnsPrefetchHelper::lookup):
+ (WebCore::DnsPrefetchHelper::lookedUp):
+
+2010-05-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed, build fix WinCE for QtWebKit.
+
+ [Qt] Compilation with Plugins disabled is broken
+ https://bugs.webkit.org/show_bug.cgi?id=31407
+
+ Rename platform/qt/TemporaryLinkStubs.cpp to avoid name collition on
+ Windows.
+
+ Thanks for Ismail "cartman" Donmez for help.
+
+ No new tests, as there is no new functionality.
+
+ * WebCore.gypi:
+ * WebCore.pro:
+ * platform/qt/TemporaryLinkStubs.cpp: Removed.
+ * platform/qt/TemporaryLinkStubsQt.cpp: Copied from WebCore/platform/qt/TemporaryLinkStubs.cpp.
+
+2010-04-23 Qi Zhang <qi.2.zhang@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] LayoutTests/fast/canvas/pointInPath.html passed, actually it failed
+ https://bugs.webkit.org/show_bug.cgi?id=37276
+
+ QPainterPath::contains doesn't count the point on the bound.
+
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::isPointOnPathBorder):
+ (WebCore::Path::contains):
+
+2010-05-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix rendering of -webkit-user-select: none
+
+ -webkit-user-select: none is implemented by filling
+ the area with an invalid default-constructed Color.
+ In most ports passing an invalid color down to the
+ graphics backend seems to produce transparent fills.
+
+ In Qt the behavior of painting with an invalid QColor
+ is undefined, and in practice it results in painting
+ black opaque areas.
+
+ One way to fix this would be to use Qt::transparent
+ when converting an undefined Color to a QColor, but
+ Qt does not have short circuits for fully transparent
+ painting, and we actually end up in slow code paths
+ due to the transparency. So, we're better of doing the
+ short circuit in WebKit.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38523
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+
+2010-04-05 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix infinite redirection loop in QNetworkReplyHandler
+
+ Put a maximum on consecutive redirections so we don't have to
+ worry about whether it's the same url or not.
+
+ Tolerate up to 10 consecutive redirections, anything beyond
+ that is considered a potentially infinite recursion in the
+ redirection requests. This is the same behaviour as Firefox.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37097
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
+ (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+ * platform/network/qt/QNetworkReplyHandler.h:
+
+2010-04-05 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde-Christiansen.
+
+ [Qt] Fix infinite redirection loop in QNetworkReplyHandler
+
+ Qt enters an infinite loop if a redirect response redirects to itself.
+
+ Fixes http/tests/xmlhttprequest/connection-error-sync.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=37097
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+
+2010-05-07 Ben Murdoch <benm@google.com>
+
+ Reviewed by Darin Adler.
+
+ Potential crash in EventHandler::handleTouchEvent
+ https://bugs.webkit.org/show_bug.cgi?id=38646
+
+ Fix a ref counting bug that can cause a crash if the m_originatingouchPointTargets
+ hashmap holds the last ref to an EventTarget when the user lifts their finger.
+
+ This is very hard to reproduce in a consistent way and clearly a
+ simple logic error in the code, therefore no new tests.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTouchEvent): Don't let the RefPtr we get back from
+ the hasmap go out of scope so soon as it could delete the wrapped ptr if the
+ hashmap held the last ref (and we use the raw ptr that the RefPtr
+ wraps later in the WebCore::Touch constructor).
+
+2010-05-04 Ben Murdoch <benm@google.com>
+
+ Reviewed by Simon Hausmann.
+
+ Crash in handleTouchEvent: using dangling node ptrs in hashmap
+ https://bugs.webkit.org/show_bug.cgi?id=38514
+
+ When navigating away from a page, if you have your finger still
+ pressed and then lift it on the new page we see a crash if the
+ node got deleted as we still have a dangling pointer in the
+ m_originatingTouchPointTargets hashmap and try to use it as the
+ receiver to dispatch a touchend event.
+
+ Test: fast/events/touch/touch-stale-node-crash.html
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::clear): Clear the hashmap of touch targets.
+
+2010-05-04 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QT_MOBILE_THEME compile time flag
+ https://bugs.webkit.org/show_bug.cgi?id=38439
+
+ Replacing preprocessor conditional used in RenderThemeQt from Q_WS_MAEMO_5 to
+ USE(QT_MOBILE_THEME).
+
+ * WebCore.pro:
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::RenderThemeQt::RenderThemeQt):
+ (WebCore::RenderThemeQt::qStyle):
+ (WebCore::RenderThemeQt::extraDefaultStyleSheet):
+ (WebCore::RenderThemeQt::adjustMenuListButtonStyle):
+ (WebCore::RenderThemeQt::setPaletteFromPageClientIfExists):
+ * platform/qt/RenderThemeQt.h:
+
+2010-03-25 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt]Fix compile error with QT_NO_LIBRARY
+ https://bugs.webkit.org/show_bug.cgi?id=36533
+
+ * platform/FileSystem.h:
+ * platform/qt/FileSystemQt.cpp:
+ (WebCore::unloadModule):
+
+2010-05-06 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed WinCE buildfix after r58842.
+ Preprocessor doesn't understand "true", changed to "1"
+
+ * platform/graphics/MediaPlayer.cpp:
+
+2010-05-06 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Spatial Navigation: adapt the logic of {deep}findFocusableNodeInDirection to do traversal starting from Node* not Document*
+ https://bugs.webkit.org/show_bug.cgi?id=37803
+
+ Instead of receiving a Document pointer as incoming parameter, patch modifies
+ findFocusableNodeInDirection and deepFindFocusableNodeInDirection methods to
+ receive a Node pointer as start for content traversal.
+ This way we can make good use of deepFindFocusableNodeInDirection to traverse
+ other scrollable container like scrollable div's, and not only frames or iframes.
+
+ Patch also makes use of 'while' instead of 'for' to loop control, that gives move
+ flexibility to the incremental step: e.g. if a scrollable div was processed, the incremental
+ step in the loop does not have to do node->traverseNextNode() but node->traverseNextSibling().
+
+ No behavior change. It is a preparation for supporting scrollable containers in Spatial
+ Navigation.
+
+ * page/FocusController.cpp:
+ (WebCore::FocusController::advanceFocusDirectionally):
+ (WebCore::FocusController::findFocusableNodeInDirection):
+ (WebCore::FocusController::deepFindFocusableNodeInDirection):
+ * page/FocusController.h:
+
+2010-05-06 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] REGRESSION: Loading of external CSS and JS files over network fails in some cases
+ https://bugs.webkit.org/show_bug.cgi?id=36755
+
+ Enable the direct connection between QtNetwork and QtWebKit only for Qt versions
+ greater than 4.6.2, due to a bug in Qt that's been fixed after 4.6.2.
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+
+2010-05-05 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt]Disable Qt Multimedia backend for HTML 5 Audio and Video elements
+ Fall back to the Phonon backend until the release situation has been cleared up.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38612
+
+ Buildfix for QT_VERSION >= 0x040700 after r58810.
+
+ * platform/graphics/MediaPlayer.cpp:
+
+2010-05-03 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix rendering of <button> elements on Mac OS X
+
+ The <button> element has ButtonPart appearance, not PushButton part,
+ so we have to include ButtonPart when we decide if we should draw the
+ button as raised on Mac OS X.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38458
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::RenderThemeQt::initializeCommonQStyleOptions):
+
+2010-04-26 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ View modes names in CSSValueKeywords.in
+ https://bugs.webkit.org/show_bug.cgi?id=38125
+
+ View mode names has changed in previous patch but CSSValueKeywords.in file was
+ not updated.
+
+ * css/CSSValueKeywords.in:
+
+2010-04-28 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Simon Fraser.
+
+ Media queries empty values
+ https://bugs.webkit.org/show_bug.cgi?id=38116
+
+ Adding isValid() method to MediaQueryExp to make it possible to differentiate
+ between queries with empty values and queries with invalid values.
+
+ Test: fast/media/media-query-invalid-value.html
+
+ * css/MediaQueryEvaluator.cpp:
+ (WebCore::MediaQueryEvaluator::eval):
+ * css/MediaQueryExp.cpp:
+ (WebCore::MediaQueryExp::MediaQueryExp):
+ * css/MediaQueryExp.h:
+ (WebCore::MediaQueryExp::isValid):
+
+2010-05-05 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Disable Qt Multimedia backend for HTML 5 Audio and Video elements
+
+ Fall back to the Phonon backend until the release situation has been cleared up.
+
+ * WebCore.pro:
+
2010-05-03 Janne Koskinen <janne.p.koskinen@digia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.gypi b/src/3rdparty/webkit/WebCore/WebCore.gypi
index caa79f2..1e92f1f 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.gypi
+++ b/src/3rdparty/webkit/WebCore/WebCore.gypi
@@ -18,10 +18,10 @@
'css/CSSVariablesDeclaration.idl',
'css/CSSVariablesRule.idl',
'css/Counter.idl',
- 'css/Media.idl',
'css/MediaList.idl',
- 'css/RGBColor.idl',
'css/Rect.idl',
+ 'css/RGBColor.idl',
+ 'css/StyleMedia.idl',
'css/StyleSheet.idl',
'css/StyleSheetList.idl',
'css/WebKitCSSKeyframeRule.idl',
@@ -1003,33 +1003,33 @@
'css/FontValue.h',
'css/MediaFeatureNames.cpp',
'css/MediaFeatureNames.h',
- 'css/Media.cpp',
- 'css/Media.h',
'css/MediaList.cpp',
'css/MediaList.h',
'css/MediaQuery.cpp',
- 'css/MediaQuery.h',
'css/MediaQueryEvaluator.cpp',
'css/MediaQueryEvaluator.h',
'css/MediaQueryExp.cpp',
'css/MediaQueryExp.h',
+ 'css/MediaQuery.h',
'css/Pair.h',
'css/Rect.h',
'css/RGBColor.cpp',
'css/RGBColor.h',
- 'css/SVGCSSComputedStyleDeclaration.cpp',
- 'css/SVGCSSParser.cpp',
- 'css/SVGCSSStyleSelector.cpp',
'css/ShadowValue.cpp',
'css/ShadowValue.h',
'css/StyleBase.cpp',
'css/StyleBase.h',
'css/StyleList.cpp',
'css/StyleList.h',
+ 'css/StyleMedia.cpp',
+ 'css/StyleMedia.h',
'css/StyleSheet.cpp',
'css/StyleSheet.h',
'css/StyleSheetList.cpp',
'css/StyleSheetList.h',
+ 'css/SVGCSSComputedStyleDeclaration.cpp',
+ 'css/SVGCSSParser.cpp',
+ 'css/SVGCSSStyleSelector.cpp',
'css/WebKitCSSKeyframeRule.cpp',
'css/WebKitCSSKeyframeRule.h',
'css/WebKitCSSKeyframesRule.cpp',
@@ -2640,7 +2640,7 @@
'platform/qt/SharedBufferQt.cpp',
'platform/qt/SharedTimerQt.cpp',
'platform/qt/SoundQt.cpp',
- 'platform/qt/TemporaryLinkStubs.cpp',
+ 'platform/qt/TemporaryLinkStubsQt.cpp',
'platform/qt/WheelEventQt.cpp',
'platform/qt/WidgetQt.cpp',
'platform/sql/SQLValue.cpp',
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pri b/src/3rdparty/webkit/WebCore/WebCore.pri
index 039f26c..5f5987f 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pri
+++ b/src/3rdparty/webkit/WebCore/WebCore.pri
@@ -96,10 +96,9 @@ greaterThan(QT_MINOR_VERSION, 5) {
# Web Socket support.
!contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
-# XSLT support with QtXmlPatterns
+# Disable XSLT support with QtXmlPatterns in the 2.0 release
!contains(DEFINES, ENABLE_XSLT=.) {
- contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
- else:DEFINES += ENABLE_XSLT=0
+ DEFINES += ENABLE_XSLT=0
}
!CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_QT_BEARER=.) {
@@ -228,10 +227,10 @@ IDL_BINDINGS += \
css/CSSValueList.idl \
css/CSSVariablesDeclaration.idl \
css/CSSVariablesRule.idl \
- css/Media.idl \
css/MediaList.idl \
- css/RGBColor.idl \
css/Rect.idl \
+ css/RGBColor.idl \
+ css/StyleMedia.idl \
css/StyleSheet.idl \
css/StyleSheetList.idl \
css/WebKitCSSKeyframeRule.idl \
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 3d57562..689c5ff 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -59,7 +59,7 @@ CONFIG(standalone_package) {
isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = generated
isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = ../JavaScriptCore/generated
- CONFIG(debug, debug|release) {
+ !CONFIG(release, debug|release) {
OBJECTS_DIR = obj/debug
} else { # Release
OBJECTS_DIR = obj/release
@@ -126,6 +126,10 @@ maemo5|symbian|embedded {
}
maemo5 {
+ DEFINES += WTF_USE_QT_MOBILE_THEME=1
+}
+
+contains(DEFINES, WTF_USE_QT_MOBILE_THEME=1) {
DEFINES += ENABLE_NO_LISTBOX_RENDERING=1
}
@@ -134,17 +138,12 @@ addJavaScriptCoreLib(../JavaScriptCore)
# HTML5 Media Support
-# We require phonon for versions of Qt < 4.7
-# We require QtMultimedia for versions of Qt >= 4.7
+# We require phonon. QtMultimedia support is disabled currently.
!contains(DEFINES, ENABLE_VIDEO=.) {
DEFINES -= ENABLE_VIDEO=1
DEFINES += ENABLE_VIDEO=0
- lessThan(QT_MINOR_VERSION, 7):contains(QT_CONFIG, phonon) {
- DEFINES -= ENABLE_VIDEO=0
- DEFINES += ENABLE_VIDEO=1
- }
- !lessThan(QT_MINOR_VERSION, 7):contains(QT_CONFIG, mediaservices) {
+ contains(QT_CONFIG, phonon) {
DEFINES -= ENABLE_VIDEO=0
DEFINES += ENABLE_VIDEO=1
}
@@ -432,7 +431,6 @@ SOURCES += \
css/FontFamilyValue.cpp \
css/FontValue.cpp \
css/MediaFeatureNames.cpp \
- css/Media.cpp \
css/MediaList.cpp \
css/MediaQuery.cpp \
css/MediaQueryEvaluator.cpp \
@@ -441,6 +439,7 @@ SOURCES += \
css/ShadowValue.cpp \
css/StyleBase.cpp \
css/StyleList.cpp \
+ css/StyleMedia.cpp \
css/StyleSheet.cpp \
css/StyleSheetList.cpp \
css/WebKitCSSKeyframeRule.cpp \
@@ -1146,7 +1145,6 @@ HEADERS += \
css/FontFamilyValue.h \
css/FontValue.h \
css/MediaFeatureNames.h \
- css/Media.h \
css/MediaList.h \
css/MediaQueryEvaluator.h \
css/MediaQueryExp.h \
@@ -1155,6 +1153,7 @@ HEADERS += \
css/ShadowValue.h \
css/StyleBase.h \
css/StyleList.h \
+ css/StyleMedia.h \
css/StyleSheet.h \
css/StyleSheetList.h \
css/WebKitCSSKeyframeRule.h \
@@ -2082,7 +2081,7 @@ SOURCES += \
platform/qt/SoundQt.cpp \
platform/qt/LoggingQt.cpp \
platform/text/qt/StringQt.cpp \
- platform/qt/TemporaryLinkStubs.cpp \
+ platform/qt/TemporaryLinkStubsQt.cpp \
platform/text/qt/TextBoundariesQt.cpp \
platform/text/qt/TextBreakIteratorQt.cpp \
platform/text/qt/TextCodecQt.cpp \
@@ -2112,13 +2111,15 @@ SOURCES += \
../WebKit/qt/Api/qwebinspector.cpp \
../WebKit/qt/Api/qwebkitversion.cpp
+
+contains(DEFINES, WTF_USE_QT_MOBILE_THEME=1) {
+ HEADERS += platform/qt/Maemo5Webstyle.h
+ SOURCES += platform/qt/Maemo5Webstyle.cpp
+}
+
maemo5 {
- HEADERS += \
- ../WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h \
- platform/qt/Maemo5Webstyle.h
- SOURCES += \
- ../WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp \
- platform/qt/Maemo5Webstyle.cpp
+ HEADERS += ../WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h
+ SOURCES += ../WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp
}
@@ -2369,8 +2370,8 @@ contains(DEFINES, ENABLE_VIDEO=1) {
rendering/RenderMedia.cpp \
bindings/js/JSAudioConstructor.cpp
- # QtMultimedia since 4.7
- greaterThan(QT_MINOR_VERSION, 6) {
+ # QtMultimedia disabled currently
+ false:greaterThan(QT_MINOR_VERSION, 6) {
HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp
diff --git a/src/3rdparty/webkit/WebCore/css/CSSValueKeywords.in b/src/3rdparty/webkit/WebCore/css/CSSValueKeywords.in
index 09d969a..1028dcf 100644
--- a/src/3rdparty/webkit/WebCore/css/CSSValueKeywords.in
+++ b/src/3rdparty/webkit/WebCore/css/CSSValueKeywords.in
@@ -711,7 +711,8 @@ geometricPrecision
sRGB
# (-webkit-view-mode:) media feature:
-mini
floating
-application
fullscreen
+maximized
+minimized
+windowed
diff --git a/src/3rdparty/webkit/WebCore/css/MediaQueryEvaluator.cpp b/src/3rdparty/webkit/WebCore/css/MediaQueryEvaluator.cpp
index ded40b5..20c7bb9 100644
--- a/src/3rdparty/webkit/WebCore/css/MediaQueryEvaluator.cpp
+++ b/src/3rdparty/webkit/WebCore/css/MediaQueryEvaluator.cpp
@@ -533,6 +533,9 @@ bool MediaQueryEvaluator::eval(const MediaQueryExp* expr) const
if (!m_frame || !m_style)
return m_expResult;
+ if (!expr->isValid())
+ return false;
+
if (!gFunctionMap)
createFunctionMap();
diff --git a/src/3rdparty/webkit/WebCore/css/MediaQueryExp.cpp b/src/3rdparty/webkit/WebCore/css/MediaQueryExp.cpp
index 7ba6d84..53c0b73 100644
--- a/src/3rdparty/webkit/WebCore/css/MediaQueryExp.cpp
+++ b/src/3rdparty/webkit/WebCore/css/MediaQueryExp.cpp
@@ -37,6 +37,7 @@ namespace WebCore {
MediaQueryExp::MediaQueryExp(const AtomicString& mediaFeature, CSSParserValueList* valueList)
: m_mediaFeature(mediaFeature)
, m_value(0)
+ , m_isValid(true)
{
if (valueList) {
if (valueList->size() == 1) {
@@ -73,6 +74,7 @@ MediaQueryExp::MediaQueryExp(const AtomicString& mediaFeature, CSSParserValueLis
if (isValid)
m_value = list.release();
}
+ m_isValid = m_value;
}
}
diff --git a/src/3rdparty/webkit/WebCore/css/MediaQueryExp.h b/src/3rdparty/webkit/WebCore/css/MediaQueryExp.h
index fd55cf6..9272402 100644
--- a/src/3rdparty/webkit/WebCore/css/MediaQueryExp.h
+++ b/src/3rdparty/webkit/WebCore/css/MediaQueryExp.h
@@ -52,6 +52,8 @@ public:
|| (other.m_value && m_value && other.m_value->cssText() == m_value->cssText()));
}
+ bool isValid() const { return m_isValid; }
+
bool isViewportDependent() const { return m_mediaFeature == MediaFeatureNames::widthMediaFeature ||
m_mediaFeature == MediaFeatureNames::heightMediaFeature ||
m_mediaFeature == MediaFeatureNames::min_widthMediaFeature ||
@@ -65,6 +67,7 @@ public:
private:
AtomicString m_mediaFeature;
RefPtr<CSSValue> m_value;
+ bool m_isValid;
};
} // namespace
diff --git a/src/3rdparty/webkit/WebCore/css/Media.cpp b/src/3rdparty/webkit/WebCore/css/StyleMedia.cpp
index e238602..6cb662f 100644
--- a/src/3rdparty/webkit/WebCore/css/Media.cpp
+++ b/src/3rdparty/webkit/WebCore/css/StyleMedia.cpp
@@ -24,8 +24,8 @@
*/
#include "config.h"
+#include "StyleMedia.h"
-#include "Media.h"
#include "CSSStyleSelector.h"
#include "Frame.h"
#include "FrameView.h"
@@ -34,12 +34,12 @@
namespace WebCore {
-Media::Media(Frame* frame)
+StyleMedia::StyleMedia(Frame* frame)
: m_frame(frame)
{
}
-String Media::type() const
+String StyleMedia::type() const
{
FrameView* view = m_frame ? m_frame->view() : 0;
if (view)
@@ -48,7 +48,7 @@ String Media::type() const
return String();
}
-bool Media::matchMedium(const String& query) const
+bool StyleMedia::matchMedium(const String& query) const
{
if (!m_frame)
return false;
diff --git a/src/3rdparty/webkit/WebCore/css/Media.h b/src/3rdparty/webkit/WebCore/css/StyleMedia.h
index ee6961b..761e6a3 100644
--- a/src/3rdparty/webkit/WebCore/css/Media.h
+++ b/src/3rdparty/webkit/WebCore/css/StyleMedia.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,18 +24,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Media_h
-#define Media_h
+#ifndef StyleMedia_h
+#define StyleMedia_h
#include "DOMWindow.h"
namespace WebCore {
-class Media : public RefCounted<Media> {
+class StyleMedia : public RefCounted<StyleMedia> {
public:
- static PassRefPtr<Media> create(Frame* frame)
+ static PassRefPtr<StyleMedia> create(Frame* frame)
{
- return adoptRef(new Media(frame));
+ return adoptRef(new StyleMedia(frame));
}
void disconnectFrame() { m_frame = 0; }
@@ -42,13 +43,13 @@ public:
String type() const;
bool matchMedium(const String&) const;
-
+
private:
- Media(Frame*);
+ StyleMedia(Frame*);
Frame* m_frame;
};
} // namespace
-#endif // Media_h
+#endif // StyleMedia_h
diff --git a/src/3rdparty/webkit/WebCore/css/Media.idl b/src/3rdparty/webkit/WebCore/css/StyleMedia.idl
index 1bf5900..7be35cc 100644
--- a/src/3rdparty/webkit/WebCore/css/Media.idl
+++ b/src/3rdparty/webkit/WebCore/css/StyleMedia.idl
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,7 +25,7 @@
*/
module view {
- interface Media {
+ interface StyleMedia {
readonly attribute DOMString type;
boolean matchMedium(in DOMString mediaquery);
};
diff --git a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c
index 6a2581e..b7bf3de 100644
--- a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c
+++ b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c
@@ -203,7 +203,7 @@ findValue (register const char *str, register unsigned int len)
{
enum
{
- TOTAL_KEYWORDS = 613,
+ TOTAL_KEYWORDS = 614,
MIN_WORD_LENGTH = 2,
MAX_WORD_LENGTH = 35,
MIN_HASH_VALUE = 0,
@@ -226,7 +226,7 @@ findValue (register const char *str, register unsigned int len)
{"end", CSSValueEnd},
#line 46 "CSSValueKeywords.gperf"
{"700", CSSValue700},
-#line 621 "CSSValueKeywords.gperf"
+#line 622 "CSSValueKeywords.gperf"
{"lr", CSSValueLr},
#line 45 "CSSValueKeywords.gperf"
{"600", CSSValue600},
@@ -236,17 +236,17 @@ findValue (register const char *str, register unsigned int len)
{"400", CSSValue400},
#line 41 "CSSValueKeywords.gperf"
{"200", CSSValue200},
-#line 623 "CSSValueKeywords.gperf"
+#line 624 "CSSValueKeywords.gperf"
{"tb", CSSValueTb},
#line 15 "CSSValueKeywords.gperf"
{"inset", CSSValueInset},
#line 146 "CSSValueKeywords.gperf"
{"sub", CSSValueSub},
-#line 520 "CSSValueKeywords.gperf"
+#line 521 "CSSValueKeywords.gperf"
{"indigo", CSSValueIndigo},
-#line 559 "CSSValueKeywords.gperf"
+#line 560 "CSSValueKeywords.gperf"
{"oldlace", CSSValueOldlace},
-#line 571 "CSSValueKeywords.gperf"
+#line 572 "CSSValueKeywords.gperf"
{"plum", CSSValuePlum},
#line 71 "CSSValueKeywords.gperf"
{"cursive", CSSValueCursive},
@@ -264,7 +264,7 @@ findValue (register const char *str, register unsigned int len)
{"armenian", CSSValueArmenian},
#line 299 "CSSValueKeywords.gperf"
{"above", CSSValueAbove},
-#line 590 "CSSValueKeywords.gperf"
+#line 591 "CSSValueKeywords.gperf"
{"tomato", CSSValueTomato},
#line 36 "CSSValueKeywords.gperf"
{"normal", CSSValueNormal},
@@ -272,7 +272,7 @@ findValue (register const char *str, register unsigned int len)
{"cross", CSSValueCross},
#line 352 "CSSValueKeywords.gperf"
{"multiple", CSSValueMultiple},
-#line 480 "CSSValueKeywords.gperf"
+#line 481 "CSSValueKeywords.gperf"
{"coral", CSSValueCoral},
#line 371 "CSSValueKeywords.gperf"
{"ellipsis", CSSValueEllipsis},
@@ -294,7 +294,7 @@ findValue (register const char *str, register unsigned int len)
{"contain", CSSValueContain},
#line 437 "CSSValueKeywords.gperf"
{"logical", CSSValueLogical},
-#line 616 "CSSValueKeywords.gperf"
+#line 617 "CSSValueKeywords.gperf"
{"no-change", CSSValueNoChange},
#line 308 "CSSValueKeywords.gperf"
{"crop", CSSValueCrop},
@@ -302,17 +302,17 @@ findValue (register const char *str, register unsigned int len)
{"blue", CSSValueBlue},
#line 444 "CSSValueKeywords.gperf"
{"ease", CSSValueEase},
-#line 588 "CSSValueKeywords.gperf"
+#line 589 "CSSValueKeywords.gperf"
{"tan", CSSValueTan},
#line 462 "CSSValueKeywords.gperf"
{"srgb", CSSValueSrgb},
#line 53 "CSSValueKeywords.gperf"
{"large", CSSValueLarge},
-#line 479 "CSSValueKeywords.gperf"
+#line 480 "CSSValueKeywords.gperf"
{"chocolate", CSSValueChocolate},
#line 258 "CSSValueKeywords.gperf"
{"auto", CSSValueAuto},
-#line 618 "CSSValueKeywords.gperf"
+#line 619 "CSSValueKeywords.gperf"
{"lr-tb", CSSValueLrTb},
#line 298 "CSSValueKeywords.gperf"
{"collapse", CSSValueCollapse},
@@ -326,9 +326,9 @@ findValue (register const char *str, register unsigned int len)
{"orange", CSSValueOrange},
#line 18 "CSSValueKeywords.gperf"
{"outset", CSSValueOutset},
-#line 576 "CSSValueKeywords.gperf"
+#line 577 "CSSValueKeywords.gperf"
{"salmon", CSSValueSalmon},
-#line 544 "CSSValueKeywords.gperf"
+#line 545 "CSSValueKeywords.gperf"
{"magenta", CSSValueMagenta},
#line 419 "CSSValueKeywords.gperf"
{"caret", CSSValueCaret},
@@ -338,9 +338,9 @@ findValue (register const char *str, register unsigned int len)
{"table", CSSValueTable},
#line 51 "CSSValueKeywords.gperf"
{"small", CSSValueSmall},
-#line 613 "CSSValueKeywords.gperf"
+#line 614 "CSSValueKeywords.gperf"
{"hanging", CSSValueHanging},
-#line 474 "CSSValueKeywords.gperf"
+#line 475 "CSSValueKeywords.gperf"
{"blueviolet", CSSValueBlueviolet},
#line 243 "CSSValueKeywords.gperf"
{"compact", CSSValueCompact},
@@ -368,10 +368,8 @@ findValue (register const char *str, register unsigned int len)
{"top", CSSValueTop},
#line 310 "CSSValueKeywords.gperf"
{"embed", CSSValueEmbed},
-#line 514 "CSSValueKeywords.gperf"
+#line 515 "CSSValueKeywords.gperf"
{"gold", CSSValueGold},
-#line 463 "CSSValueKeywords.gperf"
- {"mini", CSSValueMini},
#line 439 "CSSValueKeywords.gperf"
{"lines", CSSValueLines},
#line 351 "CSSValueKeywords.gperf"
@@ -386,11 +384,11 @@ findValue (register const char *str, register unsigned int len)
{"thin", CSSValueThin},
#line 21 "CSSValueKeywords.gperf"
{"solid", CSSValueSolid},
-#line 543 "CSSValueKeywords.gperf"
+#line 544 "CSSValueKeywords.gperf"
{"linen", CSSValueLinen},
#line 319 "CSSValueKeywords.gperf"
{"local", CSSValueLocal},
-#line 589 "CSSValueKeywords.gperf"
+#line 590 "CSSValueKeywords.gperf"
{"thistle", CSSValueThistle},
#line 392 "CSSValueKeywords.gperf"
{"listitem", CSSValueListitem},
@@ -402,31 +400,31 @@ findValue (register const char *str, register unsigned int len)
{"tibetan", CSSValueTibetan},
#line 105 "CSSValueKeywords.gperf"
{"highlight", CSSValueHighlight},
-#line 484 "CSSValueKeywords.gperf"
+#line 485 "CSSValueKeywords.gperf"
{"cyan", CSSValueCyan},
-#line 483 "CSSValueKeywords.gperf"
+#line 484 "CSSValueKeywords.gperf"
{"crimson", CSSValueCrimson},
#line 117 "CSSValueKeywords.gperf"
{"threedhighlight", CSSValueThreedhighlight},
-#line 592 "CSSValueKeywords.gperf"
+#line 593 "CSSValueKeywords.gperf"
{"violet", CSSValueViolet},
#line 164 "CSSValueKeywords.gperf"
{"circle", CSSValueCircle},
#line 370 "CSSValueKeywords.gperf"
{"clip", CSSValueClip},
-#line 535 "CSSValueKeywords.gperf"
+#line 536 "CSSValueKeywords.gperf"
{"lightsalmon", CSSValueLightsalmon},
-#line 557 "CSSValueKeywords.gperf"
+#line 558 "CSSValueKeywords.gperf"
{"moccasin", CSSValueMoccasin},
#line 206 "CSSValueKeywords.gperf"
{"ethiopic", CSSValueEthiopic},
-#line 603 "CSSValueKeywords.gperf"
+#line 604 "CSSValueKeywords.gperf"
{"butt", CSSValueButt},
#line 356 "CSSValueKeywords.gperf"
{"up", CSSValueUp},
#line 185 "CSSValueKeywords.gperf"
{"urdu", CSSValueUrdu},
-#line 622 "CSSValueKeywords.gperf"
+#line 623 "CSSValueKeywords.gperf"
{"rl", CSSValueRl},
#line 312 "CSSValueKeywords.gperf"
{"hand", CSSValueHand},
@@ -434,7 +432,7 @@ findValue (register const char *str, register unsigned int len)
{"aqua", CSSValueAqua},
#line 211 "CSSValueKeywords.gperf"
{"hangul", CSSValueHangul},
-#line 470 "CSSValueKeywords.gperf"
+#line 471 "CSSValueKeywords.gperf"
{"azure", CSSValueAzure},
#line 386 "CSSValueKeywords.gperf"
{"button", CSSValueButton},
@@ -450,7 +448,7 @@ findValue (register const char *str, register unsigned int len)
{"slow", CSSValueSlow},
#line 144 "CSSValueKeywords.gperf"
{"baseline", CSSValueBaseline},
-#line 585 "CSSValueKeywords.gperf"
+#line 586 "CSSValueKeywords.gperf"
{"snow", CSSValueSnow},
#line 338 "CSSValueKeywords.gperf"
{"static", CSSValueStatic},
@@ -460,7 +458,7 @@ findValue (register const char *str, register unsigned int len)
{"outside", CSSValueOutside},
#line 306 "CSSValueKeywords.gperf"
{"both", CSSValueBoth},
-#line 591 "CSSValueKeywords.gperf"
+#line 592 "CSSValueKeywords.gperf"
{"turquoise", CSSValueTurquoise},
#line 37 "CSSValueKeywords.gperf"
{"bold", CSSValueBold},
@@ -470,11 +468,11 @@ findValue (register const char *str, register unsigned int len)
{"inactivecaption", CSSValueInactivecaption},
#line 151 "CSSValueKeywords.gperf"
{"bottom", CSSValueBottom},
-#line 612 "CSSValueKeywords.gperf"
+#line 613 "CSSValueKeywords.gperf"
{"alphabetic", CSSValueAlphabetic},
-#line 562 "CSSValueKeywords.gperf"
+#line 563 "CSSValueKeywords.gperf"
{"orchid", CSSValueOrchid},
-#line 620 "CSSValueKeywords.gperf"
+#line 621 "CSSValueKeywords.gperf"
{"tb-rl", CSSValueTbRl},
#line 32 "CSSValueKeywords.gperf"
{"italic", CSSValueItalic},
@@ -486,7 +484,7 @@ findValue (register const char *str, register unsigned int len)
{"oblique", CSSValueOblique},
#line 438 "CSSValueKeywords.gperf"
{"visual", CSSValueVisual},
-#line 614 "CSSValueKeywords.gperf"
+#line 615 "CSSValueKeywords.gperf"
{"mathematical", CSSValueMathematical},
#line 22 "CSSValueKeywords.gperf"
{"double", CSSValueDouble},
@@ -506,7 +504,7 @@ findValue (register const char *str, register unsigned int len)
{"running", CSSValueRunning},
#line 279 "CSSValueKeywords.gperf"
{"w-resize", CSSValueWResize},
-#line 513 "CSSValueKeywords.gperf"
+#line 514 "CSSValueKeywords.gperf"
{"ghostwhite", CSSValueGhostwhite},
#line 163 "CSSValueKeywords.gperf"
{"disc", CSSValueDisc},
@@ -516,7 +514,7 @@ findValue (register const char *str, register unsigned int len)
{"padding", CSSValuePadding},
#line 200 "CSSValueKeywords.gperf"
{"amharic", CSSValueAmharic},
-#line 581 "CSSValueKeywords.gperf"
+#line 582 "CSSValueKeywords.gperf"
{"skyblue", CSSValueSkyblue},
#line 100 "CSSValueKeywords.gperf"
{"buttonhighlight", CSSValueButtonhighlight},
@@ -524,8 +522,6 @@ findValue (register const char *str, register unsigned int len)
{"landscape", CSSValueLandscape},
#line 246 "CSSValueKeywords.gperf"
{"inline-table", CSSValueInlineTable},
-#line 465 "CSSValueKeywords.gperf"
- {"application", CSSValueApplication},
#line 259 "CSSValueKeywords.gperf"
{"crosshair", CSSValueCrosshair},
#line 267 "CSSValueKeywords.gperf"
@@ -546,13 +542,13 @@ findValue (register const char *str, register unsigned int len)
{"portrait", CSSValuePortrait},
#line 130 "CSSValueKeywords.gperf"
{"no-repeat", CSSValueNoRepeat},
-#line 582 "CSSValueKeywords.gperf"
+#line 583 "CSSValueKeywords.gperf"
{"slateblue", CSSValueSlateblue},
#line 294 "CSSValueKeywords.gperf"
{"capitalize", CSSValueCapitalize},
-#line 619 "CSSValueKeywords.gperf"
+#line 620 "CSSValueKeywords.gperf"
{"rl-tb", CSSValueRlTb},
-#line 602 "CSSValueKeywords.gperf"
+#line 603 "CSSValueKeywords.gperf"
{"crispedges", CSSValueCrispedges},
#line 293 "CSSValueKeywords.gperf"
{"rtl", CSSValueRtl},
@@ -568,11 +564,13 @@ findValue (register const char *str, register unsigned int len)
{"small-caps", CSSValueSmallCaps},
#line 147 "CSSValueKeywords.gperf"
{"super", CSSValueSuper},
-#line 477 "CSSValueKeywords.gperf"
+#line 478 "CSSValueKeywords.gperf"
{"cadetblue", CSSValueCadetblue},
-#line 596 "CSSValueKeywords.gperf"
+#line 466 "CSSValueKeywords.gperf"
+ {"minimized", CSSValueMinimized},
+#line 597 "CSSValueKeywords.gperf"
{"nonzero", CSSValueNonzero},
-#line 475 "CSSValueKeywords.gperf"
+#line 476 "CSSValueKeywords.gperf"
{"brown", CSSValueBrown},
#line 90 "CSSValueKeywords.gperf"
{"white", CSSValueWhite},
@@ -606,29 +604,29 @@ findValue (register const char *str, register unsigned int len)
{"linear", CSSValueLinear},
#line 171 "CSSValueKeywords.gperf"
{"cambodian", CSSValueCambodian},
-#line 467 "CSSValueKeywords.gperf"
+#line 468 "CSSValueKeywords.gperf"
{"aliceblue", CSSValueAliceblue},
-#line 527 "CSSValueKeywords.gperf"
+#line 528 "CSSValueKeywords.gperf"
{"lightblue", CSSValueLightblue},
#line 314 "CSSValueKeywords.gperf"
{"higher", CSSValueHigher},
#line 19 "CSSValueKeywords.gperf"
{"dotted", CSSValueDotted},
-#line 564 "CSSValueKeywords.gperf"
+#line 565 "CSSValueKeywords.gperf"
{"palegreen", CSSValuePalegreen},
#line 141 "CSSValueKeywords.gperf"
{"xor", CSSValueXor},
#line 154 "CSSValueKeywords.gperf"
{"left", CSSValueLeft},
-#line 519 "CSSValueKeywords.gperf"
+#line 520 "CSSValueKeywords.gperf"
{"indianred", CSSValueIndianred},
#line 39 "CSSValueKeywords.gperf"
{"lighter", CSSValueLighter},
-#line 586 "CSSValueKeywords.gperf"
+#line 587 "CSSValueKeywords.gperf"
{"springgreen", CSSValueSpringgreen},
#line 80 "CSSValueKeywords.gperf"
{"green", CSSValueGreen},
-#line 482 "CSSValueKeywords.gperf"
+#line 483 "CSSValueKeywords.gperf"
{"cornsilk", CSSValueCornsilk},
#line 79 "CSSValueKeywords.gperf"
{"gray", CSSValueGray},
@@ -636,27 +634,27 @@ findValue (register const char *str, register unsigned int len)
{"round", CSSValueRound},
#line 181 "CSSValueKeywords.gperf"
{"myanmar", CSSValueMyanmar},
-#line 554 "CSSValueKeywords.gperf"
+#line 555 "CSSValueKeywords.gperf"
{"midnightblue", CSSValueMidnightblue},
#line 366 "CSSValueKeywords.gperf"
{"element", CSSValueElement},
-#line 555 "CSSValueKeywords.gperf"
+#line 556 "CSSValueKeywords.gperf"
{"mintcream", CSSValueMintcream},
#line 242 "CSSValueKeywords.gperf"
{"run-in", CSSValueRunIn},
#line 449 "CSSValueKeywords.gperf"
{"document", CSSValueDocument},
-#line 540 "CSSValueKeywords.gperf"
+#line 541 "CSSValueKeywords.gperf"
{"lightsteelblue", CSSValueLightsteelblue},
#line 264 "CSSValueKeywords.gperf"
{"cell", CSSValueCell},
#line 179 "CSSValueKeywords.gperf"
{"malayalam", CSSValueMalayalam},
-#line 532 "CSSValueKeywords.gperf"
+#line 533 "CSSValueKeywords.gperf"
{"lightgreen", CSSValueLightgreen},
#line 92 "CSSValueKeywords.gperf"
{"transparent", CSSValueTransparent},
-#line 542 "CSSValueKeywords.gperf"
+#line 543 "CSSValueKeywords.gperf"
{"limegreen", CSSValueLimegreen},
#line 456 "CSSValueKeywords.gperf"
{"stroke", CSSValueStroke},
@@ -664,7 +662,7 @@ findValue (register const char *str, register unsigned int len)
{"intrinsic", CSSValueIntrinsic},
#line 454 "CSSValueKeywords.gperf"
{"painted", CSSValuePainted},
-#line 536 "CSSValueKeywords.gperf"
+#line 537 "CSSValueKeywords.gperf"
{"lightseagreen", CSSValueLightseagreen},
#line 331 "CSSValueKeywords.gperf"
{"pre", CSSValuePre},
@@ -676,7 +674,7 @@ findValue (register const char *str, register unsigned int len)
{"gurmukhi", CSSValueGurmukhi},
#line 348 "CSSValueKeywords.gperf"
{"vertical", CSSValueVertical},
-#line 528 "CSSValueKeywords.gperf"
+#line 529 "CSSValueKeywords.gperf"
{"lightcoral", CSSValueLightcoral},
#line 384 "CSSValueKeywords.gperf"
{"push-button", CSSValuePushButton},
@@ -696,7 +694,7 @@ findValue (register const char *str, register unsigned int len)
{"close-quote", CSSValueCloseQuote},
#line 183 "CSSValueKeywords.gperf"
{"oriya", CSSValueOriya},
-#line 464 "CSSValueKeywords.gperf"
+#line 463 "CSSValueKeywords.gperf"
{"floating", CSSValueFloating},
#line 143 "CSSValueKeywords.gperf"
{"plus-lighter", CSSValuePlusLighter},
@@ -714,15 +712,15 @@ findValue (register const char *str, register unsigned int len)
{"source-in", CSSValueSourceIn},
#line 261 "CSSValueKeywords.gperf"
{"pointer", CSSValuePointer},
-#line 472 "CSSValueKeywords.gperf"
+#line 473 "CSSValueKeywords.gperf"
{"bisque", CSSValueBisque},
-#line 598 "CSSValueKeywords.gperf"
+#line 599 "CSSValueKeywords.gperf"
{"accumulate", CSSValueAccumulate},
#line 119 "CSSValueKeywords.gperf"
{"threedshadow", CSSValueThreedshadow},
#line 339 "CSSValueKeywords.gperf"
{"thick", CSSValueThick},
-#line 561 "CSSValueKeywords.gperf"
+#line 562 "CSSValueKeywords.gperf"
{"orangered", CSSValueOrangered},
#line 132 "CSSValueKeywords.gperf"
{"copy", CSSValueCopy},
@@ -732,9 +730,9 @@ findValue (register const char *str, register unsigned int len)
{"no-close-quote", CSSValueNoCloseQuote},
#line 459 "CSSValueKeywords.gperf"
{"optimizespeed", CSSValueOptimizespeed},
-#line 570 "CSSValueKeywords.gperf"
+#line 571 "CSSValueKeywords.gperf"
{"pink", CSSValuePink},
-#line 604 "CSSValueKeywords.gperf"
+#line 605 "CSSValueKeywords.gperf"
{"miter", CSSValueMiter},
#line 442 "CSSValueKeywords.gperf"
{"flat", CSSValueFlat},
@@ -744,7 +742,7 @@ findValue (register const char *str, register unsigned int len)
{"bolder", CSSValueBolder},
#line 436 "CSSValueKeywords.gperf"
{"cover", CSSValueCover},
-#line 469 "CSSValueKeywords.gperf"
+#line 470 "CSSValueKeywords.gperf"
{"aquamarine", CSSValueAquamarine},
#line 429 "CSSValueKeywords.gperf"
{"border", CSSValueBorder},
@@ -760,7 +758,7 @@ findValue (register const char *str, register unsigned int len)
{"button-bevel", CSSValueButtonBevel},
#line 325 "CSSValueKeywords.gperf"
{"no-open-quote", CSSValueNoOpenQuote},
-#line 529 "CSSValueKeywords.gperf"
+#line 530 "CSSValueKeywords.gperf"
{"lightcyan", CSSValueLightcyan},
#line 118 "CSSValueKeywords.gperf"
{"threedlightshadow", CSSValueThreedlightshadow},
@@ -772,13 +770,13 @@ findValue (register const char *str, register unsigned int len)
{"ahead", CSSValueAhead},
#line 284 "CSSValueKeywords.gperf"
{"col-resize", CSSValueColResize},
-#line 579 "CSSValueKeywords.gperf"
+#line 580 "CSSValueKeywords.gperf"
{"seashell", CSSValueSeashell},
-#line 473 "CSSValueKeywords.gperf"
+#line 474 "CSSValueKeywords.gperf"
{"blanchedalmond", CSSValueBlanchedalmond},
#line 76 "CSSValueKeywords.gperf"
{"black", CSSValueBlack},
-#line 518 "CSSValueKeywords.gperf"
+#line 519 "CSSValueKeywords.gperf"
{"hotpink", CSSValueHotpink},
#line 78 "CSSValueKeywords.gperf"
{"fuchsia", CSSValueFuchsia},
@@ -786,13 +784,13 @@ findValue (register const char *str, register unsigned int len)
{"down", CSSValueDown},
#line 409 "CSSValueKeywords.gperf"
{"menulist", CSSValueMenulist},
-#line 566 "CSSValueKeywords.gperf"
+#line 567 "CSSValueKeywords.gperf"
{"palevioletred", CSSValuePalevioletred},
-#line 515 "CSSValueKeywords.gperf"
+#line 516 "CSSValueKeywords.gperf"
{"goldenrod", CSSValueGoldenrod},
-#line 534 "CSSValueKeywords.gperf"
+#line 535 "CSSValueKeywords.gperf"
{"lightpink", CSSValueLightpink},
-#line 569 "CSSValueKeywords.gperf"
+#line 570 "CSSValueKeywords.gperf"
{"peru", CSSValuePeru},
#line 455 "CSSValueKeywords.gperf"
{"fill", CSSValueFill},
@@ -800,7 +798,7 @@ findValue (register const char *str, register unsigned int len)
{"kannada", CSSValueKannada},
#line 373 "CSSValueKeywords.gperf"
{"dot-dash", CSSValueDotDash},
-#line 492 "CSSValueKeywords.gperf"
+#line 493 "CSSValueKeywords.gperf"
{"darkmagenta", CSSValueDarkmagenta},
#line 174 "CSSValueKeywords.gperf"
{"gujarati", CSSValueGujarati},
@@ -816,17 +814,17 @@ findValue (register const char *str, register unsigned int len)
{"currentcolor", CSSValueCurrentcolor},
#line 172 "CSSValueKeywords.gperf"
{"khmer", CSSValueKhmer},
-#line 503 "CSSValueKeywords.gperf"
+#line 504 "CSSValueKeywords.gperf"
{"darkviolet", CSSValueDarkviolet},
#line 106 "CSSValueKeywords.gperf"
{"highlighttext", CSSValueHighlighttext},
-#line 497 "CSSValueKeywords.gperf"
+#line 498 "CSSValueKeywords.gperf"
{"darksalmon", CSSValueDarksalmon},
#line 305 "CSSValueKeywords.gperf"
{"blink", CSSValueBlink},
-#line 574 "CSSValueKeywords.gperf"
+#line 575 "CSSValueKeywords.gperf"
{"royalblue", CSSValueRoyalblue},
-#line 580 "CSSValueKeywords.gperf"
+#line 581 "CSSValueKeywords.gperf"
{"sienna", CSSValueSienna},
#line 349 "CSSValueKeywords.gperf"
{"inline-axis", CSSValueInlineAxis},
@@ -840,7 +838,7 @@ findValue (register const char *str, register unsigned int len)
{"buttonshadow", CSSValueButtonshadow},
#line 59 "CSSValueKeywords.gperf"
{"wider", CSSValueWider},
-#line 468 "CSSValueKeywords.gperf"
+#line 469 "CSSValueKeywords.gperf"
{"antiquewhite", CSSValueAntiquewhite},
#line 54 "CSSValueKeywords.gperf"
{"x-large", CSSValueXLarge},
@@ -848,7 +846,7 @@ findValue (register const char *str, register unsigned int len)
{"ethiopic-abegede", CSSValueEthiopicAbegede},
#line 207 "CSSValueKeywords.gperf"
{"ethiopic-halehame-gez", CSSValueEthiopicHalehameGez},
-#line 593 "CSSValueKeywords.gperf"
+#line 594 "CSSValueKeywords.gperf"
{"wheat", CSSValueWheat},
#line 295 "CSSValueKeywords.gperf"
{"uppercase", CSSValueUppercase},
@@ -856,19 +854,21 @@ findValue (register const char *str, register unsigned int len)
{"buttontext", CSSValueButtontext},
#line 317 "CSSValueKeywords.gperf"
{"level", CSSValueLevel},
-#line 560 "CSSValueKeywords.gperf"
+#line 561 "CSSValueKeywords.gperf"
{"olivedrab", CSSValueOlivedrab},
-#line 512 "CSSValueKeywords.gperf"
+#line 513 "CSSValueKeywords.gperf"
{"gainsboro", CSSValueGainsboro},
+#line 465 "CSSValueKeywords.gperf"
+ {"maximized", CSSValueMaximized},
#line 186 "CSSValueKeywords.gperf"
{"telugu", CSSValueTelugu},
-#line 607 "CSSValueKeywords.gperf"
+#line 608 "CSSValueKeywords.gperf"
{"after-edge", CSSValueAfterEdge},
#line 332 "CSSValueKeywords.gperf"
{"pre-line", CSSValuePreLine},
#line 87 "CSSValueKeywords.gperf"
{"red", CSSValueRed},
-#line 508 "CSSValueKeywords.gperf"
+#line 509 "CSSValueKeywords.gperf"
{"dodgerblue", CSSValueDodgerblue},
#line 83 "CSSValueKeywords.gperf"
{"navy", CSSValueNavy},
@@ -882,7 +882,7 @@ findValue (register const char *str, register unsigned int len)
{"inactivecaptiontext", CSSValueInactivecaptiontext},
#line 260 "CSSValueKeywords.gperf"
{"default", CSSValueDefault},
-#line 471 "CSSValueKeywords.gperf"
+#line 472 "CSSValueKeywords.gperf"
{"beige", CSSValueBeige},
#line 244 "CSSValueKeywords.gperf"
{"inline-block", CSSValueInlineBlock},
@@ -898,17 +898,17 @@ findValue (register const char *str, register unsigned int len)
{"captiontext", CSSValueCaptiontext},
#line 166 "CSSValueKeywords.gperf"
{"decimal", CSSValueDecimal},
-#line 583 "CSSValueKeywords.gperf"
+#line 584 "CSSValueKeywords.gperf"
{"slategray", CSSValueSlategray},
#line 156 "CSSValueKeywords.gperf"
{"center", CSSValueCenter},
-#line 584 "CSSValueKeywords.gperf"
+#line 585 "CSSValueKeywords.gperf"
{"slategrey", CSSValueSlategrey},
#line 99 "CSSValueKeywords.gperf"
{"buttonface", CSSValueButtonface},
-#line 563 "CSSValueKeywords.gperf"
+#line 564 "CSSValueKeywords.gperf"
{"palegoldenrod", CSSValuePalegoldenrod},
-#line 608 "CSSValueKeywords.gperf"
+#line 609 "CSSValueKeywords.gperf"
{"central", CSSValueCentral},
#line 269 "CSSValueKeywords.gperf"
{"not-allowed", CSSValueNotAllowed},
@@ -924,21 +924,21 @@ findValue (register const char *str, register unsigned int len)
{"sw-resize", CSSValueSwResize},
#line 318 "CSSValueKeywords.gperf"
{"line-through", CSSValueLineThrough},
-#line 594 "CSSValueKeywords.gperf"
+#line 595 "CSSValueKeywords.gperf"
{"whitesmoke", CSSValueWhitesmoke},
-#line 466 "CSSValueKeywords.gperf"
+#line 464 "CSSValueKeywords.gperf"
{"fullscreen", CSSValueFullscreen},
#line 120 "CSSValueKeywords.gperf"
{"window", CSSValueWindow},
#line 66 "CSSValueKeywords.gperf"
{"expanded", CSSValueExpanded},
-#line 517 "CSSValueKeywords.gperf"
+#line 518 "CSSValueKeywords.gperf"
{"honeydew", CSSValueHoneydew},
#line 274 "CSSValueKeywords.gperf"
{"nw-resize", CSSValueNwResize},
#line 326 "CSSValueKeywords.gperf"
{"nowrap", CSSValueNowrap},
-#line 523 "CSSValueKeywords.gperf"
+#line 524 "CSSValueKeywords.gperf"
{"lavender", CSSValueLavender},
#line 233 "CSSValueKeywords.gperf"
{"georgian", CSSValueGeorgian},
@@ -946,7 +946,7 @@ findValue (register const char *str, register unsigned int len)
{"xx-small", CSSValueXxSmall},
#line 133 "CSSValueKeywords.gperf"
{"source-over", CSSValueSourceOver},
-#line 511 "CSSValueKeywords.gperf"
+#line 512 "CSSValueKeywords.gperf"
{"forestgreen", CSSValueForestgreen},
#line 198 "CSSValueKeywords.gperf"
{"ethiopic-halehame-aa-et", CSSValueEthiopicHalehameAaEt},
@@ -956,99 +956,99 @@ findValue (register const char *str, register unsigned int len)
{"ethiopic-halehame-am-et", CSSValueEthiopicHalehameAmEt},
#line 452 "CSSValueKeywords.gperf"
{"visiblefill", CSSValueVisiblefill},
-#line 558 "CSSValueKeywords.gperf"
+#line 559 "CSSValueKeywords.gperf"
{"navajowhite", CSSValueNavajowhite},
#line 303 "CSSValueKeywords.gperf"
{"below", CSSValueBelow},
#line 286 "CSSValueKeywords.gperf"
{"text", CSSValueText},
-#line 605 "CSSValueKeywords.gperf"
+#line 606 "CSSValueKeywords.gperf"
{"bevel", CSSValueBevel},
#line 214 "CSSValueKeywords.gperf"
{"ethiopic-halehame-om-et", CSSValueEthiopicHalehameOmEt},
#line 276 "CSSValueKeywords.gperf"
{"se-resize", CSSValueSeResize},
-#line 556 "CSSValueKeywords.gperf"
+#line 557 "CSSValueKeywords.gperf"
{"mistyrose", CSSValueMistyrose},
#line 218 "CSSValueKeywords.gperf"
{"ethiopic-halehame-so-et", CSSValueEthiopicHalehameSoEt},
#line 432 "CSSValueKeywords.gperf"
{"content-box", CSSValueContentBox},
-#line 541 "CSSValueKeywords.gperf"
+#line 542 "CSSValueKeywords.gperf"
{"lightyellow", CSSValueLightyellow},
-#line 531 "CSSValueKeywords.gperf"
+#line 532 "CSSValueKeywords.gperf"
{"lightgray", CSSValueLightgray},
#line 226 "CSSValueKeywords.gperf"
{"ethiopic-halehame-ti-et", CSSValueEthiopicHalehameTiEt},
-#line 533 "CSSValueKeywords.gperf"
+#line 534 "CSSValueKeywords.gperf"
{"lightgrey", CSSValueLightgrey},
#line 265 "CSSValueKeywords.gperf"
{"context-menu", CSSValueContextMenu},
#line 273 "CSSValueKeywords.gperf"
{"ne-resize", CSSValueNeResize},
-#line 611 "CSSValueKeywords.gperf"
+#line 612 "CSSValueKeywords.gperf"
{"ideographic", CSSValueIdeographic},
-#line 478 "CSSValueKeywords.gperf"
+#line 479 "CSSValueKeywords.gperf"
{"chartreuse", CSSValueChartreuse},
-#line 522 "CSSValueKeywords.gperf"
+#line 523 "CSSValueKeywords.gperf"
{"khaki", CSSValueKhaki},
#line 250 "CSSValueKeywords.gperf"
{"table-row", CSSValueTableRow},
-#line 600 "CSSValueKeywords.gperf"
+#line 601 "CSSValueKeywords.gperf"
{"linearrgb", CSSValueLinearrgb},
-#line 538 "CSSValueKeywords.gperf"
- {"lightslategray", CSSValueLightslategray},
#line 539 "CSSValueKeywords.gperf"
+ {"lightslategray", CSSValueLightslategray},
+#line 540 "CSSValueKeywords.gperf"
{"lightslategrey", CSSValueLightslategrey},
-#line 525 "CSSValueKeywords.gperf"
+#line 526 "CSSValueKeywords.gperf"
{"lawngreen", CSSValueLawngreen},
-#line 587 "CSSValueKeywords.gperf"
+#line 588 "CSSValueKeywords.gperf"
{"steelblue", CSSValueSteelblue},
#line 127 "CSSValueKeywords.gperf"
{"repeat", CSSValueRepeat},
-#line 546 "CSSValueKeywords.gperf"
+#line 547 "CSSValueKeywords.gperf"
{"mediumblue", CSSValueMediumblue},
-#line 578 "CSSValueKeywords.gperf"
+#line 579 "CSSValueKeywords.gperf"
{"seagreen", CSSValueSeagreen},
#line 336 "CSSValueKeywords.gperf"
{"separate", CSSValueSeparate},
-#line 565 "CSSValueKeywords.gperf"
+#line 566 "CSSValueKeywords.gperf"
{"paleturquoise", CSSValuePaleturquoise},
-#line 485 "CSSValueKeywords.gperf"
+#line 486 "CSSValueKeywords.gperf"
{"darkblue", CSSValueDarkblue},
#line 138 "CSSValueKeywords.gperf"
{"destination-in", CSSValueDestinationIn},
-#line 476 "CSSValueKeywords.gperf"
+#line 477 "CSSValueKeywords.gperf"
{"burlywood", CSSValueBurlywood},
-#line 599 "CSSValueKeywords.gperf"
+#line 600 "CSSValueKeywords.gperf"
{"new", CSSValueNew},
-#line 550 "CSSValueKeywords.gperf"
+#line 551 "CSSValueKeywords.gperf"
{"mediumslateblue", CSSValueMediumslateblue},
#line 196 "CSSValueKeywords.gperf"
{"upper-latin", CSSValueUpperLatin},
-#line 499 "CSSValueKeywords.gperf"
+#line 500 "CSSValueKeywords.gperf"
{"darkslateblue", CSSValueDarkslateblue},
-#line 549 "CSSValueKeywords.gperf"
+#line 550 "CSSValueKeywords.gperf"
{"mediumseagreen", CSSValueMediumseagreen},
#line 104 "CSSValueKeywords.gperf"
{"graytext", CSSValueGraytext},
#line 458 "CSSValueKeywords.gperf"
{"subpixel-antialiased", CSSValueSubpixelAntialiased},
-#line 489 "CSSValueKeywords.gperf"
+#line 490 "CSSValueKeywords.gperf"
{"darkgreen", CSSValueDarkgreen},
#line 140 "CSSValueKeywords.gperf"
{"destination-atop", CSSValueDestinationAtop},
-#line 494 "CSSValueKeywords.gperf"
+#line 495 "CSSValueKeywords.gperf"
{"darkorange", CSSValueDarkorange},
#line 195 "CSSValueKeywords.gperf"
{"upper-alpha", CSSValueUpperAlpha},
-#line 498 "CSSValueKeywords.gperf"
+#line 499 "CSSValueKeywords.gperf"
{"darkseagreen", CSSValueDarkseagreen},
#line 377 "CSSValueKeywords.gperf"
{"skip-white-space", CSSValueSkipWhiteSpace},
#line 169 "CSSValueKeywords.gperf"
{"binary", CSSValueBinary},
-#line 521 "CSSValueKeywords.gperf"
+#line 522 "CSSValueKeywords.gperf"
{"ivory", CSSValueIvory},
#line 460 "CSSValueKeywords.gperf"
{"optimizelegibility", CSSValueOptimizelegibility},
@@ -1056,23 +1056,25 @@ findValue (register const char *str, register unsigned int len)
{"serif", CSSValueSerif},
#line 60 "CSSValueKeywords.gperf"
{"narrower", CSSValueNarrower},
-#line 575 "CSSValueKeywords.gperf"
+#line 576 "CSSValueKeywords.gperf"
{"saddlebrown", CSSValueSaddlebrown},
#line 209 "CSSValueKeywords.gperf"
{"ethiopic-abegede-gez", CSSValueEthiopicAbegedeGez},
+#line 467 "CSSValueKeywords.gperf"
+ {"windowed", CSSValueWindowed},
#line 72 "CSSValueKeywords.gperf"
{"fantasy", CSSValueFantasy},
#line 414 "CSSValueKeywords.gperf"
{"progress-bar", CSSValueProgressBar},
-#line 493 "CSSValueKeywords.gperf"
+#line 494 "CSSValueKeywords.gperf"
{"darkolivegreen", CSSValueDarkolivegreen},
#line 31 "CSSValueKeywords.gperf"
{"status-bar", CSSValueStatusBar},
-#line 506 "CSSValueKeywords.gperf"
- {"dimgray", CSSValueDimgray},
#line 507 "CSSValueKeywords.gperf"
+ {"dimgray", CSSValueDimgray},
+#line 508 "CSSValueKeywords.gperf"
{"dimgrey", CSSValueDimgrey},
-#line 567 "CSSValueKeywords.gperf"
+#line 568 "CSSValueKeywords.gperf"
{"papayawhip", CSSValuePapayawhip},
#line 453 "CSSValueKeywords.gperf"
{"visiblestroke", CSSValueVisiblestroke},
@@ -1092,9 +1094,9 @@ findValue (register const char *str, register unsigned int len)
{"destination-out", CSSValueDestinationOut},
#line 231 "CSSValueKeywords.gperf"
{"hebrew", CSSValueHebrew},
-#line 617 "CSSValueKeywords.gperf"
+#line 618 "CSSValueKeywords.gperf"
{"reset-size", CSSValueResetSize},
-#line 597 "CSSValueKeywords.gperf"
+#line 598 "CSSValueKeywords.gperf"
{"evenodd", CSSValueEvenodd},
#line 107 "CSSValueKeywords.gperf"
{"inactiveborder", CSSValueInactiveborder},
@@ -1106,7 +1108,7 @@ findValue (register const char *str, register unsigned int len)
{"overline", CSSValueOverline},
#line 389 "CSSValueKeywords.gperf"
{"inner-spin-button", CSSValueInnerSpinButton},
-#line 486 "CSSValueKeywords.gperf"
+#line 487 "CSSValueKeywords.gperf"
{"darkcyan", CSSValueDarkcyan},
#line 113 "CSSValueKeywords.gperf"
{"menutext", CSSValueMenutext},
@@ -1114,15 +1116,15 @@ findValue (register const char *str, register unsigned int len)
{"tigrinya-et", CSSValueTigrinyaEt},
#line 64 "CSSValueKeywords.gperf"
{"semi-condensed", CSSValueSemiCondensed},
-#line 496 "CSSValueKeywords.gperf"
+#line 497 "CSSValueKeywords.gperf"
{"darkred", CSSValueDarkred},
-#line 601 "CSSValueKeywords.gperf"
+#line 602 "CSSValueKeywords.gperf"
{"optimizequality", CSSValueOptimizequality},
#line 203 "CSSValueKeywords.gperf"
{"ethiopic-abegede-am-et", CSSValueEthiopicAbegedeAmEt},
#line 148 "CSSValueKeywords.gperf"
{"text-top", CSSValueTextTop},
-#line 510 "CSSValueKeywords.gperf"
+#line 511 "CSSValueKeywords.gperf"
{"floralwhite", CSSValueFloralwhite},
#line 70 "CSSValueKeywords.gperf"
{"sans-serif", CSSValueSansSerif},
@@ -1130,7 +1132,7 @@ findValue (register const char *str, register unsigned int len)
{"padding-box", CSSValuePaddingBox},
#line 55 "CSSValueKeywords.gperf"
{"xx-large", CSSValueXxLarge},
-#line 553 "CSSValueKeywords.gperf"
+#line 554 "CSSValueKeywords.gperf"
{"mediumvioletred", CSSValueMediumvioletred},
#line 228 "CSSValueKeywords.gperf"
{"ethiopic-abegede-ti-et", CSSValueEthiopicAbegedeTiEt},
@@ -1140,13 +1142,13 @@ findValue (register const char *str, register unsigned int len)
{"open-quote", CSSValueOpenQuote},
#line 61 "CSSValueKeywords.gperf"
{"ultra-condensed", CSSValueUltraCondensed},
-#line 547 "CSSValueKeywords.gperf"
+#line 548 "CSSValueKeywords.gperf"
{"mediumorchid", CSSValueMediumorchid},
-#line 524 "CSSValueKeywords.gperf"
+#line 525 "CSSValueKeywords.gperf"
{"lavenderblush", CSSValueLavenderblush},
#line 199 "CSSValueKeywords.gperf"
{"ethiopic-halehame-aa-er", CSSValueEthiopicHalehameAaEr},
-#line 495 "CSSValueKeywords.gperf"
+#line 496 "CSSValueKeywords.gperf"
{"darkorchid", CSSValueDarkorchid},
#line 410 "CSSValueKeywords.gperf"
{"menulist-button", CSSValueMenulistButton},
@@ -1166,11 +1168,11 @@ findValue (register const char *str, register unsigned int len)
{"ethiopic-halehame-ti-er", CSSValueEthiopicHalehameTiEr},
#line 95 "CSSValueKeywords.gperf"
{"activeborder", CSSValueActiveborder},
-#line 516 "CSSValueKeywords.gperf"
+#line 517 "CSSValueKeywords.gperf"
{"greenyellow", CSSValueGreenyellow},
#line 443 "CSSValueKeywords.gperf"
{"preserve-3d", CSSValuePreserve3d},
-#line 548 "CSSValueKeywords.gperf"
+#line 549 "CSSValueKeywords.gperf"
{"mediumpurple", CSSValueMediumpurple},
#line 263 "CSSValueKeywords.gperf"
{"vertical-text", CSSValueVerticalText},
@@ -1178,7 +1180,7 @@ findValue (register const char *str, register unsigned int len)
{"fixed", CSSValueFixed},
#line 378 "CSSValueKeywords.gperf"
{"break-all", CSSValueBreakAll},
-#line 615 "CSSValueKeywords.gperf"
+#line 616 "CSSValueKeywords.gperf"
{"use-script", CSSValueUseScript},
#line 413 "CSSValueKeywords.gperf"
{"outer-spin-button", CSSValueOuterSpinButton},
@@ -1198,23 +1200,23 @@ findValue (register const char *str, register unsigned int len)
{"forwards", CSSValueForwards},
#line 251 "CSSValueKeywords.gperf"
{"table-column-group", CSSValueTableColumnGroup},
-#line 606 "CSSValueKeywords.gperf"
+#line 607 "CSSValueKeywords.gperf"
{"before-edge", CSSValueBeforeEdge},
#line 415 "CSSValueKeywords.gperf"
{"slider-horizontal", CSSValueSliderHorizontal},
-#line 537 "CSSValueKeywords.gperf"
+#line 538 "CSSValueKeywords.gperf"
{"lightskyblue", CSSValueLightskyblue},
#line 26 "CSSValueKeywords.gperf"
{"message-box", CSSValueMessageBox},
-#line 545 "CSSValueKeywords.gperf"
+#line 546 "CSSValueKeywords.gperf"
{"mediumaquamarine", CSSValueMediumaquamarine},
#line 304 "CSSValueKeywords.gperf"
{"bidi-override", CSSValueBidiOverride},
-#line 572 "CSSValueKeywords.gperf"
+#line 573 "CSSValueKeywords.gperf"
{"powderblue", CSSValuePowderblue},
#line 388 "CSSValueKeywords.gperf"
{"default-button", CSSValueDefaultButton},
-#line 487 "CSSValueKeywords.gperf"
+#line 488 "CSSValueKeywords.gperf"
{"darkgoldenrod", CSSValueDarkgoldenrod},
#line 97 "CSSValueKeywords.gperf"
{"appworkspace", CSSValueAppworkspace},
@@ -1232,23 +1234,23 @@ findValue (register const char *str, register unsigned int len)
{"media-mute-button", CSSValueMediaMuteButton},
#line 346 "CSSValueKeywords.gperf"
{"reverse", CSSValueReverse},
-#line 488 "CSSValueKeywords.gperf"
+#line 489 "CSSValueKeywords.gperf"
{"darkgray", CSSValueDarkgray},
-#line 490 "CSSValueKeywords.gperf"
+#line 491 "CSSValueKeywords.gperf"
{"darkgrey", CSSValueDarkgrey},
#line 282 "CSSValueKeywords.gperf"
{"nesw-resize", CSSValueNeswResize},
-#line 551 "CSSValueKeywords.gperf"
+#line 552 "CSSValueKeywords.gperf"
{"mediumspringgreen", CSSValueMediumspringgreen},
#line 142 "CSSValueKeywords.gperf"
{"plus-darker", CSSValuePlusDarker},
-#line 500 "CSSValueKeywords.gperf"
- {"darkslategray", CSSValueDarkslategray},
#line 501 "CSSValueKeywords.gperf"
+ {"darkslategray", CSSValueDarkslategray},
+#line 502 "CSSValueKeywords.gperf"
{"darkslategrey", CSSValueDarkslategrey},
#line 285 "CSSValueKeywords.gperf"
{"row-resize", CSSValueRowResize},
-#line 577 "CSSValueKeywords.gperf"
+#line 578 "CSSValueKeywords.gperf"
{"sandybrown", CSSValueSandybrown},
#line 221 "CSSValueKeywords.gperf"
{"tigrinya-er", CSSValueTigrinyaEr},
@@ -1258,27 +1260,27 @@ findValue (register const char *str, register unsigned int len)
{"background", CSSValueBackground},
#line 430 "CSSValueKeywords.gperf"
{"border-box", CSSValueBorderBox},
-#line 552 "CSSValueKeywords.gperf"
+#line 553 "CSSValueKeywords.gperf"
{"mediumturquoise", CSSValueMediumturquoise},
-#line 502 "CSSValueKeywords.gperf"
+#line 503 "CSSValueKeywords.gperf"
{"darkturquoise", CSSValueDarkturquoise},
#line 115 "CSSValueKeywords.gperf"
{"threeddarkshadow", CSSValueThreeddarkshadow},
#line 224 "CSSValueKeywords.gperf"
{"ethiopic-abegede-ti-er", CSSValueEthiopicAbegedeTiEr},
-#line 573 "CSSValueKeywords.gperf"
+#line 574 "CSSValueKeywords.gperf"
{"rosybrown", CSSValueRosybrown},
#line 328 "CSSValueKeywords.gperf"
{"overlay", CSSValueOverlay},
-#line 491 "CSSValueKeywords.gperf"
+#line 492 "CSSValueKeywords.gperf"
{"darkkhaki", CSSValueDarkkhaki},
-#line 481 "CSSValueKeywords.gperf"
+#line 482 "CSSValueKeywords.gperf"
{"cornflowerblue", CSSValueCornflowerblue},
#line 402 "CSSValueKeywords.gperf"
{"media-sliderthumb", CSSValueMediaSliderthumb},
#line 418 "CSSValueKeywords.gperf"
{"sliderthumb-vertical", CSSValueSliderthumbVertical},
-#line 595 "CSSValueKeywords.gperf"
+#line 596 "CSSValueKeywords.gperf"
{"yellowgreen", CSSValueYellowgreen},
#line 354 "CSSValueKeywords.gperf"
{"backwards", CSSValueBackwards},
@@ -1286,7 +1288,7 @@ findValue (register const char *str, register unsigned int len)
{"table-header-group", CSSValueTableHeaderGroup},
#line 129 "CSSValueKeywords.gperf"
{"repeat-y", CSSValueRepeatY},
-#line 509 "CSSValueKeywords.gperf"
+#line 510 "CSSValueKeywords.gperf"
{"firebrick", CSSValueFirebrick},
#line 382 "CSSValueKeywords.gperf"
{"checkbox", CSSValueCheckbox},
@@ -1294,7 +1296,7 @@ findValue (register const char *str, register unsigned int len)
{"media-volume-slider", CSSValueMediaVolumeSlider},
#line 230 "CSSValueKeywords.gperf"
{"upper-norwegian", CSSValueUpperNorwegian},
-#line 530 "CSSValueKeywords.gperf"
+#line 531 "CSSValueKeywords.gperf"
{"lightgoldenrodyellow", CSSValueLightgoldenrodyellow},
#line 65 "CSSValueKeywords.gperf"
{"semi-expanded", CSSValueSemiExpanded},
@@ -1318,7 +1320,7 @@ findValue (register const char *str, register unsigned int len)
{"upper-greek", CSSValueUpperGreek},
#line 247 "CSSValueKeywords.gperf"
{"table-row-group", CSSValueTableRowGroup},
-#line 526 "CSSValueKeywords.gperf"
+#line 527 "CSSValueKeywords.gperf"
{"lemonchiffon", CSSValueLemonchiffon},
#line 212 "CSSValueKeywords.gperf"
{"lower-norwegian", CSSValueLowerNorwegian},
@@ -1328,7 +1330,7 @@ findValue (register const char *str, register unsigned int len)
{"media-play-button", CSSValueMediaPlayButton},
#line 427 "CSSValueKeywords.gperf"
{"caps-lock-indicator", CSSValueCapsLockIndicator},
-#line 504 "CSSValueKeywords.gperf"
+#line 505 "CSSValueKeywords.gperf"
{"deeppink", CSSValueDeeppink},
#line 121 "CSSValueKeywords.gperf"
{"windowframe", CSSValueWindowframe},
@@ -1350,7 +1352,7 @@ findValue (register const char *str, register unsigned int len)
{"table-footer-group", CSSValueTableFooterGroup},
#line 223 "CSSValueKeywords.gperf"
{"tigrinya-er-abegede", CSSValueTigrinyaErAbegede},
-#line 568 "CSSValueKeywords.gperf"
+#line 569 "CSSValueKeywords.gperf"
{"peachpuff", CSSValuePeachpuff},
#line 379 "CSSValueKeywords.gperf"
{"break-word", CSSValueBreakWord},
@@ -1376,11 +1378,11 @@ findValue (register const char *str, register unsigned int len)
{"-webkit-center", CSSValueWebkitCenter},
#line 393 "CSSValueKeywords.gperf"
{"media-fullscreen-button", CSSValueMediaFullscreenButton},
-#line 610 "CSSValueKeywords.gperf"
+#line 611 "CSSValueKeywords.gperf"
{"text-after-edge", CSSValueTextAfterEdge},
#line 30 "CSSValueKeywords.gperf"
{"-webkit-control", CSSValueWebkitControl},
-#line 505 "CSSValueKeywords.gperf"
+#line 506 "CSSValueKeywords.gperf"
{"deepskyblue", CSSValueDeepskyblue},
#line 290 "CSSValueKeywords.gperf"
{"-webkit-grab", CSSValueWebkitGrab},
@@ -1394,7 +1396,7 @@ findValue (register const char *str, register unsigned int len)
{"-webkit-text", CSSValueWebkitText},
#line 94 "CSSValueKeywords.gperf"
{"-webkit-activelink", CSSValueWebkitActivelink},
-#line 609 "CSSValueKeywords.gperf"
+#line 610 "CSSValueKeywords.gperf"
{"text-before-edge", CSSValueTextBeforeEdge},
#line 421 "CSSValueKeywords.gperf"
{"searchfield-decoration", CSSValueSearchfieldDecoration},
@@ -1482,118 +1484,118 @@ findValue (register const char *str, register unsigned int len)
-1, 66, -1, -1, -1, 67, 68, -1, -1, -1,
69, 70, 71, -1, -1, 72, -1, -1, 73, -1,
-1, 74, -1, -1, -1, 75, -1, 76, -1, -1,
- 77, 78, -1, -1, -1, -1, 79, -1, -1, -1,
- -1, 80, 81, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 82, -1, -1, 83, 84, -1, -1,
- -1, -1, -1, -1, -1, -1, 85, -1, -1, -1,
- 86, 87, -1, -1, -1, 88, 89, -1, -1, -1,
- -1, 90, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
+ 77, 78, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 79, 80, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 81, -1, -1, 82, 83, -1, -1,
+ -1, -1, -1, -1, -1, -1, 84, -1, -1, -1,
+ 85, 86, -1, -1, -1, 87, 88, -1, -1, -1,
+ -1, 89, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 90, 91, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 92, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 93, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 94, -1, -1, -1,
- 95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- 97, -1, -1, 98, -1, -1, 99, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 100, -1, 101, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 102, -1, -1, -1, -1,
- 103, -1, 104, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 105, -1, -1, 106, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 107, 108, 109, -1, -1,
- -1, -1, 110, -1, -1, -1, -1, 111, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 112, -1, -1,
- -1, 113, -1, -1, -1, -1, 114, 115, -1, -1,
- 116, 117, -1, -1, -1, 118, -1, -1, -1, -1,
- -1, 119, -1, -1, -1, -1, -1, -1, -1, -1,
- 120, -1, -1, -1, -1, -1, 121, 122, -1, -1,
- -1, 123, -1, -1, -1, -1, -1, -1, -1, 124,
- 125, 126, 127, -1, -1, 128, -1, -1, 129, -1,
- -1, 130, -1, 131, -1, 132, -1, 133, -1, -1,
- -1, 134, 135, 136, -1, -1, 137, -1, -1, -1,
- -1, -1, 138, 139, -1, 140, -1, 141, -1, -1,
- 142, 143, -1, -1, -1, -1, -1, -1, -1, -1,
- 144, -1, -1, 145, 146, -1, -1, -1, 147, -1,
- -1, -1, -1, -1, -1, -1, 148, 149, -1, -1,
- -1, 150, -1, -1, -1, 151, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 152, -1, -1, -1, -1,
- -1, -1, 153, -1, -1, -1, -1, -1, -1, -1,
+ 94, 95, -1, -1, -1, -1, -1, -1, -1, -1,
+ 96, -1, -1, 97, -1, -1, 98, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 99, -1, 100, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 101, -1, -1, -1, -1,
+ 102, -1, 103, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 104, -1, -1, 105, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 106, 107, 108, -1, -1,
+ -1, -1, 109, -1, -1, -1, -1, 110, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 111, -1, -1,
+ -1, 112, -1, -1, -1, -1, 113, 114, -1, -1,
+ 115, 116, -1, -1, -1, 117, -1, -1, -1, -1,
+ -1, 118, -1, -1, -1, -1, -1, -1, -1, -1,
+ 119, -1, -1, -1, -1, -1, 120, 121, -1, -1,
+ -1, 122, -1, -1, -1, -1, -1, -1, -1, 123,
+ 124, 125, 126, -1, -1, 127, -1, -1, 128, -1,
+ -1, 129, -1, 130, -1, 131, -1, 132, -1, -1,
+ -1, 133, 134, 135, -1, -1, 136, -1, -1, -1,
+ -1, -1, 137, 138, -1, 139, -1, 140, -1, -1,
+ 141, 142, -1, -1, -1, -1, -1, -1, -1, -1,
+ 143, -1, -1, 144, 145, -1, -1, -1, 146, -1,
+ -1, -1, -1, -1, -1, -1, 147, 148, -1, -1,
+ -1, 149, -1, -1, -1, 150, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 151, -1, -1, -1, -1,
+ -1, -1, 152, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 153, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 154, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 155, -1, -1, -1, 156,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 157, -1, -1, -1, -1, 158, -1, -1, -1,
- -1, 159, -1, -1, -1, 160, -1, -1, 161, -1,
- 162, 163, -1, -1, -1, 164, -1, -1, -1, -1,
- 165, -1, -1, 166, -1, 167, -1, 168, 169, -1,
- -1, -1, -1, -1, -1, -1, -1, 170, -1, -1,
- 171, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 172, 173, -1, -1, -1, -1, -1, -1, -1,
- 174, 175, -1, -1, -1, 176, -1, -1, -1, 177,
- 178, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 179, -1, -1, -1, -1, -1, 180, 181, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 182, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 183, -1, -1, -1, 184, -1, -1, -1, -1,
- 185, -1, -1, -1, -1, -1, -1, 186, -1, -1,
- -1, -1, -1, 187, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 188, -1, 189, -1, 190, -1, -1,
- 191, 192, -1, -1, -1, -1, -1, -1, 193, -1,
- 194, 195, -1, -1, -1, 196, 197, -1, 198, 199,
- 200, 201, -1, -1, -1, 202, 203, -1, -1, -1,
- 204, -1, -1, -1, -1, -1, -1, -1, 205, 206,
- -1, -1, -1, -1, -1, -1, 207, 208, -1, -1,
- -1, 209, 210, -1, -1, 211, -1, -1, 212, -1,
- 213, 214, 215, -1, -1, 216, -1, -1, -1, -1,
- -1, -1, -1, 217, -1, 218, -1, -1, -1, -1,
- 219, -1, -1, -1, 220, 221, -1, 222, -1, -1,
- -1, -1, 223, -1, -1, 224, 225, -1, -1, 226,
- 227, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 228, 229, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 230, -1, -1, -1, -1, -1, 231, 232, -1,
- -1, -1, -1, 233, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 234, 235, -1, -1, 236, -1, -1, -1, -1,
- 237, -1, -1, 238, -1, -1, 239, 240, -1, -1,
- -1, 241, -1, -1, -1, -1, 242, -1, -1, 243,
- 244, -1, -1, -1, -1, -1, -1, 245, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 246, 247, -1, -1, -1, 248, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 249, -1, -1,
- -1, 250, -1, 251, -1, 252, -1, 253, 254, -1,
- -1, 255, 256, -1, -1, -1, -1, -1, -1, -1,
- 257, -1, -1, -1, -1, 258, -1, 259, 260, -1,
- -1, 261, -1, -1, -1, 262, -1, -1, -1, -1,
- 263, -1, -1, -1, -1, 264, 265, 266, -1, -1,
- 267, -1, 268, -1, -1, 269, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 270, -1, 271, -1, 272,
- -1, -1, -1, -1, -1, 273, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 274, 275,
- 276, 277, -1, -1, -1, 278, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 279, -1, -1, -1, -1,
- -1, 280, -1, -1, -1, -1, 281, 282, 283, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 284, -1,
- 285, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 286, -1, 287, -1, -1, -1, 288, -1, -1, -1,
- 289, -1, -1, -1, -1, 290, 291, 292, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 293, -1, 294, -1, 295, -1, -1, -1, -1,
- 296, 297, -1, -1, -1, 298, -1, -1, -1, -1,
- -1, -1, -1, 299, -1, -1, -1, 300, -1, -1,
- -1, -1, 301, -1, 302, -1, 303, 304, 305, -1,
- -1, -1, -1, -1, -1, 306, 307, -1, -1, -1,
- 308, -1, -1, -1, -1, 309, -1, 310, -1, -1,
- -1, -1, -1, -1, 311, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 312,
- -1, -1, 313, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 314, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 315,
- -1, 316, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 317, -1, -1, 318, -1, -1, -1,
- -1, -1, -1, -1, 319, -1, -1, 320, -1, -1,
- -1, 321, -1, 322, -1, -1, -1, 323, -1, -1,
- -1, -1, -1, -1, -1, -1, 324, 325, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 155, -1, -1, -1, -1, 156, -1, -1, -1,
+ -1, 157, -1, -1, -1, 158, -1, -1, 159, -1,
+ 160, 161, -1, -1, -1, 162, -1, -1, -1, -1,
+ 163, -1, -1, 164, -1, 165, -1, 166, 167, -1,
+ -1, -1, -1, -1, -1, -1, -1, 168, -1, -1,
+ 169, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 170, 171, -1, -1, -1, -1, -1, -1, -1,
+ 172, 173, -1, -1, -1, 174, -1, -1, -1, 175,
+ 176, -1, -1, -1, -1, -1, 177, -1, -1, -1,
+ 178, -1, -1, -1, -1, -1, 179, 180, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 181, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 182, -1, -1, -1, 183, -1, -1, -1, -1,
+ 184, -1, -1, -1, -1, -1, -1, 185, -1, -1,
+ -1, -1, -1, 186, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 187, -1, 188, -1, 189, -1, -1,
+ 190, 191, -1, -1, -1, -1, -1, -1, 192, -1,
+ 193, 194, -1, -1, -1, 195, 196, -1, 197, 198,
+ 199, 200, -1, -1, -1, 201, 202, -1, -1, -1,
+ 203, -1, -1, -1, -1, -1, -1, -1, 204, 205,
+ -1, -1, -1, -1, -1, -1, 206, 207, -1, -1,
+ -1, 208, 209, -1, -1, 210, -1, -1, 211, -1,
+ 212, 213, 214, -1, -1, 215, -1, -1, -1, -1,
+ -1, -1, -1, 216, -1, 217, -1, -1, -1, -1,
+ 218, -1, -1, -1, 219, 220, -1, 221, -1, -1,
+ -1, -1, 222, -1, -1, 223, 224, -1, -1, 225,
+ 226, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 227, 228, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 229, -1, -1, -1, -1, -1, 230, 231, -1,
+ -1, -1, -1, 232, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 233, 234, -1, -1, 235, -1, -1, -1, -1,
+ 236, -1, -1, 237, -1, -1, 238, 239, -1, -1,
+ -1, 240, -1, -1, -1, -1, 241, -1, -1, 242,
+ 243, -1, -1, -1, -1, -1, -1, 244, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 245, 246, -1, -1, -1, 247, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 248, -1, -1,
+ -1, 249, -1, 250, -1, 251, -1, 252, 253, -1,
+ -1, 254, 255, -1, -1, -1, -1, -1, -1, -1,
+ 256, -1, -1, -1, -1, 257, -1, 258, 259, -1,
+ -1, 260, -1, -1, -1, 261, -1, -1, -1, -1,
+ 262, -1, -1, -1, -1, 263, 264, 265, -1, -1,
+ 266, -1, 267, -1, -1, 268, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 269, -1, 270, -1, 271,
+ -1, -1, -1, -1, -1, 272, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 273, 274,
+ 275, 276, -1, -1, -1, 277, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 278, -1, -1, -1, -1,
+ -1, 279, -1, -1, -1, -1, 280, 281, 282, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 283, -1,
+ 284, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 285, -1, 286, -1, -1, -1, 287, -1, -1, -1,
+ 288, -1, -1, -1, -1, 289, 290, 291, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 292, -1, 293, -1, 294, -1, -1, -1, -1,
+ 295, 296, -1, -1, -1, 297, -1, -1, -1, -1,
+ -1, -1, -1, 298, -1, -1, -1, 299, -1, -1,
+ -1, -1, 300, -1, 301, -1, 302, 303, 304, -1,
+ -1, -1, -1, -1, -1, 305, 306, -1, -1, -1,
+ 307, -1, -1, -1, -1, 308, -1, 309, -1, -1,
+ -1, -1, -1, -1, 310, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 311,
+ -1, -1, 312, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 313, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 314,
+ -1, 315, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 316, -1, -1, 317, -1, -1, -1,
+ -1, -1, -1, -1, 318, -1, -1, 319, -1, -1,
+ -1, 320, -1, 321, -1, -1, -1, 322, -1, -1,
+ -1, -1, -1, -1, -1, 323, 324, 325, -1, -1,
326, -1, -1, -1, -1, 327, -1, -1, -1, -1,
-1, 328, -1, -1, -1, -1, 329, -1, -1, -1,
-1, 330, -1, -1, -1, 331, -1, -1, -1, -1,
@@ -1639,136 +1641,135 @@ findValue (register const char *str, register unsigned int len)
-1, 417, -1, -1, -1, -1, 418, -1, 419, -1,
420, -1, -1, -1, -1, -1, 421, -1, -1, -1,
-1, 422, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 423, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 424, 425, -1, -1, -1,
- -1, -1, -1, -1, -1, 426, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 427, -1, 428, -1, -1, -1, -1, 429, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 430,
- 431, 432, -1, -1, -1, -1, -1, -1, -1, 433,
- 434, -1, 435, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 436, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 437, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 438, -1, 439, -1, -1, 440, 441, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 442, -1, -1,
- -1, -1, -1, 443, -1, -1, -1, -1, -1, -1,
- -1, -1, 444, -1, -1, -1, -1, -1, -1, -1,
- -1, 445, -1, -1, -1, 446, -1, 447, -1, -1,
- -1, -1, -1, -1, -1, 448, -1, 449, -1, -1,
- 450, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 451, -1, -1, -1, -1, -1, -1, 452,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 453, -1, -1, -1, 454, -1, 455, -1, -1,
- 456, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 457, -1, -1, -1, -1, -1, -1, -1, 458,
- -1, -1, 459, -1, -1, -1, 460, -1, -1, -1,
- -1, 461, -1, -1, 462, 463, -1, -1, -1, -1,
- -1, 464, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 465, -1, -1, -1, -1, 466, -1, -1,
- -1, -1, -1, 467, -1, -1, -1, -1, -1, -1,
- 468, -1, -1, -1, -1, 469, -1, -1, -1, -1,
- -1, -1, -1, -1, 470, 471, -1, -1, 472, 473,
- -1, -1, -1, 474, -1, -1, -1, 475, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 476, -1, -1,
- -1, -1, 477, -1, -1, -1, -1, 478, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 479, -1, 480, -1, -1,
- -1, -1, -1, -1, -1, -1, 481, 482, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 483, -1, 484, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 485, -1, -1, 486, -1, 487, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 488, 489, -1, -1, -1, -1,
- -1, -1, 490, -1, -1, -1, -1, -1, -1, -1,
- -1, 491, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 423, 424, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 425, 426, -1, -1, -1,
+ -1, -1, -1, -1, -1, 427, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 428, -1, 429, -1, -1, -1, -1, 430, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 431,
+ 432, 433, -1, -1, -1, -1, -1, -1, -1, 434,
+ 435, -1, 436, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 437, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 438, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 439, -1, 440, -1, -1, 441, 442, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 443, -1, -1,
+ -1, -1, -1, 444, -1, -1, -1, -1, -1, -1,
+ -1, -1, 445, -1, -1, -1, -1, -1, -1, -1,
+ -1, 446, -1, -1, -1, 447, -1, 448, -1, -1,
+ -1, -1, -1, -1, -1, 449, -1, 450, -1, -1,
+ 451, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 452, -1, -1, -1, -1, -1, -1, 453,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 454, -1, -1, -1, 455, -1, 456, -1, -1,
+ 457, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 458, -1, -1, -1, -1, -1, -1, -1, 459,
+ -1, -1, 460, -1, -1, -1, 461, -1, -1, -1,
+ -1, 462, -1, -1, 463, 464, -1, -1, -1, -1,
+ -1, 465, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 466, -1, -1, -1, -1, 467, -1, -1,
+ -1, -1, -1, 468, -1, -1, -1, -1, -1, -1,
+ 469, -1, -1, -1, -1, 470, -1, -1, -1, -1,
+ -1, -1, -1, -1, 471, 472, -1, -1, 473, 474,
+ -1, -1, -1, 475, -1, -1, -1, 476, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 477, -1, -1,
+ -1, -1, 478, -1, -1, -1, -1, 479, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 480, -1, 481, -1, -1,
+ -1, -1, -1, -1, -1, -1, 482, 483, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 484, -1, 485, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 486, -1, -1, 487, -1, 488, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 489, 490, -1, -1, -1, -1,
+ -1, -1, 491, -1, -1, -1, -1, -1, -1, -1,
-1, 492, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 493, -1, -1,
+ -1, 493, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 494, -1, -1,
- -1, -1, -1, -1, -1, 495, -1, -1, -1, -1,
- -1, 496, 497, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 498, -1,
- 499, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 500, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 495, -1, -1,
+ -1, -1, -1, -1, -1, 496, -1, -1, -1, -1,
+ -1, 497, 498, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 499, -1,
+ 500, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 501, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 501, -1, -1, -1, -1, -1, -1,
- -1, -1, 502, -1, -1, 503, -1, -1, -1, -1,
- -1, -1, -1, 504, -1, -1, -1, -1, -1, -1,
- 505, 506, -1, -1, -1, -1, 507, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 508, 509, -1, -1, -1,
- -1, -1, -1, 510, -1, -1, -1, -1, 511, -1,
- -1, 512, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 502, -1, -1, -1, -1, -1, -1,
+ -1, -1, 503, -1, -1, 504, -1, -1, -1, -1,
+ -1, -1, -1, 505, -1, -1, -1, -1, -1, -1,
+ 506, 507, -1, -1, -1, -1, 508, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 513, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 514,
- -1, -1, -1, 515, -1, -1, -1, -1, 516, -1,
- 517, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 509, 510, -1, -1, -1,
+ -1, -1, -1, 511, -1, -1, -1, -1, 512, -1,
+ -1, 513, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 518, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 519, -1, -1,
+ -1, -1, 514, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 515,
+ -1, -1, -1, 516, -1, -1, -1, -1, 517, -1,
+ 518, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 520, -1, -1, -1, -1, -1, -1, -1, 521, -1,
- 522, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 523, -1, -1,
+ -1, 519, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 520, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 524,
+ 521, -1, -1, -1, -1, -1, -1, -1, 522, -1,
+ 523, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 524, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 525,
- -1, -1, -1, -1, -1, -1, 526, -1, -1, -1,
- -1, 527, -1, -1, -1, -1, 528, -1, -1, -1,
- -1, -1, 529, -1, -1, -1, -1, -1, -1, -1,
- -1, 530, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 526,
+ -1, -1, -1, -1, -1, -1, 527, -1, -1, -1,
+ -1, 528, -1, -1, -1, -1, 529, -1, -1, -1,
+ -1, -1, 530, -1, -1, -1, -1, -1, -1, -1,
-1, 531, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 532,
- -1, -1, 533, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 532, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 533,
+ -1, -1, 534, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 534, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 535, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 536, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 535, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 536, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 537, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 537, -1, -1, -1, 538, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 539, -1, -1,
- -1, 540, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 541, -1, -1, -1, -1, 542, -1, -1, -1, -1,
+ -1, -1, -1, 538, -1, -1, -1, 539, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 540, -1, -1,
+ -1, 541, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 543, -1, 544, -1, -1, -1, -1,
- 545, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 542, -1, -1, -1, -1, 543, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 546, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 547, -1,
+ -1, -1, -1, 544, -1, 545, -1, -1, -1, -1,
+ 546, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 547, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 548, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 548, -1, -1, 549, -1, -1, -1, -1,
- 550, -1, 551, -1, -1, -1, -1, 552, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 553, -1, -1, -1,
- -1, -1, 554, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 549, -1, -1, 550, -1, -1, -1, -1,
+ 551, -1, 552, -1, -1, -1, -1, 553, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 555, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 554, -1, -1, -1,
+ -1, -1, 555, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 556, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 556, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 557,
- -1, -1, 558, 559, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 557, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 558,
+ -1, -1, 559, 560, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 560, -1, -1, -1,
- -1, -1, -1, 561, -1, 562, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 561, -1, -1, -1,
+ -1, -1, -1, 562, -1, 563, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1787,38 +1788,38 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 563, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 564, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 564, -1, -1, 565, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 565, -1, -1, 566, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 566, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 567, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 567, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 568, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 568, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 569, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 569, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 570, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 570, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 571, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 571, -1, -1, -1,
- -1, -1, 572, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 572, -1, -1, -1,
+ -1, -1, 573, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1826,12 +1827,12 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 573, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 574, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 574, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 575, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 575, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 576, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1847,58 +1848,59 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 576, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 577, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 577, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 578, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 578, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 579,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 579, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 580,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 580, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 581, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 582, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 583, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 581, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 582, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 583, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 584, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 584, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 585, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 585, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 586, -1, -1, -1, -1, -1,
- -1, -1, 587, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 586, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 587, -1, -1, -1, -1, -1,
+ -1, -1, 588, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 588,
- -1, -1, 589, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 589,
+ -1, -1, 590, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 590, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 591, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 592, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 593, -1, -1, -1, -1, -1, -1, -1,
+ -1, 593, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 594, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1907,37 +1909,37 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 594, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 595, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 595, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 596, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 596, -1, 597, -1, -1, -1, -1, 598,
- -1, -1, -1, -1, -1, -1, -1, 599, -1, -1,
+ -1, -1, 597, -1, 598, -1, -1, -1, -1, 599,
+ -1, -1, -1, -1, -1, -1, -1, 600, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 600, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 601, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 601, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 602, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 602, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 603, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 603, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 604, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 604, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 605, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1959,14 +1961,14 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 605, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 606, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 606, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 607, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -1980,7 +1982,7 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 607, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 608, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -2023,7 +2025,7 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 608, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 609, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -2060,7 +2062,7 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 609, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 610, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -2074,7 +2076,7 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 610, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 611, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -2133,7 +2135,7 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 611, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 612, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -2157,7 +2159,7 @@ findValue (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 612
+ -1, -1, -1, -1, -1, -1, -1, -1, 613
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -2179,7 +2181,7 @@ findValue (register const char *str, register unsigned int len)
}
return 0;
}
-#line 624 "CSSValueKeywords.gperf"
+#line 625 "CSSValueKeywords.gperf"
static const char * const valueList[] = {
"",
@@ -2635,10 +2637,11 @@ static const char * const valueList[] = {
"optimizelegibility",
"geometricprecision",
"srgb",
-"mini",
"floating",
-"application",
"fullscreen",
+"maximized",
+"minimized",
+"windowed",
"aliceblue",
"antiquewhite",
"aquamarine",
diff --git a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.h b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.h
index d79e658..71e8514 100644
--- a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.h
+++ b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.h
@@ -456,168 +456,169 @@ const int CSSValueOptimizespeed = 449;
const int CSSValueOptimizelegibility = 450;
const int CSSValueGeometricprecision = 451;
const int CSSValueSrgb = 452;
-const int CSSValueMini = 453;
-const int CSSValueFloating = 454;
-const int CSSValueApplication = 455;
-const int CSSValueFullscreen = 456;
-const int CSSValueAliceblue = 457;
-const int CSSValueAntiquewhite = 458;
-const int CSSValueAquamarine = 459;
-const int CSSValueAzure = 460;
-const int CSSValueBeige = 461;
-const int CSSValueBisque = 462;
-const int CSSValueBlanchedalmond = 463;
-const int CSSValueBlueviolet = 464;
-const int CSSValueBrown = 465;
-const int CSSValueBurlywood = 466;
-const int CSSValueCadetblue = 467;
-const int CSSValueChartreuse = 468;
-const int CSSValueChocolate = 469;
-const int CSSValueCoral = 470;
-const int CSSValueCornflowerblue = 471;
-const int CSSValueCornsilk = 472;
-const int CSSValueCrimson = 473;
-const int CSSValueCyan = 474;
-const int CSSValueDarkblue = 475;
-const int CSSValueDarkcyan = 476;
-const int CSSValueDarkgoldenrod = 477;
-const int CSSValueDarkgray = 478;
-const int CSSValueDarkgreen = 479;
-const int CSSValueDarkgrey = 480;
-const int CSSValueDarkkhaki = 481;
-const int CSSValueDarkmagenta = 482;
-const int CSSValueDarkolivegreen = 483;
-const int CSSValueDarkorange = 484;
-const int CSSValueDarkorchid = 485;
-const int CSSValueDarkred = 486;
-const int CSSValueDarksalmon = 487;
-const int CSSValueDarkseagreen = 488;
-const int CSSValueDarkslateblue = 489;
-const int CSSValueDarkslategray = 490;
-const int CSSValueDarkslategrey = 491;
-const int CSSValueDarkturquoise = 492;
-const int CSSValueDarkviolet = 493;
-const int CSSValueDeeppink = 494;
-const int CSSValueDeepskyblue = 495;
-const int CSSValueDimgray = 496;
-const int CSSValueDimgrey = 497;
-const int CSSValueDodgerblue = 498;
-const int CSSValueFirebrick = 499;
-const int CSSValueFloralwhite = 500;
-const int CSSValueForestgreen = 501;
-const int CSSValueGainsboro = 502;
-const int CSSValueGhostwhite = 503;
-const int CSSValueGold = 504;
-const int CSSValueGoldenrod = 505;
-const int CSSValueGreenyellow = 506;
-const int CSSValueHoneydew = 507;
-const int CSSValueHotpink = 508;
-const int CSSValueIndianred = 509;
-const int CSSValueIndigo = 510;
-const int CSSValueIvory = 511;
-const int CSSValueKhaki = 512;
-const int CSSValueLavender = 513;
-const int CSSValueLavenderblush = 514;
-const int CSSValueLawngreen = 515;
-const int CSSValueLemonchiffon = 516;
-const int CSSValueLightblue = 517;
-const int CSSValueLightcoral = 518;
-const int CSSValueLightcyan = 519;
-const int CSSValueLightgoldenrodyellow = 520;
-const int CSSValueLightgray = 521;
-const int CSSValueLightgreen = 522;
-const int CSSValueLightgrey = 523;
-const int CSSValueLightpink = 524;
-const int CSSValueLightsalmon = 525;
-const int CSSValueLightseagreen = 526;
-const int CSSValueLightskyblue = 527;
-const int CSSValueLightslategray = 528;
-const int CSSValueLightslategrey = 529;
-const int CSSValueLightsteelblue = 530;
-const int CSSValueLightyellow = 531;
-const int CSSValueLimegreen = 532;
-const int CSSValueLinen = 533;
-const int CSSValueMagenta = 534;
-const int CSSValueMediumaquamarine = 535;
-const int CSSValueMediumblue = 536;
-const int CSSValueMediumorchid = 537;
-const int CSSValueMediumpurple = 538;
-const int CSSValueMediumseagreen = 539;
-const int CSSValueMediumslateblue = 540;
-const int CSSValueMediumspringgreen = 541;
-const int CSSValueMediumturquoise = 542;
-const int CSSValueMediumvioletred = 543;
-const int CSSValueMidnightblue = 544;
-const int CSSValueMintcream = 545;
-const int CSSValueMistyrose = 546;
-const int CSSValueMoccasin = 547;
-const int CSSValueNavajowhite = 548;
-const int CSSValueOldlace = 549;
-const int CSSValueOlivedrab = 550;
-const int CSSValueOrangered = 551;
-const int CSSValueOrchid = 552;
-const int CSSValuePalegoldenrod = 553;
-const int CSSValuePalegreen = 554;
-const int CSSValuePaleturquoise = 555;
-const int CSSValuePalevioletred = 556;
-const int CSSValuePapayawhip = 557;
-const int CSSValuePeachpuff = 558;
-const int CSSValuePeru = 559;
-const int CSSValuePink = 560;
-const int CSSValuePlum = 561;
-const int CSSValuePowderblue = 562;
-const int CSSValueRosybrown = 563;
-const int CSSValueRoyalblue = 564;
-const int CSSValueSaddlebrown = 565;
-const int CSSValueSalmon = 566;
-const int CSSValueSandybrown = 567;
-const int CSSValueSeagreen = 568;
-const int CSSValueSeashell = 569;
-const int CSSValueSienna = 570;
-const int CSSValueSkyblue = 571;
-const int CSSValueSlateblue = 572;
-const int CSSValueSlategray = 573;
-const int CSSValueSlategrey = 574;
-const int CSSValueSnow = 575;
-const int CSSValueSpringgreen = 576;
-const int CSSValueSteelblue = 577;
-const int CSSValueTan = 578;
-const int CSSValueThistle = 579;
-const int CSSValueTomato = 580;
-const int CSSValueTurquoise = 581;
-const int CSSValueViolet = 582;
-const int CSSValueWheat = 583;
-const int CSSValueWhitesmoke = 584;
-const int CSSValueYellowgreen = 585;
-const int CSSValueNonzero = 586;
-const int CSSValueEvenodd = 587;
-const int CSSValueAccumulate = 588;
-const int CSSValueNew = 589;
-const int CSSValueLinearrgb = 590;
-const int CSSValueOptimizequality = 591;
-const int CSSValueCrispedges = 592;
-const int CSSValueButt = 593;
-const int CSSValueMiter = 594;
-const int CSSValueBevel = 595;
-const int CSSValueBeforeEdge = 596;
-const int CSSValueAfterEdge = 597;
-const int CSSValueCentral = 598;
-const int CSSValueTextBeforeEdge = 599;
-const int CSSValueTextAfterEdge = 600;
-const int CSSValueIdeographic = 601;
-const int CSSValueAlphabetic = 602;
-const int CSSValueHanging = 603;
-const int CSSValueMathematical = 604;
-const int CSSValueUseScript = 605;
-const int CSSValueNoChange = 606;
-const int CSSValueResetSize = 607;
-const int CSSValueLrTb = 608;
-const int CSSValueRlTb = 609;
-const int CSSValueTbRl = 610;
-const int CSSValueLr = 611;
-const int CSSValueRl = 612;
-const int CSSValueTb = 613;
-const int numCSSValueKeywords = 614;
+const int CSSValueFloating = 453;
+const int CSSValueFullscreen = 454;
+const int CSSValueMaximized = 455;
+const int CSSValueMinimized = 456;
+const int CSSValueWindowed = 457;
+const int CSSValueAliceblue = 458;
+const int CSSValueAntiquewhite = 459;
+const int CSSValueAquamarine = 460;
+const int CSSValueAzure = 461;
+const int CSSValueBeige = 462;
+const int CSSValueBisque = 463;
+const int CSSValueBlanchedalmond = 464;
+const int CSSValueBlueviolet = 465;
+const int CSSValueBrown = 466;
+const int CSSValueBurlywood = 467;
+const int CSSValueCadetblue = 468;
+const int CSSValueChartreuse = 469;
+const int CSSValueChocolate = 470;
+const int CSSValueCoral = 471;
+const int CSSValueCornflowerblue = 472;
+const int CSSValueCornsilk = 473;
+const int CSSValueCrimson = 474;
+const int CSSValueCyan = 475;
+const int CSSValueDarkblue = 476;
+const int CSSValueDarkcyan = 477;
+const int CSSValueDarkgoldenrod = 478;
+const int CSSValueDarkgray = 479;
+const int CSSValueDarkgreen = 480;
+const int CSSValueDarkgrey = 481;
+const int CSSValueDarkkhaki = 482;
+const int CSSValueDarkmagenta = 483;
+const int CSSValueDarkolivegreen = 484;
+const int CSSValueDarkorange = 485;
+const int CSSValueDarkorchid = 486;
+const int CSSValueDarkred = 487;
+const int CSSValueDarksalmon = 488;
+const int CSSValueDarkseagreen = 489;
+const int CSSValueDarkslateblue = 490;
+const int CSSValueDarkslategray = 491;
+const int CSSValueDarkslategrey = 492;
+const int CSSValueDarkturquoise = 493;
+const int CSSValueDarkviolet = 494;
+const int CSSValueDeeppink = 495;
+const int CSSValueDeepskyblue = 496;
+const int CSSValueDimgray = 497;
+const int CSSValueDimgrey = 498;
+const int CSSValueDodgerblue = 499;
+const int CSSValueFirebrick = 500;
+const int CSSValueFloralwhite = 501;
+const int CSSValueForestgreen = 502;
+const int CSSValueGainsboro = 503;
+const int CSSValueGhostwhite = 504;
+const int CSSValueGold = 505;
+const int CSSValueGoldenrod = 506;
+const int CSSValueGreenyellow = 507;
+const int CSSValueHoneydew = 508;
+const int CSSValueHotpink = 509;
+const int CSSValueIndianred = 510;
+const int CSSValueIndigo = 511;
+const int CSSValueIvory = 512;
+const int CSSValueKhaki = 513;
+const int CSSValueLavender = 514;
+const int CSSValueLavenderblush = 515;
+const int CSSValueLawngreen = 516;
+const int CSSValueLemonchiffon = 517;
+const int CSSValueLightblue = 518;
+const int CSSValueLightcoral = 519;
+const int CSSValueLightcyan = 520;
+const int CSSValueLightgoldenrodyellow = 521;
+const int CSSValueLightgray = 522;
+const int CSSValueLightgreen = 523;
+const int CSSValueLightgrey = 524;
+const int CSSValueLightpink = 525;
+const int CSSValueLightsalmon = 526;
+const int CSSValueLightseagreen = 527;
+const int CSSValueLightskyblue = 528;
+const int CSSValueLightslategray = 529;
+const int CSSValueLightslategrey = 530;
+const int CSSValueLightsteelblue = 531;
+const int CSSValueLightyellow = 532;
+const int CSSValueLimegreen = 533;
+const int CSSValueLinen = 534;
+const int CSSValueMagenta = 535;
+const int CSSValueMediumaquamarine = 536;
+const int CSSValueMediumblue = 537;
+const int CSSValueMediumorchid = 538;
+const int CSSValueMediumpurple = 539;
+const int CSSValueMediumseagreen = 540;
+const int CSSValueMediumslateblue = 541;
+const int CSSValueMediumspringgreen = 542;
+const int CSSValueMediumturquoise = 543;
+const int CSSValueMediumvioletred = 544;
+const int CSSValueMidnightblue = 545;
+const int CSSValueMintcream = 546;
+const int CSSValueMistyrose = 547;
+const int CSSValueMoccasin = 548;
+const int CSSValueNavajowhite = 549;
+const int CSSValueOldlace = 550;
+const int CSSValueOlivedrab = 551;
+const int CSSValueOrangered = 552;
+const int CSSValueOrchid = 553;
+const int CSSValuePalegoldenrod = 554;
+const int CSSValuePalegreen = 555;
+const int CSSValuePaleturquoise = 556;
+const int CSSValuePalevioletred = 557;
+const int CSSValuePapayawhip = 558;
+const int CSSValuePeachpuff = 559;
+const int CSSValuePeru = 560;
+const int CSSValuePink = 561;
+const int CSSValuePlum = 562;
+const int CSSValuePowderblue = 563;
+const int CSSValueRosybrown = 564;
+const int CSSValueRoyalblue = 565;
+const int CSSValueSaddlebrown = 566;
+const int CSSValueSalmon = 567;
+const int CSSValueSandybrown = 568;
+const int CSSValueSeagreen = 569;
+const int CSSValueSeashell = 570;
+const int CSSValueSienna = 571;
+const int CSSValueSkyblue = 572;
+const int CSSValueSlateblue = 573;
+const int CSSValueSlategray = 574;
+const int CSSValueSlategrey = 575;
+const int CSSValueSnow = 576;
+const int CSSValueSpringgreen = 577;
+const int CSSValueSteelblue = 578;
+const int CSSValueTan = 579;
+const int CSSValueThistle = 580;
+const int CSSValueTomato = 581;
+const int CSSValueTurquoise = 582;
+const int CSSValueViolet = 583;
+const int CSSValueWheat = 584;
+const int CSSValueWhitesmoke = 585;
+const int CSSValueYellowgreen = 586;
+const int CSSValueNonzero = 587;
+const int CSSValueEvenodd = 588;
+const int CSSValueAccumulate = 589;
+const int CSSValueNew = 590;
+const int CSSValueLinearrgb = 591;
+const int CSSValueOptimizequality = 592;
+const int CSSValueCrispedges = 593;
+const int CSSValueButt = 594;
+const int CSSValueMiter = 595;
+const int CSSValueBevel = 596;
+const int CSSValueBeforeEdge = 597;
+const int CSSValueAfterEdge = 598;
+const int CSSValueCentral = 599;
+const int CSSValueTextBeforeEdge = 600;
+const int CSSValueTextAfterEdge = 601;
+const int CSSValueIdeographic = 602;
+const int CSSValueAlphabetic = 603;
+const int CSSValueHanging = 604;
+const int CSSValueMathematical = 605;
+const int CSSValueUseScript = 606;
+const int CSSValueNoChange = 607;
+const int CSSValueResetSize = 608;
+const int CSSValueLrTb = 609;
+const int CSSValueRlTb = 610;
+const int CSSValueTbRl = 611;
+const int CSSValueLr = 612;
+const int CSSValueRl = 613;
+const int CSSValueTb = 614;
+const int numCSSValueKeywords = 615;
const size_t maxCSSValueKeywordLength = 35;
const char* getValueName(unsigned short id);
diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
index 04238bc..11dfd2e 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
+++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp
@@ -152,7 +152,6 @@
#include "JSHTMLVideoElement.h"
#include "JSImageData.h"
#include "JSKeyboardEvent.h"
-#include "JSMedia.h"
#include "JSMediaError.h"
#include "JSMediaList.h"
#include "JSMessageChannel.h"
@@ -299,6 +298,7 @@
#include "JSSharedWorker.h"
#include "JSStorage.h"
#include "JSStorageEvent.h"
+#include "JSStyleMedia.h"
#include "JSStyleSheet.h"
#include "JSStyleSheetList.h"
#include "JSText.h"
@@ -334,11 +334,11 @@
#include "JSXPathResult.h"
#include "JSXSLTProcessor.h"
#include "KURL.h"
-#include "Media.h"
#include "Navigator.h"
#include "RegisteredEventListener.h"
#include "Screen.h"
#include "Storage.h"
+#include "StyleMedia.h"
#include "WebKitPoint.h"
#include <runtime/Error.h>
#include <runtime/JSNumberCell.h>
@@ -395,7 +395,7 @@ static const HashTableValue JSDOMWindowTableValues[409] =
{ "parent", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowParent), (intptr_t)setJSDOMWindowParent },
{ "top", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowTop), (intptr_t)setJSDOMWindowTop },
{ "document", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowDocument), (intptr_t)0 },
- { "media", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowMedia), (intptr_t)0 },
+ { "styleMedia", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowStyleMedia), (intptr_t)0 },
{ "devicePixelRatio", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowDevicePixelRatio), (intptr_t)setJSDOMWindowDevicePixelRatio },
{ "applicationCache", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowApplicationCache), (intptr_t)0 },
{ "sessionStorage", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindowSessionStorage), (intptr_t)0 },
@@ -1304,14 +1304,14 @@ JSValue jsDOMWindowDocument(ExecState* exec, JSValue slotBase, const Identifier&
return result;
}
-JSValue jsDOMWindowMedia(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsDOMWindowStyleMedia(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDOMWindow* castedThis = static_cast<JSDOMWindow*>(asObject(slotBase));
if (!castedThis->allowsAccessFrom(exec))
return jsUndefined();
UNUSED_PARAM(exec);
DOMWindow* imp = static_cast<DOMWindow*>(castedThis->impl());
- JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->media()));
+ JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->styleMedia()));
return result;
}
diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
index a6f3253..7e50556 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
+++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h
@@ -231,7 +231,7 @@ void setJSDOMWindowParent(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsDOMWindowTop(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSDOMWindowTop(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsDOMWindowDocument(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-JSC::JSValue jsDOMWindowMedia(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsDOMWindowStyleMedia(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsDOMWindowDevicePixelRatio(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSDOMWindowDevicePixelRatio(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsDOMWindowApplicationCache(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
diff --git a/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp b/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp
deleted file mode 100644
index 1579c2b..0000000
--- a/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- This file is part of the WebKit open source project.
- This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "JSMedia.h"
-
-#include "KURL.h"
-#include "Media.h"
-#include <runtime/Error.h>
-#include <runtime/JSString.h>
-#include <wtf/GetPtr.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-ASSERT_CLASS_FITS_IN_CELL(JSMedia);
-
-/* Hash table */
-
-static const HashTableValue JSMediaTableValues[3] =
-{
- { "type", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaType), (intptr_t)0 },
- { "constructor", DontEnum|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMediaConstructor), (intptr_t)0 },
- { 0, 0, 0, 0 }
-};
-
-static JSC_CONST_HASHTABLE HashTable JSMediaTable =
-#if ENABLE(PERFECT_HASH_SIZE)
- { 3, JSMediaTableValues, 0 };
-#else
- { 4, 3, JSMediaTableValues, 0 };
-#endif
-
-/* Hash table for constructor */
-
-static const HashTableValue JSMediaConstructorTableValues[1] =
-{
- { 0, 0, 0, 0 }
-};
-
-static JSC_CONST_HASHTABLE HashTable JSMediaConstructorTable =
-#if ENABLE(PERFECT_HASH_SIZE)
- { 0, JSMediaConstructorTableValues, 0 };
-#else
- { 1, 0, JSMediaConstructorTableValues, 0 };
-#endif
-
-class JSMediaConstructor : public DOMConstructorObject {
-public:
- JSMediaConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSMediaConstructor::createStructure(globalObject->objectPrototype()), globalObject)
- {
- putDirect(exec->propertyNames().prototype, JSMediaPrototype::self(exec, globalObject), None);
- }
- virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
- virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
- virtual const ClassInfo* classInfo() const { return &s_info; }
- static const ClassInfo s_info;
-
- static PassRefPtr<Structure> createStructure(JSValue proto)
- {
- return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
-protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
-};
-
-const ClassInfo JSMediaConstructor::s_info = { "MediaConstructor", 0, &JSMediaConstructorTable, 0 };
-
-bool JSMediaConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSMediaConstructor, DOMObject>(exec, &JSMediaConstructorTable, this, propertyName, slot);
-}
-
-bool JSMediaConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSMediaConstructor, DOMObject>(exec, &JSMediaConstructorTable, this, propertyName, descriptor);
-}
-
-/* Hash table for prototype */
-
-static const HashTableValue JSMediaPrototypeTableValues[2] =
-{
- { "matchMedium", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsMediaPrototypeFunctionMatchMedium), (intptr_t)1 },
- { 0, 0, 0, 0 }
-};
-
-static JSC_CONST_HASHTABLE HashTable JSMediaPrototypeTable =
-#if ENABLE(PERFECT_HASH_SIZE)
- { 0, JSMediaPrototypeTableValues, 0 };
-#else
- { 2, 1, JSMediaPrototypeTableValues, 0 };
-#endif
-
-const ClassInfo JSMediaPrototype::s_info = { "MediaPrototype", 0, &JSMediaPrototypeTable, 0 };
-
-JSObject* JSMediaPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
-{
- return getDOMPrototype<JSMedia>(exec, globalObject);
-}
-
-bool JSMediaPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticFunctionSlot<JSObject>(exec, &JSMediaPrototypeTable, this, propertyName, slot);
-}
-
-bool JSMediaPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticFunctionDescriptor<JSObject>(exec, &JSMediaPrototypeTable, this, propertyName, descriptor);
-}
-
-const ClassInfo JSMedia::s_info = { "Media", 0, &JSMediaTable, 0 };
-
-JSMedia::JSMedia(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<Media> impl)
- : DOMObjectWithGlobalPointer(structure, globalObject)
- , m_impl(impl)
-{
-}
-
-JSMedia::~JSMedia()
-{
- forgetDOMObject(this, impl());
-}
-
-JSObject* JSMedia::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSMediaPrototype(JSMediaPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSMedia::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSMedia, Base>(exec, &JSMediaTable, this, propertyName, slot);
-}
-
-bool JSMedia::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSMedia, Base>(exec, &JSMediaTable, this, propertyName, descriptor);
-}
-
-JSValue jsMediaType(ExecState* exec, JSValue slotBase, const Identifier&)
-{
- JSMedia* castedThis = static_cast<JSMedia*>(asObject(slotBase));
- UNUSED_PARAM(exec);
- Media* imp = static_cast<Media*>(castedThis->impl());
- JSValue result = jsString(exec, imp->type());
- return result;
-}
-
-JSValue jsMediaConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
-{
- JSMedia* domObject = static_cast<JSMedia*>(asObject(slotBase));
- return JSMedia::getConstructor(exec, domObject->globalObject());
-}
-JSValue JSMedia::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
-{
- return getDOMConstructor<JSMediaConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
-}
-
-JSValue JSC_HOST_CALL jsMediaPrototypeFunctionMatchMedium(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
-{
- UNUSED_PARAM(args);
- if (!thisValue.inherits(&JSMedia::s_info))
- return throwError(exec, TypeError);
- JSMedia* castedThisObj = static_cast<JSMedia*>(asObject(thisValue));
- Media* imp = static_cast<Media*>(castedThisObj->impl());
- const UString& mediaquery = args.at(0).toString(exec);
-
-
- JSC::JSValue result = jsBoolean(imp->matchMedium(mediaquery));
- return result;
-}
-
-JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Media* object)
-{
- return getDOMObjectWrapper<JSMedia>(exec, globalObject, object);
-}
-Media* toMedia(JSC::JSValue value)
-{
- return value.inherits(&JSMedia::s_info) ? static_cast<JSMedia*>(asObject(value))->impl() : 0;
-}
-
-}
diff --git a/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp
new file mode 100644
index 0000000..b06bf09
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.cpp
@@ -0,0 +1,201 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSStyleMedia.h"
+
+#include "KURL.h"
+#include "StyleMedia.h"
+#include <runtime/Error.h>
+#include <runtime/JSString.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSStyleMedia);
+
+/* Hash table */
+
+static const HashTableValue JSStyleMediaTableValues[3] =
+{
+ { "type", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleMediaType), (intptr_t)0 },
+ { "constructor", DontEnum|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleMediaConstructor), (intptr_t)0 },
+ { 0, 0, 0, 0 }
+};
+
+static JSC_CONST_HASHTABLE HashTable JSStyleMediaTable =
+#if ENABLE(PERFECT_HASH_SIZE)
+ { 3, JSStyleMediaTableValues, 0 };
+#else
+ { 4, 3, JSStyleMediaTableValues, 0 };
+#endif
+
+/* Hash table for constructor */
+
+static const HashTableValue JSStyleMediaConstructorTableValues[1] =
+{
+ { 0, 0, 0, 0 }
+};
+
+static JSC_CONST_HASHTABLE HashTable JSStyleMediaConstructorTable =
+#if ENABLE(PERFECT_HASH_SIZE)
+ { 0, JSStyleMediaConstructorTableValues, 0 };
+#else
+ { 1, 0, JSStyleMediaConstructorTableValues, 0 };
+#endif
+
+class JSStyleMediaConstructor : public DOMConstructorObject {
+public:
+ JSStyleMediaConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSStyleMediaConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+ {
+ putDirect(exec->propertyNames().prototype, JSStyleMediaPrototype::self(exec, globalObject), None);
+ }
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
+ virtual const ClassInfo* classInfo() const { return &s_info; }
+ static const ClassInfo s_info;
+
+ static PassRefPtr<Structure> createStructure(JSValue proto)
+ {
+ return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+
+protected:
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+};
+
+const ClassInfo JSStyleMediaConstructor::s_info = { "StyleMediaConstructor", 0, &JSStyleMediaConstructorTable, 0 };
+
+bool JSStyleMediaConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSStyleMediaConstructor, DOMObject>(exec, &JSStyleMediaConstructorTable, this, propertyName, slot);
+}
+
+bool JSStyleMediaConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSStyleMediaConstructor, DOMObject>(exec, &JSStyleMediaConstructorTable, this, propertyName, descriptor);
+}
+
+/* Hash table for prototype */
+
+static const HashTableValue JSStyleMediaPrototypeTableValues[2] =
+{
+ { "matchMedium", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsStyleMediaPrototypeFunctionMatchMedium), (intptr_t)1 },
+ { 0, 0, 0, 0 }
+};
+
+static JSC_CONST_HASHTABLE HashTable JSStyleMediaPrototypeTable =
+#if ENABLE(PERFECT_HASH_SIZE)
+ { 0, JSStyleMediaPrototypeTableValues, 0 };
+#else
+ { 2, 1, JSStyleMediaPrototypeTableValues, 0 };
+#endif
+
+const ClassInfo JSStyleMediaPrototype::s_info = { "StyleMediaPrototype", 0, &JSStyleMediaPrototypeTable, 0 };
+
+JSObject* JSStyleMediaPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSStyleMedia>(exec, globalObject);
+}
+
+bool JSStyleMediaPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticFunctionSlot<JSObject>(exec, &JSStyleMediaPrototypeTable, this, propertyName, slot);
+}
+
+bool JSStyleMediaPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSStyleMediaPrototypeTable, this, propertyName, descriptor);
+}
+
+const ClassInfo JSStyleMedia::s_info = { "StyleMedia", 0, &JSStyleMediaTable, 0 };
+
+JSStyleMedia::JSStyleMedia(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<StyleMedia> impl)
+ : DOMObjectWithGlobalPointer(structure, globalObject)
+ , m_impl(impl)
+{
+}
+
+JSStyleMedia::~JSStyleMedia()
+{
+ forgetDOMObject(this, impl());
+}
+
+JSObject* JSStyleMedia::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return new (exec) JSStyleMediaPrototype(JSStyleMediaPrototype::createStructure(globalObject->objectPrototype()));
+}
+
+bool JSStyleMedia::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSStyleMedia, Base>(exec, &JSStyleMediaTable, this, propertyName, slot);
+}
+
+bool JSStyleMedia::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSStyleMedia, Base>(exec, &JSStyleMediaTable, this, propertyName, descriptor);
+}
+
+JSValue jsStyleMediaType(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSStyleMedia* castedThis = static_cast<JSStyleMedia*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ StyleMedia* imp = static_cast<StyleMedia*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->type());
+ return result;
+}
+
+JSValue jsStyleMediaConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSStyleMedia* domObject = static_cast<JSStyleMedia*>(asObject(slotBase));
+ return JSStyleMedia::getConstructor(exec, domObject->globalObject());
+}
+JSValue JSStyleMedia::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSStyleMediaConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
+}
+
+JSValue JSC_HOST_CALL jsStyleMediaPrototypeFunctionMatchMedium(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
+{
+ UNUSED_PARAM(args);
+ if (!thisValue.inherits(&JSStyleMedia::s_info))
+ return throwError(exec, TypeError);
+ JSStyleMedia* castedThisObj = static_cast<JSStyleMedia*>(asObject(thisValue));
+ StyleMedia* imp = static_cast<StyleMedia*>(castedThisObj->impl());
+ const UString& mediaquery = args.at(0).toString(exec);
+
+
+ JSC::JSValue result = jsBoolean(imp->matchMedium(mediaquery));
+ return result;
+}
+
+JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, StyleMedia* object)
+{
+ return getDOMObjectWrapper<JSStyleMedia>(exec, globalObject, object);
+}
+StyleMedia* toStyleMedia(JSC::JSValue value)
+{
+ return value.inherits(&JSStyleMedia::s_info) ? static_cast<JSStyleMedia*>(asObject(value))->impl() : 0;
+}
+
+}
diff --git a/src/3rdparty/webkit/WebCore/generated/JSMedia.h b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h
index 28515c9..12601d5 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSMedia.h
+++ b/src/3rdparty/webkit/WebCore/generated/JSStyleMedia.h
@@ -18,8 +18,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef JSMedia_h
-#define JSMedia_h
+#ifndef JSStyleMedia_h
+#define JSStyleMedia_h
#include "JSDOMBinding.h"
#include <runtime/JSGlobalObject.h>
@@ -27,13 +27,13 @@
namespace WebCore {
-class Media;
+class StyleMedia;
-class JSMedia : public DOMObjectWithGlobalPointer {
+class JSStyleMedia : public DOMObjectWithGlobalPointer {
typedef DOMObjectWithGlobalPointer Base;
public:
- JSMedia(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<Media>);
- virtual ~JSMedia();
+ JSStyleMedia(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<StyleMedia>);
+ virtual ~JSStyleMedia();
static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
@@ -46,18 +46,18 @@ public:
}
static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
- Media* impl() const { return m_impl.get(); }
+ StyleMedia* impl() const { return m_impl.get(); }
private:
- RefPtr<Media> m_impl;
+ RefPtr<StyleMedia> m_impl;
protected:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
};
-JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Media*);
-Media* toMedia(JSC::JSValue);
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, StyleMedia*);
+StyleMedia* toStyleMedia(JSC::JSValue);
-class JSMediaPrototype : public JSC::JSObject {
+class JSStyleMediaPrototype : public JSC::JSObject {
typedef JSC::JSObject Base;
public:
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
@@ -69,18 +69,18 @@ public:
{
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
- JSMediaPrototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
+ JSStyleMediaPrototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
protected:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
};
// Functions
-JSC::JSValue JSC_HOST_CALL jsMediaPrototypeFunctionMatchMedium(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
+JSC::JSValue JSC_HOST_CALL jsStyleMediaPrototypeFunctionMatchMedium(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
// Attributes
-JSC::JSValue jsMediaType(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-JSC::JSValue jsMediaConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsStyleMediaType(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsStyleMediaConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 8add19c..823ab59 100644
--- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -209,7 +209,7 @@ float CanvasRenderingContext2D::lineWidth() const
void CanvasRenderingContext2D::setLineWidth(float width)
{
- if (!(width > 0))
+ if (!(isfinite(width) && width > 0))
return;
state().m_lineWidth = width;
GraphicsContext* c = drawingContext();
@@ -259,7 +259,7 @@ float CanvasRenderingContext2D::miterLimit() const
void CanvasRenderingContext2D::setMiterLimit(float limit)
{
- if (!(limit > 0))
+ if (!(isfinite(limit) && limit > 0))
return;
state().m_miterLimit = limit;
GraphicsContext* c = drawingContext();
@@ -275,6 +275,8 @@ float CanvasRenderingContext2D::shadowOffsetX() const
void CanvasRenderingContext2D::setShadowOffsetX(float x)
{
+ if (!isfinite(x))
+ return;
state().m_shadowOffset.setWidth(x);
applyShadow();
}
@@ -286,6 +288,8 @@ float CanvasRenderingContext2D::shadowOffsetY() const
void CanvasRenderingContext2D::setShadowOffsetY(float y)
{
+ if (!isfinite(y))
+ return;
state().m_shadowOffset.setHeight(y);
applyShadow();
}
@@ -297,6 +301,8 @@ float CanvasRenderingContext2D::shadowBlur() const
void CanvasRenderingContext2D::setShadowBlur(float blur)
{
+ if (!(isfinite(blur) && blur >= 0))
+ return;
state().m_shadowBlur = blur;
applyShadow();
}
diff --git a/src/3rdparty/webkit/WebCore/page/AbstractView.idl b/src/3rdparty/webkit/WebCore/page/AbstractView.idl
index 290bf48..e4ece0f 100644
--- a/src/3rdparty/webkit/WebCore/page/AbstractView.idl
+++ b/src/3rdparty/webkit/WebCore/page/AbstractView.idl
@@ -32,7 +32,7 @@ module views {
OmitConstructor
] AbstractView {
readonly attribute Document document;
- readonly attribute Media media;
+ readonly attribute Media styleMedia;
};
}
diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
index dd90200..8dcff5c 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
+++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
@@ -57,7 +57,7 @@
#include "InspectorController.h"
#include "InspectorTimelineAgent.h"
#include "Location.h"
-#include "Media.h"
+#include "StyleMedia.h"
#include "MessageEvent.h"
#include "Navigator.h"
#include "NotificationCenter.h"
@@ -1112,10 +1112,10 @@ Document* DOMWindow::document() const
return m_frame->document();
}
-PassRefPtr<Media> DOMWindow::media() const
+PassRefPtr<StyleMedia> DOMWindow::styleMedia() const
{
if (!m_media)
- m_media = Media::create(m_frame);
+ m_media = StyleMedia::create(m_frame);
return m_media.get();
}
diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.h b/src/3rdparty/webkit/WebCore/page/DOMWindow.h
index a70713b..cf9bc88 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMWindow.h
+++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.h
@@ -56,7 +56,7 @@ namespace WebCore {
class IndexedDatabaseRequest;
class InspectorTimelineAgent;
class Location;
- class Media;
+ class StyleMedia;
class Navigator;
class Node;
class NotificationCenter;
@@ -187,7 +187,7 @@ namespace WebCore {
// DOM Level 2 AbstractView Interface
Document* document() const;
// CSSOM View Module
- PassRefPtr<Media> media() const;
+ PassRefPtr<StyleMedia> styleMedia() const;
// DOM Level 2 Style Interface
PassRefPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const;
@@ -353,7 +353,7 @@ namespace WebCore {
Console* optionalConsole() const { return m_console.get(); }
Navigator* optionalNavigator() const { return m_navigator.get(); }
Location* optionalLocation() const { return m_location.get(); }
- Media* optionalMedia() const { return m_media.get(); }
+ StyleMedia* optionalMedia() const { return m_media.get(); }
#if ENABLE(DOM_STORAGE)
Storage* optionalSessionStorage() const { return m_sessionStorage.get(); }
Storage* optionalLocalStorage() const { return m_localStorage.get(); }
@@ -390,7 +390,7 @@ namespace WebCore {
mutable RefPtr<Console> m_console;
mutable RefPtr<Navigator> m_navigator;
mutable RefPtr<Location> m_location;
- mutable RefPtr<Media> m_media;
+ mutable RefPtr<StyleMedia> m_media;
#if ENABLE(DOM_STORAGE)
mutable RefPtr<Storage> m_sessionStorage;
mutable RefPtr<Storage> m_localStorage;
diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl
index 31e4d4f..33e49e8 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl
+++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl
@@ -141,7 +141,7 @@ module window {
readonly attribute Document document;
// CSSOM View Module
- readonly attribute Media media;
+ readonly attribute StyleMedia styleMedia;
// DOM Level 2 Style Interface
CSSStyleDeclaration getComputedStyle(in Element element,
diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
index 0a0e8c6..46dd7ae 100644
--- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
+++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
@@ -230,6 +230,9 @@ void EventHandler::clear()
m_capturingMouseEventsNode = 0;
m_latchedWheelEventNode = 0;
m_previousWheelScrolledNode = 0;
+#if ENABLE(TOUCH_EVENTS)
+ m_originatingTouchPointTargets.clear();
+#endif
}
void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result)
@@ -2714,21 +2717,21 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
unsigned touchPointTargetKey = point.id() + 1;
- EventTarget* touchTarget = 0;
+ RefPtr<EventTarget> touchTarget;
if (point.state() == PlatformTouchPoint::TouchPressed) {
m_originatingTouchPointTargets.set(touchPointTargetKey, target);
touchTarget = target;
} else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == PlatformTouchPoint::TouchCancelled) {
// The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
// we also remove it from the map.
- touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get();
+ touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
} else
- touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get();
+ touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
- if (!touchTarget)
+ if (!touchTarget.get())
continue;
- RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget, point.id(),
+ RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
point.screenPos().x(), point.screenPos().y(),
adjustedPageX, adjustedPageY);
diff --git a/src/3rdparty/webkit/WebCore/page/FocusController.cpp b/src/3rdparty/webkit/WebCore/page/FocusController.cpp
index fdd117b..6c2a956 100644
--- a/src/3rdparty/webkit/WebCore/page/FocusController.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FocusController.cpp
@@ -304,7 +304,7 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa
frame = frame->tree()->top();
FocusCandidate focusCandidate;
- findFocusableNodeInDirection(frame->document(), focusedNode, direction, event, focusCandidate);
+ findFocusableNodeInDirection(frame->document()->firstChild(), focusedNode, direction, event, focusCandidate);
Node* node = focusCandidate.node;
if (!node || !node->isElementNode()) {
@@ -391,20 +391,23 @@ static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate
}
}
-void FocusController::findFocusableNodeInDirection(Document* document, Node* focusedNode,
+void FocusController::findFocusableNodeInDirection(Node* outer, Node* focusedNode,
FocusDirection direction, KeyboardEvent* event,
FocusCandidate& closestFocusCandidate,
const FocusCandidate& candidateParent)
{
- ASSERT(document);
- ASSERT(candidateParent.isNull() || static_cast<HTMLFrameOwnerElement*>(candidateParent.node));
+ ASSERT(outer);
+ ASSERT(candidateParent.isNull()
+ || candidateParent.node->hasTagName(frameTag)
+ || candidateParent.node->hasTagName(iframeTag));
// Walk all the child nodes and update closestFocusCandidate if we find a nearer node.
- for (Node* candidate = document->firstChild(); candidate; candidate = candidate->traverseNextNode()) {
+ Node* candidate = outer;
+ while (candidate) {
// Inner documents case.
if (candidate->isFrameOwnerElement())
- deepFindFocusableNodeInDirection(focusedNode, candidate, direction, event, closestFocusCandidate);
+ deepFindFocusableNodeInDirection(candidate, focusedNode, direction, event, closestFocusCandidate);
else if (candidate != focusedNode && candidate->isKeyboardFocusable(event)) {
FocusCandidate currentFocusCandidate(candidate);
@@ -412,8 +415,10 @@ void FocusController::findFocusableNodeInDirection(Document* document, Node* foc
distanceDataForNode(direction, focusedNode, currentFocusCandidate);
// Bail out if distance is maximum.
- if (currentFocusCandidate.distance == maxDistance())
+ if (currentFocusCandidate.distance == maxDistance()) {
+ candidate = candidate->traverseNextNode(outer->parent());
continue;
+ }
// If candidateParent is not null, it means that we are in a recursive call
// from deepFineFocusableNodeInDirection (i.e. processing an element in an iframe),
@@ -425,33 +430,54 @@ void FocusController::findFocusableNodeInDirection(Document* document, Node* foc
updateFocusCandidateIfCloser(focusedNode, currentFocusCandidate, closestFocusCandidate);
}
+
+ candidate = candidate->traverseNextNode(outer->parent());
}
}
-void FocusController::deepFindFocusableNodeInDirection(Node* focusedNode, Node* candidate,
+void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* focusedNode,
FocusDirection direction, KeyboardEvent* event,
FocusCandidate& closestFocusCandidate)
{
- HTMLFrameOwnerElement* owner = static_cast<HTMLFrameOwnerElement*>(candidate);
- if (!owner->contentFrame())
+ ASSERT(container->hasTagName(frameTag) || container->hasTagName(iframeTag));
+
+ // Track if focusedNode is a descendant of the current container node being processed.
+ bool descendantOfContainer = false;
+ Node* firstChild = 0;
+
+ // Iframe or Frame.
+ if (container->hasTagName(frameTag) || container->hasTagName(iframeTag)) {
+
+ HTMLFrameOwnerElement* owner = static_cast<HTMLFrameOwnerElement*>(container);
+ if (!owner->contentFrame())
+ return;
+
+ Document* innerDocument = owner->contentFrame()->document();
+ if (!innerDocument)
+ return;
+
+ descendantOfContainer = innerDocument == focusedNode->document();
+ firstChild = innerDocument->firstChild();
+
+ }
+
+ if (descendantOfContainer) {
+ findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closestFocusCandidate);
return;
+ }
- Document* innerDocument = owner->contentFrame()->document();
- if (!innerDocument)
+ // Check if the current container element itself is a good candidate
+ // to move focus to. If it is, then we traverse its inner nodes.
+ FocusCandidate candidateParent = FocusCandidate(container);
+ distanceDataForNode(direction, focusedNode, candidateParent);
+
+ // Bail out if distance is maximum.
+ if (candidateParent.distance == maxDistance())
return;
- if (innerDocument == focusedNode->document())
- findFocusableNodeInDirection(innerDocument, focusedNode, direction, event, closestFocusCandidate);
- else {
- // Check if the current {i}frame element itself is a good candidate
- // to move focus to. If it is, then we traverse its inner nodes.
- FocusCandidate candidateParent = FocusCandidate(candidate);
- distanceDataForNode(direction, focusedNode, candidateParent);
-
- // FIXME: Consider alignment?
- if (candidateParent.distance < closestFocusCandidate.distance)
- findFocusableNodeInDirection(innerDocument, focusedNode, direction, event, closestFocusCandidate, candidateParent);
- }
+ // FIXME: Consider alignment?
+ if (candidateParent.distance < closestFocusCandidate.distance)
+ findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closestFocusCandidate, candidateParent);
}
static bool relinquishesEditingFocus(Node *node)
diff --git a/src/3rdparty/webkit/WebCore/page/FocusController.h b/src/3rdparty/webkit/WebCore/page/FocusController.h
index dfa3780..4410833 100644
--- a/src/3rdparty/webkit/WebCore/page/FocusController.h
+++ b/src/3rdparty/webkit/WebCore/page/FocusController.h
@@ -63,9 +63,10 @@ private:
bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*);
bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent*, bool initialFocus);
- void findFocusableNodeInDirection(Document*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate& closestFocusCandidate,
+ void findFocusableNodeInDirection(Node* outter, Node*, FocusDirection, KeyboardEvent*,
+ FocusCandidate& closestFocusCandidate,
const FocusCandidate& parentCandidate = FocusCandidate());
- void deepFindFocusableNodeInDirection(Node*, Node*, FocusDirection, KeyboardEvent*, FocusCandidate&);
+ void deepFindFocusableNodeInDirection(Node* container, Node* focused, FocusDirection, KeyboardEvent*, FocusCandidate&);
Page* m_page;
RefPtr<Frame> m_focusedFrame;
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h
index 7371d13..7119975 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.h
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.h
@@ -139,7 +139,7 @@ public:
virtual void scrollRectIntoViewRecursively(const IntRect&);
virtual void setScrollPosition(const IntPoint&);
- void scrollPositionChanged();
+ virtual void scrollPositionChanged();
String mediaType() const;
void setMediaType(const String&);
diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp
index 890eacd..d7eaf25 100644
--- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp
+++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp
@@ -477,9 +477,8 @@ void scrollIntoView(Element* element)
// it is preferable to inflate |element|'s bounding rect a bit before
// scrolling it for accurate reason.
// Element's scrollIntoView method does not provide this flexibility.
- static const int fudgeFactor = 2;
IntRect bounds = element->getRect();
- bounds.inflate(fudgeFactor);
+ bounds.inflate(fudgeFactor());
element->renderer()->enclosingLayer()->scrollRectToVisible(bounds);
}
@@ -497,14 +496,14 @@ static void deflateIfOverlapped(IntRect& a, IntRect& b)
if (!a.intersects(b) || a.contains(b) || b.contains(a))
return;
- static const int fudgeFactor = -2;
+ int deflateFactor = -fudgeFactor();
// Avoid negative width or height values.
- if ((a.width() + 2 * fudgeFactor > 0) && (a.height() + 2 * fudgeFactor > 0))
- a.inflate(fudgeFactor);
+ if ((a.width() + 2 * deflateFactor > 0) && (a.height() + 2 * deflateFactor > 0))
+ a.inflate(deflateFactor);
- if ((b.width() + 2 * fudgeFactor > 0) && (b.height() + 2 * fudgeFactor > 0))
- b.inflate(fudgeFactor);
+ if ((b.width() + 2 * deflateFactor > 0) && (b.height() + 2 * deflateFactor > 0))
+ b.inflate(deflateFactor);
}
static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect)
diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h
index 90ff1cf..309b095 100644
--- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h
+++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.h
@@ -40,6 +40,11 @@ inline long long maxDistance()
return numeric_limits<long long>::max();
}
+inline unsigned int fudgeFactor()
+{
+ return 2;
+}
+
// Spatially speaking, two given elements in a web page can be:
// 1) Fully aligned: There is a full intersection between the rects, either
// vertically or horizontally.
diff --git a/src/3rdparty/webkit/WebCore/platform/FileSystem.h b/src/3rdparty/webkit/WebCore/platform/FileSystem.h
index 856d5bb..c236831 100644
--- a/src/3rdparty/webkit/WebCore/platform/FileSystem.h
+++ b/src/3rdparty/webkit/WebCore/platform/FileSystem.h
@@ -69,9 +69,11 @@ typedef HMODULE PlatformModule;
#elif PLATFORM(QT)
#if defined(Q_WS_MAC)
typedef CFBundleRef PlatformModule;
-#else
+#elif !defined(QT_NO_LIBRARY)
typedef QLibrary* PlatformModule;
-#endif // defined(Q_WS_MAC)
+#else
+typedef void* PlatformModule;
+#endif
#elif PLATFORM(GTK)
typedef GModule* PlatformModule;
#elif PLATFORM(CF)
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
index 5c70eff..e50ab55 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
@@ -292,6 +292,7 @@ void ScrollView::valueChanged(Scrollbar* scrollbar)
if (scrollbarsSuppressed())
return;
+ scrollPositionChanged();
scrollContents(scrollDelta);
}
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
index 9134ddf..118a310 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
@@ -302,6 +302,9 @@ private:
// Called to update the scrollbars to accurately reflect the state of the view.
void updateScrollbars(const IntSize& desiredOffset);
+ // Called when the scroll position within this view changes. FrameView overrides this to generate repaint invalidations.
+ virtual void scrollPositionChanged() {}
+
void platformInit();
void platformDestroy();
void platformAddChild(Widget*);
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/MediaPlayer.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/MediaPlayer.cpp
index 1fdc1e5..035d1c5 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/MediaPlayer.cpp
@@ -50,7 +50,8 @@
#elif PLATFORM(GTK)
#include "MediaPlayerPrivateGStreamer.h"
#elif PLATFORM(QT)
-#if QT_VERSION < 0x040700
+// QtMultimedia support is disabled currently.
+#if 1 || (QT_VERSION < 0x040700)
#include "MediaPlayerPrivatePhonon.h"
#else
#include "MediaPlayerPrivateQt.h"
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index edac268..0100b72 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -641,12 +641,12 @@ void GraphicsContext::fillRect(const FloatRect& rect)
}
}
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& c, ColorSpace colorSpace)
+void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
{
- if (paintingDisabled())
+ if (paintingDisabled() || !color.isValid())
return;
- m_data->solidColor.setColor(c);
+ m_data->solidColor.setColor(color);
QPainter* p = m_data->p();
if (m_common->state.shadowColor.isValid())
drawBorderlessRectShadow(this, p, rect);
@@ -655,7 +655,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& c, ColorSpace
void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace)
{
- if (paintingDisabled() || !color.alpha())
+ if (paintingDisabled() || !color.isValid() || !color.alpha())
return;
Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight);
@@ -717,7 +717,7 @@ void GraphicsContext::drawFocusRing(const Vector<Path>& paths, int width, int of
*/
void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width */, int /* offset */, const Color& color)
{
- if (paintingDisabled())
+ if (paintingDisabled() || !color.isValid())
return;
unsigned rectCount = rects.size();
@@ -1141,8 +1141,9 @@ void GraphicsContext::setURLForRect(const KURL&, const IntRect&)
void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace)
{
- if (paintingDisabled())
+ if (paintingDisabled() || !color.isValid())
return;
+
QPainter* p = m_data->p();
QPen newPen(p->pen());
m_data->solidColor.setColor(color);
@@ -1172,8 +1173,9 @@ void GraphicsContext::setPlatformStrokeThickness(float thickness)
void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace)
{
- if (paintingDisabled())
+ if (paintingDisabled() || !color.isValid())
return;
+
m_data->solidColor.setColor(color);
m_data->p()->setBrush(m_data->solidColor);
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index 1c4c275..d9394e1 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -357,14 +357,6 @@ void GraphicsLayerQtImpl::updateTransform()
return;
}
- // Simplistic depth test - we stack the item behind its parent if its computed z is lower than the parent's computed z at the item's center point.
- if (parent) {
- const QPointF centerPointMappedToRoot = rootLayer()->mapFromItem(this, m_size.width() / 2, m_size.height() / 2);
- setFlag(ItemStacksBehindParent,
- m_transformRelativeToRootLayer.mapPoint(FloatPoint3D(centerPointMappedToRoot.x(), centerPointMappedToRoot.y(), 0)).z() <
- parent->m_transformRelativeToRootLayer.mapPoint(FloatPoint3D(centerPointMappedToRoot.x(), centerPointMappedToRoot.y(), 0)).z());
- }
-
// The item is front-facing or backface-visibility is on.
setVisible(true);
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp
index ee4af7f..4b0c21f 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/PathQt.cpp
@@ -69,12 +69,41 @@ Path& Path::operator=(const Path& other)
return *this;
}
+// Check whether a point is on the border
+bool isPointOnPathBorder(const QPolygonF& border, const QPointF& p)
+{
+ QPointF p1 = border.at(0);
+ QPointF p2;
+
+ for (int i = 1; i < border.size(); ++i) {
+ p2 = border.at(i);
+ // (x1<=x<=x2||x1=>x>=x2) && (y1<=y<=y2||y1=>y>=y2) && (y2-y1)(x-x1) == (y-y1)(x2-x1)
+ // In which, (y2-y1)(x-x1) == (y-y1)(x2-x1) is from (y2-y1)/(x2-x1) == (y-y1)/(x-x1)
+ // it want to check the slope between p1 and p2 is same with slope between p and p1,
+ // if so then the three points lie on the same line.
+ // In which, (x1<=x<=x2||x1=>x>=x2) && (y1<=y<=y2||y1=>y>=y2) want to make sure p is
+ // between p1 and p2, not outside.
+ if (((p.x() <= p1.x() && p.x() >= p2.x()) || (p.x() >= p1.x() && p.x() <= p2.x()))
+ && ((p.y() <= p1.y() && p.y() >= p2.y()) || (p.y() >= p1.y() && p.y() <= p2.y()))
+ && (p2.y() - p1.y()) * (p.x() - p1.x()) == (p.y() - p1.y()) * (p2.x() - p1.x())) {
+ return true;
+ }
+ p1 = p2;
+ }
+ return false;
+}
+
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
Qt::FillRule savedRule = m_path.fillRule();
const_cast<QPainterPath*>(&m_path)->setFillRule(rule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
bool contains = m_path.contains(point);
+
+ if (!contains) {
+ // check whether the point is on the border
+ contains = isPointOnPathBorder(m_path.toFillPolygon(), point);
+ }
const_cast<QPainterPath*>(&m_path)->setFillRule(savedRule);
return contains;
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h
index 0d98fcb..e355025 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h
@@ -42,6 +42,13 @@ namespace WebCore {
if (currentLookups >= 10)
return; // do not launch more than 10 lookups at the same time
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 3)
+ currentLookups++;
+ QHostInfo::lookupHost(hostname, this, SLOT(lookedUp(QHostInfo)));
+#else
+ // This code is only needed for Qt versions that do not have
+ // the small Qt DNS cache yet.
+
QTime* entryTime = lookupCache.object(hostname);
if (entryTime && entryTime->elapsed() > 300*1000) {
// delete knowledge about lookup if it is already 300 seconds old
@@ -54,6 +61,7 @@ namespace WebCore {
currentLookups++;
QHostInfo::lookupHost(hostname, this, SLOT(lookedUp(QHostInfo)));
}
+#endif
}
void lookedUp(const QHostInfo&)
@@ -61,11 +69,14 @@ namespace WebCore {
// we do not cache the result, we throw it away.
// we currently rely on the OS to cache the results. If it does not do that
// then at least the ISP nameserver did it.
+ // Since Qt 4.6.3, Qt also has a small DNS cache.
currentLookups--;
}
protected:
+#if QT_VERSION < QT_VERSION_CHECK(4, 6, 3)
QCache<QString, QTime> lookupCache; // 100 entries
+#endif
int currentLookups;
};
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 4237fca..abeb895 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -41,13 +41,15 @@
// What type of connection should be used for the signals of the
// QNetworkReply? This depends on if Qt has a bugfix for this or not.
-// It is fixed in Qt 4.6.1. See https://bugs.webkit.org/show_bug.cgi?id=32113
-#if QT_VERSION > QT_VERSION_CHECK(4, 6, 0)
+// It is fixed in Qt 4.6.3. See https://bugs.webkit.org/show_bug.cgi?id=32113
+// and https://bugs.webkit.org/show_bug.cgi?id=36755
+#if QT_VERSION > QT_VERSION_CHECK(4, 6, 2)
#define SIGNAL_CONN Qt::DirectConnection
#else
#define SIGNAL_CONN Qt::QueuedConnection
#endif
+static const int gMaxRecursionLimit = 10;
namespace WebCore {
@@ -138,6 +140,7 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load
, m_shouldFinish(false)
, m_shouldSendResponse(false)
, m_shouldForwardData(false)
+ , m_redirectionTries(gMaxRecursionLimit)
{
const ResourceRequest &r = m_resourceHandle->request();
@@ -335,9 +338,18 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
QUrl redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
if (redirection.isValid()) {
+ QUrl newUrl = m_reply->url().resolved(redirection);
+
+ m_redirectionTries--;
+ if (m_redirectionTries == 0) { // 10 or more redirections to the same url is considered infinite recursion
+ ResourceError error(newUrl.host(), 400 /*bad request*/,
+ newUrl.toString(),
+ QCoreApplication::translate("QWebPage", "Redirection limit reached"));
+ client->didFail(m_resourceHandle, error);
+ return;
+ }
m_redirected = true;
- QUrl newUrl = m_reply->url().resolved(redirection);
ResourceRequest newRequest = m_resourceHandle->request();
newRequest.setURL(newUrl);
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h
index eb5ae3c..1abad4e 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.h
@@ -82,6 +82,7 @@ private:
bool m_shouldFinish;
bool m_shouldSendResponse;
bool m_shouldForwardData;
+ int m_redirectionTries;
};
// Self destructing QIODevice for FormData
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp
index 4093fad..f9ced98 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp
@@ -154,11 +154,12 @@ bool unloadModule(PlatformModule module)
return ::FreeLibrary(module);
#else
+#ifndef QT_NO_LIBRARY
if (module->unload()) {
delete module;
return true;
}
-
+#endif
return false;
#endif
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
index 0163adc..577903b 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
@@ -42,7 +42,7 @@
#include "HTMLInputElement.h"
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
#include "Maemo5Webstyle.h"
#endif
#include "NotImplemented.h"
@@ -153,7 +153,7 @@ RenderThemeQt::RenderThemeQt(Page* page)
m_buttonFontPixelSize = fontInfo.pixelSize();
#endif
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
m_fallbackStyle = new Maemo5WebStyle;
#else
m_fallbackStyle = QStyleFactory::create(QLatin1String("windows"));
@@ -166,7 +166,7 @@ RenderThemeQt::~RenderThemeQt()
delete m_lineEdit;
}
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
bool RenderThemeQt::isControlStyled(const RenderStyle* style, const BorderData& border, const FillLayer& fill, const Color& backgroundColor) const
{
switch (style->appearance()) {
@@ -198,7 +198,7 @@ QStyle* RenderThemeQt::fallbackStyle() const
QStyle* RenderThemeQt::qStyle() const
{
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
return fallbackStyle();
#endif
@@ -218,7 +218,7 @@ String RenderThemeQt::extraDefaultStyleSheet()
#if ENABLE(NO_LISTBOX_RENDERING)
result += String(themeQtNoListboxesUserAgentStyleSheet, sizeof(themeQtNoListboxesUserAgentStyleSheet));
#endif
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
result += String(themeQtMaemo5UserAgentStyleSheet, sizeof(themeQtMaemo5UserAgentStyleSheet));
#endif
return result;
@@ -648,7 +648,9 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo
void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
{
-#ifndef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
+ // Mobile theme uses border radius.
+#else
// WORKAROUND because html.css specifies -webkit-border-radius for <select> so we override it here
// see also http://bugs.webkit.org/show_bug.cgi?id=18399
style->resetBorderRadius();
@@ -870,7 +872,7 @@ bool RenderThemeQt::supportsFocus(ControlPart appearance) const
void RenderThemeQt::setPaletteFromPageClientIfExists(QPalette& palette) const
{
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
static QPalette lightGrayPalette(Qt::lightGray);
palette = lightGrayPalette;
return;
@@ -932,7 +934,7 @@ ControlPart RenderThemeQt::initializeCommonQStyleOptions(QStyleOption& option, R
case SearchFieldCancelButtonPart: {
if (isPressed(o))
option.state |= QStyle::State_Sunken;
- else if (result == PushButtonPart)
+ else if (result == PushButtonPart || result == ButtonPart)
option.state |= QStyle::State_Raised;
break;
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
index b16918a..591dd27 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h
@@ -75,7 +75,7 @@ public:
virtual double caretBlinkInterval() const;
-#ifdef Q_WS_MAEMO_5
+#if USE(QT_MOBILE_THEME)
virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const;
virtual int popupInternalPaddingBottom(RenderStyle*) const;
#endif
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp
index 04a2b1b..eb2d934 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp
@@ -114,7 +114,7 @@ static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widg
opt.state |= QStyle::State_Horizontal;
opt.sliderValue = scrollbar->value();
opt.sliderPosition = opt.sliderValue;
- opt.pageStep = scrollbar->visibleSize();
+ opt.pageStep = scrollbar->pageStep();
opt.singleStep = scrollbar->lineStep();
opt.minimum = 0;
opt.maximum = qMax(0, scrollbar->maximum());
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
index 814f961..814f961 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
diff --git a/src/3rdparty/webkit/WebKit.pri b/src/3rdparty/webkit/WebKit.pri
index e737039..a3ccd9d 100644
--- a/src/3rdparty/webkit/WebKit.pri
+++ b/src/3rdparty/webkit/WebKit.pri
@@ -22,7 +22,7 @@ building-libs {
QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
} else {
win32-*|wince* {
- CONFIG(debug, debug|release):build_pass: QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
+ !CONFIG(release, debug|release):build_pass: QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}d
QTWEBKITLIBNAME = $${QTWEBKITLIBNAME}$${QT_MAJOR_VERSION}
win32-g++: LIBS += -l$$QTWEBKITLIBNAME
else: LIBS += $${QTWEBKITLIBNAME}.lib
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index 1efae16..75a23d9 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -82,7 +82,6 @@ public:
, page(0)
, resizesToContents(false)
#if USE(ACCELERATED_COMPOSITING)
- , rootGraphicsLayer(0)
, shouldSync(false)
#endif
{
@@ -158,7 +157,7 @@ public:
enum { RootGraphicsLayerZValue, OverlayZValue };
#if USE(ACCELERATED_COMPOSITING)
- QGraphicsItem* rootGraphicsLayer;
+ QWeakPointer<QGraphicsObject> rootGraphicsLayer;
// we need to sync the layers if we get a special call from the WebCore
// compositor telling us to do so. We'll get that call from ChromeClientQt
bool shouldSync;
@@ -171,12 +170,11 @@ public:
QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate()
{
#if USE(ACCELERATED_COMPOSITING)
- if (rootGraphicsLayer) {
- // we don't need to delete the root graphics layer
- // The lifecycle is managed in GraphicsLayerQt.cpp
- rootGraphicsLayer->setParentItem(0);
- q->scene()->removeItem(rootGraphicsLayer);
- }
+ if (!rootGraphicsLayer)
+ return;
+ // we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp.
+ rootGraphicsLayer.data()->setParentItem(0);
+ q->scene()->removeItem(rootGraphicsLayer.data());
#endif
}
@@ -204,12 +202,12 @@ void QGraphicsWebViewPrivate::createOrDeleteOverlay()
void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer)
{
if (rootGraphicsLayer) {
- rootGraphicsLayer->setParentItem(0);
- q->scene()->removeItem(rootGraphicsLayer);
+ rootGraphicsLayer.data()->setParentItem(0);
+ q->scene()->removeItem(rootGraphicsLayer.data());
QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive();
}
- rootGraphicsLayer = layer;
+ rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0;
if (layer) {
layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
@@ -231,7 +229,7 @@ void QGraphicsWebViewPrivate::updateCompositingScrollPosition()
{
if (rootGraphicsLayer && q->page() && q->page()->mainFrame()) {
const QPoint scrollPosition = q->page()->mainFrame()->scrollPosition();
- rootGraphicsLayer->setPos(-scrollPosition);
+ rootGraphicsLayer.data()->setPos(-scrollPosition);
}
}
#endif
@@ -428,7 +426,9 @@ QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const
return QRectF();
QList<QGraphicsView*> views = q->scene()->views();
if (views.size() > 1) {
+#ifndef QT_NO_DEBUG_STREAM
qDebug() << "QGraphicsWebView is in more than one graphics views, unable to compute the visible rect";
+#endif
return QRectF();
}
if (views.size() < 1)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
index 4e8fd30..ba039c7 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
@@ -39,8 +39,10 @@ using namespace WebCore;
access on a local computer through JavaScript. QWebDatabase is the C++ interface to these
databases.
- To get access to all databases defined by a security origin, use QWebSecurityOrigin::databases().
- Each database has an internal name(), as well as a user-friendly name, provided by displayName().
+ Databases are grouped together in security origins. To get access to all databases defined by
+ a security origin, use QWebSecurityOrigin::databases(). Each database has an internal name(),
+ as well as a user-friendly name, provided by displayName(). These names are specified when
+ creating the database in the JavaScript code.
WebKit uses SQLite to create and access the local SQL databases. The location of the database
file in the local file system is returned by fileName(). You can access the database directly
@@ -49,7 +51,7 @@ using namespace WebCore;
For each database the web site can define an expectedSize(). The current size of the database
in bytes is returned by size().
- For more information refer to the \l{http://dev.w3.org/html5/webdatabase/}{HTML 5 Draft Standard}.
+ For more information refer to the \l{http://dev.w3.org/html5/webdatabase/}{HTML5 Web SQL Database Draft Standard}.
\sa QWebSecurityOrigin
*/
@@ -80,7 +82,7 @@ QString QWebDatabase::name() const
}
/*!
- Returns the name of the database as seen by the user.
+ Returns the name of the database in a format that is suitable for display to the user.
*/
QString QWebDatabase::displayName() const
{
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
index 955206d..69146a2 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -84,13 +84,27 @@ public:
\snippet webkitsnippets/webelement/main.cpp Traversing with QWebElement
+ Individual elements can be inspected or changed using methods such as attribute()
+ or setAttribute(). For examle, to capture the user's input in a text field for later
+ use (auto-completion), a browser could do something like this:
+
+ \snippet webkitsnippets/webelement/main.cpp autocomplete1
+
+ When the same page is later revisited, the browser can fill in the text field automatically
+ by modifying the value attribute of the input element:
+
+ \snippet webkitsnippets/webelement/main.cpp autocomplete2
+
+ Another use case is to emulate a click event on an element. The following
+ code snippet demonstrates how to call the JavaScript DOM method click() of
+ a submit button:
+
+ \snippet webkitsnippets/webelement/main.cpp Calling a DOM element method
+
The underlying content of QWebElement is explicitly shared. Creating a copy
of a QWebElement does not create a copy of the content. Instead, both
instances point to the same element.
- The element's attributes can be read using attribute() and modified with
- setAttribute().
-
The contents of child elements can be converted to plain text with
toPlainText(); to XHTML using toInnerXml(). To include the element's tag in
the output, use toOuterXml().
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 394ea17..44cc3b5 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -552,8 +552,10 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame:
can connect to the web page's \l{QWebPage::}{frameCreated()} signal
to be notified when a new frame is created.
- The hitTestContent() function can be used to programmatically examine the
- contents of a frame.
+ There are multiple ways to programmatically examine the contents of a frame.
+ The hitTestContent() function can be used to find elements by coordinate.
+ For access to the underlying DOM tree, there is documentElement(),
+ findAllElements() and findFirstElement().
A QWebFrame can be printed onto a QPrinter using the print() function.
This function is marked as a slot and can be conveniently connected to
@@ -781,6 +783,10 @@ static inline QUrl ensureAbsoluteUrl(const QUrl &url)
\property QWebFrame::url
\brief the url of the frame currently viewed
+ Setting this property clears the view and loads the URL.
+
+ By default, this property contains an empty, invalid URL.
+
\sa urlChanged()
*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
index 80567d1..61cf5af 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
@@ -41,7 +41,7 @@ static void gCleanupInterface()
/*!
Sets a new default interface, \a defaultInterface, that will be used by all of WebKit
- for managing history.
+ to keep track of visited links.
If an interface without a parent has already been set, the old interface will be deleted.
When the application exists QWebHistoryInterface will automatically delete the
@@ -68,8 +68,9 @@ void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface* defaultInte
}
/*!
- Returns the default interface that will be used by WebKit. If no
- default interface has been set, QtWebkit will not track history.
+ Returns the default interface that will be used by WebKit. If no default interface has been set,
+ Webkit will not keep track of visited links and a null pointer will be returned.
+ \sa setDefaultInterface
*/
QWebHistoryInterface* QWebHistoryInterface::defaultInterface()
{
@@ -84,11 +85,15 @@ QWebHistoryInterface* QWebHistoryInterface::defaultInterface()
\inmodule QtWebKit
The QWebHistoryInterface is an interface that can be used to
- implement link history. It contains two pure virtual methods that
- are called by the WebKit engine. addHistoryEntry() is used to add
- pages that have been visited to the interface, while
- historyContains() is used to query whether this page has been
- visited by the user.
+ keep track of visited links. It contains two pure virtual methods that
+ are called by the WebKit engine: addHistoryEntry() is used to add
+ urls that have been visited to the interface, while
+ historyContains() is used to query whether the given url has been
+ visited by the user. By default the QWebHistoryInterface is not set, so WebKit does not keep
+ track of visited links.
+
+ \note The history tracked by QWebHistoryInterface is not specific to an instance of QWebPage
+ but applies to all pages.
*/
/*!
@@ -100,7 +105,7 @@ QWebHistoryInterface::QWebHistoryInterface(QObject* parent)
}
/*!
- Destructor. If this is currently the default interface it will be unset.
+ Destroys the interface. If this is currently the default interface it will be unset.
*/
QWebHistoryInterface::~QWebHistoryInterface()
{
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
index c0e5277..802ea98 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
@@ -31,17 +31,23 @@
/*!
\class QWebInspector
\since 4.6
+ \inmodule QtWebKit
\brief The QWebInspector class allows the placement and control of a
QWebPage's inspector.
- The inspector allows you to see a page current hierarchy and loading
- statistics.
+ The inspector can display a page's hierarchy, its loading statistics and
+ the current state of its individual elements. It is mostly used by web
+ developers.
- The QWebPage to be inspected is determined with the setPage() method.
+ The QWebPage to be inspected must be specified using the setPage() method.
A typical use of QWebInspector follows:
\snippet webkitsnippets/qtwebkit_qwebinspector_snippet.cpp 0
+ A QWebInspector can be made visible either programmatically using
+ setVisible(), or by the user through the attached QWebPage's context
+ menu.
+
\note A QWebInspector will display a blank widget if either:
\list
\o page() is null
@@ -61,17 +67,16 @@
\section1 Inspector configuration persistence
The inspector allows the user to configure some options through its
- interface (e.g. the resource tracking "Always enable" option).
- These settings are persisted automatically by QtWebKit using QSettings.
-
- However since the QSettings object is instantiated using the empty
- constructor, QCoreApplication::setOrganizationName() and
- QCoreApplication::setApplicationName() must be called within your
- application to enable the persistence of these options.
+ user interface (e.g. the resource tracking "Always enable" option).
+ These settings will be persisted automatically by QtWebKit only if
+ your application previously called QCoreApplication::setOrganizationName()
+ and QCoreApplication::setApplicationName().
+ See QSettings's default constructor documentation for an explanation
+ of why this is necessary.
*/
/*!
- Constructs an empty QWebInspector with parent \a parent.
+ Constructs an unbound QWebInspector with \a parent as its parent.
*/
QWebInspector::QWebInspector(QWidget* parent)
: QWidget(parent)
@@ -89,16 +94,16 @@ QWebInspector::~QWebInspector()
}
/*!
- Sets the QWebPage to be inspected.
-
- There can only be one QWebInspector associated with a QWebPage
- and vices versa.
+ Bind this inspector to the QWebPage to be inspected.
- Calling with \a page as null will break the current association, if any.
-
- If \a page is already associated to another QWebInspector, the association
- will be replaced and the previous QWebInspector will have no page
- associated.
+ \bold {Notes:}
+ \list
+ \o There can only be one QWebInspector associated with a QWebPage
+ and vice versa.
+ \o Calling this method with a null \a page will break the current association, if any.
+ \o If \a page is already associated to another QWebInspector, the association
+ will be replaced and the previous QWebInspector will become unbound
+ \endlist
\sa page()
*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
index 062839f..181913b 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
@@ -22,11 +22,21 @@
#include <WebKitVersion.h>
/*!
-
+ \relates QWebPage
+ \since 4.6
Returns the version number of WebKit at run-time as a string (for
- example, "531.3"). This is the version of WebKit the application
- was compiled against.
+ example, "531.3").
+
+ This version is commonly used in WebKit based browsers as part
+ of the user agent string. Web servers and JavaScript might use
+ it to identify the presence of certain WebKit engine features
+ and behaviour.
+ The evolution of this version is bound to the releases of Apple's
+ Safari browser. For a version specific to the QtWebKit library,
+ see QTWEBKIT_VERSION
+
+ \sa QWebPage::userAgentForUrl()
*/
QString qWebKitVersion()
{
@@ -34,11 +44,13 @@ QString qWebKitVersion()
}
/*!
-
+ \relates QWebPage
+ \since 4.6
Returns the 'major' version number of WebKit at run-time as an integer
(for example, 531). This is the version of WebKit the application
was compiled against.
+ \sa qWebKitVersion()
*/
int qWebKitMajorVersion()
{
@@ -46,13 +58,57 @@ int qWebKitMajorVersion()
}
/*!
-
+ \relates QWebPage
+ \since 4.6
Returns the 'minor' version number of WebKit at run-time as an integer
(for example, 3). This is the version of WebKit the application
was compiled against.
+ \sa qWebKitVersion()
*/
int qWebKitMinorVersion()
{
return WEBKIT_MINOR_VERSION;
}
+
+/*!
+ \macro QTWEBKIT_VERSION
+ \relates QWebPage
+
+ This macro expands a numeric value of the form 0xMMNNPP (MM =
+ major, NN = minor, PP = patch) that specifies QtWebKit's version
+ number. For example, if you compile your application against QtWebKit
+ 2.1.2, the QTWEBKIT_VERSION macro will expand to 0x020102.
+
+ You can use QTWEBKIT_VERSION to use the latest QtWebKit API where
+ available.
+
+ \sa QT_VERSION
+*/
+
+/*!
+ \macro QTWEBKIT_VERSION_STR
+ \relates QWebPage
+
+ This macro expands to a string that specifies QtWebKit's version number
+ (for example, "2.1.2"). This is the version against which the
+ application is compiled.
+
+ \sa QTWEBKIT_VERSION
+*/
+
+/*!
+ \macro QTWEBKIT_VERSION_CHECK
+ \relates QWebPage
+
+ Turns the major, minor and patch numbers of a version into an
+ integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
+ be compared with another similarly processed version id, for example
+ in a preprocessor statement:
+
+ \code
+ #if QTWEBKIT_VERSION >= QTWEBKIT_VERSION_CHECK(2, 1, 0)
+ // code to use API new in QtWebKit 2.1.0
+ #endif
+ \endcode
+*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index b8b50b7..c5f508f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -119,15 +119,6 @@
using namespace WebCore;
-void QWEBKIT_EXPORT qt_wrt_setViewMode(QWebPage* page, const QString& mode)
-{
- QWebPagePrivate::priv(page)->viewMode = mode;
- WebCore::Frame* frame = QWebFramePrivate::core(page->mainFrame());
- WebCore::FrameView* view = frame->view();
- frame->document()->updateStyleSelector();
- view->forceLayout();
-}
-
void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
{
PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
@@ -1361,6 +1352,26 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
ev->accept();
}
+void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event)
+{
+ if (event->propertyName() == "_q_viewMode") {
+ QString mode = q->property("_q_viewMode").toString();
+ if (mode != viewMode) {
+ viewMode = mode;
+ WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
+ WebCore::FrameView* view = frame->view();
+ frame->document()->updateStyleSelector();
+ view->forceLayout();
+ }
+ } else if (event->propertyName() == "_q_HTMLTokenizerChunkSize") {
+ int chunkSize = q->property("_q_HTMLTokenizerChunkSize").toInt();
+ q->handle()->page->setCustomHTMLTokenizerChunkSize(chunkSize);
+ } else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") {
+ double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble();
+ q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay);
+ }
+}
+
void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event)
{
WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
@@ -1616,7 +1627,7 @@ InspectorController* QWebPagePrivate::inspectorController()
/*!
\enum QWebPage::FindFlag
- This enum describes the options available to QWebPage's findText() function. The options
+ This enum describes the options available to the findText() function. The options
can be OR-ed together from the following list:
\value FindBackward Searches backwards instead of forwards.
@@ -1637,6 +1648,8 @@ InspectorController* QWebPagePrivate::inspectorController()
\value DelegateExternalLinks When activating links that point to documents not stored on the
local filesystem or an equivalent - such as the Qt resource system - then linkClicked() is emitted.
\value DelegateAllLinks Whenever a link is activated the linkClicked() signal is emitted.
+
+ \sa QWebPage::linkDelegationPolicy
*/
/*!
@@ -1651,6 +1664,8 @@ InspectorController* QWebPagePrivate::inspectorController()
\value NavigationTypeReload The user activated the reload action.
\value NavigationTypeFormResubmitted An HTML form was submitted a second time.
\value NavigationTypeOther A navigation to another document using a method not listed above.
+
+ \sa acceptNavigationRequest()
*/
/*!
@@ -1660,7 +1675,7 @@ InspectorController* QWebPagePrivate::inspectorController()
Actions only have an effect when they are applicable. The availability of
actions can be be determined by checking \l{QAction::}{isEnabled()} on the
- action returned by \l{QWebPage::}{action()}.
+ action returned by action().
One method of enabling the text editing, cursor movement, and text selection actions
is by setting \l contentEditable to true.
@@ -1742,6 +1757,8 @@ InspectorController* QWebPagePrivate::inspectorController()
/*!
\enum QWebPage::WebWindowType
+ This enum describes the types of window that can be created by the createWindow() function.
+
\value WebBrowserWindow The window is a regular web browser window.
\value WebModalDialog The window acts as modal dialog.
*/
@@ -1758,11 +1775,13 @@ InspectorController* QWebPagePrivate::inspectorController()
to provide functionality like QWebView in a widget-less environment.
QWebPage's API is very similar to QWebView, as you are still provided with
- common functions like action() (known as \l{QWebView::}{pageAction()} in
- QWebView), triggerAction(), findText() and settings(). More QWebView-like
- functions can be found in the main frame of QWebPage, obtained via
- QWebPage::mainFrame(). For example, the load(), setUrl() and setHtml()
- unctions for QWebPage can be accessed using QWebFrame.
+ common functions like action() (known as
+ \l{QWebView::pageAction()}{pageAction}() in QWebView), triggerAction(),
+ findText() and settings(). More QWebView-like functions can be found in the
+ main frame of QWebPage, obtained via the mainFrame() function. For example,
+ the \l{QWebFrame::load()}{load}(), \l{QWebFrame::setUrl()}{setUrl}() and
+ \l{QWebFrame::setHtml()}{setHtml}() functions for QWebPage can be accessed
+ using QWebFrame.
The loadStarted() signal is emitted when the page begins to load.The
loadProgress() signal, on the other hand, is emitted whenever an element
@@ -1866,7 +1885,8 @@ QWebFrame *QWebPage::currentFrame() const
/*!
\since 4.6
- Returns the frame at the given point \a pos.
+ Returns the frame at the given point \a pos, or 0 if there is no frame at
+ that position.
\sa mainFrame(), currentFrame()
*/
@@ -1985,7 +2005,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
result should be written to \a result and true should be returned. If the prompt was not cancelled by the
user, the implementation should return true and the result string must not be null.
- The default implementation uses QInputDialog::getText.
+ The default implementation uses QInputDialog::getText().
*/
bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result)
{
@@ -2199,6 +2219,8 @@ QSize QWebPage::viewportSize() const
By default, for a newly-created Web page, this property contains a size with
zero width and height.
+
+ \sa QWebFrame::render(), preferredContentsSize
*/
void QWebPage::setViewportSize(const QSize &size) const
{
@@ -2227,11 +2249,12 @@ QSize QWebPage::preferredContentsSize() const
/*!
\property QWebPage::preferredContentsSize
\since 4.6
- \brief the size of the fixed layout
+ \brief the preferred size of the contents
- The size affects the layout of the page in the viewport. If set to a fixed size of
- 1024x768 for example then webkit will layout the page as if the viewport were that size
- rather than something different.
+ If this property is set to a valid size, it is used to lay out the page.
+ If it is not set (the default), the viewport size is used instead.
+
+ \sa viewportSize
*/
void QWebPage::setPreferredContentsSize(const QSize &size) const
{
@@ -2579,9 +2602,11 @@ QAction *QWebPage::action(WebAction action) const
/*!
\property QWebPage::modified
- \brief whether the page contains unsubmitted form data
+ \brief whether the page contains unsubmitted form data, or the contents have been changed.
By default, this property is false.
+
+ \sa contentsChanged(), contentEditable, undoStack()
*/
bool QWebPage::isModified() const
{
@@ -2597,6 +2622,8 @@ bool QWebPage::isModified() const
#ifndef QT_NO_UNDOSTACK
/*!
Returns a pointer to the undo stack used for editable content.
+
+ \sa modified
*/
QUndoStack *QWebPage::undoStack() const
{
@@ -2708,6 +2735,9 @@ bool QWebPage::event(QEvent *ev)
d->touchEvent(static_cast<QTouchEvent*>(ev));
break;
#endif
+ case QEvent::DynamicPropertyChange:
+ d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev));
+ break;
default:
return QObject::event(ev);
}
@@ -2716,7 +2746,7 @@ bool QWebPage::event(QEvent *ev)
}
/*!
- Similar to QWidget::focusNextPrevChild it focuses the next focusable web element
+ Similar to QWidget::focusNextPrevChild() it focuses the next focusable web element
if \a next is true; otherwise the previous element is focused.
Returns true if it can find a new focusable element, or false if it can't.
@@ -2743,6 +2773,8 @@ bool QWebPage::focusNextPrevChild(bool next)
If this property is enabled the contents of the page can be edited by the user through a visible
cursor. If disabled (the default) only HTML elements in the web page with their
\c{contenteditable} attribute set are editable.
+
+ \sa modified, contentsChanged(), WebAction
*/
void QWebPage::setContentEditable(bool editable)
{
@@ -2912,17 +2944,21 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
as a result of the user clicking on a "file upload" button in a HTML form where multiple
file selection is allowed.
- \omitvalue ErrorPageExtension (introduced in Qt 4.6)
+ \value ErrorPageExtension Whether the web page can provide an error page when loading fails.
+ (introduced in Qt 4.6)
+
+ \sa ChooseMultipleFilesExtensionOption, ChooseMultipleFilesExtensionReturn, ErrorPageExtensionOption, ErrorPageExtensionReturn
*/
/*!
\enum QWebPage::ErrorDomain
\since 4.6
- \internal
- \value QtNetwork
- \value Http
- \value WebKit
+ This enum describes the domain of an ErrorPageExtensionOption object (i.e. the layer in which the error occurred).
+
+ \value QtNetwork The error occurred in the QtNetwork layer; the error code is of type QNetworkReply::NetworkError.
+ \value Http The error occurred in the HTTP layer; the error code is a HTTP status code (see QNetworkRequest::HttpStatusCodeAttribute).
+ \value WebKit The error is an internal WebKit error.
*/
/*!
@@ -2932,7 +2968,18 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\inmodule QtWebKit
- \sa QWebPage::extension()
+ \sa QWebPage::extension() QWebPage::ExtensionReturn
+*/
+
+
+/*!
+ \class QWebPage::ExtensionReturn
+ \since 4.4
+ \brief The ExtensionReturn class provides an output result from a QWebPage's extension.
+
+ \inmodule QtWebKit
+
+ \sa QWebPage::extension() QWebPage::ExtensionOption
*/
/*!
@@ -2943,12 +2990,38 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\inmodule QtWebKit
- The ErrorPageExtensionOption class holds the \a url for which an error occoured as well as
+ The ErrorPageExtensionOption class holds the \a url for which an error occurred as well as
the associated \a frame.
The error itself is reported by an error \a domain, the \a error code as well as \a errorString.
- \sa QWebPage::ErrorPageExtensionReturn
+ \sa QWebPage::extension() QWebPage::ErrorPageExtensionReturn
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::url
+ \brief the url for which an error occurred
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::frame
+ \brief the frame associated with the error
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::domain
+ \brief the domain that reported the error
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::error
+ \brief the error code. Interpretation of the value depends on the \a domain
+ \sa QWebPage::ErrorDomain
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionOption::errorString
+ \brief a string that describes the error
*/
/*!
@@ -2969,7 +3042,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
External objects such as stylesheets or images referenced in the HTML are located relative to
\a baseUrl.
- \sa QWebPage::ErrorPageExtensionOption, QString::toUtf8()
+ \sa QWebPage::extension() QWebPage::ErrorPageExtensionOption, QString::toUtf8()
*/
/*!
@@ -2978,6 +3051,29 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
Constructs a new error page object.
*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::contentType
+ \brief the error page's content type
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::encoding
+ \brief the error page encoding
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::baseUrl
+ \brief the base url
+
+ External objects such as stylesheets or images referenced in the HTML are located relative to this url.
+*/
+
+/*!
+ \variable QWebPage::ErrorPageExtensionReturn::content
+ \brief the HTML content of the error page
+*/
+
/*!
\class QWebPage::ChooseMultipleFilesExtensionOption
\since 4.5
@@ -2989,7 +3085,22 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The ChooseMultipleFilesExtensionOption class holds the frame originating the request
and the suggested filenames which might be provided.
- \sa QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+ \sa QWebPage::extension() QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn
+*/
+
+/*!
+ \variable QWebPage::ChooseMultipleFilesExtensionOption::parentFrame
+ \brief The frame in which the request originated
+*/
+
+/*!
+ \variable QWebPage::ChooseMultipleFilesExtensionOption::suggestedFileNames
+ \brief The suggested filenames
+*/
+
+/*!
+ \variable QWebPage::ChooseMultipleFilesExtensionReturn::fileNames
+ \brief The selected filenames
*/
/*!
@@ -3003,14 +3114,17 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user
when the extension is invoked.
- \sa QWebPage::ChooseMultipleFilesExtensionOption
+ \sa QWebPage::extension() QWebPage::ChooseMultipleFilesExtensionOption
*/
/*!
This virtual function can be reimplemented in a QWebPage subclass to provide support for extensions. The \a option
argument is provided as input to the extension; the output results can be stored in \a output.
- The behavior of this function is determined by \a extension.
+ The behavior of this function is determined by \a extension. The \a option
+ and \a output values are typically casted to the corresponding types (for
+ example, ChooseMultipleFilesExtensionOption and
+ ChooseMultipleFilesExtensionReturn for ChooseMultipleFilesExtension).
You can call supportsExtension() to check if an extension is supported by the page.
@@ -3102,6 +3216,8 @@ QWebSettings *QWebPage::settings() const
A suggested filename may be provided in \a suggestedFile. The frame originating the
request is provided as \a parentFrame.
+
+ \sa ChooseMultipleFilesExtension
*/
QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile)
{
@@ -3355,6 +3471,15 @@ QString QWebPage::userAgentForUrl(const QUrl&) const
case QSysInfo::SV_9_4:
firstPartTemp += QString::fromLatin1("/9.4");
break;
+ case QSysInfo::SV_SF_2:
+ firstPartTemp += QString::fromLatin1("^2");
+ break;
+ case QSysInfo::SV_SF_3:
+ firstPartTemp += QString::fromLatin1("^3");
+ break;
+ case QSysInfo::SV_SF_4:
+ firstPartTemp += QString::fromLatin1("^4");
+ break;
default:
firstPartTemp += QString::fromLatin1("/Unknown");
}
@@ -3465,7 +3590,7 @@ quint64 QWebPage::totalBytes() const
/*!
Returns the number of bytes that were received from the network to render the current page.
- \sa totalBytes()
+ \sa totalBytes(), loadProgress()
*/
quint64 QWebPage::bytesReceived() const
{
@@ -3497,7 +3622,7 @@ quint64 QWebPage::bytesReceived() const
This signal is emitted when a load of the page is finished.
\a ok will indicate whether the load was successful or any error occurred.
- \sa loadStarted()
+ \sa loadStarted(), ErrorPageExtension
*/
/*!
@@ -3524,12 +3649,15 @@ quint64 QWebPage::bytesReceived() const
\fn void QWebPage::frameCreated(QWebFrame *frame)
This signal is emitted whenever the page creates a new \a frame.
+
+ \sa currentFrame()
*/
/*!
\fn void QWebPage::selectionChanged()
- This signal is emitted whenever the selection changes.
+ This signal is emitted whenever the selection changes, either interactively
+ or programmatically (e.g. by calling triggerAction() with a selection action).
\sa selectedText()
*/
@@ -3541,7 +3669,7 @@ quint64 QWebPage::bytesReceived() const
This signal is emitted whenever the text in form elements changes
as well as other editable content.
- \sa contentEditable, QWebFrame::toHtml(), QWebFrame::toPlainText()
+ \sa contentEditable, modified, QWebFrame::toHtml(), QWebFrame::toPlainText()
*/
/*!
@@ -3617,9 +3745,9 @@ quint64 QWebPage::bytesReceived() const
\fn void QWebPage::microFocusChanged()
This signal is emitted when for example the position of the cursor in an editable form
- element changes. It is used inform input methods about the new on-screen position where
- the user is able to enter text. This signal is usually connected to QWidget's updateMicroFocus()
- slot.
+ element changes. It is used to inform input methods about the new on-screen position where
+ the user is able to enter text. This signal is usually connected to the
+ QWidget::updateMicroFocus() slot.
*/
/*!
@@ -3660,6 +3788,8 @@ quint64 QWebPage::bytesReceived() const
This signal is emitted whenever the web site shown in \a frame is asking to store data
to the database \a databaseName and the quota allocated to that web site is exceeded.
+
+ \sa QWebDatabase
*/
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index 0712d0c..5350cd9 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -112,6 +112,8 @@ public:
void inputMethodEvent(QInputMethodEvent*);
+ void dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent*);
+
void shortcutOverrideEvent(QKeyEvent*);
void leaveEvent(QEvent*);
void handleClipboard(QEvent*, Qt::MouseButton);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
index 8ff13b1..f715430 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -23,25 +23,40 @@
/*!
\class QWebPluginFactory
\since 4.4
- \brief The QWebPluginFactory class creates plugins to be embedded into web
- pages.
+ \brief The QWebPluginFactory class is used to embed custom data types in web pages.
\inmodule QtWebKit
- QWebPluginFactory is a factory for creating plugins for QWebPage. A plugin
- factory can be installed on a QWebPage using QWebPage::setPluginFactory().
+ The HTML \c{<object>} tag is used to embed arbitrary content into a web page,
+ for example:
+
+ \code
+ <object type="application/x-pdf" data="http://qt.nokia.com/document.pdf" width="500" height="400"></object>
+ \endcode
+
+ QtWebkit will natively handle the most basic data types like \c{text/html} and
+ \c{image/jpeg}, but for any advanced or custom data types you will need to
+ provide a handler yourself.
+
+ QWebPluginFactory is a factory for creating plugins for QWebPage, where each
+ plugin provides support for one or more data types. A plugin factory can be
+ installed on a QWebPage using QWebPage::setPluginFactory().
\note The plugin factory is only used if plugins are enabled through QWebSettings.
- You can provide a QWebPluginFactory by implementing the plugins() and the
- create() method. For plugins() it is necessary to describe the plugins the
+ You provide a QWebPluginFactory by implementing the plugins() and the
+ create() methods. For plugins() it is necessary to describe the plugins the
factory can create, including a description and the supported MIME types.
The MIME types each plugin can handle should match the ones specified in
- in the HTML \c{<object>} tag.
+ in the HTML \c{<object>} tag of your content.
The create() method is called if the requested MIME type is supported. The
implementation has to return a new instance of the plugin requested for the
given MIME type and the specified URL.
+
+ The plugins themselves are subclasses of QObject, but currently only plugins
+ based on either QWidget or QGraphicsWidget are supported.
+
*/
@@ -183,6 +198,7 @@ void QWebPluginFactory::refreshPlugins()
/*!
\enum QWebPluginFactory::Extension
+ \internal
This enum describes the types of extensions that the plugin factory can support. Before using these extensions, you
should verify that the extension is supported by calling supportsExtension().
@@ -192,6 +208,7 @@ void QWebPluginFactory::refreshPlugins()
/*!
\class QWebPluginFactory::ExtensionOption
+ \internal
\since 4.4
\brief The ExtensionOption class provides an extended input argument to QWebPluginFactory's extension support.
@@ -202,6 +219,7 @@ void QWebPluginFactory::refreshPlugins()
/*!
\class QWebPluginFactory::ExtensionReturn
+ \internal
\since 4.4
\brief The ExtensionOption class provides an extended output argument to QWebPluginFactory's extension support.
@@ -214,6 +232,8 @@ void QWebPluginFactory::refreshPlugins()
This virtual function can be reimplemented in a QWebPluginFactory subclass to provide support for extensions. The \a option
argument is provided as input to the extension; the output results can be stored in \a output.
+ \internal
+
The behaviour of this function is determined by \a extension.
You can call supportsExtension() to check if an extension is supported by the factory.
@@ -233,6 +253,8 @@ bool QWebPluginFactory::extension(Extension extension, const ExtensionOption *op
/*!
This virtual function returns true if the plugin factory supports \a extension; otherwise false is returned.
+ \internal
+
\sa extension()
*/
bool QWebPluginFactory::supportsExtension(Extension extension) const
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
index 6c26bd7..7179eaa 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -63,6 +63,16 @@ void QWEBKIT_EXPORT qt_drt_setDomainRelaxationForbiddenForURLScheme(bool forbidd
\c{http://www.malicious.com/evil.html} from accessing \c{http://www.example.com/}'s resources,
because they are of a different security origin.
+ By default local schemes like \c{file://} and \c{qrc://} are concidered to be in the same
+ security origin, and can access each other's resources. You can add additional local schemes
+ by using QWebSecurityOrigin::addLocalScheme(), or override the default same-origin behavior
+ by setting QWebSettings::LocalContentCanAccessFileUrls to \c{false}.
+
+ \note Local resources are by default restricted from accessing remote content, which
+ means your \c{file://} will not be able to access \c{http://domain.com/foo.html}. You
+ can relax this restriction by setting QWebSettings::LocalContentCanAccessRemoteUrls to
+ \c{true}.
+
Call QWebFrame::securityOrigin() to get the QWebSecurityOrigin for a frame in a
web page, and use host(), scheme() and port() to identify the security origin.
@@ -219,7 +229,11 @@ QList<QWebDatabase> QWebSecurityOrigin::databases() const
\since 4.6
Adds the given \a scheme to the list of schemes that are considered equivalent
- to the \c file: scheme. They are not subject to cross domain restrictions.
+ to the \c file: scheme.
+
+ Cross domain restrictions depend on the two web settings QWebSettings::LocalContentCanAccessFileUrls
+ and QWebSettings::LocalContentCanAccessFileUrls. By default all local schemes are concidered to be
+ in the same security origin, and local schemes can not access remote content.
*/
void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
{
@@ -231,6 +245,9 @@ void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
Removes the given \a scheme from the list of local schemes.
+ \note You can not remove the \c{file://} scheme from the list
+ of local schemes.
+
\sa addLocalScheme()
*/
void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
@@ -240,7 +257,10 @@ void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
/*!
\since 4.6
- Returns a list of all the schemes that were set by the application as local schemes,
+ Returns a list of all the schemes concidered to be local.
+
+ By default this is \c{file://} and \c{qrc://}.
+
\sa addLocalScheme(), removeLocalScheme()
*/
QStringList QWebSecurityOrigin::localSchemes()
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 2305c7f..115f9fc 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -289,8 +289,8 @@ QWebSettings* QWebSettings::globalSettings()
function. The \l{QWebSettings::WebAttribute}{WebAttribute} enum further describes
each attribute.
- QWebSettings also configures global properties such as the Web page memory
- cache and the Web page icon database, local database storage and offline
+ QWebSettings also configures global properties such as the web page memory
+ cache, icon database, local database storage and offline
applications storage.
\section1 Enabling Plugins
@@ -299,8 +299,8 @@ QWebSettings* QWebSettings::globalSettings()
\l{QWebSettings::PluginsEnabled}{PluginsEnabled} attribute. For many applications,
this attribute is enabled for all pages by setting it on the
\l{globalSettings()}{global settings object}. QtWebKit will always ignore this setting
- \when processing Qt plugins. The decision to allow a Qt plugin is made by the client
- \in its reimplementation of QWebPage::createPlugin.
+ when processing Qt plugins. The decision to allow a Qt plugin is made by the client
+ in its reimplementation of QWebPage::createPlugin().
\section1 Web Application Support
@@ -339,7 +339,7 @@ QWebSettings* QWebSettings::globalSettings()
\value MinimumFontSize The hard minimum font size.
\value MinimumLogicalFontSize The minimum logical font size that is applied
- after zooming with QWebFrame's textSizeMultiplier().
+ when zooming out with QWebFrame::setTextSizeMultiplier().
\value DefaultFontSize The default font size for regular text.
\value DefaultFixedFontSize The default font size for fixed-pitch text.
*/
@@ -361,66 +361,74 @@ QWebSettings* QWebSettings::globalSettings()
This enum describes various attributes that are configurable through QWebSettings.
\value AutoLoadImages Specifies whether images are automatically loaded in
- web pages.
+ web pages. This is enabled by default.
\value DnsPrefetchEnabled Specifies whether QtWebkit will try to pre-fetch DNS entries to
- speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later.
+ speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later. This is disabled by default.
\value JavascriptEnabled Enables or disables the running of JavaScript
- programs.
+ programs. This is enabled by default
\value JavaEnabled Enables or disables Java applets.
Currently Java applets are not supported.
- \value PluginsEnabled Enables or disables plugins in Web pages. Qt plugins
- with a mimetype such as "application/x-qt-plugin" are not affected by this setting.
+ \value PluginsEnabled Enables or disables plugins in Web pages (e.g. using NPAPI). Qt plugins
+ with a mimetype such as "application/x-qt-plugin" are not affected by this setting. This is disabled by default.
\value PrivateBrowsingEnabled Private browsing prevents WebKit from
- recording visited pages in the history and storing web page icons.
+ recording visited pages in the history and storing web page icons. This is disabled by default.
\value JavascriptCanOpenWindows Specifies whether JavaScript programs
- can open new windows.
+ can open new windows. This is disabled by default.
\value JavascriptCanAccessClipboard Specifies whether JavaScript programs
- can read or write to the clipboard.
+ can read or write to the clipboard. This is disabled by default.
\value DeveloperExtrasEnabled Enables extra tools for Web developers.
Currently this enables the "Inspect" element in the context menu as
- well as the use of QWebInspector which controls the WebKit WebInspector
- for web site debugging.
+ well as the use of QWebInspector which controls the web inspector
+ for web site debugging. This is disabled by default.
\value SpatialNavigationEnabled Enables or disables the Spatial Navigation
feature, which consists in the ability to navigate between focusable
elements in a Web page, such as hyperlinks and form controls, by using
- Left, Right, Up and Down arrow keys. For example, if an user presses the
+ Left, Right, Up and Down arrow keys. For example, if a user presses the
Right key, heuristics determine whether there is an element he might be
- trying to reach towards the right, and if there are multiple elements,
- which element he probably wants.
+ trying to reach towards the right and which element he probably wants.
+ This is disabled by default.
\value LinksIncludedInFocusChain Specifies whether hyperlinks should be
- included in the keyboard focus chain.
- \value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
- only the text or all content.
+ included in the keyboard focus chain. This is enabled by default.
+ \value ZoomTextOnly Specifies whether the zoom factor on a frame applies
+ only to the text or to all content. This is disabled by default.
\value PrintElementBackgrounds Specifies whether the background color and images
- are also drawn when the page is printed.
+ are also drawn when the page is printed. This is enabled by default.
\value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5
- offline storage feature is enabled or not. Disabled by default.
+ offline storage feature is enabled or not. This is disabled by default.
\value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5
- web application cache feature is enabled or not. Disabled by default.
+ web application cache feature is enabled or not. This is disabled by default.
\value LocalStorageEnabled Specifies whether support for the HTML 5
- local storage feature is enabled or not. Disabled by default.
+ local storage feature is enabled or not. This is disabled by default.
\value LocalStorageDatabaseEnabled \e{This enum value is deprecated.} Use
QWebSettings::LocalStorageEnabled instead.
- \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls.
- \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are allowed to access other local urls.
- \value XSSAuditorEnabled Specifies whether load requests should be monitored for cross-site scripting attempts.
+ \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are
+ allowed to access remote urls. This is disabled by default. For more information
+ about security origins and local vs. remote content see QWebSecurityOrigin.
+ \value LocalContentCanAccessFileUrls Specifies whether locally loaded documents are
+ allowed to access other local urls. This is enabled by default. For more information
+ about security origins and local vs. remote content see QWebSecurityOrigin.
+ \value XSSAuditingEnabled Specifies whether load requests should be monitored for cross-site
+ scripting attempts. Suspicious scripts will be blocked and reported in the inspector's
+ JavaScript console. Enabling this feature might have an impact on performance
+ and it is disabled by default.
\value AcceleratedCompositingEnabled This feature, when used in conjunction with
QGraphicsWebView, accelerates animations of web content. CSS animations of the transform and
opacity properties will be rendered by composing the cached content of the animated elements.
- This feature is enabled by default
+ This is enabled by default.
\value TiledBackingStoreEnabled This setting enables the tiled backing store feature
for a QGraphicsWebView. With the tiled backing store enabled, the web page contents in and around
the current visible area is speculatively cached to bitmap tiles. The tiles are automatically kept
in sync with the web page as it changes. Enabling tiling can significantly speed up painting heavy
operations like scrolling. Enabling the feature increases memory consumption. It does not work well
with contents using CSS fixed positioning (see also \l{QGraphicsWebView::}{resizesToContents} property).
- \l{QGraphicsWebView::}{tiledBackingStoreFrozen} property allows application to temporarily freeze the contents of the backing store.
+ \l{QGraphicsWebView::}{tiledBackingStoreFrozen} property allows application to temporarily
+ freeze the contents of the backing store. This is disabled by default.
\value FrameFlatteningEnabled With this setting each subframe is expanded to its contents.
On touch devices, it is desired to not have any scrollable sub parts of the page
as it results in a confusing user experience, with scrolling sometimes scrolling sub parts
and at other times scrolling the page itself. For this reason iframes and framesets are
barely usable on touch devices. This will flatten all the frames to become one scrollable page.
- Disabled by default.
+ This is disabled by default.
*/
/*!
@@ -454,7 +462,6 @@ QWebSettings::QWebSettings()
d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false);
d->attributes.insert(QWebSettings::LocalContentCanAccessFileUrls, true);
d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, true);
- d->attributes.insert(QWebSettings::WebGLEnabled, false);
d->attributes.insert(QWebSettings::TiledBackingStoreEnabled, false);
d->attributes.insert(QWebSettings::FrameFlatteningEnabled, false);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
@@ -526,7 +533,8 @@ void QWebSettings::resetFontSize(FontSize type)
with UTF-8 and Base64 encoded data, such as:
"data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow=="
- NOTE: In case the base 64 data is not valid the style will not be applied.
+
+ \note If the base64 data is not valid, the style will not be applied.
\sa userStyleSheetUrl()
*/
@@ -577,9 +585,11 @@ QString QWebSettings::defaultTextEncoding() const
Sets the path of the icon database to \a path. The icon database is used
to store "favicons" associated with web sites.
- \a path must point to an existing directory where the icons are stored.
+ \a path must point to an existing directory.
Setting an empty path disables the icon database.
+
+ \sa iconDatabasePath(), clearIconDatabase()
*/
void QWebSettings::setIconDatabasePath(const QString& path)
{
@@ -622,7 +632,7 @@ void QWebSettings::clearIconDatabase()
/*!
Returns the web site's icon for \a url.
- If the web site does not specify an icon, or the icon is not in the
+ If the web site does not specify an icon \bold OR if the icon is not in the
database, a null QIcon is returned.
\note The returned icon's size is arbitrary.
@@ -659,7 +669,7 @@ QWebPluginDatabase *QWebSettings::pluginDatabase()
Sets \a graphic to be drawn when QtWebKit needs to draw an image of the
given \a type.
- For example, when an image cannot be loaded the pixmap specified by
+ For example, when an image cannot be loaded, the pixmap specified by
\l{QWebSettings::WebGraphic}{MissingImageGraphic} is drawn instead.
\sa webGraphic()
@@ -677,9 +687,6 @@ void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap& graphic)
Returns a previously set pixmap used to draw replacement graphics of the
specified \a type.
- For example, when an image cannot be loaded the pixmap specified by
- \l{QWebSettings::WebGraphic}{MissingImageGraphic} is drawn instead.
-
\sa setWebGraphic()
*/
QPixmap QWebSettings::webGraphic(WebGraphic type)
@@ -720,8 +727,7 @@ void QWebSettings::clearMemoryCaches()
Sets the maximum number of pages to hold in the memory page cache to \a pages.
The Page Cache allows for a nicer user experience when navigating forth or back
- to pages in the forward/back history, by pausing and resuming up to \a pages
- per page group.
+ to pages in the forward/back history, by pausing and resuming up to \a pages.
For more information about the feature, please refer to:
@@ -793,8 +799,8 @@ QString QWebSettings::fontFamily(FontFamily which) const
}
/*!
- Resets the actual font family to the default font family, specified by
- \a which.
+ Resets the actual font family specified by \a which to the one set
+ in the global QWebSettings instance.
This function has no effect on the global QWebSettings instance.
*/
@@ -836,7 +842,9 @@ bool QWebSettings::testAttribute(WebAttribute attr) const
/*!
\fn void QWebSettings::resetAttribute(WebAttribute attribute)
- Resets the setting of \a attribute.
+ Resets the setting of \a attribute to the value specified in the
+ global QWebSettings instance.
+
This function has no effect on the global QWebSettings instance.
\sa globalSettings()
@@ -852,12 +860,15 @@ void QWebSettings::resetAttribute(WebAttribute attr)
/*!
\since 4.5
- Sets the path for HTML5 offline storage to \a path.
+ Sets \a path as the save location for HTML5 client-side database storage data.
- \a path must point to an existing directory where the databases are stored.
+ \a path must point to an existing directory.
Setting an empty path disables the feature.
+ Support for client-side databases can enabled by setting the
+ \l{QWebSettings::OfflineStorageDatabaseEnabled}{OfflineStorageDatabaseEnabled} attribute.
+
\sa offlineStoragePath()
*/
void QWebSettings::setOfflineStoragePath(const QString& path)
@@ -870,7 +881,7 @@ void QWebSettings::setOfflineStoragePath(const QString& path)
/*!
\since 4.5
- Returns the path of the HTML5 offline storage or an empty string if the
+ Returns the path of the HTML5 client-side database storage or an empty string if the
feature is disabled.
\sa setOfflineStoragePath()
@@ -907,22 +918,24 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
/*!
\since 4.6
- \relates QWebSettings
Sets the path for HTML5 offline web application cache storage to \a path.
An application cache acts like an HTTP cache in some sense. For documents
- that use the application cache via JavaScript, the loader mechinery will
+ that use the application cache via JavaScript, the loader engine will
first ask the application cache for the contents, before hitting the
network.
The feature is described in details at:
http://dev.w3.org/html5/spec/Overview.html#appcache
- \a path must point to an existing directory where the cache is stored.
+ \a path must point to an existing directory.
Setting an empty path disables the feature.
+ Support for offline web application cache storage can enabled by setting the
+ \l{QWebSettings::OfflineWebApplicationCacheEnabled}{OfflineWebApplicationCacheEnabled} attribute.
+
\sa offlineWebApplicationCachePath()
*/
void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
@@ -934,7 +947,6 @@ void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
/*!
\since 4.6
- \relates QWebSettings
Returns the path of the HTML5 offline web application cache storage
or an empty string if the feature is disabled.
@@ -981,7 +993,6 @@ qint64 QWebSettings::offlineWebApplicationCacheQuota()
/*!
\since 4.6
- \relates QWebSettings
Sets the path for HTML5 local storage to \a path.
@@ -1026,7 +1037,6 @@ QUrl QWebSettings::inspectorUrl() const
/*!
\since 4.6
- \relates QWebSettings
Returns the path for HTML5 local storage.
@@ -1039,13 +1049,14 @@ QString QWebSettings::localStoragePath() const
/*!
\since 4.6
- \relates QWebSettings
- Enables WebKit persistent data and sets the path to \a path.
- If the \a path is empty the path for persistent data is set to the
- user-specific data location specified by
- \l{QDesktopServices::DataLocation}{DataLocation}.
-
+ Enables WebKit data persistence and sets the path to \a path.
+ If \a path is empty, the user-specific data location specified by
+ \l{QDesktopServices::DataLocation}{DataLocation} will be used instead.
+
+ This method will simultaneously set and enable the iconDatabasePath(),
+ localStoragePath(), offlineStoragePath() and offlineWebApplicationCachePath().
+
\sa localStoragePath()
*/
void QWebSettings::enablePersistentStorage(const QString& path)
@@ -1053,8 +1064,9 @@ void QWebSettings::enablePersistentStorage(const QString& path)
QString storagePath;
if (path.isEmpty()) {
+#ifndef QT_NO_DESKTOPSERVICES
storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-
+#endif
if (storagePath.isEmpty())
storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
} else
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
index caba0d5..3592e2c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -63,14 +63,13 @@ public:
OfflineStorageDatabaseEnabled,
OfflineWebApplicationCacheEnabled,
LocalStorageEnabled,
-#ifdef QT_DEPRECATED
+#if defined(QT_DEPRECATED) || defined(qdoc)
LocalStorageDatabaseEnabled = LocalStorageEnabled,
#endif
LocalContentCanAccessRemoteUrls,
DnsPrefetchEnabled,
XSSAuditorEnabled,
AcceleratedCompositingEnabled,
- WebGLEnabled,
SpatialNavigationEnabled,
LocalContentCanAccessFileUrls,
TiledBackingStoreEnabled,
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 6e450c2..efc8f27 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,203 @@
+2010-05-14 Kent Hansen <kent.hansen@nokia.com>, Jocelyn Turcotte <jocelyn.turcotte@nokia.com>, Tor Arne Vestbø <tor.arne.vestbo@nokia.com>, Henry Haverinen <henry.haverinen@nokia.com>, Jedrzej Nowacki <jedrzej.nowacki@nokia.com>, Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Merge overhaul of the QtWebKit API documentation
+
+ Numerous improvements in wording, qdoc warning fixes and
+ clarifications, done in a team work effort.
+
+ No functional changes.
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebinspector.cpp:
+ * Api/qwebkitversion.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebsecurityorigin.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+ * docs/qtwebkit.qdoc:
+ * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp:
+ (wrapInFunction):
+ * docs/webkitsnippets/webelement/main.cpp:
+ (findButtonAndClick):
+ (autocomplete1):
+ (autocomplete2):
+ (main):
+
+2010-05-14 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Documentation: Fix overview grouping.
+
+ * docs/qtwebkit.qdoc:
+
+2010-05-14 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [QT] Update the Symbian version for the user agent
+ https://bugs.webkit.org/show_bug.cgi?id=38389
+
+ Update the user agent for Symbian^2 to Symbian^4
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2010-05-11 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] emit initialLayoutCompleted signal from FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout
+ https://bugs.webkit.org/show_bug.cgi?id=38921
+
+ Emit initialLayoutCompleted signal from FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout
+ instead of FrameLoaderClientQt::dispatchDidFirstLayout , because the former ensures that a
+ visual content layed out on the frame.
+
+ It matches to QWebFrame::initialLayoutCompleted signal documentation at:
+
+ "... This is the first time you will see contents displayed on the frame ..."
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout):
+
+2010-05-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] REGRESSION(r58497) tst_QGraphicsWebView::crashOnViewlessWebPages() is failing
+ https://bugs.webkit.org/show_bug.cgi?id=38655
+
+ Fix double free by moving the connect till after the resize.
+
+ The bug is causes by the fact that a resize of an empty page causes a
+ layout, thus deleting the qgraphicswebview before setHtml is called,
+ which then deletes it again, causing a double free.
+
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::crashOnViewlessWebPages):
+
+2010-05-11 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] tst_QWebPage::inputMethods failing on Maemo5
+ https://bugs.webkit.org/show_bug.cgi?id=38685
+
+ Check if the SIP (Software Input Panel) is triggered, which normally
+ happens on mobile platforms, when a user input form receives a mouse click.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2010-05-09 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used
+ https://bugs.webkit.org/show_bug.cgi?id=38574
+
+ The fix uses a QWeakPointer for rootGraphicsLayer, protecting from a crash in case the layer is deleted before the QGraphicsWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate):
+ (QGraphicsWebViewPrivate::setRootGraphicsLayer):
+ (QGraphicsWebViewPrivate::updateCompositingScrollPosition):
+
+2010-05-03 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Expose HTMLTokenizer yielding parameters
+ https://bugs.webkit.org/show_bug.cgi?id=37023
+
+ Enables to set TimeDelay and ChunkSize for
+ HTMLTokenizer.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dynamicPropertyChangeEvent):
+
+2010-05-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QWebPage viewMode property
+ https://bugs.webkit.org/show_bug.cgi?id=38119
+
+ Rename the property from wrt_viewMode to _q_viewMode.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dynamicPropertyChangeEvent):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::viewModes):
+
+2010-04-28 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QWebPage viewMode property
+ https://bugs.webkit.org/show_bug.cgi?id=38119
+
+ Replacing method qt_wrt_setViewMode by wrt_viewMode property.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dynamicPropertyChangeEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::wrt_viewModes):
+
+2010-04-09 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt]Fix compile error with QT_NO_IM
+ https://bugs.webkit.org/show_bug.cgi?id=36533
+
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopupCombo::hidePopup):
+
+2010-04-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt]Fix compile error with QT_NO_SETTINGS
+ https://bugs.webkit.org/show_bug.cgi?id=36533
+
+ If QT_NO_SETTINGS is defined, QSettings is not available.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::populateSetting):
+ (WebCore::InspectorClientQt::storeSetting):
+
+2010-03-25 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt]Fix compile error with QT_NO_DESKTOPSERVICES
+ https://bugs.webkit.org/show_bug.cgi?id=36533
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::enablePersistentStorage):
+
+2010-03-25 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt]Fix compile error with QT_NO_DEBUG_STREAM
+ https://bugs.webkit.org/show_bug.cgi?id=36533
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::graphicsItemVisibleRect):
+
2010-04-29 Janne Koskinen <janne.p.koskinen@digia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 4ad008b..686bfcc 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -414,13 +414,13 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
void FrameLoaderClientQt::dispatchDidFirstLayout()
{
- if (m_webFrame)
- emit m_webFrame->initialLayoutCompleted();
+ notImplemented();
}
void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout()
{
- notImplemented();
+ if (m_webFrame)
+ emit m_webFrame->initialLayoutCompleted();
}
void FrameLoaderClientQt::dispatchShow()
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index c0c78ba..7fabbda 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -110,6 +110,11 @@ void InspectorClientQt::hideHighlight()
void InspectorClientQt::populateSetting(const String& key, String* setting)
{
+#ifdef QT_NO_SETTINGS
+ Q_UNUSED(key)
+ Q_UNUSED(setting)
+ qWarning("QWebInspector: QSettings is not supported by Qt.");
+#else
QSettings qsettings;
if (qsettings.status() == QSettings::AccessError) {
// QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called
@@ -123,10 +128,16 @@ void InspectorClientQt::populateSetting(const String& key, String* setting)
QVariant storedValue = qsettings.value(settingKey);
storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
*setting = variantToSetting(storedValue);
+#endif // QT_NO_SETTINGS
}
void InspectorClientQt::storeSetting(const String& key, const String& setting)
{
+#ifdef QT_NO_SETTINGS
+ Q_UNUSED(key)
+ Q_UNUSED(setting)
+ qWarning("QWebInspector: QSettings is not supported by Qt.");
+#else
QSettings qsettings;
if (qsettings.status() == QSettings::AccessError) {
qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
@@ -138,6 +149,7 @@ void InspectorClientQt::storeSetting(const String& key, const String& setting)
QString settingKey(settingStoragePrefix + QString(key));
qsettings.setValue(settingKey, valueToStore);
qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
+#endif // QT_NO_SETTINGS
}
static String variantToSetting(const QVariant& qvariant)
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index 65a28fe..7514077 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -55,6 +55,7 @@ void QtFallbackWebPopupCombo::showPopup()
void QtFallbackWebPopupCombo::hidePopup()
{
+#ifndef QT_NO_IM
QWidget* activeFocus = QApplication::focusWidget();
if (activeFocus && activeFocus == QComboBox::view()
&& activeFocus->testAttribute(Qt::WA_InputMethodEnabled)) {
@@ -64,6 +65,7 @@ void QtFallbackWebPopupCombo::hidePopup()
qic->setFocusWidget(0);
}
}
+#endif // QT_NO_IM
QComboBox::hidePopup();
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
index 9e653e4..c6dd550 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
@@ -5,63 +5,11 @@
\previouspage QtSvg
\nextpage QtXml
\ingroup modules
+ \ingroup technology-apis
+
\brief The QtWebKit module provides a web browser engine as well as
classes to render and interact with web content.
- To include the definitions of the module's classes, use the
- following directive:
-
- \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
-
- To link against the module, add this line to your \l qmake \c
- .pro file:
-
- \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
-
- \section1 License Information
-
- This is a snapshot of the Qt port of WebKit. The exact version information
- can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
-
- Qt Commercial Edition licensees that wish to distribute applications that
- use the QtWebKit module need to be aware of their obligations under the
- GNU Library General Public License (LGPL).
-
- Developers using the Open Source Edition can choose to redistribute
- the module under the appropriate version of the GNU LGPL.
-
- \legalese
- WebKit is licensed under the GNU Library General Public License.
- Individual contributor names and copyright dates can be found
- inline in the code.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- \endlegalese
-*/
-
-/*!
- \page webintegration.html
- \title Integrating Web Content with QtWebKit
- \since 4.4
-
- \ingroup frameworks-technologies
-
- \keyword Browser
- \keyword Web Browser
-
QtWebKit provides a Web browser engine that makes it easy to embed content
from the World Wide Web into your Qt application. At the same time Web
content can be enhanced with native controls.
@@ -83,6 +31,20 @@
QtWebKit is based on the Open Source WebKit engine. More information about
WebKit itself can be found on the \l{WebKit Open Source Project} Web site.
+ \section1 Including In Your Project
+
+ To include the definitions of the module's classes, use the
+ following directive:
+
+ \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
+
+ To link against the module, add this line to your \l qmake \c
+ .pro file:
+
+ \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
+
+ \section1 Notes
+
\note Building the QtWebKit module with debugging symbols is problematic
on many platforms due to the size of the WebKit engine. We recommend
building the module only in release mode for embedded platforms.
@@ -97,10 +59,6 @@
Embedded Linux systems. See the \l{Qt for Embedded Linux Requirements}
document for more information.
- Topics:
-
- \tableofcontents
-
\section1 Architecture
The easiest way to render content is through the QWebView class. As a
@@ -193,4 +151,39 @@
\o The system \c{/Library/Internet Plug-Ins} directory
\endlist
\endtable
+
+
+ \section1 License Information
+
+ This is a snapshot of the Qt port of WebKit. The exact version information
+ can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
+
+ Qt Commercial Edition licensees that wish to distribute applications that
+ use the QtWebKit module need to be aware of their obligations under the
+ GNU Library General Public License (LGPL).
+
+ Developers using the Open Source Edition can choose to redistribute
+ the module under the appropriate version of the GNU LGPL.
+
+ \legalese
+ WebKit is licensed under the GNU Library General Public License.
+ Individual contributor names and copyright dates can be found
+ inline in the code.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ \endlegalese
*/
+
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
index a6b6620..07f1d45 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
@@ -9,8 +9,6 @@ void wrapInFunction()
QWebInspector *inspector = new QWebInspector;
inspector->setPage(page);
-
- connect(page, SIGNAL(webInspectorTriggered(QWebElement)), inspector, SLOT(show()));
//! [0]
}
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
index 822b61c..b1781a6 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
@@ -36,6 +36,59 @@ static void traverse()
//! [Traversing with QWebElement]
}
+static void findButtonAndClick()
+{
+
+ frame->setHtml("<form name=\"myform\" action=\"submit_form.asp\" method=\"get\">"
+ "<input type=\"text\" name=\"myfield\">"
+ "<input type=\"submit\" value=\"Submit\">"
+ "</form>");
+
+//! [Calling a DOM element method]
+
+ QWebElement document = frame->documentElement();
+ /* Assume that the document has the following structure:
+
+ <form name="myform" action="submit_form.asp" method="get">
+ <input type="text" name="myfield">
+ <input type="submit" value="Submit">
+ </form>
+
+ */
+
+ QWebElement button = document.findFirst("input[type=submit]");
+ button.evaluateJavaScript("click()");
+
+//! [Calling a DOM element method]
+
+ }
+
+static void autocomplete1()
+{
+ QWebElement document = frame->documentElement();
+
+//! [autocomplete1]
+ QWebElement firstTextInput = document.findFirst("input[type=text]");
+ QString storedText = firstTextInput.attribute("value");
+//! [autocomplete1]
+
+}
+
+
+static void autocomplete2()
+{
+
+ QWebElement document = frame->documentElement();
+ QString storedText = "text";
+
+//! [autocomplete2]
+ QWebElement firstTextInput = document.findFirst("input[type=text]");
+ textInput.setAttribute("value", storedText);
+//! [autocomplete2]
+
+}
+
+
static void findAll()
{
//! [FindAll]
@@ -65,5 +118,8 @@ int main(int argc, char *argv[])
frame = view->page()->mainFrame();
traverse();
findAll();
+ findButtonAndClick();
+ autocomplete1();
+ autocomplete2();
return 0;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def
index a450f9e..910ba8f 100644
--- a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def
+++ b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def
@@ -642,7 +642,7 @@ EXPORTS
?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 641 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &)
?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 642 NONAME ; void qt_drt_webinspector_show(class QWebPage *)
?qt_drt_workerThreadCount@@YAHXZ @ 643 NONAME ; int qt_drt_workerThreadCount(void)
- ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &)
+ ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ABSENT ; void qt_wrt_setViewMode(class QWebPage *, class QString const &)
?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 645 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &)
?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 646 NONAME ; bool QGraphicsWebView::resizesToContents(void) const
?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 647 NONAME ; void QWebFrame::scrollToAnchor(class QString const &)
diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
index 145fe0b..ca462d0 100644
--- a/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -716,7 +716,7 @@ EXPORTS
_ZN13QWebInspector10closeEventEP11QCloseEvent @ 715 NONAME
_ZN16QGraphicsWebView26setTiledBackingStoreFrozenEb @ 716 NONAME
_ZNK16QGraphicsWebView25isTiledBackingStoreFrozenEv @ 717 NONAME
- _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME
+ _Z18qt_wrt_setViewModeP8QWebPageRK7QString @ 718 NONAME ABSENT
_Z19qt_drt_setMediaTypeP9QWebFrameRK7QString @ 719 NONAME
_Z26qt_drt_enableCaretBrowsingP8QWebPageb @ 720 NONAME
_ZNK12QWebSettings12inspectorUrlEv @ 721 NONAME
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index 14f5820..ebe847d 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -84,16 +84,19 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
WebPage* page = new WebPage;
webView->setPage(page);
page->webView = webView;
- connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
-
scene.addItem(webView);
view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
view.resize(600, 480);
webView->resize(view.geometry().size());
+
QCoreApplication::processEvents();
view.show();
+ // Resizing the page will resize and layout the empty "about:blank"
+ // page, so we first connect the signal afterward.
+ connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
+
page->mainFrame()->setHtml(QString("data:text/html,"
"<frameset cols=\"25%,75%\">"
"<frame src=\"data:text/html,foo \">"
@@ -101,6 +104,7 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
"</frameset>"));
QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
+ delete page;
}
void tst_QGraphicsWebView::microFocusCoordinates()
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index f7eddd5..12fb9b3 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -26,6 +26,7 @@
#include <QLocale>
#include <QMenu>
#include <QPushButton>
+#include <QStyle>
#include <QtTest/QtTest>
#include <QTextCharFormat>
#include <qgraphicsscene.h>
@@ -110,6 +111,8 @@ private slots:
void userAgentApplicationName();
void userAgentLocaleChange();
+ void viewModes();
+
void crashTests_LazyInitializationOfMainFrame();
void screenshot_data();
@@ -357,6 +360,21 @@ void tst_QWebPage::userStyleSheet()
QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png"));
}
+void tst_QWebPage::viewModes()
+{
+ m_view->setHtml("<body></body>");
+ m_page->setProperty("_q_viewMode", "minimized");
+
+ QVariant empty = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode)\")");
+ QVERIFY(empty.type() == QVariant::Bool && empty.toBool());
+
+ QVariant minimized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: minimized)\")");
+ QVERIFY(minimized.type() == QVariant::Bool && minimized.toBool());
+
+ QVariant maximized = m_page->mainFrame()->evaluateJavaScript("window.styleMedia.matchMedium(\"(-webkit-view-mode: maximized)\")");
+ QVERIFY(maximized.type() == QVariant::Bool && !maximized.toBool());
+}
+
void tst_QWebPage::modified()
{
m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>blub"));
@@ -1350,7 +1368,27 @@ void tst_QWebPage::inputMethods()
page->event(&evrel);
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+ // This part of the test checks if the SIP (Software Input Panel) is triggered,
+ // which normally happens on mobile platforms, when a user input form receives
+ // a mouse click.
+ int inputPanel = 0;
+ if (viewType == "QWebView") {
+ if (QWebView* wv = qobject_cast<QWebView*>(view))
+ inputPanel = wv->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel);
+ } else if (viewType == "QGraphicsWebView") {
+ if (QGraphicsWebView* wv = qobject_cast<QGraphicsWebView*>(view))
+ inputPanel = wv->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel);
+ }
+
+ // For non-mobile platforms RequestSoftwareInputPanel event is not called
+ // because there is no SIP (Software Input Panel) triggered. In the case of a
+ // mobile platform, an input panel, e.g. virtual keyboard, is usually invoked
+ // and the RequestSoftwareInputPanel event is called. For these two situations
+ // this part of the test can verified as the checks below.
+ if (inputPanel)
+ QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+ else
+ QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
#endif
viewEventSpy.clear();
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 01570ad..04342e7 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -369,6 +369,9 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
if (state == newState)
return;
+ if (loopCount == 0)
+ return;
+
QAbstractAnimation::State oldState = state;
int oldCurrentTime = currentTime;
int oldCurrentLoop = currentLoop;
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp
index 69daae7..6136742 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian.cpp
+++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp
@@ -106,7 +106,7 @@ void QNotifyChangeEvent::DoCancel()
}
QSymbianFileSystemWatcherEngine::QSymbianFileSystemWatcherEngine() :
- errorCode(KErrNone), watcherStarted(false)
+ watcherStarted(false)
{
moveToThread(this);
}
@@ -122,11 +122,7 @@ QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths,
QMutexLocker locker(&mutex);
QStringList p = paths;
- if (!startWatcher()) {
- qWarning("Could not start QSymbianFileSystemWatcherEngine thread");
-
- return p;
- }
+ startWatcher();
QMutableListIterator<QString> it(p);
while (it.hasNext()) {
@@ -150,18 +146,17 @@ QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths,
filePath += QChar(L'/');
}
- currentEvent = NULL;
+ currentAddEvent = NULL;
QMetaObject::invokeMethod(this,
"addNativeListener",
Qt::QueuedConnection,
Q_ARG(QString, filePath));
syncCondition.wait(&mutex);
+ if (currentAddEvent) {
+ currentAddEvent->isDir = isDir;
- if (currentEvent) {
- currentEvent->isDir = isDir;
-
- activeObjectToPath.insert(currentEvent, path);
+ activeObjectToPath.insert(currentAddEvent, path);
it.remove();
if (isDir)
@@ -185,10 +180,10 @@ QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &path
while (it.hasNext()) {
QString path = it.next();
- currentEvent = activeObjectToPath.key(path);
- if (!currentEvent)
+ currentRemoveEvent = activeObjectToPath.key(path);
+ if (!currentRemoveEvent)
continue;
- activeObjectToPath.remove(currentEvent);
+ activeObjectToPath.remove(currentRemoveEvent);
QMetaObject::invokeMethod(this,
"removeNativeListener",
@@ -202,9 +197,6 @@ QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &path
directories->removeAll(path);
}
- if (activeObjectToPath.size() == 0)
- stop();
-
return p;
}
@@ -228,44 +220,31 @@ void QSymbianFileSystemWatcherEngine::stop()
}
// This method must be called inside mutex
-bool QSymbianFileSystemWatcherEngine::startWatcher()
+void QSymbianFileSystemWatcherEngine::startWatcher()
{
- bool retval = true;
-
if (!watcherStarted) {
setStackSize(0x5000);
start();
syncCondition.wait(&mutex);
-
- if (errorCode != KErrNone) {
- retval = false;
- } else {
- watcherStarted = true;
- }
+ watcherStarted = true;
}
- return retval;
}
void QSymbianFileSystemWatcherEngine::run()
{
- // Initialize file session
-
mutex.lock();
syncCondition.wakeOne();
mutex.unlock();
- if (errorCode == KErrNone) {
- exec();
+ exec();
- foreach(QNotifyChangeEvent *e, activeObjectToPath.keys()) {
- e->Cancel();
- delete e;
- }
-
- activeObjectToPath.clear();
- watcherStarted = false;
+ foreach(QNotifyChangeEvent *e, activeObjectToPath.keys()) {
+ e->Cancel();
+ delete e;
}
+
+ activeObjectToPath.clear();
}
void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directoryPath)
@@ -273,16 +252,16 @@ void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directory
QMutexLocker locker(&mutex);
QString nativeDir(QDir::toNativeSeparators(directoryPath));
TPtrC ptr(qt_QString2TPtrC(nativeDir));
- currentEvent = new QNotifyChangeEvent(qt_s60GetRFs(), ptr, this, directoryPath.endsWith(QChar(L'/'), Qt::CaseSensitive));
+ currentAddEvent = new QNotifyChangeEvent(qt_s60GetRFs(), ptr, this, directoryPath.endsWith(QChar(L'/'), Qt::CaseSensitive));
syncCondition.wakeOne();
}
void QSymbianFileSystemWatcherEngine::removeNativeListener()
{
QMutexLocker locker(&mutex);
- currentEvent->Cancel();
- delete currentEvent;
- currentEvent = NULL;
+ currentRemoveEvent->Cancel();
+ delete currentRemoveEvent;
+ currentRemoveEvent = NULL;
syncCondition.wakeOne();
}
diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h
index 7e3f045..e687a4a 100644
--- a/src/corelib/io/qfilesystemwatcher_symbian_p.h
+++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h
@@ -113,14 +113,14 @@ private:
friend class QNotifyChangeEvent;
void emitPathChanged(QNotifyChangeEvent *e);
- bool startWatcher();
+ void startWatcher();
QHash<QNotifyChangeEvent*, QString> activeObjectToPath;
QMutex mutex;
QWaitCondition syncCondition;
- int errorCode;
bool watcherStarted;
- QNotifyChangeEvent *currentEvent;
+ QNotifyChangeEvent *currentAddEvent;
+ QNotifyChangeEvent *currentRemoveEvent;
};
#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index bb11d6b..223df9b 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -810,6 +810,9 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
}
}
+ if (!maxSize)
+ return readSoFar;
+
if ((d->openMode & Unbuffered) == 0 && maxSize < QIODEVICE_BUFFERSIZE) {
// In buffered mode, we try to fill up the QIODevice buffer before
// we do anything else.
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 4e580dd..d4b8b5f 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -5557,6 +5557,12 @@ QUrl QUrl::resolved(const QUrl &relative) const
removeDotsFromPath(&t.d->encodedPath);
t.d->path.clear();
+#if defined(QURL_DEBUG)
+ qDebug("QUrl(\"%s\").resolved(\"%s\") = \"%s\"",
+ toEncoded().constData(),
+ relative.toEncoded().constData(),
+ t.toEncoded().constData());
+#endif
return t;
}
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index b0503be..3660a3c 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2530,6 +2530,62 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
condition is true, in which case you should abort your move
operation.
+ \table 80%
+ \row
+ \o \inlineimage modelview-move-rows-1.png Moving rows to another parent
+ \o Specify the first and last row numbers for the span of rows in
+ the source parent you want to move in the model. Also specify
+ the row in the destination parent to move the span to.
+
+ For example, as shown in the diagram, we move three rows from
+ row 2 to 4 in the source, so \a sourceFirst is 2 and \a sourceLast is 4.
+ We move those items to above row 2 in the destination, so \a destinationRow is 2.
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 6
+
+ This moves the three rows rows 2, 3, and 4 in the source to become 2, 3 and 4 in
+ the destination. Other affected siblings are displaced accordingly.
+ \row
+ \o \inlineimage modelview-move-rows-2.png Moving rows to append to another parent
+ \o To append rows to another parent, move them to after the last row.
+
+ For example, as shown in the diagram, we move three rows to a
+ collection of 6 existing rows (ending in row 5), so \a destinationStart is 6:
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 7
+
+ This moves the target rows to the end of the target parent as 6, 7 and 8.
+ \row
+ \o \inlineimage modelview-move-rows-3.png Moving rows in the same parent up
+ \o To move rows within the same parent, specify the row to move them to.
+
+ For example, as shown in the diagram, we move one item from row 2 to row 0,
+ so \a sourceFirst and \a sourceLast are 2 and \a destinationChild is 0.
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 8
+
+ Note that other rows may be displaced accordingly. Note also that when moving
+ items within the same parent you should not attempt invalid or no-op moves. In
+ the above example, item 2 is at row 2 before the move, so it can not be moved
+ to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where
+ it is already)
+
+ \row
+ \o \inlineimage modelview-move-rows-4.png Moving rows in the same parent down
+ \o To move rows within the same parent, specify the row to move them to.
+
+ For example, as shown in the diagram, we move one item from row 2 to row 4,
+ so \a sourceFirst and \a sourceLast are 2 and \a destinationChild is 4.
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 9
+
+ Note that other rows may be displaced accordingly.
+ \endtable
+
+ \note This function emits the rowsAboutToBeInserted() signal which
+ connected views (or proxies) must handle before the data is inserted.
+ Otherwise, the views may end up in an invalid state.
+
\sa endMoveRows()
\since 4.6
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 609e6b3..4e6e6b9 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -63,6 +63,7 @@
#include <qvarlengtharray.h>
#include <private/qfactoryloader_p.h>
#include <private/qfunctions_p.h>
+#include <private/qlocale_p.h>
#ifdef Q_OS_SYMBIAN
# include <exception>
@@ -521,6 +522,9 @@ QCoreApplication::QCoreApplication(int &argc, char **argv)
QFactoryLoader::refreshAll();
#endif
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+ d_func()->symbianInit();
+#endif
}
// ### move to QCoreApplicationPrivate constructor?
@@ -597,6 +601,15 @@ void QCoreApplication::init()
qt_startup_hook();
}
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+void QCoreApplicationPrivate::symbianInit()
+{
+ if (!environmentChangeNotifier)
+ environmentChangeNotifier.reset(new QEnvironmentChangeNotifier);
+}
+#endif
+
+
/*!
Destroys the QCoreApplication object.
*/
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 77188d3..e066137 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -65,6 +65,9 @@ QT_BEGIN_NAMESPACE
typedef QList<QTranslator*> QTranslatorList;
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+class QEnvironmentChangeNotifier;
+#endif
class QAbstractEventDispatcher;
class Q_CORE_EXPORT QCoreApplicationPrivate : public QObjectPrivate
@@ -113,6 +116,10 @@ public:
bool aboutToQuitEmitted;
QString cachedApplicationDirPath;
QString cachedApplicationFilePath;
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+ QScopedPointer<QEnvironmentChangeNotifier> environmentChangeNotifier;
+ void symbianInit();
+#endif
static bool isTranslatorInstalled(QTranslator *translator);
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index a6d486e..687a6d9 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -1105,3 +1105,5 @@ void CQtActiveScheduler::Error(TInt aError) const
}
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 05758ca..bc42753 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -221,6 +221,7 @@ public: // from CActiveScheduler
class Q_CORE_EXPORT QEventDispatcherSymbian : public QAbstractEventDispatcher
{
+ Q_OBJECT
Q_DECLARE_PRIVATE(QAbstractEventDispatcher)
public:
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 67ea00d..2f09b0e 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -653,14 +653,41 @@ bool QChar::isSymbol() const
\fn bool QChar::isHighSurrogate() const
Returns true if the QChar is the high part of a utf16 surrogate
- (ie. if its code point is between 0xd800 and 0xdbff).
+ (ie. if its code point is between 0xd800 and 0xdbff, inclusive).
*/
/*!
\fn bool QChar::isLowSurrogate() const
Returns true if the QChar is the low part of a utf16 surrogate
- (ie. if its code point is between 0xdc00 and 0xdfff).
+ (ie. if its code point is between 0xdc00 and 0xdfff, inclusive).
+*/
+
+/*!
+ \fn static bool QChar::isHighSurrogate(uint ucs4)
+ \since 4.7
+
+ Returns true if the UCS-4-encoded character specified by \a ucs4
+ is the high part of a utf16 surrogate
+ (ie. if its code point is between 0xd800 and 0xdbff, inclusive).
+*/
+
+/*!
+ \fn static bool QChar::isLowSurrogate(uint ucs4)
+ \since 4.7
+
+ Returns true if the UCS-4-encoded character specified by \a ucs4
+ is the high part of a utf16 surrogate
+ (ie. if its code point is between 0xdc00 and 0xdfff, inclusive).
+*/
+
+/*!
+ \fn static bool QChar::requiresSurrogates(uint ucs4)
+ \since 4.7
+
+ Returns true if the UCS-4-encoded character specified by \a ucs4
+ can be splited to the high and low parts of a utf16 surrogate
+ (ie. if its code point is greater than or equals to 0x10000).
*/
/*!
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 1432c7f..205f911 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -285,6 +285,15 @@ public:
inline void setCell(uchar cell);
inline void setRow(uchar row);
+ static inline bool isHighSurrogate(uint ucs4) {
+ return ((ucs4 & 0xfffffc00) == 0xd800);
+ }
+ static inline bool isLowSurrogate(uint ucs4) {
+ return ((ucs4 & 0xfffffc00) == 0xdc00);
+ }
+ static inline bool requiresSurrogates(uint ucs4) {
+ return (ucs4 >= 0x10000);
+ }
static inline uint surrogateToUcs4(ushort high, ushort low) {
return (uint(high)<<10) + low - 0x35fdc00;
}
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 9afcd80..9f5d8c6 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1705,7 +1705,7 @@ int QTime::secsTo(const QTime &t) const
Note that the time will wrap if it passes midnight. See addSecs()
for an example.
- \sa addSecs(), msecsTo()
+ \sa addSecs(), msecsTo(), QDateTime::addMSecs()
*/
QTime QTime::addMSecs(int ms) const
@@ -1734,7 +1734,7 @@ QTime QTime::addMSecs(int ms) const
seconds in a day, the result is always between -86400000 and
86400000 ms.
- \sa secsTo(), addMSecs()
+ \sa secsTo(), addMSecs(), QDateTime::msecsTo()
*/
int QTime::msecsTo(const QTime &t) const
@@ -2042,10 +2042,11 @@ int QTime::elapsed() const
later.
You can increment (or decrement) a datetime by a given number of
- seconds using addSecs(), or days using addDays(). Similarly you can
- use addMonths() and addYears(). The daysTo() function returns the
- number of days between two datetimes, and secsTo() returns the
- number of seconds between two datetimes.
+ milliseconds using addMSecs(), seconds using addSecs(), or days
+ using addDays(). Similarly you can use addMonths() and addYears().
+ The daysTo() function returns the number of days between two datetimes,
+ secsTo() returns the number of seconds between two datetimes, and
+ msecsTo() returns the number of milliseconds between two datetimes.
QDateTime can store datetimes as \l{Qt::LocalTime}{local time} or
as \l{Qt::UTC}{UTC}. QDateTime::currentDateTime() returns a
@@ -2719,7 +2720,7 @@ QDateTime QDateTime::addSecs(int s) const
later than the datetime of this object (or earlier if \a msecs is
negative).
- \sa addSecs(), secsTo(), addDays(), addMonths(), addYears()
+ \sa addSecs(), msecsTo(), addDays(), addMonths(), addYears()
*/
QDateTime QDateTime::addMSecs(qint64 msecs) const
{
@@ -2731,7 +2732,7 @@ QDateTime QDateTime::addMSecs(qint64 msecs) const
datetime. If the \a other datetime is earlier than this datetime,
the value returned is negative.
- \sa addDays(), secsTo()
+ \sa addDays(), secsTo(), msecsTo()
*/
int QDateTime::daysTo(const QDateTime &other) const
@@ -2766,6 +2767,33 @@ int QDateTime::secsTo(const QDateTime &other) const
}
/*!
+ Returns the number of milliseconds from this datetime to the \a other
+ datetime. If the \a other datetime is earlier than this datetime,
+ the value returned is negative.
+
+ Before performing the comparison, the two datetimes are converted
+ to Qt::UTC to ensure that the result is correct if one of the two
+ datetimes has daylight saving time (DST) and the other doesn't.
+
+ \sa addMSecs(), daysTo(), QTime::msecsTo()
+*/
+
+qint64 QDateTime::msecsTo(const QDateTime &other) const
+{
+ QDate selfDate;
+ QDate otherDate;
+ QTime selfTime;
+ QTime otherTime;
+
+ d->getUTC(selfDate, selfTime);
+ other.d->getUTC(otherDate, otherTime);
+
+ return (static_cast<qint64>(selfDate.daysTo(otherDate)) * static_cast<qint64>(MSECS_PER_DAY))
+ + static_cast<qint64>(selfTime.msecsTo(otherTime));
+}
+
+
+/*!
\fn QDateTime QDateTime::toTimeSpec(Qt::TimeSpec specification) const
Returns a copy of this datetime configured to use the given time
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index f445f1c..2466aeb 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -251,6 +251,7 @@ public:
inline QDateTime toUTC() const { return toTimeSpec(Qt::UTC); }
int daysTo(const QDateTime &) const;
int secsTo(const QDateTime &) const;
+ qint64 msecsTo(const QDateTime &) const;
bool operator==(const QDateTime &other) const;
inline bool operator!=(const QDateTime &other) const { return !(*this == other); }
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index c3f6783..20c2e27 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -129,6 +129,11 @@ inline bool isascii(int c)
}
#endif
+#if defined(Q_OS_SYMBIAN)
+void qt_symbianUpdateSystemPrivate();
+void qt_symbianInitSystemLocale();
+#endif
+
/******************************************************************************
** Helpers for accessing Qt locale database
*/
@@ -1407,6 +1412,9 @@ static const QSystemLocale *systemLocale()
{
if (_systemLocale)
return _systemLocale;
+#if defined(Q_OS_SYMBIAN)
+ qt_symbianInitSystemLocale();
+#endif
return QSystemLocale_globalSystemLocale();
}
@@ -1417,6 +1425,10 @@ void QLocalePrivate::updateSystemPrivate()
system_lp = globalLocalePrivate();
*system_lp = *sys_locale->fallbackLocale().d();
+#if defined(Q_OS_SYMBIAN)
+ qt_symbianUpdateSystemPrivate();
+#endif
+
QVariant res = sys_locale->query(QSystemLocale::LanguageId, QVariant());
if (!res.isNull())
system_lp->m_language_id = res.toInt();
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index ecf79e9..6205745 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -58,6 +58,10 @@
#include "qlocale.h"
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+class CEnvironmentChangeNotifier;
+#endif
+
QT_BEGIN_NAMESPACE
struct Q_CORE_EXPORT QLocalePrivate
@@ -201,6 +205,20 @@ inline char QLocalePrivate::digitToCLocale(const QChar &in) const
return 0;
}
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+class QEnvironmentChangeNotifier
+{
+public:
+ QEnvironmentChangeNotifier();
+ ~QEnvironmentChangeNotifier();
+
+ static TInt localeChanged(TAny *data);
+
+private:
+ CEnvironmentChangeNotifier *iChangeNotifier;
+};
+#endif
+
QT_END_NAMESPACE
#endif // QLOCALE_P_H
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 01f56cc..6e36dcd 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -46,8 +46,14 @@
#include <QThread>
#include <e32std.h>
+#include <e32const.h>
+#include <e32base.h>
+#include <e32property.h>
+#include <bacntf.h>
#include "private/qcore_symbian_p.h"
-
+#include "private/qcoreapplication_p.h"
+#include "private/qlocale_p.h"
+#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -771,13 +777,18 @@ static QLocale::MeasurementSystem symbianMeasurementSystem()
return QLocale::MetricSystem;
}
-QLocale QSystemLocale::fallbackLocale() const
+void qt_symbianUpdateSystemPrivate()
{
// load system data before query calls
+ _s60Locale.LoadSystemSettings();
+}
+
+void qt_symbianInitSystemLocale()
+{
static QBasicAtomicInt initDone = Q_BASIC_ATOMIC_INITIALIZER(0);
+ if (initDone == 2)
+ return;
if (initDone.testAndSetRelaxed(0, 1)) {
- _s60Locale.LoadSystemSettings();
-
// Initialize platform version dependent function pointers
ptrTimeFormatL = reinterpret_cast<FormatFunc>
(qt_resolveS60PluginFunc(S60Plugin_TimeFormatL));
@@ -801,7 +812,10 @@ QLocale QSystemLocale::fallbackLocale() const
}
while(initDone != 2)
QThread::yieldCurrentThread();
+}
+QLocale QSystemLocale::fallbackLocale() const
+{
TLanguage lang = User::Language();
QString locale = QLatin1String(qt_symbianLocaleName(lang));
return QLocale(locale);
@@ -884,4 +898,35 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
return QVariant();
}
+#if !defined(QT_NO_SYSTEMLOCALE)
+QEnvironmentChangeNotifier::QEnvironmentChangeNotifier()
+{
+ // Create the change notifier and install the callback function
+ const TCallBack callback(&QEnvironmentChangeNotifier::localeChanged, this);
+ QT_TRAP_THROWING(iChangeNotifier = CEnvironmentChangeNotifier::NewL(CActive::EPriorityStandard, callback));
+ iChangeNotifier->Start();
+}
+
+TInt QEnvironmentChangeNotifier::localeChanged(TAny *data)
+{
+ QEnvironmentChangeNotifier *that = reinterpret_cast<QEnvironmentChangeNotifier *>(data);
+
+ TInt flag = that->iChangeNotifier->Change();
+ if (flag & EChangesLocale) {
+ static bool first = true;
+ if (!first) { // skip the first notification on app startup
+ QT_TRYCATCH_LEAVING(QLocalePrivate::updateSystemPrivate());
+ QT_TRYCATCH_LEAVING(QCoreApplication::postEvent(qApp, new QEvent(QEvent::LocaleChange)));
+ }
+ first = false;
+ }
+ return KErrNone;
+}
+
+QEnvironmentChangeNotifier::~QEnvironmentChangeNotifier()
+{
+ delete iChangeNotifier;
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index df0ae46..5696ba6 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -125,6 +125,10 @@ template <class Key, class T>
struct QMapNode {
Key key;
T value;
+
+private:
+ // never access these members through this structure.
+ // see below
QMapData::Node *backward;
QMapData::Node *forward[1];
};
@@ -134,6 +138,22 @@ struct QMapPayloadNode
{
Key key;
T value;
+
+private:
+ // QMap::e is a pointer to QMapData::Node, which matches the member
+ // below. However, the memory allocation node in QMapData::node_create
+ // allocates sizeof(QMapPayloNode) and incorrectly calculates the offset
+ // of 'backward' below. If the alignment of QMapPayloadNode is larger
+ // than the alignment of a pointer, the 'backward' member is aligned to
+ // the end of this structure, not to 'value' above, and will occupy the
+ // tail-padding area.
+ //
+ // e.g., on a 32-bit archictecture with Key = int and
+ // sizeof(T) = alignof(T) = 8
+ // 0 4 8 12 16 20 24 byte
+ // | key | PAD | value |backward| PAD | correct layout
+ // | key | PAD | value | |backward| how it's actually used
+ // |<----- value of QMap::payload() = 20 ----->|
QMapData::Node *backward;
};
diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp
index 8fc219a..78abf94 100644
--- a/src/dbus/qdbusinternalfilters.cpp
+++ b/src/dbus/qdbusinternalfilters.cpp
@@ -87,7 +87,7 @@ static const char propertiesInterfaceXml[] =
" <method name=\"GetAll\">\n"
" <arg name=\"interface_name\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"values\" type=\"a{sv}\" direction=\"out\"/>\n"
- " <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>"
+ " <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>\n"
" </method>\n"
" </interface>\n";
diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp
index 9c25d82..463ac73 100644
--- a/src/dbus/qdbusxmlgenerator.cpp
+++ b/src/dbus/qdbusxmlgenerator.cpp
@@ -160,7 +160,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
// do we need to describe this argument?
if (QDBusMetaType::signatureToType(typeName) == QVariant::Invalid)
xml += QString::fromLatin1(" <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"%1\"/>\n")
- .arg(typeNameToXml(mm.typeName()));
+ .arg(typeNameToXml(QVariant::typeToName(QVariant::Type(typeId))));
} else
continue;
}
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 9c46467..ec8f508 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,15 +1,30 @@
=============================================================================
The changes below are pre Qt 4.7.0 RC
-Flickable: overShoot is replaced by boundsBehavior enumeration.
+Flickable:
+ - overShoot is replaced by boundsBehavior enumeration
+ - flickingHorizontally and flickingVertically properties added
+ - movingHorizontally and movingVertically properties added
+ - flickDirection is renamed flickableDirection
+Component: isReady, isLoading, isError and isNull properties removed, use
+ status property instead
+QList<QObject*> models no longer provide properties in model object. The
+properties are now updated when the object changes. An object's property
+"foo" may now be accessed as "foo", modelData.foo" or model.modelData.foo"
+component.createObject has gained a mandatory "parent" argument
C++ API
-------
QDeclarativeExpression::value() has been renamed to
QDeclarativeExpression::evaluate()
+QML Launcher
+------------
+The standalone executable has been renamed to qml launcher. Runtime warnings
+can be now accessed via the menu (Debugging->Show Warnings).
+
=============================================================================
-The changes below are pre Qt 4.7.0 beta
+The changes below are pre Qt 4.7.0 beta 1
TextEdit: wrap property is replaced by wrapMode enumeration.
Text: wrap property is replaced by wrapMode enumeration.
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
index 4287e25..8037a16 100644
--- a/src/declarative/declarative.pro
+++ b/src/declarative/declarative.pro
@@ -1,13 +1,13 @@
TARGET = QtDeclarative
QPRO_PWD = $$PWD
-QT = core gui xml script network
+QT = core gui script network
contains(QT_CONFIG, svg): QT += svg
contains(QT_CONFIG, opengl): QT += opengl
DEFINES += QT_BUILD_DECLARATIVE_LIB QT_NO_URL_CAST_FROM_STRING
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
-unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtXml
+unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
exists("qdeclarative_enable_gcov") {
QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index f15316b..ef07cbb 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -128,7 +128,6 @@ static qreal adjustedPosition(QGraphicsObject *item, QDeclarativeAnchorLine::Anc
\internal
\class QDeclarativeAnchors
\since 4.7
- \ingroup group_layouts
\brief The QDeclarativeAnchors class provides a way to lay out items relative to other items.
\warning Currently, only anchoring to siblings or parent is supported.
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index 06f8363..229e15b 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -57,9 +57,25 @@ QT_BEGIN_NAMESPACE
\inherits Item
\since 4.7
- \snippet snippets/declarative/border-image.qml 0
+ A BorderImage breaks an image into 9 sections, as shown below:
+
+ \image declarative-scalegrid.png
+
+ When the image is scaled:
+ \list
+ \i the corners (sections 1, 3, 7, and 9) are not scaled at all
+ \i sections 2 and 8 are scaled according to \l{BorderImage::horizontalTileMode}{horizontalTileMode}
+ \i sections 4 and 6 are scaled according to \l{BorderImage::verticalTileMode}{verticalTileMode}
+ \i the middle (section 5) is scaled according to both \l{BorderImage::horizontalTileMode}{horizontalTileMode} and \l{BorderImage::verticalTileMode}{verticalTileMode}
+ \endlist
+
+ Examples:
+ \snippet snippets/declarative/borderimage.qml 0
\image BorderImage.png
+
+ The \l{declarative/imageelements/borderimage}{BorderImage example} shows how a BorderImage can be used to simulate a shadow effect on a
+ rectangular item.
*/
/*!
@@ -86,10 +102,10 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
This property holds the status of image loading. It can be one of:
\list
- \o Null - no image has been set
- \o Ready - the image has been loaded
- \o Loading - the image is currently being loaded
- \o Error - an error occurred while loading the image
+ \o BorderImage.Null - no image has been set
+ \o BorderImage.Ready - the image has been loaded
+ \o BorderImage.Loading - the image is currently being loaded
+ \o BorderImage.Error - an error occurred while loading the image
\endlist
\sa progress
@@ -255,21 +271,17 @@ void QDeclarativeBorderImage::load()
\qmlproperty int BorderImage::border.top
\qmlproperty int BorderImage::border.bottom
- \target ImagexmlpropertiesscaleGrid
-
- The 4 border lines (2 horizontal and 2 vertical) break an image into 9 sections, as shown below:
+ The 4 border lines (2 horizontal and 2 vertical) break the image into 9 sections, as shown below:
\image declarative-scalegrid.png
- When the image is scaled:
- \list
- \i the corners (sections 1, 3, 7, and 9) are not scaled at all
- \i sections 2 and 8 are scaled according to \l{BorderImage::horizontalTileMode}{horizontalTileMode}
- \i sections 4 and 6 are scaled according to \l{BorderImage::verticalTileMode}{verticalTileMode}
- \i the middle (section 5) is scaled according to both \l{BorderImage::horizontalTileMode}{horizontalTileMode} and \l{BorderImage::verticalTileMode}{verticalTileMode}
- \endlist
+ Each border line (left, right, top, and bottom) specifies an offset in pixels from the respective side.
- Each border line (left, right, top, and bottom) specifies an offset from the respective side. For example, \c{border.bottom: 10} sets the bottom line 10 pixels up from the bottom of the image.
+ For example:
+ \qml
+ border.bottom: 10
+ \endqml
+ sets the bottom line 10 pixels up from the bottom of the image.
The border lines can also be specified using a
\l {BorderImage::source}{.sci file}.
@@ -288,9 +300,9 @@ QDeclarativeScaleGrid *QDeclarativeBorderImage::border()
This property describes how to repeat or stretch the middle parts of the border image.
\list
- \o Stretch - Scale the image to fit to the available area.
- \o Repeat - Tile the image until there is no more space. May crop the last image.
- \o Round - Like Repeat, but scales the images down to ensure that the last image is not cropped.
+ \o BorderImage.Stretch - Scale the image to fit to the available area.
+ \o BorderImage.Repeat - Tile the image until there is no more space. May crop the last image.
+ \o BorderImage.Round - Like Repeat, but scales the images down to ensure that the last image is not cropped.
\endlist
*/
QDeclarativeBorderImage::TileMode QDeclarativeBorderImage::horizontalTileMode() const
diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp
index 4425c97..81ec6e1 100644
--- a/src/declarative/graphicsitems/qdeclarativeevents.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp
@@ -151,7 +151,7 @@ Item {
\list
\o Qt.LeftButton
\o Qt.RightButton
- \o Qt.MidButton
+ \o Qt.MiddleButton
\endlist
*/
@@ -174,7 +174,7 @@ Item {
\list
\o Qt.LeftButton
\o Qt.RightButton
- \o Qt.MidButton
+ \o Qt.MiddleButton
\endlist
*/
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index b462443..3c0f5a2 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -125,12 +125,14 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
: viewport(new QDeclarativeItem)
, hData(this, &QDeclarativeFlickablePrivate::setRoundedViewportX)
, vData(this, &QDeclarativeFlickablePrivate::setRoundedViewportY)
- , flicked(false), moving(false), stealMouse(false)
- , pressed(false)
+ , flickingHorizontally(false), flickingVertically(false)
+ , hMoved(false), vMoved(false)
+ , movingHorizontally(false), movingVertically(false)
+ , stealMouse(false), pressed(false)
, interactive(true), deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100)
, delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(600)
, vTime(0), visibleArea(0)
- , flickDirection(QDeclarativeFlickable::AutoFlickDirection)
+ , flickableDirection(QDeclarativeFlickable::AutoFlickDirection)
, boundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds)
{
}
@@ -226,10 +228,19 @@ void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal
timeline.reset(data.move);
timeline.accel(data.move, v, deceleration, maxDistance);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
- if (!flicked) {
- flicked = true;
+ if (!flickingHorizontally && q->xflick()) {
+ flickingHorizontally = true;
emit q->flickingChanged();
- emit q->flickStarted();
+ emit q->flickingHorizontallyChanged();
+ if (!flickingVertically)
+ emit q->flickStarted();
+ }
+ if (!flickingVertically && q->yflick()) {
+ flickingVertically = true;
+ emit q->flickingChanged();
+ emit q->flickingVerticallyChanged();
+ if (!flickingHorizontally)
+ emit q->flickStarted();
}
} else {
timeline.reset(data.move);
@@ -274,7 +285,6 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
q->viewportMoved();
}
}
- //emit flickingChanged();
} else if (data.move.value() < maxExtent) {
timeline.reset(data.move);
if (fixupDuration) {
@@ -285,11 +295,7 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal
data.move.setValue(maxExtent);
q->viewportMoved();
}
- //emit flickingChanged();
- } else {
- flicked = false;
}
-
vTime = timeline.time();
}
@@ -345,19 +351,21 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd()
\code
Flickable {
- width: 200; height: 200; contentWidth: image.width; contentHeight: image.height
- Image { id: image; source: "bigimage.png" }
+ width: 200; height: 200
+ contentWidth: image.width; contentHeight: image.height
+
+ Image { id: image; source: "bigImage.png" }
}
\endcode
\image flickable.gif
- \note Flickable does not automatically clip its contents. If
- it is not full-screen it is likely that \c clip should be set
- to true.
+ Flickable does not automatically clip its contents. If
+ it is not full-screen it is likely that \l {Item::clip}{clip} should be set
+ to \c true.
- \note Due to an implementation detail items placed inside a flickable cannot anchor to it by
- id, use 'parent' instead.
+ \note Due to an implementation detail, items placed inside a Flickable cannot anchor to it by
+ \c id. Use \c parent instead.
*/
/*!
@@ -400,18 +408,17 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd()
These properties describe the position and size of the currently viewed area.
The size is defined as the percentage of the full view currently visible,
scaled to 0.0 - 1.0. The page position is usually in the range 0.0 (beginning) to
- 1.0 minus size ratio (end), i.e. yPosition is in the range 0.0 to 1.0-heightRatio.
+ 1.0 minus size ratio (end), i.e. \c yPosition is in the range 0.0 to 1.0-\c heightRatio.
However, it is possible for the contents to be dragged outside of the normal
range, resulting in the page positions also being outside the normal range.
- These properties are typically used to draw a scrollbar, for example:
- \code
- Rectangle {
- opacity: 0.5; anchors.right: MyListView.right-2; width: 6
- y: MyListView.visibleArea.yPosition * MyListView.height
- height: MyListView.visibleArea.heightRatio * MyListView.height
- }
- \endcode
+ These properties are typically used to draw a scrollbar. For example:
+
+ \snippet doc/src/snippets/declarative/flickableScrollbar.qml 0
+ \dots 4
+ \snippet doc/src/snippets/declarative/flickableScrollbar.qml 1
+
+ \sa {declarative/ui-components/scrollbar}{scrollbar example}
*/
QDeclarativeFlickable::QDeclarativeFlickable(QDeclarativeItem *parent)
@@ -479,11 +486,12 @@ void QDeclarativeFlickable::setContentY(qreal pos)
/*!
\qmlproperty bool Flickable::interactive
- A user cannot drag or flick a Flickable that is not interactive.
+ This property holds whether the user can interact with the Flickable. A user
+ cannot drag or flick a Flickable that is not interactive.
This property is useful for temporarily disabling flicking. This allows
special interaction with Flickable's children: for example, you might want to
- freeze a flickable map while viewing detailed information on a location popup that is a child of the Flickable.
+ freeze a flickable map while scrolling through a pop-up dialog that is a child of the Flickable.
*/
bool QDeclarativeFlickable::isInteractive() const
{
@@ -496,11 +504,14 @@ void QDeclarativeFlickable::setInteractive(bool interactive)
Q_D(QDeclarativeFlickable);
if (interactive != d->interactive) {
d->interactive = interactive;
- if (!interactive && d->flicked) {
+ if (!interactive && (d->flickingHorizontally || d->flickingVertically)) {
d->timeline.clear();
d->vTime = d->timeline.time();
- d->flicked = false;
+ d->flickingHorizontally = false;
+ d->flickingVertically = false;
emit flickingChanged();
+ emit flickingHorizontallyChanged();
+ emit flickingVerticallyChanged();
emit flickEnded();
}
emit interactiveChanged();
@@ -580,35 +591,47 @@ QDeclarativeFlickableVisibleArea *QDeclarativeFlickable::visibleArea()
}
/*!
- \qmlproperty enumeration Flickable::flickDirection
+ \qmlproperty enumeration Flickable::flickableDirection
This property determines which directions the view can be flicked.
\list
- \o AutoFlickDirection (default) - allows flicking vertically if the
+ \o Flickable.AutoFlickDirection (default) - allows flicking vertically if the
\e contentHeight is not equal to the \e height of the Flickable.
Allows flicking horizontally if the \e contentWidth is not equal
to the \e width of the Flickable.
- \o HorizontalFlick - allows flicking horizontally.
- \o VerticalFlick - allows flicking vertically.
- \o HorizontalAndVerticalFlick - allows flicking in both directions.
+ \o Flickable.HorizontalFlick - allows flicking horizontally.
+ \o Flickable.VerticalFlick - allows flicking vertically.
+ \o Flickable.HorizontalAndVerticalFlick - allows flicking in both directions.
\endlist
*/
-QDeclarativeFlickable::FlickDirection QDeclarativeFlickable::flickDirection() const
+QDeclarativeFlickable::FlickableDirection QDeclarativeFlickable::flickableDirection() const
{
Q_D(const QDeclarativeFlickable);
- return d->flickDirection;
+ return d->flickableDirection;
}
-void QDeclarativeFlickable::setFlickDirection(FlickDirection direction)
+void QDeclarativeFlickable::setFlickableDirection(FlickableDirection direction)
{
Q_D(QDeclarativeFlickable);
- if (direction != d->flickDirection) {
- d->flickDirection = direction;
- emit flickDirectionChanged();
+ if (direction != d->flickableDirection) {
+ d->flickableDirection = direction;
+ emit flickableDirectionChanged();
}
}
+QDeclarativeFlickable::FlickableDirection QDeclarativeFlickable::flickDirection() const
+{
+ qmlInfo(this) << "'flickDirection' is deprecated. Please use 'flickableDirection' instead.";
+ return flickableDirection();
+}
+
+void QDeclarativeFlickable::setFlickDirection(FlickableDirection direction)
+{
+ qmlInfo(this) << "'flickDirection' is deprecated. Please use 'flickableDirection' instead.";
+ setFlickableDirection(direction);
+}
+
void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (interactive && timeline.isActive() && (qAbs(hData.velocity) > 10 || qAbs(vData.velocity) > 10))
@@ -624,7 +647,8 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
pressPos = event->pos();
hData.pressPos = hData.move.value();
vData.pressPos = vData.move.value();
- flicked = false;
+ flickingHorizontally = false;
+ flickingVertically = false;
QDeclarativeItemPrivate::start(pressTime);
QDeclarativeItemPrivate::start(velocityTime);
}
@@ -636,7 +660,6 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
return;
bool rejectY = false;
bool rejectX = false;
- bool moved = false;
if (q->yflick()) {
int dy = int(event->pos().y() - pressPos.y());
@@ -658,7 +681,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
}
if (!rejectY && stealMouse) {
vData.move.setValue(qRound(newY));
- moved = true;
+ vMoved = true;
}
if (qAbs(dy) > QApplication::startDragDistance())
stealMouse = true;
@@ -685,7 +708,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
}
if (!rejectX && stealMouse) {
hData.move.setValue(qRound(newX));
- moved = true;
+ hMoved = true;
}
if (qAbs(dx) > QApplication::startDragDistance())
@@ -715,7 +738,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (rejectY) vData.velocity = 0;
if (rejectX) hData.velocity = 0;
- if (moved) {
+ if (hMoved || vMoved) {
q->movementStarting();
q->viewportMoved();
}
@@ -810,20 +833,24 @@ void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
d->vData.velocity = qMax(event->delta() - d->vData.smoothVelocity.value(), qreal(250.0));
else
d->vData.velocity = qMin(event->delta() - d->vData.smoothVelocity.value(), qreal(-250.0));
- d->flicked = false;
+ d->flickingVertically = false;
d->flickY(d->vData.velocity);
- if (d->flicked)
+ if (d->flickingVertically) {
+ d->vMoved = true;
movementStarting();
+ }
event->accept();
} else if (xflick()) {
if (event->delta() > 0)
d->hData.velocity = qMax(event->delta() - d->hData.smoothVelocity.value(), qreal(250.0));
else
d->hData.velocity = qMin(event->delta() - d->hData.smoothVelocity.value(), qreal(-250.0));
- d->flicked = false;
+ d->flickingHorizontally = false;
d->flickX(d->hData.velocity);
- if (d->flicked)
+ if (d->flickingHorizontally) {
+ d->hMoved = true;
movementStarting();
+ }
event->accept();
} else {
QDeclarativeItem::wheelEvent(event);
@@ -1026,14 +1053,14 @@ void QDeclarativeFlickable::setOverShoot(bool o)
This enables the feeling that the edges of the view are soft,
rather than a hard physical boundary.
- boundsBehavior can be one of:
+ The \c boundsBehavior can be one of:
\list
- \o \e StopAtBounds - the contents can not be dragged beyond the boundary
+ \o \e Flickable.StopAtBounds - the contents can not be dragged beyond the boundary
of the flickable, and flicks will not overshoot.
- \o \e DragOverBounds - the contents can be dragged beyond the boundary
+ \o \e Flickable.DragOverBounds - the contents can be dragged beyond the boundary
of the Flickable, but flicks will not overshoot.
- \o \e DragAndOvershootBounds (default) - the contents can be dragged
+ \o \e Flickable.DragAndOvershootBounds (default) - the contents can be dragged
beyond the boundary of the Flickable, and can overshoot the
boundary when flicked.
\endlist
@@ -1059,12 +1086,16 @@ void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b)
\qmlproperty int Flickable::contentHeight
The dimensions of the content (the surface controlled by Flickable). Typically this
- should be set to the combined size of the items placed in the Flickable.
+ should be set to the combined size of the items placed in the Flickable. Note this
+ can be set automatically using \l {Item::childrenRect.width}{childrenRect.width}
+ and \l {Item::childrenRect.height}{childrenRect.height}. For example:
\code
Flickable {
- width: 320; height: 480; contentWidth: image.width; contentHeight: image.height
- Image { id: image; source: "bigimage.png" }
+ width: 320; height: 480
+ contentWidth: childrenRect.width; contentHeight: childrenRect.height
+
+ Image { id: image; source: "bigImage.png" }
}
\endcode
*/
@@ -1085,7 +1116,7 @@ void QDeclarativeFlickable::setContentWidth(qreal w)
else
d->viewport->setWidth(w);
// Make sure that we're entirely in view.
- if (!d->pressed) {
+ if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
int oldDuration = d->fixupDuration;
d->fixupDuration = 0;
d->fixupX();
@@ -1112,7 +1143,7 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
else
d->viewport->setHeight(h);
// Make sure that we're entirely in view.
- if (!d->pressed) {
+ if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
int oldDuration = d->fixupDuration;
d->fixupDuration = 0;
d->fixupY();
@@ -1143,17 +1174,17 @@ qreal QDeclarativeFlickable::vHeight() const
bool QDeclarativeFlickable::xflick() const
{
Q_D(const QDeclarativeFlickable);
- if (d->flickDirection == QDeclarativeFlickable::AutoFlickDirection)
+ if (d->flickableDirection == QDeclarativeFlickable::AutoFlickDirection)
return vWidth() != width();
- return d->flickDirection & QDeclarativeFlickable::HorizontalFlick;
+ return d->flickableDirection & QDeclarativeFlickable::HorizontalFlick;
}
bool QDeclarativeFlickable::yflick() const
{
Q_D(const QDeclarativeFlickable);
- if (d->flickDirection == QDeclarativeFlickable::AutoFlickDirection)
+ if (d->flickableDirection == QDeclarativeFlickable::AutoFlickDirection)
return vHeight() != height();
- return d->flickDirection & QDeclarativeFlickable::VerticalFlick;
+ return d->flickableDirection & QDeclarativeFlickable::VerticalFlick;
}
bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
@@ -1275,16 +1306,30 @@ void QDeclarativeFlickable::setFlickDeceleration(qreal deceleration)
emit flickDecelerationChanged();
}
+bool QDeclarativeFlickable::isFlicking() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->flickingHorizontally || d->flickingVertically;
+}
+
/*!
\qmlproperty bool Flickable::flicking
+ \qmlproperty bool Flickable::flickingHorizontally
+ \qmlproperty bool Flickable::flickingVertically
- This property holds whether the view is currently moving due to
- the user flicking the view.
+ These properties hold whether the view is currently moving horizontally
+ or vertically due to the user flicking the view.
*/
-bool QDeclarativeFlickable::isFlicking() const
+bool QDeclarativeFlickable::isFlickingHorizontally() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->flickingHorizontally;
+}
+
+bool QDeclarativeFlickable::isFlickingVertically() const
{
Q_D(const QDeclarativeFlickable);
- return d->flicked;
+ return d->flickingVertically;
}
/*!
@@ -1313,40 +1358,84 @@ void QDeclarativeFlickable::setPressDelay(int delay)
emit pressDelayChanged();
}
+
+bool QDeclarativeFlickable::isMoving() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->movingHorizontally || d->movingVertically;
+}
+
/*!
\qmlproperty bool Flickable::moving
+ \qmlproperty bool Flickable::movingHorizontally
+ \qmlproperty bool Flickable::movingVertically
- This property holds whether the view is currently moving due to
- the user either dragging or flicking the view.
+ These properties hold whether the view is currently moving horizontally
+ or vertically due to the user either dragging or flicking the view.
*/
-bool QDeclarativeFlickable::isMoving() const
+bool QDeclarativeFlickable::isMovingHorizontally() const
{
Q_D(const QDeclarativeFlickable);
- return d->moving;
+ return d->movingHorizontally;
+}
+
+bool QDeclarativeFlickable::isMovingVertically() const
+{
+ Q_D(const QDeclarativeFlickable);
+ return d->movingVertically;
}
void QDeclarativeFlickable::movementStarting()
{
Q_D(QDeclarativeFlickable);
- if (!d->moving) {
- d->moving = true;
+ if (d->hMoved && !d->movingHorizontally) {
+ d->movingHorizontally = true;
+ emit movingChanged();
+ emit movingHorizontallyChanged();
+ if (!d->movingVertically)
+ emit movementStarted();
+ }
+ else if (d->vMoved && !d->movingVertically) {
+ d->movingVertically = true;
emit movingChanged();
- emit movementStarted();
+ emit movingVerticallyChanged();
+ if (!d->movingHorizontally)
+ emit movementStarted();
}
}
void QDeclarativeFlickable::movementEnding()
{
Q_D(QDeclarativeFlickable);
- if (d->moving) {
- d->moving = false;
- emit movingChanged();
- emit movementEnded();
+ if (d->flickingHorizontally) {
+ d->flickingHorizontally = false;
+ emit flickingChanged();
+ emit flickingHorizontallyChanged();
+ if (!d->flickingVertically)
+ emit flickEnded();
}
- if (d->flicked) {
- d->flicked = false;
+ if (d->flickingVertically) {
+ d->flickingVertically = false;
emit flickingChanged();
- emit flickEnded();
+ emit flickingVerticallyChanged();
+ if (!d->flickingHorizontally)
+ emit flickEnded();
+ }
+ if (d->movingHorizontally) {
+ d->movingHorizontally = false;
+ d->hMoved = false;
+ emit movingChanged();
+ emit movingHorizontallyChanged();
+ if (!d->movingVertically)
+ emit movementEnded();
+ }
+ if (d->movingVertically) {
+ d->movingVertically = false;
+ d->vMoved = false;
+ emit movingChanged();
+ emit movingVerticallyChanged();
+ if (!d->movingHorizontally)
+ emit movementEnded();
}
d->hData.smoothVelocity.setValue(0);
d->vData.smoothVelocity.setValue(0);
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index f031a24..05887b8 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -69,8 +69,13 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged)
+ Q_PROPERTY(bool movingHorizontally READ isMovingHorizontally NOTIFY movingHorizontallyChanged)
+ Q_PROPERTY(bool movingVertically READ isMovingVertically NOTIFY movingVerticallyChanged)
Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
- Q_PROPERTY(FlickDirection flickDirection READ flickDirection WRITE setFlickDirection NOTIFY flickDirectionChanged)
+ Q_PROPERTY(bool flickingHorizontally READ isFlickingHorizontally NOTIFY flickingHorizontallyChanged)
+ Q_PROPERTY(bool flickingVertically READ isFlickingVertically NOTIFY flickingVerticallyChanged)
+ Q_PROPERTY(FlickableDirection flickDirection READ flickDirection WRITE setFlickDirection NOTIFY flickableDirectionChanged) // deprecated
+ Q_PROPERTY(FlickableDirection flickableDirection READ flickableDirection WRITE setFlickableDirection NOTIFY flickableDirectionChanged)
Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
@@ -86,7 +91,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> flickableChildren READ flickableChildren)
Q_CLASSINFO("DefaultProperty", "flickableData")
- Q_ENUMS(FlickDirection)
+ Q_ENUMS(FlickableDirection)
Q_ENUMS(BoundsBehavior)
public:
@@ -116,7 +121,11 @@ public:
void setContentY(qreal pos);
bool isMoving() const;
+ bool isMovingHorizontally() const;
+ bool isMovingVertically() const;
bool isFlicking() const;
+ bool isFlickingHorizontally() const;
+ bool isFlickingVertically() const;
int pressDelay() const;
void setPressDelay(int delay);
@@ -140,9 +149,11 @@ public:
QDeclarativeItem *viewport();
- enum FlickDirection { AutoFlickDirection=0x00, HorizontalFlick=0x01, VerticalFlick=0x02, HorizontalAndVerticalFlick=0x03 };
- FlickDirection flickDirection() const;
- void setFlickDirection(FlickDirection);
+ enum FlickableDirection { AutoFlickDirection=0x00, HorizontalFlick=0x01, VerticalFlick=0x02, HorizontalAndVerticalFlick=0x03 };
+ FlickableDirection flickDirection() const; // deprecated
+ void setFlickDirection(FlickableDirection); // deprecated
+ FlickableDirection flickableDirection() const;
+ void setFlickableDirection(FlickableDirection);
Q_SIGNALS:
void contentWidthChanged();
@@ -150,22 +161,26 @@ Q_SIGNALS:
void contentXChanged();
void contentYChanged();
void movingChanged();
+ void movingHorizontallyChanged();
+ void movingVerticallyChanged();
void flickingChanged();
- void movementStarted();
- void movementEnded();
- void flickStarted();
- void flickEnded();
+ void flickingHorizontallyChanged();
+ void flickingVerticallyChanged();
void horizontalVelocityChanged();
void verticalVelocityChanged();
void isAtBoundaryChanged();
void pageChanged();
- void flickDirectionChanged();
+ void flickableDirectionChanged();
void interactiveChanged();
void overShootChanged();
void boundsBehaviorChanged();
void maximumFlickVelocityChanged();
void flickDecelerationChanged();
void pressDelayChanged();
+ void movementStarted();
+ void movementEnded();
+ void flickStarted();
+ void flickEnded();
protected:
virtual bool sceneEventFilter(QGraphicsItem *, QEvent *);
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index 01cfb18..b467ed2 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -131,8 +131,12 @@ public:
AxisData vData;
QDeclarativeTimeLine timeline;
- bool flicked : 1;
- bool moving : 1;
+ bool flickingHorizontally : 1;
+ bool flickingVertically : 1;
+ bool hMoved : 1;
+ bool vMoved : 1;
+ bool movingHorizontally : 1;
+ bool movingVertically : 1;
bool stealMouse : 1;
bool pressed : 1;
bool interactive : 1;
@@ -158,7 +162,7 @@ public:
int vTime;
QDeclarativeTimeLine velocityTimeline;
QDeclarativeFlickableVisibleArea *visibleArea;
- QDeclarativeFlickable::FlickDirection flickDirection;
+ QDeclarativeFlickable::FlickableDirection flickableDirection;
QDeclarativeFlickable::BoundsBehavior boundsBehavior;
void handleMousePressEvent(QGraphicsSceneMouseEvent *);
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index 57045f1..d926119 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -94,8 +94,6 @@ public:
\class QDeclarativeFlipable
\brief The Flipable item provides a surface that can be flipped.
- \ingroup group_widgets
-
Flipable is an item that can be visibly "flipped" between its front and
back sides.
*/
@@ -169,7 +167,7 @@ void QDeclarativeFlipable::retransformBack()
\qmlproperty enumeration Flipable::side
The side of the Flippable currently visible. Possible values are \c
- Front and \c Back.
+ Flippable.Front and \c Flippable.Back.
*/
QDeclarativeFlipable::Side QDeclarativeFlipable::side() const
{
@@ -192,12 +190,15 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent()
QPointF p2(1, 0);
QPointF p3(1, 1);
- p1 = sceneTransform.map(p1);
- p2 = sceneTransform.map(p2);
- p3 = sceneTransform.map(p3);
+ QPointF scenep1 = sceneTransform.map(p1);
+ QPointF scenep2 = sceneTransform.map(p2);
+ QPointF scenep3 = sceneTransform.map(p3);
+ p1 = q->mapToParent(p1);
+ p2 = q->mapToParent(p2);
+ p3 = q->mapToParent(p3);
- qreal cross = (p1.x() - p2.x()) * (p3.y() - p2.y()) -
- (p1.y() - p2.y()) * (p3.x() - p2.x());
+ qreal cross = (scenep1.x() - scenep2.x()) * (scenep3.y() - scenep2.y()) -
+ (scenep1.y() - scenep2.y()) * (scenep3.x() - scenep2.x());
wantBackYFlipped = p1.x() >= p2.x();
wantBackXFlipped = p2.y() >= p3.y();
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index f79a853..e1874b8 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -108,7 +108,7 @@ public:
, highlightComponent(0), highlight(0), trackedItem(0)
, moveReason(Other), buffer(0), highlightXAnimator(0), highlightYAnimator(0)
, highlightMoveDuration(150)
- , bufferMode(NoBuffer), snapMode(QDeclarativeGridView::NoSnap)
+ , bufferMode(BufferBefore | BufferAfter), snapMode(QDeclarativeGridView::NoSnap)
, ownModel(false), wrap(false), autoHighlight(true)
, fixCurrentVisibility(false), lazyRelease(false), layoutScheduled(false)
, deferredRelease(false), haveHighlightRange(false) {}
@@ -331,7 +331,7 @@ public:
QSmoothedAnimation *highlightYAnimator;
int highlightMoveDuration;
enum BufferMode { NoBuffer = 0x00, BufferBefore = 0x01, BufferAfter = 0x02 };
- BufferMode bufferMode;
+ int bufferMode;
QDeclarativeGridView::SnapMode snapMode;
bool ownModel : 1;
@@ -349,7 +349,7 @@ void QDeclarativeGridViewPrivate::init()
Q_Q(QDeclarativeGridView);
QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped()));
q->setFlag(QGraphicsItem::ItemIsFocusScope);
- q->setFlickDirection(QDeclarativeFlickable::VerticalFlick);
+ q->setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
addItemChangeListener(this, Geometry);
}
@@ -378,9 +378,11 @@ FxGridItem *QDeclarativeGridViewPrivate::createItem(int modelIndex)
if (model->completePending()) {
// complete
listItem->item->setZValue(1);
+ listItem->item->setParentItem(q->viewport());
model->completeItem();
+ } else {
+ listItem->item->setParentItem(q->viewport());
}
- listItem->item->setParentItem(q->viewport());
unrequestedItems.remove(listItem->item);
}
requestedIndex = -1;
@@ -690,7 +692,7 @@ void QDeclarativeGridViewPrivate::updateHighlight()
{
if ((!currentItem && highlight) || (currentItem && !highlight))
createHighlight();
- if (currentItem && autoHighlight && highlight && !moving) {
+ if (currentItem && autoHighlight && highlight && !movingHorizontally && !movingVertically) {
// auto-update highlight
highlightXAnimator->to = currentItem->item->x();
highlightYAnimator->to = currentItem->item->y();
@@ -804,7 +806,8 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
Q_Q(QDeclarativeGridView);
moveReason = Mouse;
- if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange) && snapMode == QDeclarativeGridView::NoSnap) {
+ if ((!haveHighlightRange || highlightRange != QDeclarativeGridView::StrictlyEnforceRange)
+ && snapMode == QDeclarativeGridView::NoSnap) {
QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
return;
}
@@ -855,10 +858,13 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
qreal adjDist = -data.flickTarget + data.move.value();
if (qAbs(adjDist) > qAbs(dist)) {
// Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
- v2 = accel * 2.0f * qAbs(dist);
- v = qSqrt(v2);
- if (dist > 0)
- v = -v;
+ qreal adjv2 = accel * 2.0f * qAbs(adjDist);
+ if (adjv2 > v2) {
+ v2 = adjv2;
+ v = qSqrt(v2);
+ if (dist > 0)
+ v = -v;
+ }
}
dist = adjDist;
accel = v2 / (2.0f * qAbs(dist));
@@ -869,9 +875,18 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
timeline.reset(data.move);
timeline.accel(data.move, v, accel, maxDistance + overshootDist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
- flicked = true;
- emit q->flickingChanged();
- emit q->flickStarted();
+ if (!flickingHorizontally && q->xflick()) {
+ flickingHorizontally = true;
+ emit q->flickingChanged();
+ emit q->flickingHorizontallyChanged();
+ emit q->flickStarted();
+ }
+ if (!flickingVertically && q->yflick()) {
+ flickingVertically = true;
+ emit q->flickingChanged();
+ emit q->flickingVerticallyChanged();
+ emit q->flickStarted();
+ }
} else {
timeline.reset(data.move);
fixup(data, minExtent, maxExtent);
@@ -905,6 +920,9 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
In this case ListModel is a handy way for us to test our UI. In practice
the model would be implemented in C++, or perhaps via a SQL data source.
+ Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+
\bold Note that views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
to set \e {clip: true} in order to have the out of view items clipped
@@ -958,7 +976,7 @@ QDeclarativeGridView::~QDeclarativeGridView()
id: wrapper
GridView.onRemove: SequentialAnimation {
PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
- NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
}
}
@@ -1019,13 +1037,14 @@ void QDeclarativeGridView::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
d->ownModel = true;
}
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
dataModel->setModel(model);
}
if (d->model) {
+ d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore | QDeclarativeGridViewPrivate::BufferAfter;
if (isComponentComplete()) {
refill();
if (d->currentIndex >= d->model->count() || d->currentIndex < 0) {
@@ -1047,12 +1066,17 @@ void QDeclarativeGridView::setModel(const QVariant &model)
}
/*!
- \qmlproperty component GridView::delegate
+ \qmlproperty Component GridView::delegate
The delegate provides a template defining each item instantiated by the view.
The index is exposed as an accessible \c index property. Properties of the
model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+ The number of elements in the delegate has a direct effect on the
+ flicking performance of the view. If at all possible, place functionality
+ that is not needed for the normal display of the delegate in a \l Loader which
+ can load additional elements when needed.
+
Note that the GridView will layout the items based on the size of the root item
in the delegate.
@@ -1160,7 +1184,7 @@ int QDeclarativeGridView::count() const
}
/*!
- \qmlproperty component GridView::highlight
+ \qmlproperty Component GridView::highlight
This property holds the component to use as the highlight.
An instance of the highlight component will be created for each view.
@@ -1271,17 +1295,17 @@ void QDeclarativeGridView::setHighlightMoveDuration(int duration)
highlight range. Furthermore, the behaviour of the current item index will occur
whether or not a highlight exists.
- If highlightRangeMode is set to \e ApplyRange the view will
+ If highlightRangeMode is set to \e GridView.ApplyRange the view will
attempt to maintain the highlight within the range, however
the highlight can move outside of the range at the ends of the list
or due to a mouse interaction.
- If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never
+ If highlightRangeMode is set to \e GridView.StrictlyEnforceRange the highlight will never
move outside of the range. This means that the current item will change
if a keyboard or mouse action would cause the highlight to move
outside of the range.
- The default value is \e NoHighlightRange.
+ The default value is \e GridView.NoHighlightRange.
Note that a valid range requires preferredHighlightEnd to be greater
than or equal to preferredHighlightBegin.
@@ -1339,10 +1363,10 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
\qmlproperty enumeration GridView::flow
This property holds the flow of the grid.
- Possible values are \c LeftToRight (default) and \c TopToBottom.
+ Possible values are \c GridView.LeftToRight (default) and \c GridView.TopToBottom.
- If \a flow is \c LeftToRight, the view will scroll vertically.
- If \a flow is \c TopToBottom, the view will scroll horizontally.
+ If \a flow is \c GridView.LeftToRight, the view will scroll vertically.
+ If \a flow is \c GridView.TopToBottom, the view will scroll horizontally.
*/
QDeclarativeGridView::Flow QDeclarativeGridView::flow() const
{
@@ -1357,10 +1381,10 @@ void QDeclarativeGridView::setFlow(Flow flow)
d->flow = flow;
if (d->flow == LeftToRight) {
setContentWidth(-1);
- setFlickDirection(QDeclarativeFlickable::VerticalFlick);
+ setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
} else {
setContentHeight(-1);
- setFlickDirection(QDeclarativeFlickable::HorizontalFlick);
+ setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
}
d->clear();
d->updateGrid();
@@ -1393,12 +1417,23 @@ void QDeclarativeGridView::setWrapEnabled(bool wrap)
}
/*!
- \qmlproperty int GridView::cacheBuffer
- This property holds the number of off-screen pixels to cache.
-
- This property determines the number of pixels above the top of the view
- and below the bottom of the view to cache. Setting this value can make
- scrolling the view smoother at the expense of additional memory usage.
+ \qmlproperty int GridView::cacheBuffer
+ This property determines whether delegates are retained outside the
+ visible area of the view.
+
+ If non-zero the view will keep as many delegates
+ instantiated as will fit within the buffer specified. For example,
+ if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is
+ set to 40, then up to 2 delegates above and 2 delegates below the visible
+ area may be retained.
+
+ Note that cacheBuffer is not a pixel buffer - it only maintains additional
+ instantiated delegates.
+
+ Setting this value can make scrolling the list smoother at the expense
+ of additional memory usage. It is not a substitute for creating efficient
+ delegates; the fewer elements in a delegate, the faster a view may be
+ scrolled.
*/
int QDeclarativeGridView::cacheBuffer() const
{
@@ -1465,10 +1500,10 @@ void QDeclarativeGridView::setCellHeight(int cellHeight)
The allowed values are:
\list
- \o NoSnap (default) - the view will stop anywhere within the visible area.
- \o SnapToRow - the view will settle with a row (or column for TopToBottom flow)
+ \o GridView.NoSnap (default) - the view will stop anywhere within the visible area.
+ \o GridView.SnapToRow - the view will settle with a row (or column for TopToBottom flow)
aligned with the start of the view.
- \o SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow)
+ \o GridView.SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow)
away from the first visible row at the time the mouse button is released.
This mode is particularly useful for moving one page at a time.
\endlist
@@ -1505,7 +1540,7 @@ void QDeclarativeGridView::viewportMoved()
Q_D(QDeclarativeGridView);
QDeclarativeFlickable::viewportMoved();
d->lazyRelease = true;
- if (d->flicked) {
+ if (d->flickingHorizontally || d->flickingVertically) {
if (yflick()) {
if (d->vData.velocity > 0)
d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore;
@@ -1521,7 +1556,7 @@ void QDeclarativeGridView::viewportMoved()
}
}
refill();
- if (isFlicking() || d->moving)
+ if (d->flickingHorizontally || d->flickingVertically || d->movingHorizontally || d->movingVertically)
d->moveReason = QDeclarativeGridViewPrivate::Mouse;
if (d->moveReason != QDeclarativeGridViewPrivate::SetIndex) {
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
@@ -1616,6 +1651,9 @@ qreal QDeclarativeGridView::maxXExtent() const
void QDeclarativeGridView::keyPressEvent(QKeyEvent *event)
{
Q_D(QDeclarativeGridView);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
if (d->model && d->model->count() && d->interactive) {
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
int oldCurrent = currentIndex();
@@ -1641,10 +1679,8 @@ void QDeclarativeGridView::keyPressEvent(QKeyEvent *event)
}
}
d->moveReason = QDeclarativeGridViewPrivate::Other;
- QDeclarativeFlickable::keyPressEvent(event);
- if (event->isAccepted())
- return;
event->ignore();
+ QDeclarativeFlickable::keyPressEvent(event);
}
/*!
@@ -1860,7 +1896,8 @@ void QDeclarativeGridView::trackedPositionChanged()
Q_D(QDeclarativeGridView);
if (!d->trackedItem || !d->currentItem)
return;
- if (!isFlicking() && !d->moving && d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
+ if (!d->flickingHorizontally && !d->flickingVertically && !d->movingHorizontally && !d->movingVertically
+ && d->moveReason == QDeclarativeGridViewPrivate::SetIndex) {
const qreal trackedPos = d->trackedItem->rowPos();
const qreal viewPos = d->position();
if (d->haveHighlightRange) {
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index c06879e..2bf154c 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -82,6 +82,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeGridView : public QDeclarativeFlickable
Q_ENUMS(HighlightRangeMode)
Q_ENUMS(SnapMode)
+ Q_ENUMS(Flow)
+ Q_ENUMS(PositionMode)
Q_CLASSINFO("DefaultProperty", "data")
public:
@@ -120,7 +122,6 @@ public:
qreal preferredHighlightEnd() const;
void setPreferredHighlightEnd(qreal);
- Q_ENUMS(Flow)
enum Flow { LeftToRight, TopToBottom };
Flow flow() const;
void setFlow(Flow);
@@ -142,7 +143,6 @@ public:
void setSnapMode(SnapMode mode);
enum PositionMode { Beginning, Center, End, Visible, Contain };
- Q_ENUMS(PositionMode);
Q_INVOKABLE void positionViewAtIndex(int index, int mode);
Q_INVOKABLE int indexAt(int x, int y) const;
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 247e348..fe642e0 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -54,68 +54,44 @@ QT_BEGIN_NAMESPACE
\brief The Image element allows you to add bitmaps to a scene.
\inherits Item
- The Image element supports untransformed, stretched and tiled.
+ An Image element displays a specified \l source image:
- For an explanation of stretching and tiling, see the fillMode property description.
-
- Examples:
\table
\row
- \o \image declarative-qtlogo1.png
- \o Untransformed
- \qml
- Image { source: "pics/qtlogo.png" }
- \endqml
- \row
- \o \image declarative-qtlogo2.png
- \o fillMode: Stretch (default)
- \qml
- Image {
- width: 160
- height: 160
- source: "pics/qtlogo.png"
- }
- \endqml
- \row
- \o \image declarative-qtlogo3.png
- \o fillMode: Tile
- \qml
- Image {
- fillMode: Image.Tile
- width: 160; height: 160
- source: "pics/qtlogo.png"
- }
- \endqml
- \row
- \o \image declarative-qtlogo6.png
- \o fillMode: TileVertically
- \qml
- Image {
- fillMode: Image.TileVertically
- width: 160; height: 160
- source: "pics/qtlogo.png"
- }
- \endqml
- \row
- \o \image declarative-qtlogo5.png
- \o fillMode: TileHorizontally
+ \o
+ \image declarative-qtlogo.png
+ \o
\qml
- Image {
- fillMode: Image.TileHorizontally
- width: 160; height: 160
- source: "pics/qtlogo.png"
- }
+ import Qt 4.7
+
+ Image { source: "qtlogo.png" }
\endqml
\endtable
- */
+
+ If a size is not specified explicitly, the Image element is sized to the loaded image.
+ Image elements can be stretched and tiled using the \l fillMode property.
+
+ If the image \l source is a network resource, the image is loaded asynchronous and the
+ \l progress and \l status properties are updated appropriately. Otherwise, if the image is
+ available locally, it is loaded immediately and the user interface is blocked until loading is
+ complete. (This is typically the correct behavior for user interface elements.)
+ For large local images, which do not need to be visible immediately, it may be preferable to
+ enable \l asynchronous loading. This loads the image in the background using a low priority thread.
+
+ Images are cached and shared internally, so if several Image elements have the same source
+ only one copy of the image will be loaded.
+
+ \bold Note: Images are often the greatest user of memory in QML user interfaces. It is recommended
+ that images which do not form part of the user interface have their
+ size bounded via the \l sourceSize property. This is especially important for content
+ that is loaded from external sources or provided by the user.
+*/
/*!
\internal
\class QDeclarativeImage Image
\brief The QDeclarativeImage class provides an image item that you can add to a QDeclarativeView.
- \ingroup group_coreitems
-
Example:
\qml
Image { source: "pics/star.png" }
@@ -181,15 +157,85 @@ void QDeclarativeImagePrivate::setPixmap(const QPixmap &pixmap)
than the size of the item.
\list
- \o Stretch - the image is scaled to fit
- \o PreserveAspectFit - the image is scaled uniformly to fit without cropping
- \o PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary
- \o Tile - the image is duplicated horizontally and vertically
- \o TileVertically - the image is stretched horizontally and tiled vertically
- \o TileHorizontally - the image is stretched vertically and tiled horizontally
+ \o Image.Stretch - the image is scaled to fit
+ \o Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping
+ \o Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary
+ \o Image.Tile - the image is duplicated horizontally and vertically
+ \o Image.TileVertically - the image is stretched horizontally and tiled vertically
+ \o Image.TileHorizontally - the image is stretched vertically and tiled horizontally
\endlist
- \image declarative-image_fillMode.gif
+ \table
+
+ \row
+ \o \image declarative-qtlogo-stretch.png
+ \o Stretch (default)
+ \qml
+ Image {
+ width: 130; height: 100
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-preserveaspectfit.png
+ \o PreserveAspectFit
+ \qml
+ Image {
+ width: 130; height: 100
+ fillMode: Image.PreserveAspectFit
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-preserveaspectcrop.png
+ \o PreserveAspectCrop
+ \qml
+ Image {
+ width: 130; height: 100
+ fillMode: Image.PreserveAspectCrop
+ smooth: true
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-tile.png
+ \o Tile
+ \qml
+ Image {
+ width: 120; height: 120
+ fillMode: Image.Tile
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-tilevertically.png
+ \o TileVertically
+ \qml
+ Image {
+ width: 120; height: 120
+ fillMode: Image.TileVertically
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \row
+ \o \image declarative-qtlogo-tilehorizontally.png
+ \o TileHorizontally
+ \qml
+ Image {
+ width: 120; height: 120
+ fillMode: Image.TileHorizontally
+ source: "qtlogo.png"
+ }
+ \endqml
+
+ \endtable
*/
QDeclarativeImage::FillMode QDeclarativeImage::fillMode() const
{
@@ -225,10 +271,10 @@ qreal QDeclarativeImage::paintedHeight() const
This property holds the status of image loading. It can be one of:
\list
- \o Null - no image has been set
- \o Ready - the image has been loaded
- \o Loading - the image is currently being loaded
- \o Error - an error occurred while loading the image
+ \o Image.Null - no image has been set
+ \o Image.Ready - the image has been loaded
+ \o Image.Loading - the image is currently being loaded
+ \o Image.Error - an error occurred while loading the image
\endlist
Note that a change in the status property does not cause anything to happen
@@ -272,30 +318,54 @@ qreal QDeclarativeImage::paintedHeight() const
/*!
\qmlproperty QSize Image::sourceSize
- This properties is the size of the loaded image, in pixels.
-
- If you set this property explicitly, you can to control the storage
- used by a loaded image. The image will be scaled down if its intrinsic size
- is greater than this value.
-
- If only one dimension of the size is set (and the other left at 0), the
- unset dimension will be set in proportion to the set dimension to preserve
- the source image aspect ratio. The fillMode is independent of this.
-
- Unlike setting the width and height properties, which merely scale the painting
- of the image, this property affects the number of pixels stored.
+ This property holds the size of the loaded image, in pixels.
- \e{Changing this property dynamically will lead to the image source being reloaded,
- potentially even from the network if it is not in the disk cache.}
+ This is used to control the storage used by a loaded image. Unlike
+ the width and height properties, which scale the painting of the image, this property
+ affects the number of pixels stored.
+ If the image's actual size is larger than the sourceSize, the image is scaled down.
+ If only one dimension of the size is set to greater than 0, the
+ other dimension is set in proportion to preserve the source image's aspect ratio.
+ (The \l fillMode is independent of this.)
+
If the source is an instrinsically scalable image (eg. SVG), this property
- determines the size of the loaded image regardless of intrinsic size. You should
- avoid changing this property dynamically - rendering an SVG is \e slow compared
+ determines the size of the loaded image regardless of intrinsic size.
+ Avoid changing this property dynamically; rendering an SVG is \e slow compared
to an image.
If the source is a non-scalable image (eg. JPEG), the loaded image will
be no greater than this property specifies. For some formats (currently only JPEG),
the whole image will never actually be loaded into memory.
+
+ \note \e{Changing this property dynamically will lead to the image source being reloaded,
+ potentially even from the network if it is not in the disk cache.}
+
+ Here is an example that ensures the size of the image in memory is
+ no larger than 1024x1024 pixels, regardless of the size of the Image element.
+
+ \code
+ Image {
+ anchors.fill: parent
+ source: "images/reallyBigImage.jpg"
+ sourceSize.width: 1024
+ sourceSize.height: 1024
+ }
+ \endcode
+
+ The example below ensures the memory used by the image is no more than necessary
+ to display the image at the size of the Image element.
+ Of course if the Image element is resized a costly reload will be required, so
+ use this technique \e only when the Image size is fixed.
+
+ \code
+ Image {
+ anchors.fill: parent
+ source: "images/reallyBigImage.jpg"
+ sourceSize.width: width
+ sourceSize.height: height
+ }
+ \endcode
*/
void QDeclarativeImage::updatePaintedGeometry()
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 096e4bf..9547884 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -219,46 +219,9 @@ QT_BEGIN_NAMESPACE
The angle to rotate, in degrees clockwise.
*/
-
-/*!
- \group group_animation
- \title Animation
-*/
-
-/*!
- \group group_coreitems
- \title Basic Items
-*/
-
-/*!
- \group group_layouts
- \title Layouts
-*/
-
-/*!
- \group group_states
- \title States and Transitions
-*/
-
-/*!
- \group group_utility
- \title Utility
-*/
-
-/*!
- \group group_views
- \title Views
-*/
-
-/*!
- \group group_widgets
- \title Widgets
-*/
-
/*!
\internal
\class QDeclarativeContents
- \ingroup group_utility
\brief The QDeclarativeContents class gives access to the height and width of an item's contents.
*/
@@ -267,62 +230,93 @@ QDeclarativeContents::QDeclarativeContents() : m_x(0), m_y(0), m_width(0), m_hei
{
}
+QDeclarativeContents::~QDeclarativeContents()
+{
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ QDeclarativeItemPrivate::get(child)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ }
+}
+
QRectF QDeclarativeContents::rectF() const
{
return QRectF(m_x, m_y, m_width, m_height);
}
-//TODO: optimization: only check sender(), if there is one
-void QDeclarativeContents::calcHeight()
+void QDeclarativeContents::calcHeight(QDeclarativeItem *changed)
{
qreal oldy = m_y;
qreal oldheight = m_height;
- qreal top = FLT_MAX;
- qreal bottom = 0;
-
- QList<QGraphicsItem *> children = m_item->childItems();
- for (int i = 0; i < children.count(); ++i) {
- QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
- if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
- continue;
- qreal y = child->y();
- if (y + child->height() > bottom)
- bottom = y + child->height();
+ if (changed) {
+ qreal top = oldy;
+ qreal bottom = oldy + oldheight;
+ qreal y = changed->y();
+ if (y + changed->height() > bottom)
+ bottom = y + changed->height();
if (y < top)
top = y;
- }
- if (!children.isEmpty())
m_y = top;
- m_height = qMax(bottom - top, qreal(0.0));
+ m_height = bottom - top;
+ } else {
+ qreal top = FLT_MAX;
+ qreal bottom = 0;
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ qreal y = child->y();
+ if (y + child->height() > bottom)
+ bottom = y + child->height();
+ if (y < top)
+ top = y;
+ }
+ if (!children.isEmpty())
+ m_y = top;
+ m_height = qMax(bottom - top, qreal(0.0));
+ }
if (m_height != oldheight || m_y != oldy)
emit rectChanged(rectF());
}
-//TODO: optimization: only check sender(), if there is one
-void QDeclarativeContents::calcWidth()
+void QDeclarativeContents::calcWidth(QDeclarativeItem *changed)
{
qreal oldx = m_x;
qreal oldwidth = m_width;
- qreal left = FLT_MAX;
- qreal right = 0;
-
- QList<QGraphicsItem *> children = m_item->childItems();
- for (int i = 0; i < children.count(); ++i) {
- QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
- if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
- continue;
- qreal x = child->x();
- if (x + child->width() > right)
- right = x + child->width();
+ if (changed) {
+ qreal left = oldx;
+ qreal right = oldx + oldwidth;
+ qreal x = changed->x();
+ if (x + changed->width() > right)
+ right = x + changed->width();
if (x < left)
left = x;
- }
- if (!children.isEmpty())
m_x = left;
- m_width = qMax(right - left, qreal(0.0));
+ m_width = right - left;
+ } else {
+ qreal left = FLT_MAX;
+ qreal right = 0;
+ QList<QGraphicsItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
+ if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
+ continue;
+ qreal x = child->x();
+ if (x + child->width() > right)
+ right = x + child->width();
+ if (x < left)
+ left = x;
+ }
+ if (!children.isEmpty())
+ m_x = left;
+ m_width = qMax(right - left, qreal(0.0));
+ }
if (m_width != oldwidth || m_x != oldx)
emit rectChanged(rectF());
@@ -331,25 +325,57 @@ void QDeclarativeContents::calcWidth()
void QDeclarativeContents::setItem(QDeclarativeItem *item)
{
m_item = item;
+ //### optimize
+ connect(this, SIGNAL(rectChanged(QRectF)), m_item, SIGNAL(childrenRectChanged(QRectF)));
QList<QGraphicsItem *> children = m_item->childItems();
for (int i = 0; i < children.count(); ++i) {
QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i));
if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects?
continue;
- connect(child, SIGNAL(heightChanged()), this, SLOT(calcHeight()));
- connect(child, SIGNAL(yChanged()), this, SLOT(calcHeight()));
- connect(child, SIGNAL(widthChanged()), this, SLOT(calcWidth()));
- connect(child, SIGNAL(xChanged()), this, SLOT(calcWidth()));
- connect(this, SIGNAL(rectChanged(QRectF)), m_item, SIGNAL(childrenRectChanged(QRectF)));
+ QDeclarativeItemPrivate::get(child)->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ //###what about changes to visibility?
}
+ //### defer until componentComplete
+ calcHeight();
+ calcWidth();
+}
+
+void QDeclarativeContents::itemGeometryChanged(QDeclarativeItem *changed, const QRectF &newGeometry, const QRectF &oldGeometry)
+{
+ if (newGeometry.width() != oldGeometry.width())
+ calcWidth(changed);
+ if (newGeometry.height() != oldGeometry.height())
+ calcHeight(changed);
+}
+
+void QDeclarativeContents::itemDestroyed(QDeclarativeItem *item)
+{
+ if (item)
+ QDeclarativeItemPrivate::get(item)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ calcWidth();
calcHeight();
+}
+
+void QDeclarativeContents::childRemoved(QDeclarativeItem *item)
+{
+ if (item)
+ QDeclarativeItemPrivate::get(item)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
calcWidth();
+ calcHeight();
+}
+
+void QDeclarativeContents::childAdded(QDeclarativeItem *item)
+{
+ if (item)
+ QDeclarativeItemPrivate::get(item)->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed);
+ calcWidth(item);
+ calcHeight(item);
}
QDeclarativeItemKeyFilter::QDeclarativeItemKeyFilter(QDeclarativeItem *item)
-: m_next(0)
+: m_processPost(false), m_next(0)
{
QDeclarativeItemPrivate *p =
item?static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(item)):0;
@@ -363,19 +389,19 @@ QDeclarativeItemKeyFilter::~QDeclarativeItemKeyFilter()
{
}
-void QDeclarativeItemKeyFilter::keyPressed(QKeyEvent *event)
+void QDeclarativeItemKeyFilter::keyPressed(QKeyEvent *event, bool post)
{
- if (m_next) m_next->keyPressed(event);
+ if (m_next) m_next->keyPressed(event, post);
}
-void QDeclarativeItemKeyFilter::keyReleased(QKeyEvent *event)
+void QDeclarativeItemKeyFilter::keyReleased(QKeyEvent *event, bool post)
{
- if (m_next) m_next->keyReleased(event);
+ if (m_next) m_next->keyReleased(event, post);
}
-void QDeclarativeItemKeyFilter::inputMethodEvent(QInputMethodEvent *event)
+void QDeclarativeItemKeyFilter::inputMethodEvent(QInputMethodEvent *event, bool post)
{
- if (m_next) m_next->inputMethodEvent(event);
+ if (m_next) m_next->inputMethodEvent(event, post);
}
QVariant QDeclarativeItemKeyFilter::inputMethodQuery(Qt::InputMethodQuery query) const
@@ -437,14 +463,16 @@ void QDeclarativeItemKeyFilter::componentComplete()
}
\endcode
- KeyNavigation receives key events after the item it is attached to.
+ By default KeyNavigation receives key events after the item it is attached to.
If the item accepts an arrow key event, the KeyNavigation
- attached property will not receive an event for that key.
+ attached property will not receive an event for that key. Setting the
+ \l priority property to KeyNavigation.BeforeItem allows handling
+ of the key events before normal item processing.
If an item has been set for a direction and the KeyNavigation
attached property receives the corresponding
key press and release events, the events will be accepted by
- KeyNaviagtion and will not propagate any further.
+ KeyNavigation and will not propagate any further.
\sa {Keys}{Keys attached property}
*/
@@ -464,6 +492,7 @@ QDeclarativeKeyNavigationAttached::QDeclarativeKeyNavigationAttached(QObject *pa
: QObject(*(new QDeclarativeKeyNavigationAttachedPrivate), parent),
QDeclarativeItemKeyFilter(qobject_cast<QDeclarativeItem*>(parent))
{
+ m_processPost = true;
}
QDeclarativeKeyNavigationAttached *
@@ -550,12 +579,45 @@ void QDeclarativeKeyNavigationAttached::setBacktab(QDeclarativeItem *i)
emit changed();
}
-void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event)
+/*!
+ \qmlproperty enumeration KeyNavigation::priority
+
+ This property determines whether the keys are processed before
+ or after the attached item's own key handling.
+
+ \list
+ \o KeyNavigation.BeforeItem - process the key events before normal
+ item key processing. If the event is accepted it will not
+ be passed on to the item.
+ \o KeyNavigation.AfterItem (default) - process the key events after normal item key
+ handling. If the item accepts the key event it will not be
+ handled by the KeyNavigation attached property handler.
+ \endlist
+*/
+QDeclarativeKeyNavigationAttached::Priority QDeclarativeKeyNavigationAttached::priority() const
+{
+ return m_processPost ? AfterItem : BeforeItem;
+}
+
+void QDeclarativeKeyNavigationAttached::setPriority(Priority order)
{
- Q_D(QDeclarativeKeyNavigationAttached);
+ bool processPost = order == AfterItem;
+ if (processPost != m_processPost) {
+ m_processPost = processPost;
+ emit priorityChanged();
+ }
+}
+void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event, bool post)
+{
+ Q_D(QDeclarativeKeyNavigationAttached);
event->ignore();
+ if (post != m_processPost) {
+ QDeclarativeItemKeyFilter::keyPressed(event, post);
+ return;
+ }
+
switch(event->key()) {
case Qt::Key_Left:
if (d->left) {
@@ -597,15 +659,19 @@ void QDeclarativeKeyNavigationAttached::keyPressed(QKeyEvent *event)
break;
}
- if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyPressed(event);
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyPressed(event, post);
}
-void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event)
+void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
{
Q_D(QDeclarativeKeyNavigationAttached);
-
event->ignore();
+ if (post != m_processPost) {
+ QDeclarativeItemKeyFilter::keyReleased(event, post);
+ return;
+ }
+
switch(event->key()) {
case Qt::Key_Left:
if (d->left) {
@@ -641,7 +707,7 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event)
break;
}
- if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event);
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event, post);
}
/*!
@@ -683,6 +749,28 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event)
See \l {Qt::Key}{Qt.Key} for the list of keyboard codes.
+ If priority is Keys.BeforeItem (default) the order of key event processing is:
+
+ \list 1
+ \o Items specified in \c forwardTo
+ \o specific key handlers, e.g. onReturnPressed
+ \o onKeyPress, onKeyRelease handlers
+ \o Item specific key handling, e.g. TextInput key handling
+ \o parent item
+ \endlist
+
+ If priority is Keys.AfterItem the order of key event processing is:
+ \list 1
+ \o Item specific key handling, e.g. TextInput key handling
+ \o Items specified in \c forwardTo
+ \o specific key handlers, e.g. onReturnPressed
+ \o onKeyPress, onKeyRelease handlers
+ \o parent item
+ \endlist
+
+ If the event is accepted during any of the above steps, key
+ propagation stops.
+
\sa KeyEvent, {KeyNavigation}{KeyNavigation attached property}
*/
@@ -694,7 +782,23 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event)
*/
/*!
- \qmlproperty List<Object> Keys::forwardTo
+ \qmlproperty enumeration Keys::priority
+
+ This property determines whether the keys are processed before
+ or after the attached item's own key handling.
+
+ \list
+ \o Keys.BeforeItem (default) - process the key events before normal
+ item key processing. If the event is accepted it will not
+ be passed on to the item.
+ \o Keys.AfterItem - process the key events after normal item key
+ handling. If the item accepts the key event it will not be
+ handled by the Keys attached property handler.
+ \endlist
+*/
+
+/*!
+ \qmlproperty list<Object> Keys::forwardTo
This property provides a way to forward key presses, key releases, and keyboard input
coming from input methods to other items. This can be useful when you want
@@ -1013,6 +1117,7 @@ QDeclarativeKeysAttached::QDeclarativeKeysAttached(QObject *parent)
QDeclarativeItemKeyFilter(qobject_cast<QDeclarativeItem*>(parent))
{
Q_D(QDeclarativeKeysAttached);
+ m_processPost = false;
d->item = qobject_cast<QDeclarativeItem*>(parent);
}
@@ -1020,6 +1125,20 @@ QDeclarativeKeysAttached::~QDeclarativeKeysAttached()
{
}
+QDeclarativeKeysAttached::Priority QDeclarativeKeysAttached::priority() const
+{
+ return m_processPost ? AfterItem : BeforeItem;
+}
+
+void QDeclarativeKeysAttached::setPriority(Priority order)
+{
+ bool processPost = order == AfterItem;
+ if (processPost != m_processPost) {
+ m_processPost = processPost;
+ emit priorityChanged();
+ }
+}
+
void QDeclarativeKeysAttached::componentComplete()
{
Q_D(QDeclarativeKeysAttached);
@@ -1034,11 +1153,12 @@ void QDeclarativeKeysAttached::componentComplete()
}
}
-void QDeclarativeKeysAttached::keyPressed(QKeyEvent *event)
+void QDeclarativeKeysAttached::keyPressed(QKeyEvent *event, bool post)
{
Q_D(QDeclarativeKeysAttached);
- if (!d->enabled || d->inPress) {
+ if (post != m_processPost || !d->enabled || d->inPress) {
event->ignore();
+ QDeclarativeItemKeyFilter::keyPressed(event, post);
return;
}
@@ -1073,14 +1193,15 @@ void QDeclarativeKeysAttached::keyPressed(QKeyEvent *event)
emit pressed(&ke);
event->setAccepted(ke.isAccepted());
- if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyPressed(event);
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyPressed(event, post);
}
-void QDeclarativeKeysAttached::keyReleased(QKeyEvent *event)
+void QDeclarativeKeysAttached::keyReleased(QKeyEvent *event, bool post)
{
Q_D(QDeclarativeKeysAttached);
- if (!d->enabled || d->inRelease) {
+ if (post != m_processPost || !d->enabled || d->inRelease) {
event->ignore();
+ QDeclarativeItemKeyFilter::keyReleased(event, post);
return;
}
@@ -1103,13 +1224,13 @@ void QDeclarativeKeysAttached::keyReleased(QKeyEvent *event)
emit released(&ke);
event->setAccepted(ke.isAccepted());
- if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event);
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::keyReleased(event, post);
}
-void QDeclarativeKeysAttached::inputMethodEvent(QInputMethodEvent *event)
+void QDeclarativeKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool post)
{
Q_D(QDeclarativeKeysAttached);
- if (d->item && !d->inIM && d->item->scene()) {
+ if (post == m_processPost && d->item && !d->inIM && d->item->scene()) {
d->inIM = true;
for (int ii = 0; ii < d->targets.count(); ++ii) {
QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii));
@@ -1124,7 +1245,7 @@ void QDeclarativeKeysAttached::inputMethodEvent(QInputMethodEvent *event)
}
d->inIM = false;
}
- if (!event->isAccepted()) QDeclarativeItemKeyFilter::inputMethodEvent(event);
+ if (!event->isAccepted()) QDeclarativeItemKeyFilter::inputMethodEvent(event, post);
}
class QDeclarativeItemAccessor : public QGraphicsItem
@@ -1168,7 +1289,10 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
width and height, \l {anchor-layout}{anchoring} and key handling.
You can subclass QDeclarativeItem to provide your own custom visual item that inherits
- these features.
+ these features. Note that, because it does not draw anything, QDeclarativeItem sets the
+ QGraphicsItem::ItemHasNoContents flag. If you subclass QDeclarativeItem to create a visual
+ item, you will need to unset this flag.
+
*/
/*!
@@ -1258,8 +1382,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
changes. For many properties in Item or Item derivatives this can be used
to add a touch of imperative logic to your application (when absolutely
necessary).
-
- \ingroup group_coreitems
*/
/*!
@@ -1388,6 +1510,7 @@ QDeclarativeItem::~QDeclarativeItem()
delete d->_anchorLines; d->_anchorLines = 0;
delete d->_anchors; d->_anchors = 0;
delete d->_stateGroup; d->_stateGroup = 0;
+ delete d->_contents; d->_contents = 0;
}
/*!
@@ -1407,7 +1530,7 @@ QDeclarativeItem::~QDeclarativeItem()
}
\endqml
- The default transform origin is \c Center.
+ The default transform origin is \c Item.Center.
*/
/*!
@@ -1472,11 +1595,6 @@ QDeclarativeItem *QDeclarativeItem::parentItem() const
*/
/*!
- \property QDeclarativeItem::resources
- \internal
-*/
-
-/*!
Returns true if construction of the QML component is complete; otherwise
returns false.
@@ -1491,18 +1609,6 @@ bool QDeclarativeItem::isComponentComplete() const
return d->_componentComplete;
}
-/*!
- \property QDeclarativeItem::anchors
- \internal
-*/
-
-/*! \internal */
-QDeclarativeAnchors *QDeclarativeItem::anchors()
-{
- Q_D(QDeclarativeItem);
- return d->anchors();
-}
-
void QDeclarativeItemPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
{
if (!o)
@@ -1624,29 +1730,23 @@ void QDeclarativeItemPrivate::parentProperty(QObject *o, void *rv, QDeclarativeN
specify it.
*/
-/*!
- \property QDeclarativeItem::data
- \internal
-*/
-
/*! \internal */
-QDeclarativeListProperty<QObject> QDeclarativeItem::data()
+QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::data()
{
- return QDeclarativeListProperty<QObject>(this, 0, QDeclarativeItemPrivate::data_append);
+ return QDeclarativeListProperty<QObject>(q_func(), 0, QDeclarativeItemPrivate::data_append);
}
/*!
\property QDeclarativeItem::childrenRect
\brief The geometry of an item's children.
- childrenRect provides an easy way to access the (collective) position and size of the item's children.
+ This property holds the (collective) position and size of the item's children.
*/
QRectF QDeclarativeItem::childrenRect()
{
Q_D(QDeclarativeItem);
if (!d->_contents) {
d->_contents = new QDeclarativeContents;
- QDeclarative_setParent_noEvent(d->_contents, this);
d->_contents->setItem(this);
}
return d->_contents->rectF();
@@ -1817,8 +1917,11 @@ void QDeclarativeItemPrivate::removeItemChangeListener(QDeclarativeItemChangeLis
void QDeclarativeItem::keyPressEvent(QKeyEvent *event)
{
Q_D(QDeclarativeItem);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
if (d->keyHandler)
- d->keyHandler->keyPressed(event);
+ d->keyHandler->keyPressed(event, true);
else
event->ignore();
}
@@ -1827,8 +1930,11 @@ void QDeclarativeItem::keyPressEvent(QKeyEvent *event)
void QDeclarativeItem::keyReleaseEvent(QKeyEvent *event)
{
Q_D(QDeclarativeItem);
+ keyReleasePreHandler(event);
+ if (event->isAccepted())
+ return;
if (d->keyHandler)
- d->keyHandler->keyReleased(event);
+ d->keyHandler->keyReleased(event, true);
else
event->ignore();
}
@@ -1837,8 +1943,11 @@ void QDeclarativeItem::keyReleaseEvent(QKeyEvent *event)
void QDeclarativeItem::inputMethodEvent(QInputMethodEvent *event)
{
Q_D(QDeclarativeItem);
+ inputMethodPreHandler(event);
+ if (event->isAccepted())
+ return;
if (d->keyHandler)
- d->keyHandler->inputMethodEvent(event);
+ d->keyHandler->inputMethodEvent(event, true);
else
event->ignore();
}
@@ -1857,99 +1966,93 @@ QVariant QDeclarativeItem::inputMethodQuery(Qt::InputMethodQuery query) const
return v;
}
-/*!
- \internal
-*/
-QDeclarativeAnchorLine QDeclarativeItem::left() const
+void QDeclarativeItem::keyPressPreHandler(QKeyEvent *event)
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->left;
+ Q_D(QDeclarativeItem);
+ if (d->keyHandler && !d->doneEventPreHandler)
+ d->keyHandler->keyPressed(event, false);
+ else
+ event->ignore();
+ d->doneEventPreHandler = true;
}
-/*!
- \internal
-*/
-QDeclarativeAnchorLine QDeclarativeItem::right() const
+void QDeclarativeItem::keyReleasePreHandler(QKeyEvent *event)
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->right;
+ Q_D(QDeclarativeItem);
+ if (d->keyHandler && !d->doneEventPreHandler)
+ d->keyHandler->keyReleased(event, false);
+ else
+ event->ignore();
+ d->doneEventPreHandler = true;
}
-/*!
- \internal
-*/
-QDeclarativeAnchorLine QDeclarativeItem::horizontalCenter() const
+void QDeclarativeItem::inputMethodPreHandler(QInputMethodEvent *event)
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->hCenter;
+ Q_D(QDeclarativeItem);
+ if (d->keyHandler && !d->doneEventPreHandler)
+ d->keyHandler->inputMethodEvent(event, false);
+ else
+ event->ignore();
+ d->doneEventPreHandler = true;
}
+
/*!
\internal
*/
-QDeclarativeAnchorLine QDeclarativeItem::top() const
+QDeclarativeAnchorLine QDeclarativeItemPrivate::left() const
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->top;
+ return anchorLines()->left;
}
/*!
\internal
*/
-QDeclarativeAnchorLine QDeclarativeItem::bottom() const
+QDeclarativeAnchorLine QDeclarativeItemPrivate::right() const
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->bottom;
+ return anchorLines()->right;
}
/*!
\internal
*/
-QDeclarativeAnchorLine QDeclarativeItem::verticalCenter() const
+QDeclarativeAnchorLine QDeclarativeItemPrivate::horizontalCenter() const
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->vCenter;
+ return anchorLines()->hCenter;
}
-
/*!
\internal
*/
-QDeclarativeAnchorLine QDeclarativeItem::baseline() const
+QDeclarativeAnchorLine QDeclarativeItemPrivate::top() const
{
- Q_D(const QDeclarativeItem);
- return d->anchorLines()->baseline;
+ return anchorLines()->top;
}
/*!
- \property QDeclarativeItem::top
- \internal
-*/
-
-/*!
- \property QDeclarativeItem::bottom
- \internal
-*/
-
-/*!
- \property QDeclarativeItem::left
- \internal
+ \internal
*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::bottom() const
+{
+ return anchorLines()->bottom;
+}
/*!
- \property QDeclarativeItem::right
- \internal
+ \internal
*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::verticalCenter() const
+{
+ return anchorLines()->vCenter;
+}
-/*!
- \property QDeclarativeItem::horizontalCenter
- \internal
-*/
/*!
- \property QDeclarativeItem::verticalCenter
- \internal
+ \internal
*/
+QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
+{
+ return anchorLines()->baseline;
+}
/*!
\qmlproperty AnchorLine Item::top
@@ -2291,9 +2394,9 @@ void QDeclarativeItemPrivate::focusChanged(bool flag)
}
/*! \internal */
-QDeclarativeListProperty<QObject> QDeclarativeItem::resources()
+QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::resources()
{
- return QDeclarativeListProperty<QObject>(this, 0, QDeclarativeItemPrivate::resources_append,
+ return QDeclarativeListProperty<QObject>(q_func(), 0, QDeclarativeItemPrivate::resources_append,
QDeclarativeItemPrivate::resources_count,
QDeclarativeItemPrivate::resources_at);
}
@@ -2315,15 +2418,10 @@ QDeclarativeListProperty<QObject> QDeclarativeItem::resources()
\sa {qmlstate}{States}
*/
-/*!
- \property QDeclarativeItem::states
- \internal
-*/
/*! \internal */
-QDeclarativeListProperty<QDeclarativeState> QDeclarativeItem::states()
+QDeclarativeListProperty<QDeclarativeState> QDeclarativeItemPrivate::states()
{
- Q_D(QDeclarativeItem);
- return d->states()->statesProperty();
+ return _states()->statesProperty();
}
/*!
@@ -2343,16 +2441,11 @@ QDeclarativeListProperty<QDeclarativeState> QDeclarativeItem::states()
\sa {state-transitions}{Transitions}
*/
-/*!
- \property QDeclarativeItem::transitions
- \internal
-*/
/*! \internal */
-QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItem::transitions()
+QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transitions()
{
- Q_D(QDeclarativeItem);
- return d->states()->transitionsProperty();
+ return _states()->transitionsProperty();
}
/*
@@ -2426,20 +2519,18 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItem::transitions()
*/
/*! \internal */
-QString QDeclarativeItem::state() const
+QString QDeclarativeItemPrivate::state() const
{
- Q_D(const QDeclarativeItem);
- if (!d->_stateGroup)
+ if (!_stateGroup)
return QString();
else
- return d->_stateGroup->state();
+ return _stateGroup->state();
}
/*! \internal */
-void QDeclarativeItem::setState(const QString &state)
+void QDeclarativeItemPrivate::setState(const QString &state)
{
- Q_D(QDeclarativeItem);
- d->states()->setState(state);
+ _states()->setState(state);
}
/*!
@@ -2502,7 +2593,7 @@ void QDeclarativeItem::componentComplete()
d->keyHandler->componentComplete();
}
-QDeclarativeStateGroup *QDeclarativeItemPrivate::states()
+QDeclarativeStateGroup *QDeclarativeItemPrivate::_states()
{
Q_Q(QDeclarativeItem);
if (!_stateGroup) {
@@ -2618,6 +2709,16 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change,
}
}
break;
+ case ItemChildAddedChange:
+ if (d->_contents)
+ d->_contents->childAdded(qobject_cast<QDeclarativeItem*>(
+ value.value<QGraphicsItem*>()));
+ break;
+ case ItemChildRemovedChange:
+ if (d->_contents)
+ d->_contents->childRemoved(qobject_cast<QDeclarativeItem*>(
+ value.value<QGraphicsItem*>()));
+ break;
default:
break;
}
@@ -2723,29 +2824,48 @@ void QDeclarativeItem::setSmooth(bool smooth)
update();
}
+/*!
+ \internal
+ Return the width of the item
+*/
qreal QDeclarativeItem::width() const
{
Q_D(const QDeclarativeItem);
return d->width();
}
+/*!
+ \internal
+ Set the width of the item
+*/
void QDeclarativeItem::setWidth(qreal w)
{
Q_D(QDeclarativeItem);
d->setWidth(w);
}
+/*!
+ \internal
+ Reset the width of the item
+*/
void QDeclarativeItem::resetWidth()
{
Q_D(QDeclarativeItem);
d->resetWidth();
}
+/*!
+ \internal
+ Return the width of the item
+*/
qreal QDeclarativeItemPrivate::width() const
{
return mWidth;
}
+/*!
+ \internal
+*/
void QDeclarativeItemPrivate::setWidth(qreal w)
{
Q_Q(QDeclarativeItem);
@@ -2765,7 +2885,10 @@ void QDeclarativeItemPrivate::setWidth(qreal w)
QRectF(q->x(), q->y(), oldWidth, height()));
}
-void QDeclarativeItemPrivate ::resetWidth()
+/*!
+ \internal
+*/
+void QDeclarativeItemPrivate::resetWidth()
{
Q_Q(QDeclarativeItem);
widthValid = false;
@@ -2810,29 +2933,47 @@ bool QDeclarativeItem::widthValid() const
return d->widthValid;
}
+/*!
+ \internal
+ Return the height of the item
+*/
qreal QDeclarativeItem::height() const
{
Q_D(const QDeclarativeItem);
return d->height();
}
+/*!
+ \internal
+ Set the height of the item
+*/
void QDeclarativeItem::setHeight(qreal h)
{
Q_D(QDeclarativeItem);
d->setHeight(h);
}
+/*!
+ \internal
+ Reset the height of the item
+*/
void QDeclarativeItem::resetHeight()
{
Q_D(QDeclarativeItem);
d->resetHeight();
}
+/*!
+ \internal
+*/
qreal QDeclarativeItemPrivate::height() const
{
return mHeight;
}
+/*!
+ \internal
+*/
void QDeclarativeItemPrivate::setHeight(qreal h)
{
Q_Q(QDeclarativeItem);
@@ -2852,6 +2993,9 @@ void QDeclarativeItemPrivate::setHeight(qreal h)
QRectF(q->x(), q->y(), width(), oldHeight));
}
+/*!
+ \internal
+*/
void QDeclarativeItemPrivate::resetHeight()
{
Q_Q(QDeclarativeItem);
@@ -2956,7 +3100,6 @@ void QDeclarativeItem::setFocus(bool focus)
}
/*!
- \reimp
\internal
*/
void QDeclarativeItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
@@ -2964,11 +3107,21 @@ void QDeclarativeItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidg
}
/*!
- \reimp
\internal
*/
bool QDeclarativeItem::event(QEvent *ev)
{
+ Q_D(QDeclarativeItem);
+ switch (ev->type()) {
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ case QEvent::InputMethod:
+ d->doneEventPreHandler = false;
+ break;
+ default:
+ break;
+ }
+
return QGraphicsObject::event(ev);
}
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index da5a36e..29fd241 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -70,20 +70,20 @@ class Q_DECLARATIVE_EXPORT QDeclarativeItem : public QGraphicsObject, public QDe
Q_INTERFACES(QDeclarativeParserStatus)
Q_PROPERTY(QDeclarativeItem * parent READ parentItem WRITE setParentItem NOTIFY parentChanged DESIGNABLE false FINAL)
- Q_PROPERTY(QDeclarativeListProperty<QObject> data READ data DESIGNABLE false)
- Q_PROPERTY(QDeclarativeListProperty<QObject> resources READ resources DESIGNABLE false)
- Q_PROPERTY(QDeclarativeListProperty<QDeclarativeState> states READ states DESIGNABLE false)
- Q_PROPERTY(QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitions DESIGNABLE false)
- Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QObject> data READ data DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QObject> resources READ resources DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QDeclarativeState> states READ states DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitions DESIGNABLE false)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QString state READ state WRITE setState NOTIFY stateChanged)
Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL)
- Q_PROPERTY(QDeclarativeAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine left READ left CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine right READ right CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine horizontalCenter READ horizontalCenter CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine top READ top CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine bottom READ bottom CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine verticalCenter READ verticalCenter CONSTANT FINAL)
- Q_PROPERTY(QDeclarativeAnchorLine baseline READ baseline CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine left READ left CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine right READ right CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine horizontalCenter READ horizontalCenter CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine top READ top CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine bottom READ bottom CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine verticalCenter READ verticalCenter CONSTANT FINAL)
+ Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine baseline READ baseline CONSTANT FINAL)
Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged) // ### move to QGI/QGO, NOTIFY
Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
@@ -107,21 +107,11 @@ public:
QDeclarativeItem *parentItem() const;
void setParentItem(QDeclarativeItem *parent);
- QDeclarativeListProperty<QObject> data();
- QDeclarativeListProperty<QObject> resources();
-
- QDeclarativeAnchors *anchors();
QRectF childrenRect();
bool clip() const;
void setClip(bool);
- QDeclarativeListProperty<QDeclarativeState> states();
- QDeclarativeListProperty<QDeclarativeTransition> transitions();
-
- QString state() const;
- void setState(const QString &);
-
qreal baselineOffset() const;
void setBaselineOffset(qreal);
@@ -159,14 +149,6 @@ public:
Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const;
Q_INVOKABLE void forceFocus();
- QDeclarativeAnchorLine left() const;
- QDeclarativeAnchorLine right() const;
- QDeclarativeAnchorLine horizontalCenter() const;
- QDeclarativeAnchorLine top() const;
- QDeclarativeAnchorLine bottom() const;
- QDeclarativeAnchorLine verticalCenter() const;
- QDeclarativeAnchorLine baseline() const;
-
Q_SIGNALS:
void childrenChanged();
void childrenRectChanged(const QRectF &);
@@ -196,6 +178,10 @@ protected:
virtual void keyReleaseEvent(QKeyEvent *event);
virtual void inputMethodEvent(QInputMethodEvent *);
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+ void keyPressPreHandler(QKeyEvent *);
+ void keyReleasePreHandler(QKeyEvent *);
+ void inputMethodPreHandler(QInputMethodEvent *);
+
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index 3f5bf1a..15b34f0 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -79,24 +79,32 @@ class QNetworkReply;
class QDeclarativeItemKeyFilter;
//### merge into private?
-class QDeclarativeContents : public QObject
+class QDeclarativeContents : public QObject, public QDeclarativeItemChangeListener
{
Q_OBJECT
public:
QDeclarativeContents();
+ ~QDeclarativeContents();
QRectF rectF() const;
void setItem(QDeclarativeItem *item);
-public Q_SLOTS:
- void calcHeight();
- void calcWidth();
+ void childRemoved(QDeclarativeItem *item);
+ void childAdded(QDeclarativeItem *item);
Q_SIGNALS:
void rectChanged(QRectF);
+protected:
+ void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
+ void itemDestroyed(QDeclarativeItem *item);
+ //void itemVisibilityChanged(QDeclarativeItem *item)
+
private:
+ void calcHeight(QDeclarativeItem *changed = 0);
+ void calcWidth(QDeclarativeItem *changed = 0);
+
QDeclarativeItem *m_item;
qreal m_x;
qreal m_y;
@@ -116,7 +124,7 @@ public:
_stateGroup(0), origin(QDeclarativeItem::Center),
widthValid(false), heightValid(false),
_componentComplete(true), _keepMouse(false),
- smooth(false), transformOriginDirty(true), keyHandler(0),
+ smooth(false), transformOriginDirty(true), doneEventPreHandler(false), keyHandler(0),
mWidth(0), mHeight(0), implicitWidth(0), implicitHeight(0)
{
QGraphicsItemPrivate::acceptedMouseButtons = 0;
@@ -150,6 +158,22 @@ public:
void setHeight(qreal);
void resetHeight();
+ QDeclarativeListProperty<QObject> data();
+ QDeclarativeListProperty<QObject> resources();
+
+ QDeclarativeListProperty<QDeclarativeState> states();
+ QDeclarativeListProperty<QDeclarativeTransition> transitions();
+
+ QString state() const;
+ void setState(const QString &);
+
+ QDeclarativeAnchorLine left() const;
+ QDeclarativeAnchorLine right() const;
+ QDeclarativeAnchorLine horizontalCenter() const;
+ QDeclarativeAnchorLine top() const;
+ QDeclarativeAnchorLine bottom() const;
+ QDeclarativeAnchorLine verticalCenter() const;
+ QDeclarativeAnchorLine baseline() const;
// data property
static void data_append(QDeclarativeListProperty<QObject> *, QObject *);
@@ -165,6 +189,11 @@ public:
static QGraphicsTransform *transform_at(QDeclarativeListProperty<QGraphicsTransform> *list, int);
static void transform_clear(QDeclarativeListProperty<QGraphicsTransform> *list);
+ static QDeclarativeItemPrivate* get(QDeclarativeItem *item)
+ {
+ return item->d_func();
+ }
+
// Accelerated property accessors
QDeclarativeNotifier parentNotifier;
static void parentProperty(QObject *o, void *rv, QDeclarativeNotifierEndpoint *e);
@@ -224,7 +253,7 @@ public:
void removeItemChangeListener(QDeclarativeItemChangeListener *, ChangeTypes types);
QPODVector<ChangeListener,4> changeListeners;
- QDeclarativeStateGroup *states();
+ QDeclarativeStateGroup *_states();
QDeclarativeStateGroup *_stateGroup;
QDeclarativeItem::TransformOrigin origin:4;
@@ -234,6 +263,7 @@ public:
bool _keepMouse:1;
bool smooth:1;
bool transformOriginDirty : 1;
+ bool doneEventPreHandler : 1;
QDeclarativeItemKeyFilter *keyHandler;
@@ -295,12 +325,14 @@ public:
QDeclarativeItemKeyFilter(QDeclarativeItem * = 0);
virtual ~QDeclarativeItemKeyFilter();
- virtual void keyPressed(QKeyEvent *event);
- virtual void keyReleased(QKeyEvent *event);
- virtual void inputMethodEvent(QInputMethodEvent *event);
+ virtual void keyPressed(QKeyEvent *event, bool post);
+ virtual void keyReleased(QKeyEvent *event, bool post);
+ virtual void inputMethodEvent(QInputMethodEvent *event, bool post);
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
virtual void componentComplete();
+ bool m_processPost;
+
private:
QDeclarativeItemKeyFilter *m_next;
};
@@ -330,6 +362,9 @@ class QDeclarativeKeyNavigationAttached : public QObject, public QDeclarativeIte
Q_PROPERTY(QDeclarativeItem *down READ down WRITE setDown NOTIFY changed)
Q_PROPERTY(QDeclarativeItem *tab READ tab WRITE setTab NOTIFY changed)
Q_PROPERTY(QDeclarativeItem *backtab READ backtab WRITE setBacktab NOTIFY changed)
+ Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
+
+ Q_ENUMS(Priority)
public:
QDeclarativeKeyNavigationAttached(QObject * = 0);
@@ -347,14 +382,19 @@ public:
QDeclarativeItem *backtab() const;
void setBacktab(QDeclarativeItem *);
+ enum Priority { BeforeItem, AfterItem };
+ Priority priority() const;
+ void setPriority(Priority);
+
static QDeclarativeKeyNavigationAttached *qmlAttachedProperties(QObject *);
Q_SIGNALS:
void changed();
+ void priorityChanged();
private:
- virtual void keyPressed(QKeyEvent *event);
- virtual void keyReleased(QKeyEvent *event);
+ virtual void keyPressed(QKeyEvent *event, bool post);
+ virtual void keyReleased(QKeyEvent *event, bool post);
};
class QDeclarativeKeysAttachedPrivate : public QObjectPrivate
@@ -394,6 +434,9 @@ class QDeclarativeKeysAttached : public QObject, public QDeclarativeItemKeyFilte
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeItem> forwardTo READ forwardTo)
+ Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
+
+ Q_ENUMS(Priority)
public:
QDeclarativeKeysAttached(QObject *parent=0);
@@ -408,6 +451,10 @@ public:
}
}
+ enum Priority { BeforeItem, AfterItem};
+ Priority priority() const;
+ void setPriority(Priority);
+
QDeclarativeListProperty<QDeclarativeItem> forwardTo() {
Q_D(QDeclarativeKeysAttached);
return QDeclarativeListProperty<QDeclarativeItem>(this, d->targets);
@@ -419,6 +466,7 @@ public:
Q_SIGNALS:
void enabledChanged();
+ void priorityChanged();
void pressed(QDeclarativeKeyEvent *event);
void released(QDeclarativeKeyEvent *event);
void digit0Pressed(QDeclarativeKeyEvent *event);
@@ -463,9 +511,9 @@ Q_SIGNALS:
void volumeDownPressed(QDeclarativeKeyEvent *event);
private:
- virtual void keyPressed(QKeyEvent *event);
- virtual void keyReleased(QKeyEvent *event);
- virtual void inputMethodEvent(QInputMethodEvent *);
+ virtual void keyPressed(QKeyEvent *event, bool post);
+ virtual void keyReleased(QKeyEvent *event, bool post);
+ virtual void inputMethodEvent(QInputMethodEvent *, bool post);
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
const QByteArray keyToSignal(int key) {
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 2945b6c..7c55009 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -143,7 +143,9 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QAction>();
qmlRegisterType<QDeclarativePen>();
qmlRegisterType<QDeclarativeFlickableVisibleArea>();
+#ifndef QT_NO_GRAPHICSEFFECT
qmlRegisterType<QGraphicsEffect>();
+#endif
qmlRegisterUncreatableType<QDeclarativeKeyNavigationAttached>("Qt",4,7,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties"));
qmlRegisterUncreatableType<QDeclarativeKeysAttached>("Qt",4,7,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties"));
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index c88dab2..936f9b0 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -48,6 +48,7 @@
#include <qdeclarativeexpression.h>
#include <qdeclarativeengine.h>
#include <qdeclarativeguard_p.h>
+#include <qdeclarativeinfo.h>
#include <qlistmodelinterface_p.h>
#include <qmath.h>
@@ -161,9 +162,9 @@ public:
, highlightResizeSpeed(400), highlightResizeDuration(-1), highlightRange(QDeclarativeListView::NoHighlightRange)
, snapMode(QDeclarativeListView::NoSnap), overshootDist(0.0)
, footerComponent(0), footer(0), headerComponent(0), header(0)
- , bufferMode(NoBuffer)
+ , bufferMode(BufferBefore | BufferAfter)
, ownModel(false), wrap(false), autoHighlight(true), haveHighlightRange(false)
- , correctFlick(true), inFlickCorrection(false), lazyRelease(false)
+ , correctFlick(false), inFlickCorrection(false), lazyRelease(false)
, deferredRelease(false), layoutScheduled(false), minExtentDirty(true), maxExtentDirty(true)
{}
@@ -525,7 +526,7 @@ void QDeclarativeListViewPrivate::init()
q->setFlag(QGraphicsItem::ItemIsFocusScope);
addItemChangeListener(this, Geometry);
QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped()));
- q->setFlickDirection(QDeclarativeFlickable::VerticalFlick);
+ q->setFlickableDirection(QDeclarativeFlickable::VerticalFlick);
::memset(sectionCache, 0, sizeof(QDeclarativeItem*) * sectionCacheSize);
}
@@ -573,9 +574,11 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
if (model->completePending()) {
// complete
listItem->item->setZValue(1);
+ listItem->item->setParentItem(q->viewport());
model->completeItem();
+ } else {
+ listItem->item->setParentItem(q->viewport());
}
- listItem->item->setParentItem(q->viewport());
QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
if (sectionCriteria && sectionCriteria->delegate()) {
@@ -648,7 +651,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
FxListItem *item = 0;
int pos = itemEnd + 1;
while (modelIndex < model->count() && pos <= fillTo) {
- //qDebug() << "refill: append item" << modelIndex << "pos" << pos;
+// qDebug() << "refill: append item" << modelIndex << "pos" << pos;
if (!(item = createItem(modelIndex)))
break;
item->setPosition(pos);
@@ -659,8 +662,8 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
if (doBuffer) // never buffer more than one item per frame
break;
}
- while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos > fillFrom) {
- //qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos;
+ while (visibleIndex > 0 && visibleIndex <= model->count() && visiblePos-1 >= fillFrom) {
+// qDebug() << "refill: prepend item" << visibleIndex-1 << "current top pos" << visiblePos;
if (!(item = createItem(visibleIndex-1)))
break;
--visibleIndex;
@@ -676,7 +679,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
while (visibleItems.count() > 1 && (item = visibleItems.first()) && item->endPosition() < bufferFrom) {
if (item->attached->delayRemove())
break;
- //qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
+// qDebug() << "refill: remove first" << visibleIndex << "top end pos" << item->endPosition();
if (item->index != -1)
visibleIndex++;
visibleItems.removeFirst();
@@ -686,7 +689,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer)
while (visibleItems.count() > 1 && (item = visibleItems.last()) && item->position() > bufferTo) {
if (item->attached->delayRemove())
break;
- //qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1;
+// qDebug() << "refill: remove last" << visibleIndex+visibleItems.count()-1 << item->position();
visibleItems.removeLast();
releaseItem(item);
changed = true;
@@ -866,7 +869,7 @@ void QDeclarativeListViewPrivate::updateHighlight()
{
if ((!currentItem && highlight) || (currentItem && !highlight))
createHighlight();
- if (currentItem && autoHighlight && highlight && !moving) {
+ if (currentItem && autoHighlight && highlight && !movingHorizontally && !movingVertically) {
// auto-update highlight
highlightPosAnimator->to = currentItem->position();
highlightSizeAnimator->to = currentItem->size();
@@ -1164,6 +1167,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
moveReason = Mouse;
if ((!haveHighlightRange || highlightRange != QDeclarativeListView::StrictlyEnforceRange) && snapMode == QDeclarativeListView::NoSnap) {
+ correctFlick = true;
QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity);
return;
}
@@ -1205,7 +1209,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
else
v = maxVelocity;
}
- if (!flicked) {
+ if (!flickingHorizontally && !flickingVertically) {
// the initial flick - estimate boundary
qreal accel = deceleration;
qreal v2 = v * v;
@@ -1230,10 +1234,13 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
qreal adjDist = -data.flickTarget + data.move.value();
if (qAbs(adjDist) > qAbs(dist)) {
// Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
- v2 = accel * 2.0f * qAbs(dist);
- v = qSqrt(v2);
- if (dist > 0)
- v = -v;
+ qreal adjv2 = accel * 2.0f * qAbs(adjDist);
+ if (adjv2 > v2) {
+ v2 = adjv2;
+ v = qSqrt(v2);
+ if (dist > 0)
+ v = -v;
+ }
}
dist = adjDist;
accel = v2 / (2.0f * qAbs(dist));
@@ -1250,9 +1257,18 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
timeline.reset(data.move);
timeline.accel(data.move, v, accel, maxDistance + overshootDist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
- flicked = true;
- emit q->flickingChanged();
- emit q->flickStarted();
+ if (!flickingHorizontally && q->xflick()) {
+ flickingHorizontally = true;
+ emit q->flickingChanged();
+ emit q->flickingHorizontallyChanged();
+ emit q->flickStarted();
+ }
+ if (!flickingVertically && q->yflick()) {
+ flickingVertically = true;
+ emit q->flickingChanged();
+ emit q->flickingVerticallyChanged();
+ emit q->flickStarted();
+ }
correctFlick = true;
} else {
// reevaluate the target boundary.
@@ -1310,6 +1326,9 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
In this case ListModel is a handy way for us to test our UI. In practice
the model would be implemented in C++, or perhaps via a SQL data source.
+ Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+
\bold Note that views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
to set \e {clip: true} in order to have the out of view items clipped
@@ -1388,7 +1407,7 @@ QDeclarativeListView::~QDeclarativeListView()
id: wrapper
ListView.onRemove: SequentialAnimation {
PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
- NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" }
+ NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
}
}
@@ -1452,13 +1471,14 @@ void QDeclarativeListView::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
d->ownModel = true;
}
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
dataModel->setModel(model);
}
if (d->model) {
+ d->bufferMode = QDeclarativeListViewPrivate::BufferBefore | QDeclarativeListViewPrivate::BufferAfter;
if (isComponentComplete()) {
refill();
if (d->currentIndex >= d->model->count() || d->currentIndex < 0) {
@@ -1480,12 +1500,17 @@ void QDeclarativeListView::setModel(const QVariant &model)
}
/*!
- \qmlproperty component ListView::delegate
+ \qmlproperty Component ListView::delegate
The delegate provides a template defining each item instantiated by the view.
The index is exposed as an accessible \c index property. Properties of the
model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+ The number of elements in the delegate has a direct effect on the
+ flicking performance of the view. If at all possible, place functionality
+ that is not needed for the normal display of the delegate in a \l Loader which
+ can load additional elements when needed.
+
Note that the ListView will layout the items based on the size of the root item
in the delegate.
@@ -1595,7 +1620,7 @@ int QDeclarativeListView::count() const
}
/*!
- \qmlproperty component ListView::highlight
+ \qmlproperty Component ListView::highlight
This property holds the component to use as the highlight.
An instance of the highlight component will be created for each list.
@@ -1681,17 +1706,17 @@ void QDeclarativeListView::setHighlightFollowsCurrentItem(bool autoHighlight)
highlight range. Furthermore, the behaviour of the current item index will occur
whether or not a highlight exists.
- If highlightRangeMode is set to \e ApplyRange the view will
+ If highlightRangeMode is set to \e ListView.ApplyRange the view will
attempt to maintain the highlight within the range, however
the highlight can move outside of the range at the ends of the list
or due to a mouse interaction.
- If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never
+ If highlightRangeMode is set to \e ListView.StrictlyEnforceRange the highlight will never
move outside of the range. This means that the current item will change
if a keyboard or mouse action would cause the highlight to move
outside of the range.
- The default value is \e NoHighlightRange.
+ The default value is \e ListView.NoHighlightRange.
Note that a valid range requires preferredHighlightEnd to be greater
than or equal to preferredHighlightBegin.
@@ -1771,9 +1796,9 @@ void QDeclarativeListView::setSpacing(qreal spacing)
Possible values are \c Vertical (default) and \c Horizontal.
- Vertical Example:
+ ListView.Vertical Example:
\image trivialListView.png
- Horizontal Example:
+ ListView.Horizontal Example:
\image ListViewHorizontal.png
*/
QDeclarativeListView::Orientation QDeclarativeListView::orientation() const
@@ -1789,10 +1814,10 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
d->orient = orientation;
if (d->orient == QDeclarativeListView::Vertical) {
setContentWidth(-1);
- setFlickDirection(VerticalFlick);
+ setFlickableDirection(VerticalFlick);
} else {
setContentHeight(-1);
- setFlickDirection(HorizontalFlick);
+ setFlickableDirection(HorizontalFlick);
}
d->clear();
d->setPosition(0);
@@ -1826,11 +1851,22 @@ void QDeclarativeListView::setWrapEnabled(bool wrap)
/*!
\qmlproperty int ListView::cacheBuffer
- This property holds the number of off-screen pixels to cache.
-
- This property determines the number of pixels above the top of the list
- and below the bottom of the list to cache. Setting this value can make
- scrolling the list smoother at the expense of additional memory usage.
+ This property determines whether delegates are retained outside the
+ visible area of the view.
+
+ If non-zero the view will keep as many delegates
+ instantiated as will fit within the buffer specified. For example,
+ if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is
+ set to 40, then up to 2 delegates above and 2 delegates below the visible
+ area may be retained.
+
+ Note that cacheBuffer is not a pixel buffer - it only maintains additional
+ instantiated delegates.
+
+ Setting this value can make scrolling the list smoother at the expense
+ of additional memory usage. It is not a substitute for creating efficient
+ delegates; the fewer elements in a delegate, the faster a view may be
+ scrolled.
*/
int QDeclarativeListView::cacheBuffer() const
{
@@ -1872,7 +1908,7 @@ void QDeclarativeListView::setCacheBuffer(int b)
pet. The section expression is the size property. If \c ListView.section and
\c ListView.prevSection differ, the item will display a section header.
- \snippet examples/declarative/listview/sections.qml 0
+ \snippet examples/declarative/modelviews/listview/sections.qml 0
\image ListViewSections.png
*/
@@ -1987,17 +2023,17 @@ void QDeclarativeListView::setHighlightResizeDuration(int duration)
The allowed values are:
\list
- \o NoSnap (default) - the view will stop anywhere within the visible area.
- \o SnapToItem - the view will settle with an item aligned with the start of
+ \o ListView.NoSnap (default) - the view will stop anywhere within the visible area.
+ \o ListView.SnapToItem - the view will settle with an item aligned with the start of
the view.
- \o SnapOneItem - the view will settle no more than one item away from the first
+ \o ListView.SnapOneItem - the view will settle no more than one item away from the first
visible item at the time the mouse button is released. This mode is particularly
useful for moving one page at a time.
\endlist
snapMode does not affect the currentIndex. To update the
currentIndex as the list is moved set \e highlightRangeMode
- to \e StrictlyEnforceRange.
+ to \e ListView.StrictlyEnforceRange.
\sa highlightRangeMode
*/
@@ -2080,7 +2116,7 @@ void QDeclarativeListView::viewportMoved()
QDeclarativeFlickable::viewportMoved();
d->lazyRelease = true;
refill();
- if (isFlicking() || d->moving)
+ if (d->flickingHorizontally || d->flickingVertically || d->movingHorizontally || d->movingVertically)
d->moveReason = QDeclarativeListViewPrivate::Mouse;
if (d->moveReason != QDeclarativeListViewPrivate::SetIndex) {
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
@@ -2100,7 +2136,7 @@ void QDeclarativeListView::viewportMoved()
}
}
- if (d->flicked && d->correctFlick && !d->inFlickCorrection) {
+ if ((d->flickingHorizontally || d->flickingVertically) && d->correctFlick && !d->inFlickCorrection) {
d->inFlickCorrection = true;
// Near an end and it seems that the extent has changed?
// Recalculate the flick so that we don't end up in an odd position.
@@ -2227,6 +2263,9 @@ qreal QDeclarativeListView::maxXExtent() const
void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
{
Q_D(QDeclarativeListView);
+ keyPressPreHandler(event);
+ if (event->isAccepted())
+ return;
if (d->model && d->model->count() && d->interactive) {
if ((d->orient == QDeclarativeListView::Horizontal && event->key() == Qt::Key_Left)
@@ -2251,10 +2290,8 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
}
}
}
- QDeclarativeFlickable::keyPressEvent(event);
- if (event->isAccepted())
- return;
event->ignore();
+ QDeclarativeFlickable::keyPressEvent(event);
}
/*!
@@ -2420,7 +2457,8 @@ void QDeclarativeListView::trackedPositionChanged()
Q_D(QDeclarativeListView);
if (!d->trackedItem || !d->currentItem)
return;
- if (!isFlicking() && !d->moving && d->moveReason == QDeclarativeListViewPrivate::SetIndex) {
+ if (!d->flickingHorizontally && !d->flickingVertically && !d->movingHorizontally && !d->movingVertically
+ && d->moveReason == QDeclarativeListViewPrivate::SetIndex) {
const qreal trackedPos = qCeil(d->trackedItem->position());
const qreal viewPos = d->position();
if (d->haveHighlightRange) {
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index 9c0b7dd..d6e8023 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -124,6 +124,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeListView : public QDeclarativeFlickable
Q_ENUMS(HighlightRangeMode)
Q_ENUMS(Orientation)
Q_ENUMS(SnapMode)
+ Q_ENUMS(PositionMode)
Q_CLASSINFO("DefaultProperty", "data")
public:
@@ -200,7 +201,6 @@ public:
static QDeclarativeListViewAttached *qmlAttachedProperties(QObject *);
enum PositionMode { Beginning, Center, End, Visible, Contain };
- Q_ENUMS(PositionMode);
Q_INVOKABLE void positionViewAtIndex(int index, int mode);
Q_INVOKABLE int indexAt(int x, int y) const;
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index bdd2c87..cbdfd87 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE
QDeclarativeLoaderPrivate::QDeclarativeLoaderPrivate()
: item(0), component(0), ownComponent(false)
- , resizeMode(QDeclarativeLoader::SizeLoaderToItem)
{
}
@@ -59,9 +58,8 @@ QDeclarativeLoaderPrivate::~QDeclarativeLoaderPrivate()
void QDeclarativeLoaderPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, const QRectF &newGeometry, const QRectF &oldGeometry)
{
- if (resizeItem == item && resizeMode == QDeclarativeLoader::SizeLoaderToItem) {
- _q_updateSize();
- }
+ if (resizeItem == item)
+ _q_updateSize(false);
QDeclarativeItemChangeListener::itemGeometryChanged(resizeItem, newGeometry, oldGeometry);
}
@@ -76,11 +74,9 @@ void QDeclarativeLoaderPrivate::clear()
if (item) {
if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
- if (resizeMode == QDeclarativeLoader::SizeLoaderToItem) {
- QDeclarativeItemPrivate *p =
+ QDeclarativeItemPrivate *p =
static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
- p->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
- }
+ p->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
}
// We can't delete immediately because our item may have triggered
@@ -96,16 +92,12 @@ void QDeclarativeLoaderPrivate::initResize()
{
Q_Q(QDeclarativeLoader);
if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
- if (resizeMode == QDeclarativeLoader::SizeLoaderToItem) {
- QDeclarativeItemPrivate *p =
+ QDeclarativeItemPrivate *p =
static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
- p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
- }
+ p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
} else if (item && item->isWidget()) {
QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
- if (resizeMode == QDeclarativeLoader::SizeLoaderToItem) {
- widget->installEventFilter(q);
- }
+ widget->installEventFilter(q);
}
_q_updateSize();
}
@@ -329,6 +321,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
emit q->statusChanged();
emit q->progressChanged();
emit q->itemChanged();
+ emit q->loaded();
}
}
@@ -337,10 +330,10 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
This property holds the status of QML loading. It can be one of:
\list
- \o Null - no QML source has been set
- \o Ready - the QML source has been loaded
- \o Loading - the QML source is currently being loaded
- \o Error - an error occurred while loading the QML source
+ \o Loader.Null - no QML source has been set
+ \o Loader.Ready - the QML source has been loaded
+ \o Loader.Loading - the QML source is currently being loaded
+ \o Loader.Error - an error occurred while loading the QML source
\endlist
Note that a change in the status property does not cause anything to happen
@@ -349,10 +342,13 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
of the following ways:
\list
\o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: loader.status = Loader.Ready;}
- \o Do something inside the onStatusChanged signal handler, e.g. Loader{id: loader; onStatusChanged: if(loader.status == Loader.Ready) console.log('Loaded');}
+ \o Do something inside the onLoaded signal handler, e.g. Loader{id: loader; onLoaded: console.log('Loaded');}
\o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=Loader.Ready){'Not Loaded';}else{'Loaded';}}
\endlist
\sa progress
+
+ Note that if the source is a local file, the status will initially be Ready (or Error). While
+ there will be no onStatusChanged signal in that case, the onLoaded will still be invoked.
*/
QDeclarativeLoader::Status QDeclarativeLoader::status() const
@@ -368,6 +364,21 @@ QDeclarativeLoader::Status QDeclarativeLoader::status() const
return d->source.isEmpty() ? Null : Error;
}
+void QDeclarativeLoader::componentComplete()
+{
+ if (status() == Ready)
+ emit loaded();
+}
+
+
+/*!
+ \qmlsignal Loader::onLoaded()
+
+ This handler is called when the \l status becomes Loader.Ready, or on successful
+ initial load.
+*/
+
+
/*!
\qmlproperty real Loader::progress
@@ -390,83 +401,29 @@ qreal QDeclarativeLoader::progress() const
return 0.0;
}
-/*!
- \qmlproperty enumeration Loader::resizeMode
-
- This property determines how the Loader or item are resized:
- \list
- \o NoResize - no item will be resized
- \o SizeLoaderToItem - the Loader will be sized to the size of the item, unless the size of the Loader has been otherwise specified.
- \o SizeItemToLoader - the item will be sized to the size of the Loader.
- \endlist
-
- Note that changing from SizeItemToLoader to SizeLoaderToItem
- after the component is loaded will not return the item or Loader
- to it's original size. This is due to the item size being adjusted
- to the Loader size, thereby losing the original size of the item.
- Future changes to the item's size will affect the loader, however.
-
- The default resizeMode is SizeLoaderToItem.
-*/
-QDeclarativeLoader::ResizeMode QDeclarativeLoader::resizeMode() const
-{
- Q_D(const QDeclarativeLoader);
- return d->resizeMode;
-}
-
-void QDeclarativeLoader::setResizeMode(ResizeMode mode)
-{
- Q_D(QDeclarativeLoader);
- if (mode == d->resizeMode)
- return;
-
- if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(d->item)) {
- if (d->resizeMode == SizeLoaderToItem) {
- QDeclarativeItemPrivate *p =
- static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
- p->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry);
- }
- } else if (d->item && d->item->isWidget()) {
- if (d->resizeMode == SizeLoaderToItem)
- d->item->removeEventFilter(this);
- }
-
- d->resizeMode = mode;
- emit resizeModeChanged();
- d->initResize();
-}
-
-void QDeclarativeLoaderPrivate::_q_updateSize()
+void QDeclarativeLoaderPrivate::_q_updateSize(bool loaderGeometryChanged)
{
Q_Q(QDeclarativeLoader);
if (!item)
return;
if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
- if (resizeMode == QDeclarativeLoader::SizeLoaderToItem) {
- q->setWidth(qmlItem->width());
- q->setHeight(qmlItem->height());
- } else if (resizeMode == QDeclarativeLoader::SizeItemToLoader) {
+ q->setImplicitWidth(qmlItem->width());
+ if (loaderGeometryChanged && q->widthValid())
qmlItem->setWidth(q->width());
+ q->setImplicitHeight(qmlItem->height());
+ if (loaderGeometryChanged && q->heightValid())
qmlItem->setHeight(q->height());
- }
} else if (item && item->isWidget()) {
QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
- if (resizeMode == QDeclarativeLoader::SizeLoaderToItem) {
- QSizeF newSize = widget->size();
- if (newSize.isValid()) {
- q->setWidth(newSize.width());
- q->setHeight(newSize.height());
- }
- } else if (resizeMode == QDeclarativeLoader::SizeItemToLoader) {
- QSizeF oldSize = widget->size();
- QSizeF newSize = oldSize;
- if (q->heightValid())
- newSize.setHeight(q->height());
- if (q->widthValid())
- newSize.setWidth(q->width());
- if (oldSize != newSize)
- widget->resize(newSize);
- }
+ QSizeF widgetSize = widget->size();
+ q->setImplicitWidth(widgetSize.width());
+ if (loaderGeometryChanged && q->widthValid())
+ widgetSize.setWidth(q->width());
+ q->setImplicitHeight(widgetSize.height());
+ if (loaderGeometryChanged && q->heightValid())
+ widgetSize.setHeight(q->height());
+ if (widget->size() != widgetSize)
+ widget->resize(widgetSize);
}
}
@@ -484,9 +441,7 @@ void QDeclarativeLoader::geometryChanged(const QRectF &newGeometry, const QRectF
{
Q_D(QDeclarativeLoader);
if (newGeometry != oldGeometry) {
- if (d->resizeMode == SizeItemToLoader) {
- d->_q_updateSize();
- }
+ d->_q_updateSize();
}
QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
}
@@ -496,10 +451,8 @@ QVariant QDeclarativeLoader::itemChange(GraphicsItemChange change, const QVarian
Q_D(QDeclarativeLoader);
if (change == ItemSceneHasChanged) {
if (d->item && d->item->isWidget()) {
- if (d->resizeMode == SizeLoaderToItem) {
- d->item->removeEventFilter(this);
- d->item->installEventFilter(this);
- }
+ d->item->removeEventFilter(this);
+ d->item->installEventFilter(this);
}
}
return QDeclarativeItem::itemChange(change, value);
@@ -509,9 +462,8 @@ bool QDeclarativeLoader::eventFilter(QObject *watched, QEvent *e)
{
Q_D(QDeclarativeLoader);
if (watched == d->item && e->type() == QEvent::GraphicsSceneResize) {
- if (d->item && d->item->isWidget() && d->resizeMode == SizeLoaderToItem) {
- d->_q_updateSize();
- }
+ if (d->item && d->item->isWidget())
+ d->_q_updateSize(false);
}
return QDeclarativeItem::eventFilter(watched, e);
}
diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p.h
index e9fd8e9..ec7ffe9 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeloader_p.h
@@ -55,11 +55,9 @@ class Q_DECLARATIVE_EXPORT QDeclarativeLoader : public QDeclarativeItem
{
Q_OBJECT
Q_ENUMS(Status)
- Q_ENUMS(ResizeMode)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QDeclarativeComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceChanged)
- Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode NOTIFY resizeModeChanged)
Q_PROPERTY(QGraphicsObject *item READ item NOTIFY itemChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
@@ -79,10 +77,6 @@ public:
Status status() const;
qreal progress() const;
- enum ResizeMode { NoResize, SizeLoaderToItem, SizeItemToLoader };
- ResizeMode resizeMode() const;
- void setResizeMode(ResizeMode mode);
-
QGraphicsObject *item() const;
Q_SIGNALS:
@@ -90,12 +84,14 @@ Q_SIGNALS:
void sourceChanged();
void statusChanged();
void progressChanged();
- void resizeModeChanged();
+ void loaded();
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
bool eventFilter(QObject *watched, QEvent *e);
+ void componentComplete();
+
private:
Q_DISABLE_COPY(QDeclarativeLoader)
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeLoader)
diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
index 49069f9..0d4c4d0 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeloader_p_p.h
@@ -77,10 +77,9 @@ public:
QGraphicsObject *item;
QDeclarativeComponent *component;
bool ownComponent : 1;
- QDeclarativeLoader::ResizeMode resizeMode;
void _q_sourceLoaded();
- void _q_updateSize();
+ void _q_updateSize(bool loaderGeometryChanged = true);
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 126d041..1947c00 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -197,8 +197,8 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
This handler is called when the mouse enters the mouse area.
By default the onEntered handler is only called while a button is
- pressed. Setting hoverEnabled to true enables handling of
- onExited when no mouse button is pressed.
+ pressed. Setting hoverEnabled to true enables handling of
+ onEntered when no mouse button is pressed.
\sa hoverEnabled
*/
@@ -209,7 +209,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
This handler is called when the mouse exists the mouse area.
By default the onExited handler is only called while a button is
- pressed. Setting hoverEnabled to true enables handling of
+ pressed. Setting hoverEnabled to true enables handling of
onExited when no mouse button is pressed.
\sa hoverEnabled
@@ -288,12 +288,21 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
*/
/*!
+ \qmlsignal MouseArea::onCanceled()
+
+ This handler is called when the mouse events are canceled, either because the event was not accepted or
+ another element stole the mouse event handling. This signal is for advanced users, it's useful in case there
+ is more than one mouse areas handling input, or when there is a mouse area inside a flickable. In the latter
+ case, if you do some logic on pressed and then start dragging, the flickable will steal the mouse handling
+ from the mouse area. In these cases, to reset the logic when there is no mouse handling anymore, you should
+ use onCanceled, in addition to onReleased.
+*/
+
+/*!
\internal
\class QDeclarativeMouseArea
\brief The QDeclarativeMouseArea class provides a simple mouse handling abstraction for use within Qml.
- \ingroup group_coreitems
-
All QDeclarativeItem derived classes can do mouse handling but the QDeclarativeMouseArea class exposes mouse
handling data as properties and tracks flicking and dragging of the mouse.
@@ -365,7 +374,7 @@ void QDeclarativeMouseArea::setEnabled(bool a)
\list
\o Qt.LeftButton
\o Qt.RightButton
- \o Qt.MidButton
+ \o Qt.MiddleButton
\endlist
The code below displays "right" when the right mouse buttons is pressed:
@@ -564,10 +573,12 @@ bool QDeclarativeMouseArea::sceneEvent(QEvent *event)
// state
d->pressed = false;
setKeepMouseGrab(false);
- QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, false);
- emit released(&me);
+ emit canceled();
emit pressedChanged();
- setHovered(false);
+ if (d->hovered) {
+ d->hovered = false;
+ emit hoveredChanged();
+ }
}
}
return rv;
@@ -599,6 +610,23 @@ void QDeclarativeMouseArea::geometryChanged(const QRectF &newGeometry,
d->lastPos = mapFromScene(d->lastScenePos);
}
+/*! \internal */
+QVariant QDeclarativeMouseArea::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ Q_D(QDeclarativeMouseArea);
+ switch (change) {
+ case ItemVisibleHasChanged:
+ if (acceptHoverEvents() && d->hovered != (isVisible() && isUnderMouse()))
+ setHovered(!d->hovered);
+ break;
+ default:
+ break;
+ }
+
+ return QDeclarativeItem::itemChange(change, value);
+}
+
/*!
\qmlproperty bool MouseArea::hoverEnabled
This property holds whether hover events are handled.
@@ -609,6 +637,22 @@ void QDeclarativeMouseArea::geometryChanged(const QRectF &newGeometry,
This property affects the containsMouse property and the onEntered, onExited and onPositionChanged signals.
*/
+bool QDeclarativeMouseArea::hoverEnabled() const
+{
+ return acceptHoverEvents();
+}
+
+void QDeclarativeMouseArea::setHoverEnabled(bool h)
+{
+ Q_D(QDeclarativeMouseArea);
+ if (h == acceptHoverEvents())
+ return;
+
+ setAcceptHoverEvents(h);
+ emit hoverEnabledChanged();
+ if (d->hovered != isUnderMouse())
+ setHovered(!d->hovered);
+}
/*!
\qmlproperty bool MouseArea::containsMouse
@@ -651,7 +695,7 @@ void QDeclarativeMouseArea::setHovered(bool h)
\list
\o Qt.LeftButton
\o Qt.RightButton
- \o Qt.MidButton
+ \o Qt.MiddleButton
\endlist
To accept more than one button the flags can be combined with the
@@ -715,7 +759,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
/*!
\qmlproperty Item MouseArea::drag.target
\qmlproperty bool MouseArea::drag.active
- \qmlproperty Axis MouseArea::drag.axis
+ \qmlproperty enumeration MouseArea::drag.axis
\qmlproperty real MouseArea::drag.minimumX
\qmlproperty real MouseArea::drag.maximumX
\qmlproperty real MouseArea::drag.minimumY
@@ -726,7 +770,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
\list
\i \c target specifies the item to drag.
\i \c active specifies if the target item is being currently dragged.
- \i \c axis specifies whether dragging can be done horizontally (XAxis), vertically (YAxis), or both (XandYAxis)
+ \i \c axis specifies whether dragging can be done horizontally (Drag.XAxis), vertically (Drag.YAxis), or both (Drag.XandYAxis)
\i the minimum and maximum properties limit how far the target can be dragged along the corresponding axes.
\endlist
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index 4f7df62..df77ac6 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -121,7 +121,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeMouseArea : public QDeclarativeItem
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedChanged)
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
- Q_PROPERTY(bool hoverEnabled READ acceptHoverEvents WRITE setAcceptHoverEvents)
+ 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 ???
public:
@@ -142,6 +142,9 @@ public:
Qt::MouseButtons acceptedButtons() const;
void setAcceptedButtons(Qt::MouseButtons buttons);
+ bool hoverEnabled() const;
+ void setHoverEnabled(bool h);
+
QDeclarativeDrag *drag();
Q_SIGNALS:
@@ -149,6 +152,7 @@ Q_SIGNALS:
void pressedChanged();
void enabledChanged();
void acceptedButtonsChanged();
+ void hoverEnabledChanged();
void positionChanged(QDeclarativeMouseEvent *mouse);
void mousePositionChanged(QDeclarativeMouseEvent *mouse);
@@ -159,6 +163,7 @@ Q_SIGNALS:
void doubleClicked(QDeclarativeMouseEvent *mouse);
void entered();
void exited();
+ void canceled();
protected:
void setHovered(bool);
@@ -176,6 +181,7 @@ protected:
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
private:
void handlePress();
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
index f52636f..c4f0b86 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -59,8 +59,8 @@ QT_BEGIN_NAMESPACE
\brief The QDeclarativePaintedItem class is an abstract base class for QDeclarativeView items that want cached painting.
\internal
- This is a convenience class for implementing items that paint their contents
- using a QPainter. The contents of the item are cached behind the scenes.
+ This is a convenience class for implementing items that cache their painting.
+ The contents of the item are cached behind the scenes.
The dirtyCache() function should be called if the contents change to
ensure the cache is refreshed the next time painting occurs.
@@ -184,7 +184,6 @@ void QDeclarativePaintedItem::setContentsScale(qreal scale)
QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativePaintedItemPrivate), parent)
{
- init();
}
/*!
@@ -195,7 +194,6 @@ QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativeItem *parent)
QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent)
: QDeclarativeItem(dd, parent)
{
- init();
}
/*!
@@ -206,14 +204,23 @@ QDeclarativePaintedItem::~QDeclarativePaintedItem()
clearCache();
}
-/*!
- \internal
-*/
-void QDeclarativePaintedItem::init()
+void QDeclarativePaintedItem::geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry)
{
- connect(this,SIGNAL(widthChanged()),this,SLOT(clearCache()));
- connect(this,SIGNAL(heightChanged()),this,SLOT(clearCache()));
- connect(this,SIGNAL(visibleChanged()),this,SLOT(clearCache()));
+ if (newGeometry.width() != oldGeometry.width() ||
+ newGeometry.height() != oldGeometry.height())
+ clearCache();
+
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+QVariant QDeclarativePaintedItem::itemChange(GraphicsItemChange change,
+ const QVariant &value)
+{
+ if (change == ItemVisibleHasChanged)
+ clearCache();
+
+ return QDeclarativeItem::itemChange(change, value);
}
void QDeclarativePaintedItem::setCacheFrozen(bool frozen)
@@ -226,7 +233,7 @@ void QDeclarativePaintedItem::setCacheFrozen(bool frozen)
}
/*!
- \reimp
+ \internal
*/
void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
{
diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
index cc616af..8d08ba2 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h
@@ -87,6 +87,10 @@ protected:
QDeclarativePaintedItem(QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent);
virtual void drawContents(QPainter *p, const QRect &) = 0;
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+ virtual QVariant itemChange(GraphicsItemChange change,
+ const QVariant &value);
void setCacheFrozen(bool);
@@ -100,7 +104,6 @@ protected Q_SLOTS:
void clearCache();
private:
- void init();
Q_DISABLE_COPY(QDeclarativePaintedItem)
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativePaintedItem)
};
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index e2042fc..2d08c7c 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -63,7 +63,6 @@ QT_BEGIN_NAMESPACE
/*!
\internal
\class QDeclarativePathElement
- \ingroup group_utility
*/
/*!
@@ -86,7 +85,6 @@ QT_BEGIN_NAMESPACE
/*!
\internal
\class QDeclarativePath
- \ingroup group_utility
\brief The QDeclarativePath class defines a path.
\sa QDeclarativePathView
*/
@@ -117,6 +115,7 @@ void QDeclarativePath::setStartX(qreal x)
return;
d->startX = x;
emit startXChanged();
+ processPath();
}
qreal QDeclarativePath::startY() const
@@ -132,6 +131,7 @@ void QDeclarativePath::setStartY(qreal y)
return;
d->startY = y;
emit startYChanged();
+ processPath();
}
/*!
@@ -220,6 +220,9 @@ void QDeclarativePath::processPath()
{
Q_D(QDeclarativePath);
+ if (!d->componentComplete)
+ return;
+
d->_pointCache.clear();
d->_attributePoints.clear();
d->_path = QPainterPath();
@@ -284,10 +287,18 @@ void QDeclarativePath::processPath()
emit changed();
}
+void QDeclarativePath::classBegin()
+{
+ Q_D(QDeclarativePath);
+ d->componentComplete = false;
+}
+
void QDeclarativePath::componentComplete()
{
Q_D(QDeclarativePath);
QSet<QString> attrs;
+ d->componentComplete = true;
+
// First gather up all the attributes
foreach (QDeclarativePathElement *pathElement, d->_pathElements) {
if (QDeclarativePathAttribute *attribute =
@@ -311,6 +322,17 @@ QPainterPath QDeclarativePath::path() const
QStringList QDeclarativePath::attributes() const
{
Q_D(const QDeclarativePath);
+ if (!d->componentComplete) {
+ QSet<QString> attrs;
+
+ // First gather up all the attributes
+ foreach (QDeclarativePathElement *pathElement, d->_pathElements) {
+ if (QDeclarativePathAttribute *attribute =
+ qobject_cast<QDeclarativePathAttribute *>(pathElement))
+ attrs.insert(attribute->name());
+ }
+ return attrs.toList();
+ }
return d->_attributes;
}
@@ -355,7 +377,9 @@ void QDeclarativePath::createPointCache() const
{
Q_D(const QDeclarativePath);
qreal pathLength = d->_path.length();
- const int points = int(pathLength*2);
+ // more points means less jitter between items as they move along the
+ // path, but takes longer to generate
+ const int points = int(pathLength*5);
const int lastElement = d->_path.elementCount() - 1;
d->_pointCache.resize(points+1);
@@ -500,7 +524,6 @@ void QDeclarativeCurve::setY(qreal y)
/*!
\internal
\class QDeclarativePathAttribute
- \ingroup group_utility
\brief The QDeclarativePathAttribute class allows to set the value of an attribute at a given position in the path.
\sa QDeclarativePath
@@ -573,7 +596,6 @@ void QDeclarativePathAttribute::setValue(qreal value)
/*!
\internal
\class QDeclarativePathLine
- \ingroup group_utility
\brief The QDeclarativePathLine class defines a straight line.
\sa QDeclarativePath
@@ -617,7 +639,6 @@ void QDeclarativePathLine::addToPath(QPainterPath &path)
/*!
\internal
\class QDeclarativePathQuad
- \ingroup group_utility
\brief The QDeclarativePathQuad class defines a quadratic Bezier curve with a control point.
\sa QDeclarativePath
@@ -705,7 +726,6 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path)
/*!
\internal
\class QDeclarativePathCubic
- \ingroup group_utility
\brief The QDeclarativePathCubic class defines a cubic Bezier curve with two control points.
\sa QDeclarativePath
@@ -831,7 +851,6 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path)
/*!
\internal
\class QDeclarativePathPercent
- \ingroup group_utility
\brief The QDeclarativePathPercent class manipulates the way a path is interpreted.
QDeclarativePathPercent allows you to bunch up items (or spread out items) along various
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h
index d7cfca1..17a2ea3 100644
--- a/src/declarative/graphicsitems/qdeclarativepath_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepath_p.h
@@ -224,6 +224,7 @@ Q_SIGNALS:
protected:
virtual void componentComplete();
+ virtual void classBegin();
private Q_SLOTS:
void processPath();
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p_p.h b/src/declarative/graphicsitems/qdeclarativepath_p_p.h
index e82bcf5..994090e 100644
--- a/src/declarative/graphicsitems/qdeclarativepath_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepath_p_p.h
@@ -65,7 +65,7 @@ class QDeclarativePathPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QDeclarativePath)
public:
- QDeclarativePathPrivate() : startX(0), startY(0), closed(false) { }
+ QDeclarativePathPrivate() : startX(0), startY(0), closed(false), componentComplete(true) { }
QPainterPath _path;
QList<QDeclarativePathElement*> _pathElements;
@@ -75,6 +75,7 @@ public:
int startX;
int startY;
bool closed;
+ bool componentComplete;
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index d0a3cd1..207cc25 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -49,6 +49,7 @@
#include <qlistmodelinterface_p.h>
#include <QGraphicsSceneEvent>
+#include <qmath.h>
#include <math.h>
QT_BEGIN_NAMESPACE
@@ -98,9 +99,8 @@ QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex)
if (!attType) {
// pre-create one metatype to share with all attached objects
attType = new QDeclarativeOpenMetaObjectType(&QDeclarativePathViewAttached::staticMetaObject, qmlEngine(q));
- foreach(const QString &attr, path->attributes()) {
+ foreach(const QString &attr, path->attributes())
attType->createProperty(attr.toUtf8());
- }
}
qPathViewAttachedType = attType;
QDeclarativePathViewAttached *att = static_cast<QDeclarativePathViewAttached *>(qmlAttachedPropertiesObject<QDeclarativePathView>(item));
@@ -280,8 +280,8 @@ void QDeclarativePathViewPrivate::updateItem(QDeclarativeItem *item, qreal perce
att->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
}
QPointF pf = path->pointAt(percent);
- item->setX(pf.x() - item->width()*item->scale()/2);
- item->setY(pf.y() - item->height()*item->scale()/2);
+ item->setX(qRound(pf.x() - item->width()*item->scale()/2));
+ item->setY(qRound(pf.y() - item->height()*item->scale()/2));
}
void QDeclarativePathViewPrivate::regenerate()
@@ -308,12 +308,16 @@ void QDeclarativePathViewPrivate::regenerate()
The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in QML.
- The items are laid out along a path defined by a \l Path and may be flicked to scroll.
+ The \l delegate is instantiated for each item on the \l path.
+ The items may be flicked to move them along the path.
\snippet doc/src/snippets/declarative/pathview/pathview.qml 0
\image pathview.gif
+ Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
+
\bold Note that views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
to set \e {clip: true} in order to have the out of view items clipped
@@ -414,7 +418,7 @@ void QDeclarativePathView::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
d->ownModel = true;
}
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
@@ -467,12 +471,14 @@ void QDeclarativePathView::setPath(QDeclarativePath *path)
disconnect(d->path, SIGNAL(changed()), this, SLOT(refill()));
d->path = path;
connect(d->path, SIGNAL(changed()), this, SLOT(refill()));
- d->clear();
- if (d->attType) {
- d->attType->release();
- d->attType = 0;
+ if (d->isValid() && isComponentComplete()) {
+ d->clear();
+ if (d->attType) {
+ d->attType->release();
+ d->attType = 0;
+ }
+ d->regenerate();
}
- d->regenerate();
emit pathChanged();
}
@@ -522,6 +528,33 @@ void QDeclarativePathView::setCurrentIndex(int idx)
}
/*!
+ \qmlmethod PathView::incrementCurrentIndex()
+
+ Increments the current index.
+*/
+void QDeclarativePathView::incrementCurrentIndex()
+{
+ setCurrentIndex(currentIndex()+1);
+}
+
+
+/*!
+ \qmlmethod PathView::decrementCurrentIndex()
+
+ Decrements the current index.
+*/
+void QDeclarativePathView::decrementCurrentIndex()
+{
+ Q_D(QDeclarativePathView);
+ if (d->model && d->model->count()) {
+ int idx = currentIndex()-1;
+ if (idx < 0)
+ idx = d->model->count() - 1;
+ setCurrentIndex(idx);
+ }
+}
+
+/*!
\qmlproperty real PathView::offset
The offset specifies how far along the path the items are from their initial positions.
@@ -557,7 +590,7 @@ void QDeclarativePathViewPrivate::setOffset(qreal o)
}
/*!
- \qmlproperty component PathView::highlight
+ \qmlproperty Component PathView::highlight
This property holds the component to use as the highlight.
An instance of the highlight component will be created for each view.
@@ -618,12 +651,12 @@ QDeclarativeItem *QDeclarativePathView::highlightItem()
These properties set the preferred range of the highlight (current item)
within the view. The preferred values must be in the range 0.0-1.0.
- If highlightRangeMode is set to \e ApplyRange the view will
+ If highlightRangeMode is set to \e PathView.ApplyRange the view will
attempt to maintain the highlight within the range, however
the highlight can move outside of the range at the ends of the path
or due to a mouse interaction.
- If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never
+ If highlightRangeMode is set to \e PathView.StrictlyEnforceRange the highlight will never
move outside of the range. This means that the current item will change
if a keyboard or mouse action would cause the highlight to move
outside of the range.
@@ -631,14 +664,14 @@ QDeclarativeItem *QDeclarativePathView::highlightItem()
Note that this is the correct way to influence where the
current item ends up when the view moves. For example, if you want the
currently selected item to be in the middle of the path, then set the
- highlight range to be 0.5,0.5 and highlightRangeMode to StrictlyEnforceRange.
+ highlight range to be 0.5,0.5 and highlightRangeMode to PathView.StrictlyEnforceRange.
Then, when the path scrolls,
the currently selected item will be the item at that position. This also applies to
when the currently selected item changes - it will scroll to within the preferred
highlight range. Furthermore, the behaviour of the current item index will occur
whether or not a highlight exists.
- The default value is \e StrictlyEnforceRange.
+ The default value is \e PathView.StrictlyEnforceRange.
Note that a valid range requires preferredHighlightEnd to be greater
than or equal to preferredHighlightBegin.
@@ -786,12 +819,17 @@ void QDeclarativePathView::setInteractive(bool interactive)
}
/*!
- \qmlproperty component PathView::delegate
+ \qmlproperty Component PathView::delegate
The delegate provides a template defining each item instantiated by the view.
The index is exposed as an accessible \c index property. Properties of the
model are also available depending upon the type of \l {qmlmodels}{Data Model}.
+ The number of elements in the delegate has a direct effect on the
+ flicking performance of the view when pathItemCount is specified. If at all possible, place functionality
+ that is not needed for the normal display of the delegate in a \l Loader which
+ can load additional elements when needed.
+
Note that the PathView will layout the items based on the size of the root
item in the delegate.
@@ -961,7 +999,12 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
else
dist = qRound(dist - d->offset) + d->offset;
// Calculate accel required to stop on item boundary
- accel = v2 / (2.0f * qAbs(dist));
+ if (dist <= 0.) {
+ dist = 0.;
+ accel = 0.;
+ } else {
+ accel = v2 / (2.0f * qAbs(dist));
+ }
}
d->moveOffset.setValue(d->offset);
d->tl.accel(d->moveOffset, velocity, accel, dist);
@@ -1046,7 +1089,11 @@ void QDeclarativePathView::componentComplete()
Q_D(QDeclarativePathView);
QDeclarativeItem::componentComplete();
d->createHighlight();
- d->regenerate();
+ // It is possible that a refill has already happended to to Path
+ // bindings being handled in the componentComplete(). If so
+ // don't do it again.
+ if (d->items.count() == 0)
+ d->regenerate();
d->updateHighlight();
}
@@ -1101,7 +1148,8 @@ void QDeclarativePathView::refill()
while ((pos > startPos || !d->items.count()) && d->items.count() < count) {
// qDebug() << "append" << idx;
QDeclarativeItem *item = d->getItem(idx);
- item->setZValue(idx+1);
+ if (d->model->completePending())
+ item->setZValue(idx+1);
if (d->currentIndex == idx) {
item->setFocus(true);
if (QDeclarativePathViewAttached *att = d->attached(item))
@@ -1114,7 +1162,8 @@ void QDeclarativePathView::refill()
d->firstIndex = idx;
d->items.append(item);
d->updateItem(item, pos);
- d->model->completeItem();
+ if (d->model->completePending())
+ d->model->completeItem();
++idx;
if (idx >= d->model->count())
idx = 0;
@@ -1128,7 +1177,8 @@ void QDeclarativePathView::refill()
while (pos >= 0.0 && pos < startPos) {
// qDebug() << "prepend" << idx;
QDeclarativeItem *item = d->getItem(idx);
- item->setZValue(idx+1);
+ if (d->model->completePending())
+ item->setZValue(idx+1);
if (d->currentIndex == idx) {
item->setFocus(true);
if (QDeclarativePathViewAttached *att = d->attached(item))
@@ -1139,7 +1189,8 @@ void QDeclarativePathView::refill()
}
d->items.prepend(item);
d->updateItem(item, pos);
- d->model->completeItem();
+ if (d->model->completePending())
+ d->model->completeItem();
d->firstIndex = idx;
idx = d->firstIndex - 1;
if (idx < 0)
@@ -1251,6 +1302,19 @@ void QDeclarativePathView::createdItem(int index, QDeclarativeItem *item)
{
Q_D(QDeclarativePathView);
if (d->requestedIndex != index) {
+ if (!d->attType) {
+ // pre-create one metatype to share with all attached objects
+ d->attType = new QDeclarativeOpenMetaObjectType(&QDeclarativePathViewAttached::staticMetaObject, qmlEngine(this));
+ foreach(const QString &attr, d->path->attributes())
+ d->attType->createProperty(attr.toUtf8());
+ }
+ qPathViewAttachedType = d->attType;
+ QDeclarativePathViewAttached *att = static_cast<QDeclarativePathViewAttached *>(qmlAttachedPropertiesObject<QDeclarativePathView>(item));
+ qPathViewAttachedType = 0;
+ if (att) {
+ att->m_view = this;
+ att->setOnPath(false);
+ }
item->setParentItem(this);
d->updateItem(item, index < d->firstIndex ? 0.0 : 1.0);
}
@@ -1276,6 +1340,7 @@ int QDeclarativePathViewPrivate::calcCurrentIndex()
if (offset < 0)
offset += model->count();
current = qRound(qAbs(qmlMod(model->count() - offset, model->count())));
+ current = current % model->count();
}
return current;
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h
index 7240578..349a01c 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h
@@ -132,6 +132,10 @@ public:
static QDeclarativePathViewAttached *qmlAttachedProperties(QObject *);
+public Q_SLOTS:
+ void incrementCurrentIndex();
+ void decrementCurrentIndex();
+
Q_SIGNALS:
void currentIndexChanged();
void offsetChanged();
@@ -215,6 +219,7 @@ Q_SIGNALS:
private:
friend class QDeclarativePathViewPrivate;
+ friend class QDeclarativePathView;
QDeclarativePathView *m_view;
QDeclarativeOpenMetaObject *m_metaobject;
bool m_onPath : 1;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 21c33e2..8796e63 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -46,6 +46,7 @@
#include <qdeclarativestate_p.h>
#include <qdeclarativestategroup_p.h>
#include <qdeclarativestateoperations_p.h>
+#include <qdeclarativeinfo.h>
#include <QtCore/qmath.h>
#include <QDebug>
@@ -75,7 +76,6 @@ void QDeclarativeBasePositionerPrivate::unwatchChanges(QDeclarativeItem* other)
/*!
\internal
\class QDeclarativeBasePositioner
- \ingroup group_layouts
\brief The QDeclarativeBasePositioner class provides a base for QDeclarativeGraphics layouts.
To create a QDeclarativeGraphics Positioner, simply subclass QDeclarativeBasePositioner and implement
@@ -165,6 +165,7 @@ void QDeclarativeBasePositioner::componentComplete()
QDeclarativeItem::componentComplete();
positionedItems.reserve(d->QGraphicsItemPrivate::children.count());
prePositioning();
+ reportConflictingAnchors();
}
QVariant QDeclarativeBasePositioner::itemChange(GraphicsItemChange change,
@@ -203,7 +204,11 @@ void QDeclarativeBasePositioner::prePositioning()
if (!isComponentComplete())
return;
+ if (d->doingPositioning)
+ return;
+
d->queuedPositioning = false;
+ d->doingPositioning = true;
//Need to order children by creation order modified by stacking order
QList<QGraphicsItem *> children = d->QGraphicsItemPrivate::children;
qSort(children.begin(), children.end(), d->insertionOrder);
@@ -241,6 +246,7 @@ void QDeclarativeBasePositioner::prePositioning()
doPositioning(&contentSize);
if(d->addTransition || d->moveTransition)
finishApplyTransitions();
+ d->doingPositioning = false;
//Set implicit size to the size of its children
setImplicitHeight(contentSize.height());
setImplicitWidth(contentSize.width());
@@ -329,7 +335,6 @@ Column {
\qml
Column {
spacing: 2
- remove: ...
add: ...
move: ...
...
@@ -339,7 +344,8 @@ Column {
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
- the x or y properties, or use anchors on a child of a positioner, then the
+ the x or y properties, use anchors on a child of a positioner, or have the
+ height of a child depend on the position of a child, then the
positioner may exhibit strange behaviour.
*/
@@ -377,7 +383,7 @@ Column {
move: Transition {
NumberAnimation {
properties: "y"
- easing.type: "OutBounce"
+ easing.type: Easing.OutBounce
}
}
}
@@ -403,7 +409,6 @@ Column {
\internal
\class QDeclarativeColumn
\brief The QDeclarativeColumn class lines up items vertically.
- \ingroup group_positioners
*/
QDeclarativeColumn::QDeclarativeColumn(QDeclarativeItem *parent)
: QDeclarativeBasePositioner(Vertical, parent)
@@ -436,6 +441,30 @@ void QDeclarativeColumn::doPositioning(QSizeF *contentSize)
contentSize->setHeight(voffset - spacing());
}
+void QDeclarativeColumn::reportConflictingAnchors()
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors) {
+ QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
+ if (usedAnchors & QDeclarativeAnchors::TopAnchor ||
+ usedAnchors & QDeclarativeAnchors::BottomAnchor ||
+ usedAnchors & QDeclarativeAnchors::VCenterAnchor ||
+ anchors->fill() || anchors->centerIn()) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ }
+ if (d->anchorConflict) {
+ qmlInfo(this) << "Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column";
+ }
+}
+
/*!
\qmlclass Row QDeclarativeRow
\since 4.7
@@ -464,7 +493,8 @@ Row {
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
- the x or y properties, or use anchors on a child of a positioner, then the
+ the x or y properties, use anchors on a child of a positioner, or have the
+ width of a child depend on the position of a child, then the
positioner may exhibit strange behaviour.
*/
@@ -523,7 +553,6 @@ Row {
\internal
\class QDeclarativeRow
\brief The QDeclarativeRow class lines up items horizontally.
- \ingroup group_positioners
*/
QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
: QDeclarativeBasePositioner(Horizontal, parent)
@@ -551,6 +580,28 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
contentSize->setWidth(hoffset - spacing());
}
+void QDeclarativeRow::reportConflictingAnchors()
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors) {
+ QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
+ if (usedAnchors & QDeclarativeAnchors::LeftAnchor ||
+ usedAnchors & QDeclarativeAnchors::RightAnchor ||
+ usedAnchors & QDeclarativeAnchors::HCenterAnchor ||
+ anchors->fill() || anchors->centerIn()) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ }
+ if (d->anchorConflict)
+ qmlInfo(this) << "Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row";
+}
/*!
\qmlclass Grid QDeclarativeGrid
@@ -595,7 +646,8 @@ Grid {
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
- the x or y properties, or use anchors on a child of a positioner, then the
+ the x or y properties, use anchors on a child of a positioner, or have the
+ width or height of a child depend on the position of a child, then the
positioner may exhibit strange behaviour.
*/
/*!
@@ -652,8 +704,6 @@ Grid {
\internal
\class QDeclarativeGrid
\brief The QDeclarativeGrid class lays out items in a grid.
- \ingroup group_layouts
-
*/
QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight)
@@ -697,14 +747,14 @@ void QDeclarativeGrid::setRows(const int rows)
}
/*!
- \qmlproperty enumeration Flow::flow
+ \qmlproperty enumeration Grid::flow
This property holds the flow of the layout.
- Possible values are \c LeftToRight (default) and \c TopToBottom.
+ Possible values are \c Grid.LeftToRight (default) and \c Grid.TopToBottom.
- If \a flow is \c LeftToRight, the items are positioned next to
+ If \a flow is \c Grid.LeftToRight, the items are positioned next to
to each other from left to right, then wrapped to the next line.
- If \a flow is \c TopToBottom, the items are positioned next to each
+ If \a flow is \c Grid.TopToBottom, the items are positioned next to each
other from top to bottom, then wrapped to the next column.
*/
QDeclarativeGrid::Flow QDeclarativeGrid::flow() const
@@ -823,6 +873,22 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
}
}
+void QDeclarativeGrid::reportConflictingAnchors()
+{
+ QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ if (d->anchorConflict)
+ qmlInfo(this) << "Cannot specify anchors for items inside Grid";
+}
/*!
\qmlclass Flow QDeclarativeFlow
@@ -830,6 +896,11 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
\brief The Flow item lines up its children side by side, wrapping as necessary.
\inherits Item
+ Note that the positioner assumes that the x and y positions of its children
+ will not change. If you manually change the x or y properties in script, bind
+ the x or y properties, use anchors on a child of a positioner, or have the
+ width or height of a child depend on the position of a child, then the
+ positioner may exhibit strange behaviour.
*/
/*!
@@ -894,12 +965,12 @@ QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent)
\qmlproperty enumeration Flow::flow
This property holds the flow of the layout.
- Possible values are \c LeftToRight (default) and \c TopToBottom.
+ Possible values are \c Flow.LeftToRight (default) and \c Flow.TopToBottom.
- If \a flow is \c LeftToRight, the items are positioned next to
+ If \a flow is \c Flow.LeftToRight, the items are positioned next to
to each other from left to right until the width of the Flow
is exceeded, then wrapped to the next line.
- If \a flow is \c TopToBottom, the items are positioned next to each
+ If \a flow is \c Flow.TopToBottom, the items are positioned next to each
other from top to bottom until the height of the Flow is exceeded,
then wrapped to the next column.
*/
@@ -966,5 +1037,21 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
}
}
+void QDeclarativeFlow::reportConflictingAnchors()
+{
+ Q_D(QDeclarativeFlow);
+ for (int ii = 0; ii < positionedItems.count(); ++ii) {
+ const PositionedItem &child = positionedItems.at(ii);
+ if (child.item) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) {
+ d->anchorConflict = true;
+ break;
+ }
+ }
+ }
+ if (d->anchorConflict)
+ qmlInfo(this) << "Cannot specify anchors for items inside Flow";
+}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index b5fc979..787dcd3 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -94,6 +94,7 @@ protected Q_SLOTS:
protected:
virtual void doPositioning(QSizeF *contentSize)=0;
+ virtual void reportConflictingAnchors()=0;
struct PositionedItem {
PositionedItem(QDeclarativeItem *i) : item(i), isNew(false), isVisible(true) {}
bool operator==(const PositionedItem &other) const { return other.item == item; }
@@ -118,6 +119,7 @@ public:
QDeclarativeColumn(QDeclarativeItem *parent=0);
protected:
virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
private:
Q_DISABLE_COPY(QDeclarativeColumn)
};
@@ -129,6 +131,7 @@ public:
QDeclarativeRow(QDeclarativeItem *parent=0);
protected:
virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
private:
Q_DISABLE_COPY(QDeclarativeRow)
};
@@ -161,6 +164,7 @@ Q_SIGNALS:
protected:
virtual void doPositioning(QSizeF *contentSize);
+ virtual void reportConflictingAnchors();
private:
int m_rows;
@@ -187,7 +191,7 @@ Q_SIGNALS:
protected:
virtual void doPositioning(QSizeF *contentSize);
-
+ virtual void reportConflictingAnchors();
protected:
QDeclarativeFlow(QDeclarativeFlowPrivate &dd, QDeclarativeItem *parent);
private:
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
index 576f35b..04f0181 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -75,6 +75,7 @@ public:
QDeclarativeBasePositionerPrivate()
: spacing(0), type(QDeclarativeBasePositioner::None)
, moveTransition(0), addTransition(0), queuedPositioning(false)
+ , doingPositioning(false), anchorConflict(false)
{
}
@@ -95,7 +96,9 @@ public:
void watchChanges(QDeclarativeItem *other);
void unwatchChanges(QDeclarativeItem* other);
- bool queuedPositioning;
+ bool queuedPositioning : 1;
+ bool doingPositioning : 1;
+ bool anchorConflict : 1;
virtual void itemSiblingOrderChanged(QDeclarativeItem* other)
{
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index 0328f91..ccabbde 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -43,6 +43,7 @@
#include "private/qdeclarativerectangle_p_p.h"
#include <QPainter>
+#include <QStringBuilder>
#include <QtCore/qmath.h>
QT_BEGIN_NAMESPACE
@@ -155,8 +156,8 @@ void QDeclarativeGradient::doUpdate()
\brief The Rectangle item allows you to add rectangles to a scene.
\inherits Item
- A Rectangle is painted having a solid fill (color) and an optional border.
- You can also create rounded rectangles using the radius property.
+ A Rectangle is painted using a solid fill (color) and an optional border.
+ You can also create rounded rectangles using the \l radius property.
\qml
Rectangle {
@@ -223,14 +224,22 @@ QDeclarativePen *QDeclarativeRectangle::border()
\o \image declarative-rect_gradient.png
\o
\qml
- Rectangle { y: 0; width: 80; height: 80; color: "lightsteelblue" }
- Rectangle { y: 100; width: 80; height: 80
+ Rectangle {
+ y: 0; width: 80; height: 80
+ color: "lightsteelblue"
+ }
+
+ Rectangle {
+ y: 100; width: 80; height: 80
gradient: Gradient {
GradientStop { position: 0.0; color: "lightsteelblue" }
GradientStop { position: 1.0; color: "blue" }
}
}
- Rectangle { rotation: 90; y: 200; width: 80; height: 80
+
+ Rectangle {
+ y: 200; width: 80; height: 80
+ rotation: 90
gradient: Gradient {
GradientStop { position: 0.0; color: "lightsteelblue" }
GradientStop { position: 1.0; color: "blue" }
@@ -334,21 +343,29 @@ void QDeclarativeRectangle::generateRoundedRect()
if (d->rectImage.isNull()) {
const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
const int radius = qCeil(d->radius); //ensure odd numbered width/height so we get 1-pixel center
- d->rectImage = QPixmap(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2);
- d->rectImage.fill(Qt::transparent);
- QPainter p(&(d->rectImage));
- p.setRenderHint(QPainter::Antialiasing);
- if (d->pen && d->pen->isValid()) {
- QPen pn(QColor(d->pen->color()), d->pen->width());
- p.setPen(pn);
- } else {
- p.setPen(Qt::NoPen);
+
+ QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QString::number(d->color.alpha(), 16) % QLatin1Char('_') % QString::number(radius);
+ if (d->pen && d->pen->isValid())
+ key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16);
+
+ if (!QPixmapCache::find(key, &d->rectImage)) {
+ d->rectImage = QPixmap(radius*2 + 3 + pw*2, radius*2 + 3 + pw*2);
+ d->rectImage.fill(Qt::transparent);
+ QPainter p(&(d->rectImage));
+ p.setRenderHint(QPainter::Antialiasing);
+ if (d->pen && d->pen->isValid()) {
+ QPen pn(QColor(d->pen->color()), d->pen->width());
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
+ p.setBrush(d->color);
+ if (pw%2)
+ p.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)), d->radius, d->radius);
+ else
+ p.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw), d->radius, d->radius);
+ QPixmapCache::insert(key, d->rectImage);
}
- p.setBrush(d->color);
- if (pw%2)
- p.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)), d->radius, d->radius);
- else
- p.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw), d->radius, d->radius);
}
}
@@ -357,22 +374,30 @@ void QDeclarativeRectangle::generateBorderedRect()
Q_D(QDeclarativeRectangle);
if (d->rectImage.isNull()) {
const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0;
- d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3);
- d->rectImage.fill(Qt::transparent);
- QPainter p(&(d->rectImage));
- p.setRenderHint(QPainter::Antialiasing);
- if (d->pen && d->pen->isValid()) {
- QPen pn(QColor(d->pen->color()), d->pen->width());
- pn.setJoinStyle(Qt::MiterJoin);
- p.setPen(pn);
- } else {
- p.setPen(Qt::NoPen);
+
+ QString key = QLatin1String("q_") % QString::number(pw) % d->color.name() % QString::number(d->color.alpha(), 16);
+ if (d->pen && d->pen->isValid())
+ key += d->pen->color().name() % QString::number(d->pen->color().alpha(), 16);
+
+ if (!QPixmapCache::find(key, &d->rectImage)) {
+ d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3);
+ d->rectImage.fill(Qt::transparent);
+ QPainter p(&(d->rectImage));
+ p.setRenderHint(QPainter::Antialiasing);
+ if (d->pen && d->pen->isValid()) {
+ QPen pn(QColor(d->pen->color()), d->pen->width());
+ pn.setJoinStyle(Qt::MiterJoin);
+ p.setPen(pn);
+ } else {
+ p.setPen(Qt::NoPen);
+ }
+ p.setBrush(d->color);
+ if (pw%2)
+ p.drawRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)));
+ else
+ p.drawRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw));
+ QPixmapCache::insert(key, d->rectImage);
}
- p.setBrush(d->color);
- if (pw%2)
- p.drawRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)));
- else
- p.drawRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw));
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index d49bb02..04076f8 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -67,7 +67,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
\brief The Repeater item allows you to repeat an Item-based component using a model.
- The Repeater item is used when you want to create a large number of
+ The Repeater item is used to create a large number of
similar items. For each entry in the model, an item is instantiated
in a context seeded with data from the model. If the repeater will
be instantiating a large number of instances, it may be more efficient to
@@ -193,7 +193,7 @@ void QDeclarativeRepeater::setModel(const QVariant &model)
d->model = vim;
} else {
if (!d->ownModel) {
- d->model = new QDeclarativeVisualDataModel(qmlContext(this));
+ d->model = new QDeclarativeVisualDataModel(qmlContext(this), this);
d->ownModel = true;
}
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model))
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 2b8da8e..4e7e0fd 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -116,7 +116,7 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
\brief The Text item allows you to add formatted text to a scene.
\inherits Item
- It can display both plain and rich text. For example:
+ A Text item can display both plain and rich text. For example:
\qml
Text { text: "Hello World!"; font.family: "Helvetica"; font.pointSize: 24; color: "red" }
@@ -132,8 +132,8 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
The \c elide property can alternatively be used to fit a single line of
plain text to a set width.
- Note that the \l{Supported HTML Subset} is limited, and that if IMG tags
- load remote images, the text reloads (see resourcesLoading).
+ Note that the \l{Supported HTML Subset} is limited. Also, if the text contains
+ HTML img tags that load remote images, the text is reloaded.
Text provides read-only text. For editable text, see \l TextEdit.
*/
@@ -142,7 +142,6 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
\internal
\class QDeclarativeText
\qmlclass Text
- \ingroup group_coreitems
\brief The QDeclarativeText class provides a formatted text item that you can add to a QDeclarativeView.
@@ -191,7 +190,7 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
/*!
\qmlproperty bool Text::font.bold
- Sets the font's weight to bold.
+ Sets whether the font weight is bold.
*/
/*!
@@ -201,11 +200,11 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
The weight can be one of:
\list
- \o Light
- \o Normal - the default
- \o DemiBold
- \o Bold
- \o Black
+ \o Font.Light
+ \o Font.Normal - the default
+ \o Font.DemiBold
+ \o Font.Bold
+ \o Font.Black
\endlist
\qml
@@ -216,25 +215,25 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
/*!
\qmlproperty bool Text::font.italic
- Sets the style of the text to italic.
+ Sets whether the font has an italic style.
*/
/*!
\qmlproperty bool Text::font.underline
- Set the style of the text to underline.
+ Sets whether the text is underlined.
*/
/*!
\qmlproperty bool Text::font.outline
- Set the style of the text to outline.
+ Sets whether the font has an outline style.
*/
/*!
\qmlproperty bool Text::font.strikeout
- Set the style of the text to strikeout.
+ Sets whether the font has a strikeout style.
*/
/*!
@@ -278,11 +277,11 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
Sets the capitalization for the text.
\list
- \o MixedCase - This is the normal text rendering option where no capitalization change is applied.
- \o AllUppercase - This alters the text to be rendered in all uppercase type.
- \o AllLowercase - This alters the text to be rendered in all lowercase type.
- \o SmallCaps - This alters the text to be rendered in small-caps type.
- \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
+ \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
+ \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
+ \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+ \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
+ \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
\endlist
\qml
@@ -381,10 +380,10 @@ QColor QDeclarativeText::color() const
Supported text styles are:
\list
- \o Normal - the default
- \o Outline
- \o Raised
- \o Sunken
+ \o Text.Normal - the default
+ \o Text.Outline
+ \o Text.Raised
+ \o Text.Sunken
\endlist
\qml
@@ -452,9 +451,14 @@ QColor QDeclarativeText::styleColor() const
Sets the horizontal and vertical alignment of the text within the Text items
width and height. By default, the text is top-left aligned.
- The valid values for \c horizontalAlignment are \c AlignLeft, \c AlignRight and
- \c AlignHCenter. The valid values for \c verticalAlignment are \c AlignTop, \c AlignBottom
- and \c AlignVCenter.
+ The valid values for \c horizontalAlignment are \c Text.AlignLeft, \c Text.AlignRight and
+ \c Text.AlignHCenter. The valid values for \c verticalAlignment are \c Text.AlignTop, \c Text.AlignBottom
+ and \c Text.AlignVCenter.
+
+ Note that for a single line of text, the size of the text is the area of the text. In this common case,
+ all alignments are equivalent. If you want the text to be, say, centered in it parent, then you will
+ need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to
+ that of the parent.
*/
QDeclarativeText::HAlignment QDeclarativeText::hAlign() const
{
@@ -495,16 +499,16 @@ void QDeclarativeText::setVAlign(VAlignment align)
wrap if an explicit width has been set. wrapMode can be one of:
\list
- \o NoWrap - no wrapping will be performed.
- \o WordWrap - wrapping is done on word boundaries. If the text cannot be
+ \o Text.NoWrap - no wrapping will be performed.
+ \o Text.WordWrap - wrapping is done on word boundaries. If the text cannot be
word-wrapped to the specified width it will be partially drawn outside of the item's bounds.
If this is undesirable then enable clipping on the item (Item::clip).
- \o WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
- \o WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it
+ \o Text.WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
+ \o Text.WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it
will occur at the appropriate point on the line, even in the middle of a word.
\endlist
- The default is NoWrap.
+ The default is Text.NoWrap.
*/
QDeclarativeText::WrapMode QDeclarativeText::wrapMode() const
{
@@ -531,13 +535,20 @@ void QDeclarativeText::setWrapMode(WrapMode mode)
The way the text property should be displayed.
- Supported text formats are \c AutoText, \c PlainText, \c RichText and \c StyledText
+ Supported text formats are:
+
+ \list
+ \o Text.AutoText
+ \o Text.PlainText
+ \o Text.RichText
+ \o Text.StyledText
+ \endlist
- The default is AutoText. If the text format is AutoText the text element
+ The default is Text.AutoText. If the text format is Text.AutoText the text element
will automatically determine whether the text should be treated as
rich text. This determination is made using Qt::mightBeRichText().
- StyledText is an optimized format supporting some basic text
+ Text.StyledText is an optimized format supporting some basic text
styling markup, in the style of html 3.2:
\code
@@ -548,7 +559,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode)
&gt; &lt; &amp;
\endcode
- \c StyledText parser is strict, requiring tags to be correctly nested.
+ \c Text.StyledText parser is strict, requiring tags to be correctly nested.
\table
\row
@@ -616,13 +627,13 @@ void QDeclarativeText::setTextFormat(TextFormat format)
Eliding can be:
\list
- \o ElideNone - the default
- \o ElideLeft
- \o ElideMiddle
- \o ElideRight
+ \o Text.ElideNone - the default
+ \o Text.ElideLeft
+ \o Text.ElideMiddle
+ \o Text.ElideRight
\endlist
- If the text is a multi-length string, and the mode is not \c ElideNone,
+ If the text is a multi-length string, and the mode is not \c Text.ElideNone,
the first string that fits will be used, otherwise the last will be elided.
Multi-length strings are ordered from longest to shortest, separated by the
@@ -1069,8 +1080,9 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
/*!
\qmlproperty bool Text::smooth
- Set this property if you want the text to be smoothly scaled or
- transformed. Smooth filtering gives better visual quality, but is slower. If
+ This property holds whether the text is smoothly scaled or transformed.
+
+ Smooth filtering gives better visual quality, but is slower. If
the item is displayed at its natural size, this property has no visual or
performance effect.
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 25eaef6..45b79a7 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -46,6 +46,8 @@
#include <private/qdeclarativeglobal_p.h>
#include <qdeclarativeinfo.h>
+#include <QtCore/qmath.h>
+
#include <QTextLayout>
#include <QTextLine>
#include <QTextDocument>
@@ -85,7 +87,6 @@ TextEdit {
\internal
\class QDeclarativeTextEdit
\qmlclass TextEdit
- \ingroup group_coreitems
\brief The QDeclarativeTextEdit class provides an editable formatted text item that you can add to a QDeclarativeView.
@@ -129,7 +130,7 @@ QString QDeclarativeTextEdit::text() const
/*!
\qmlproperty bool TextEdit::font.bold
- Sets the font's weight to bold.
+ Sets whether the font weight is bold.
*/
/*!
@@ -139,11 +140,11 @@ QString QDeclarativeTextEdit::text() const
The weight can be one of:
\list
- \o Light
- \o Normal - the default
- \o DemiBold
- \o Bold
- \o Black
+ \o Font.Light
+ \o Font.Normal - the default
+ \o Font.DemiBold
+ \o Font.Bold
+ \o Font.Black
\endlist
\qml
@@ -154,25 +155,25 @@ QString QDeclarativeTextEdit::text() const
/*!
\qmlproperty bool TextEdit::font.italic
- Sets the style of the text to italic.
+ Sets whether the font has an italic style.
*/
/*!
\qmlproperty bool TextEdit::font.underline
- Set the style of the text to underline.
+ Sets whether the text is underlined.
*/
/*!
\qmlproperty bool TextEdit::font.outline
- Set the style of the text to outline.
+ Sets whether the font has an outline style.
*/
/*!
\qmlproperty bool TextEdit::font.strikeout
- Set the style of the text to strikeout.
+ Sets whether the font has a strikeout style.
*/
/*!
@@ -216,11 +217,11 @@ QString QDeclarativeTextEdit::text() const
Sets the capitalization for the text.
\list
- \o MixedCase - This is the normal text rendering option where no capitalization change is applied.
- \o AllUppercase - This alters the text to be rendered in all uppercase type.
- \o AllLowercase - This alters the text to be rendered in all lowercase type.
- \o SmallCaps - This alters the text to be rendered in small-caps type.
- \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
+ \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
+ \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
+ \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+ \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
+ \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
\endlist
\qml
@@ -255,9 +256,14 @@ void QDeclarativeTextEdit::setText(const QString &text)
The way the text property should be displayed.
- Supported text formats are \c AutoText, \c PlainText and \c RichText.
+ \list
+ \o TextEdit.AutoText
+ \o TextEdit.PlainText
+ \o TextEdit.RichText
+ \o TextEdit.StyledText
+ \endlist
- The default is AutoText. If the text format is AutoText the text edit
+ The default is TextEdit.AutoText. If the text format is TextEdit.AutoText the text edit
will automatically determine whether the text should be treated as
rich text. This determination is made using Qt::mightBeRichText().
@@ -424,9 +430,9 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color)
Sets the horizontal and vertical alignment of the text within the TextEdit items
width and height. By default, the text is top-left aligned.
- The valid values for \c horizontalAlignment are \c AlignLeft, \c AlignRight and
- \c AlignHCenter. The valid values for \c verticalAlignment are \c AlignTop, \c AlignBottom
- and \c AlignVCenter.
+ The valid values for \c horizontalAlignment are \c TextEdit.AlignLeft, \c TextEdit.AlignRight and
+ \c TextEdit.AlignHCenter. The valid values for \c verticalAlignment are \c TextEdit.AlignTop, \c TextEdit.AlignBottom
+ and \c TextEdit.AlignVCenter.
*/
QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const
{
@@ -469,14 +475,14 @@ void QDeclarativeTextEdit::setVAlign(QDeclarativeTextEdit::VAlignment alignment)
The text will only wrap if an explicit width has been set.
\list
- \o NoWrap - no wrapping will be performed.
- \o WordWrap - wrapping is done on word boundaries.
- \o WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
- \o WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it
+ \o TextEdit.NoWrap - no wrapping will be performed.
+ \o TextEdit.WordWrap - wrapping is done on word boundaries.
+ \o TextEdit.WrapAnywhere - Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
+ \o TextEdit.WrapAtWordBoundaryOrAnywhere - If possible, wrapping occurs at a word boundary; otherwise it
will occur at the appropriate point on the line, even in the middle of a word.
\endlist
- The default is NoWrap.
+ The default is TextEdit.NoWrap.
*/
QDeclarativeTextEdit::WrapMode QDeclarativeTextEdit::wrapMode() const
{
@@ -724,7 +730,7 @@ void QDeclarativeTextEdit::setPersistentSelection(bool on)
}
/*
- \qmlproperty number TextEdit::textMargin
+ \qmlproperty real TextEdit::textMargin
The margin, in pixels, around the text in the TextEdit.
*/
@@ -852,8 +858,9 @@ Handles the given key \a event.
void QDeclarativeTextEdit::keyPressEvent(QKeyEvent *event)
{
Q_D(QDeclarativeTextEdit);
- d->control->processEvent(event, QPointF(0, 0));
-
+ keyPressPreHandler(event);
+ if (!event->isAccepted())
+ d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
QDeclarativePaintedItem::keyPressEvent(event);
}
@@ -865,7 +872,9 @@ Handles the given key \a event.
void QDeclarativeTextEdit::keyReleaseEvent(QKeyEvent *event)
{
Q_D(QDeclarativeTextEdit);
- d->control->processEvent(event, QPointF(0, 0));
+ keyReleasePreHandler(event);
+ if (!event->isAccepted())
+ d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
QDeclarativePaintedItem::keyReleaseEvent(event);
}
@@ -893,17 +902,18 @@ Handles the given mouse \a event.
void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
+ bool hadFocus = hasFocus();
if (d->focusOnPress){
QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
while(p) {
- if(p->flags() & QGraphicsItem::ItemIsFocusScope){
+ if (p->flags() & QGraphicsItem::ItemIsFocusScope)
p->setFocus();
- break;
- }
p = p->parentItem();
}
setFocus(true);
}
+ if (!hadFocus && hasFocus())
+ d->clickCausedFocus = true;
d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
QDeclarativePaintedItem::mousePressEvent(event);
@@ -918,11 +928,12 @@ void QDeclarativeTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextEdit);
QWidget *widget = event->widget();
if (widget && (d->control->textInteractionFlags() & Qt::TextEditable) && boundingRect().contains(event->pos()))
- qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->focusOnPress);
+ qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ d->clickCausedFocus = false;
d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
- QDeclarativePaintedItem::mousePressEvent(event);
+ QDeclarativePaintedItem::mouseReleaseEvent(event);
}
/*!
@@ -946,7 +957,8 @@ void QDeclarativeTextEdit::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextEdit);
d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
- QDeclarativePaintedItem::mousePressEvent(event);
+ QDeclarativePaintedItem::mouseMoveEvent(event);
+ event->setAccepted(true);
}
/*!
@@ -991,8 +1003,9 @@ void QDeclarativeTextEdit::updateImgCache(const QRectF &r)
/*!
\qmlproperty bool TextEdit::smooth
- Set this property if you want the text to be smoothly scaled or
- transformed. Smooth filtering gives better visual quality, but is slower. If
+ This property holds whether the text is smoothly scaled or transformed.
+
+ Smooth filtering gives better visual quality, but is slower. If
the item is displayed at its natural size, this property has no visual or
performance effect.
@@ -1102,7 +1115,7 @@ void QDeclarativeTextEdit::updateSize()
setBaselineOffset(fm.ascent() + yoff + d->textMargin);
//### need to comfirm cost of always setting these
- int newWidth = (int)d->document->idealWidth();
+ int newWidth = qCeil(d->document->idealWidth());
d->document->setTextWidth(newWidth); // ### QTextDoc> Alignment will not work unless textWidth is set. Does Text need this line as well?
int cursorWidth = 1;
if(d->cursor)
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 8d4b611..5e19c3d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -70,7 +70,7 @@ public:
QDeclarativeTextEditPrivate()
: color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
- persistentSelection(true), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
+ persistentSelection(true), clickCausedFocus(false), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0),
cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText), document(0),
wrapMode(QDeclarativeTextEdit::NoWrap)
{
@@ -100,6 +100,7 @@ public:
bool cursorVisible : 1;
bool focusOnPress : 1;
bool persistentSelection : 1;
+ bool clickCausedFocus : 1;
qreal textMargin;
int lastSelectionStart;
int lastSelectionEnd;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index b618183..8aa7e99 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -55,13 +55,16 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass TextInput QDeclarativeTextInput
\since 4.7
- The TextInput item allows you to add an editable line of text to a scene.
+ \brief The TextInput item allows you to add an editable line of text to a scene.
TextInput can only display a single line of text, and can only display
plain text. However it can provide addition input constraints on the text.
Input constraints include setting a QValidator, an input mask, or a
maximum input length.
+
+ On Mac OS X, the Up/Down key bindings for Home/End are explicitly disabled.
+ If you want such bindings (on any platform), you will need to construct them in QML.
*/
QDeclarativeTextInput::QDeclarativeTextInput(QDeclarativeItem* parent)
: QDeclarativePaintedItem(*(new QDeclarativeTextInputPrivate), parent)
@@ -108,7 +111,7 @@ void QDeclarativeTextInput::setText(const QString &s)
/*!
\qmlproperty bool TextInput::font.bold
- Sets the font's weight to bold.
+ Sets whether the font weight is bold.
*/
/*!
@@ -118,11 +121,11 @@ void QDeclarativeTextInput::setText(const QString &s)
The weight can be one of:
\list
- \o Light
- \o Normal - the default
- \o DemiBold
- \o Bold
- \o Black
+ \o Font.Light
+ \o Font.Normal - the default
+ \o Font.DemiBold
+ \o Font.Bold
+ \o Font.Black
\endlist
\qml
@@ -133,25 +136,25 @@ void QDeclarativeTextInput::setText(const QString &s)
/*!
\qmlproperty bool TextInput::font.italic
- Sets the style of the text to italic.
+ Sets whether the font has an italic style.
*/
/*!
\qmlproperty bool TextInput::font.underline
- Set the style of the text to underline.
+ Sets whether the text is underlined.
*/
/*!
\qmlproperty bool TextInput::font.outline
- Set the style of the text to outline.
+ Sets whether the font has an outline style.
*/
/*!
\qmlproperty bool TextInput::font.strikeout
- Set the style of the text to strikeout.
+ Sets whether the font has a strikeout style.
*/
/*!
@@ -195,11 +198,11 @@ void QDeclarativeTextInput::setText(const QString &s)
Sets the capitalization for the text.
\list
- \o MixedCase - This is the normal text rendering option where no capitalization change is applied.
- \o AllUppercase - This alters the text to be rendered in all uppercase type.
- \o AllLowercase - This alters the text to be rendered in all lowercase type.
- \o SmallCaps - This alters the text to be rendered in small-caps type.
- \o Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
+ \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
+ \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
+ \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
+ \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
+ \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
\endlist
\qml
@@ -308,8 +311,8 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
vertically. You can use anchors to align it however you want within
another item.
- The valid values for \c horizontalAlignment are \c AlignLeft, \c AlignRight and
- \c AlignHCenter.
+ The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and
+ \c TextInput.AlignHCenter.
*/
QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const
{
@@ -600,9 +603,9 @@ void QDeclarativeTextInput::setAutoScroll(bool b)
This property holds the notation of how a string can describe a number.
The values for this property are DoubleValidator.StandardNotation or DoubleValidator.ScientificNotation.
- If this property is set to ScientificNotation, the written number may have an exponent part(i.e. 1.5E-2).
+ If this property is set to DoubleValidator.ScientificNotation, the written number may have an exponent part(i.e. 1.5E-2).
- By default, this property is set to ScientificNotation.
+ By default, this property is set to DoubleValidator.ScientificNotation.
*/
/*!
@@ -706,14 +709,15 @@ bool QDeclarativeTextInput::hasAcceptableInput() const
}
/*!
- \qmlproperty TextInput.EchoMode TextInput::echoMode
+ \qmlproperty enumeration TextInput::echoMode
Specifies how the text should be displayed in the TextInput.
- The default is Normal, which displays the text as it is. Other values
- are Password, which displays asterixes instead of characters, NoEcho,
- which displays nothing, and PasswordEchoOnEdit, which displays all but the
- current character as asterixes.
-
+ \list
+ \o TextInput.Normal - Displays the text as it is. (Default)
+ \o TextInput.Password - Displays asterixes instead of characters.
+ \o TextInput.NoEcho - Displays nothing.
+ \o TextInput.PasswordEchoOnEdit - Displays all but the current character as asterixes.
+ \endlist
*/
QDeclarativeTextInput::EchoMode QDeclarativeTextInput::echoMode() const
{
@@ -827,8 +831,8 @@ void QDeclarativeTextInput::moveCursor()
d->cursorItem->setX(d->control->cursorToX() - d->hscroll);
}
-/*
- \qmlmethod int xToPosition(int x)
+/*!
+ \qmlmethod int TextInput::xToPosition(int x)
This function returns the character position at
x pixels from the left of the textInput. Position 0 is before the
@@ -859,10 +863,15 @@ void QDeclarativeTextInputPrivate::focusChanged(bool hasFocus)
void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
{
Q_D(QDeclarativeTextInput);
- if(((d->control->cursor() == 0 && ev->key() == Qt::Key_Left)
+ keyPressPreHandler(ev);
+ if (ev->isAccepted())
+ return;
+ if (((ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) && ev->modifiers() == Qt::NoModifier) // Don't allow MacOSX up/down support, and we don't allow a completer.
+ || (((d->control->cursor() == 0 && ev->key() == Qt::Key_Left)
|| (d->control->cursor() == d->control->text().length()
&& ev->key() == Qt::Key_Right))
- && (d->lastSelectionStart == d->lastSelectionEnd)){
+ && (d->lastSelectionStart == d->lastSelectionEnd)))
+ {
//ignore when moving off the end
//unless there is a selection, because then moving will do something (deselect)
ev->ignore();
@@ -876,26 +885,30 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ bool hadFocus = hasFocus();
if(d->focusOnPress){
QGraphicsItem *p = parentItem();//###Is there a better way to find my focus scope?
while(p) {
- if(p->flags() & QGraphicsItem::ItemIsFocusScope){
+ if (p->flags() & QGraphicsItem::ItemIsFocusScope)
p->setFocus();
- break;
- }
p = p->parentItem();
}
setFocus(true);
}
+ if (!hadFocus && hasFocus())
+ d->clickCausedFocus = true;
+
bool mark = event->modifiers() & Qt::ShiftModifier;
int cursor = d->xToPos(event->pos().x());
d->control->moveCursor(cursor, mark);
+ event->setAccepted(true);
}
void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
d->control->moveCursor(d->xToPos(event->pos().x()), true);
+ event->setAccepted(true);
}
/*!
@@ -907,8 +920,10 @@ void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextInput);
QWidget *widget = event->widget();
if (widget && !d->control->isReadOnly() && boundingRect().contains(event->pos()))
- qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->focusOnPress);
- d->control->processEvent(event);
+ qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ d->clickCausedFocus = false;
+ if (!event->isAccepted())
+ QDeclarativePaintedItem::mouseReleaseEvent(event);
}
bool QDeclarativeTextInput::event(QEvent* ev)
@@ -929,8 +944,8 @@ bool QDeclarativeTextInput::event(QEvent* ev)
updateSize();
}
if(!handled)
- return QDeclarativePaintedItem::event(ev);
- return true;
+ handled = QDeclarativePaintedItem::event(ev);
+ return handled;
}
void QDeclarativeTextInput::geometryChanged(const QRectF &newGeometry,
@@ -1012,6 +1027,8 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
{
Q_D(const QDeclarativeTextInput);
switch(property) {
+ case Qt::ImMicroFocus:
+ return d->control->cursorRect();
case Qt::ImFont:
return font();
case Qt::ImCursorPosition:
@@ -1044,8 +1061,9 @@ void QDeclarativeTextInput::selectAll()
/*!
\qmlproperty bool TextInput::smooth
- Set this property if you want the text to be smoothly scaled or
- transformed. Smooth filtering gives better visual quality, but is slower. If
+ This property holds whether the text is smoothly scaled or transformed.
+
+ Smooth filtering gives better visual quality, but is slower. If
the item is displayed at its natural size, this property has no visual or
performance effect.
@@ -1054,15 +1072,15 @@ void QDeclarativeTextInput::selectAll()
filtering at the beginning of the animation and reenable it at the conclusion.
*/
-/*
+/*!
\qmlproperty string TextInput::passwordCharacter
This is the character displayed when echoMode is set to Password or
PasswordEchoOnEdit. By default it is an asterisk.
- Attempting to set this to more than one character will set it to
- the first character in the string. Attempting to set this to less
- than one character will fail.
+ If this property is set to a string with more than one character,
+ the first character is used. If the string is empty, the value
+ is ignored and the property is not set.
*/
QString QDeclarativeTextInput::passwordCharacter() const
{
@@ -1079,15 +1097,15 @@ void QDeclarativeTextInput::setPasswordCharacter(const QString &str)
d->control->setPasswordCharacter(str.constData()[0]);
}
-/*
+/*!
\qmlproperty string TextInput::displayText
- This is the actual text displayed in the TextInput. When
- echoMode is set to TextInput::Normal this will be exactly
- the same as the TextInput::text property. When echoMode
- is set to something else, this property will contain the text
- the user sees, while the text property will contain the
- entered text.
+ This is the text displayed in the TextInput.
+
+ If \l echoMode is set to TextInput::Normal, this holds the
+ same value as the TextInput::text property. Otherwise,
+ this property holds the text visible to the user, while
+ the \l text property holds the actual entered text.
*/
QString QDeclarativeTextInput::displayText() const
{
@@ -1095,29 +1113,33 @@ QString QDeclarativeTextInput::displayText() const
return d->control->displayText();
}
-/*
- \qmlmethod void moveCursorSelection(int pos)
+/*!
+ \qmlmethod void TextInput::moveCursorSelection(int position)
- This method allows you to move the cursor while modifying the selection accordingly.
- To simply move the cursor, set the cursorPosition property.
+ Moves the cursor to \a position and updates the selection accordingly.
+ (To only move the cursor, set the \l cursorPosition property.)
When this method is called it additionally sets either the
selectionStart or the selectionEnd (whichever was at the previous cursor position)
to the specified position. This allows you to easily extend and contract the selected
text range.
- Example: The sequence of calls
+ For example, take this sequence of calls:
+
+ \code
cursorPosition = 5
moveCursorSelection(9)
moveCursorSelection(7)
- would move the cursor to position 5, extend the selection end from 5 to 9
+ \endcode
+
+ This moves the cursor to position 5, extend the selection end from 5 to 9
and then retract the selection end from 9 to 7, leaving the text from position 5 to 7
selected (the 6th and 7th characters).
*/
-void QDeclarativeTextInput::moveCursorSelection(int pos)
+void QDeclarativeTextInput::moveCursorSelection(int position)
{
Q_D(QDeclarativeTextInput);
- d->control->moveCursor(pos, true);
+ d->control->moveCursor(position, true);
}
void QDeclarativeTextInputPrivate::init()
@@ -1222,9 +1244,7 @@ void QDeclarativeTextInput::updateSize(bool needsRedraw)
int cursorWidth = d->control->cursorWidth();
if(d->cursorItem)
cursorWidth = d->cursorItem->width();
- //### Is QFontMetrics too slow?
- QFontMetricsF fm(d->font);
- setImplicitWidth(fm.width(d->control->displayText())+cursorWidth);
+ setImplicitWidth(d->control->naturalTextWidth() + cursorWidth);
setContentsSize(QSize(width(), height()));//Repaints if changed
if(w==width() && h==height() && needsRedraw){
clearCache();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index 26cf78c..99866b8 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -72,7 +72,7 @@ public:
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
hscroll(0), oldScroll(0), focused(false), focusOnPress(true),
- cursorVisible(false), autoScroll(true)
+ cursorVisible(false), autoScroll(true), clickCausedFocus(false)
{
}
@@ -116,6 +116,7 @@ public:
bool focusOnPress;
bool cursorVisible;
bool autoScroll;
+ bool clickCausedFocus;
};
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 43cafe3..0e4217e 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -44,6 +44,7 @@
#include "qdeclarativeitem.h"
#include <qdeclarativecontext.h>
+#include <qdeclarativecontext_p.h>
#include <qdeclarativeengine.h>
#include <qdeclarativeexpression.h>
#include <qdeclarativepackage_p.h>
@@ -55,6 +56,7 @@
#include <qdeclarativeguard_p.h>
#include <qdeclarativeglobal_p.h>
+#include <qgraphicsscene.h>
#include <qlistmodelinterface_p.h>
#include <qhash.h>
#include <qlist.h>
@@ -136,8 +138,8 @@ public:
}
\endcode
*/
-QDeclarativeVisualItemModel::QDeclarativeVisualItemModel()
- : QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate))
+QDeclarativeVisualItemModel::QDeclarativeVisualItemModel(QObject *parent)
+ : QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate), parent)
{
}
@@ -267,7 +269,8 @@ public:
}
if (m_roles.count() == 1)
m_roleNames.insert("modelData", m_roles.at(0));
- m_roleNames.insert("hasModelChildren", 0);
+ if (m_roles.count())
+ m_roleNames.insert("hasModelChildren", 0);
} else if (m_listAccessor) {
m_roleNames.insert("modelData", 0);
if (m_listAccessor->type() == QDeclarativeListAccessor::Instance) {
@@ -283,15 +286,19 @@ public:
}
}
+ QHash<int,int> roleToPropId;
void createMetaData() {
if (!m_metaDataCreated) {
ensureRoles();
- QHash<QByteArray, int>::const_iterator it = m_roleNames.begin();
- while (it != m_roleNames.end()) {
- m_delegateDataType->createProperty(it.key());
- ++it;
+ if (m_roleNames.count()) {
+ QHash<QByteArray, int>::const_iterator it = m_roleNames.begin();
+ while (it != m_roleNames.end()) {
+ int propId = m_delegateDataType->createProperty(it.key()) - m_delegateDataType->propertyOffset();
+ roleToPropId.insert(*it, propId);
+ ++it;
+ }
+ m_metaDataCreated = true;
}
- m_metaDataCreated = true;
}
}
@@ -381,7 +388,6 @@ public:
private:
friend class QDeclarativeVisualDataModelData;
- QHash<int,int> roleToProp;
};
class QDeclarativeVisualDataModelData : public QObject
@@ -398,6 +404,8 @@ public:
int propForRole(int) const;
void setValue(int, const QVariant &);
+ void ensureProperties();
+
Q_SIGNALS:
void indexChanged();
@@ -410,9 +418,11 @@ private:
int QDeclarativeVisualDataModelData::propForRole(int id) const
{
- QHash<int,int>::const_iterator it = m_meta->roleToProp.find(id);
- if (it != m_meta->roleToProp.end())
- return m_meta->roleToProp[id];
+ QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(m_model);
+ QHash<int,int>::const_iterator it = model->roleToPropId.find(id);
+ if (it != model->roleToPropId.end())
+ return *it;
+
return -1;
}
@@ -436,8 +446,7 @@ int QDeclarativeVisualDataModelDataMetaObject::createProperty(const char *name,
if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
if (model->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) {
model->ensureRoles();
- QObject *object = model->m_listAccessor->at(data->m_index).value<QObject*>();
- if (object && (object->property(name).isValid() || qstrcmp(name,"modelData")==0))
+ if (qstrcmp(name,"modelData") == 0)
return QDeclarativeOpenMetaObject::createProperty(name, type);
}
}
@@ -469,12 +478,10 @@ QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId)
model->ensureRoles();
QHash<QByteArray,int>::const_iterator it = model->m_roleNames.find(propName);
if (it != model->m_roleNames.end()) {
- roleToProp.insert(*it, propId);
QVariant value = model->m_listModelInterface->data(data->m_index, *it);
return value;
} else if (model->m_roles.count() == 1 && propName == "modelData") {
//for compatability with other lists, assign modelData if there is only a single role
- roleToProp.insert(model->m_roles.first(), propId);
QVariant value = model->m_listModelInterface->data(data->m_index, model->m_roles.first());
return value;
}
@@ -486,7 +493,6 @@ QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId)
} else {
QHash<QByteArray,int>::const_iterator it = model->m_roleNames.find(propName);
if (it != model->m_roleNames.end()) {
- roleToProp.insert(*it, propId);
QModelIndex index = model->m_abstractItemModel->index(data->m_index, 0, model->m_root);
return model->m_abstractItemModel->data(index, *it);
}
@@ -501,18 +507,23 @@ QDeclarativeVisualDataModelData::QDeclarativeVisualDataModelData(int index,
: m_index(index), m_model(model),
m_meta(new QDeclarativeVisualDataModelDataMetaObject(this, QDeclarativeVisualDataModelPrivate::get(model)->m_delegateDataType))
{
- QDeclarativeVisualDataModelPrivate *modelPriv = QDeclarativeVisualDataModelPrivate::get(model);
- if (modelPriv->m_metaDataCacheable) {
- if (!modelPriv->m_metaDataCreated)
- modelPriv->createMetaData();
- m_meta->setCached(true);
- }
+ ensureProperties();
}
QDeclarativeVisualDataModelData::~QDeclarativeVisualDataModelData()
{
}
+void QDeclarativeVisualDataModelData::ensureProperties()
+{
+ QDeclarativeVisualDataModelPrivate *modelPriv = QDeclarativeVisualDataModelPrivate::get(m_model);
+ if (modelPriv->m_metaDataCacheable && !modelPriv->m_metaDataCreated) {
+ modelPriv->createMetaData();
+ if (modelPriv->m_metaDataCreated)
+ m_meta->setCached(true);
+ }
+}
+
int QDeclarativeVisualDataModelData::index() const
{
return m_index;
@@ -625,8 +636,8 @@ QDeclarativeVisualDataModel::QDeclarativeVisualDataModel()
{
}
-QDeclarativeVisualDataModel::QDeclarativeVisualDataModel(QDeclarativeContext *ctxt)
-: QDeclarativeVisualModel(*(new QDeclarativeVisualDataModelPrivate(ctxt)))
+QDeclarativeVisualDataModel::QDeclarativeVisualDataModel(QDeclarativeContext *ctxt, QObject *parent)
+: QDeclarativeVisualModel(*(new QDeclarativeVisualDataModelPrivate(ctxt)), parent)
{
}
@@ -759,7 +770,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model)
}
/*!
- \qmlproperty component VisualDataModel::delegate
+ \qmlproperty Component VisualDataModel::delegate
The delegate provides a template defining each item instantiated by a view.
The index is exposed as an accessible \c index property. Properties of the
@@ -963,13 +974,18 @@ QDeclarativeVisualDataModel::ReleaseFlags QDeclarativeVisualDataModel::release(Q
}
if (d->m_cache.releaseItem(obj)) {
+ // Remove any bindings to avoid warnings due to parent change.
+ QObjectPrivate *p = QObjectPrivate::get(obj);
+ Q_ASSERT(p->declarativeData);
+ QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
+ if (d->ownContext && d->context)
+ d->context->clearExpressions();
+
if (inPackage) {
emit destroyingPackage(qobject_cast<QDeclarativePackage*>(obj));
} else {
- if (item->hasFocus())
- item->clearFocus();
- item->setOpacity(0.0);
- static_cast<QGraphicsItem*>(item)->setParentItem(0);
+ if (item->scene())
+ item->scene()->removeItem(item);
}
stat |= Destroyed;
obj->deleteLater();
@@ -1030,6 +1046,11 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray
if (!ccontext) ccontext = qmlContext(this);
QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this);
+ if ((!d->m_listModelInterface || !d->m_abstractItemModel) && d->m_listAccessor
+ && d->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) {
+ ctxt->setContextObject(d->m_listAccessor->at(index).value<QObject*>());
+ ctxt = new QDeclarativeContext(ctxt, ctxt);
+ }
ctxt->setContextProperty(QLatin1String("model"), data);
ctxt->setContextObject(data);
d->m_completePending = false;
@@ -1201,6 +1222,13 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count,
QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root);
data->setValue(propId, d->m_abstractItemModel->data(index, role));
}
+ } else {
+ QString roleName;
+ if (d->m_listModelInterface)
+ roleName = d->m_listModelInterface->toString(role);
+ else if (d->m_abstractItemModel)
+ roleName = d->m_abstractItemModel->roleNames().value(role);
+ qmlInfo(this) << "Changing role not present in item: " << roleName;
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
index edfd387..0bdbbcf 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
@@ -72,7 +72,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualModel : public QObject
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
- QDeclarativeVisualModel() {}
+ QDeclarativeVisualModel(QObject *parent=0) : QObject(parent) {}
virtual ~QDeclarativeVisualModel() {}
enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 };
@@ -117,7 +117,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualItemModel : public QDeclarativeVisu
Q_CLASSINFO("DefaultProperty", "children")
public:
- QDeclarativeVisualItemModel();
+ QDeclarativeVisualItemModel(QObject *parent=0);
virtual ~QDeclarativeVisualItemModel() {}
virtual int count() const;
@@ -156,7 +156,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualDataModel : public QDeclarativeVisu
Q_CLASSINFO("DefaultProperty", "delegate")
public:
QDeclarativeVisualDataModel();
- QDeclarativeVisualDataModel(QDeclarativeContext *);
+ QDeclarativeVisualDataModel(QDeclarativeContext *, QObject *parent=0);
virtual ~QDeclarativeVisualDataModel();
QVariant model() const;
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index d44e7fb..2e905b9 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -193,7 +193,18 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
data->error.setColumn(-1);
data->error.setDescription(QLatin1String("Unable to assign [undefined] to ") + QLatin1String(QMetaType::typeName(data->property.propertyType())));
- } else if (data->property.object() &&
+ } else if (!scriptValue.isRegExp() && scriptValue.isFunction()) {
+
+ QUrl url = QUrl(data->url);
+ int line = data->line;
+ if (url.isEmpty()) url = QUrl(QLatin1String("<Unknown File>"));
+
+ data->error.setUrl(url);
+ data->error.setLine(line);
+ data->error.setColumn(-1);
+ data->error.setDescription(QLatin1String("Unable to assign a function to a property."));
+
+ } else if (data->property.object() &&
!QDeclarativePropertyPrivate::write(data->property, value, flags)) {
QUrl url = QUrl(data->url);
@@ -275,13 +286,15 @@ QDeclarativeAbstractBinding::QDeclarativeAbstractBinding()
QDeclarativeAbstractBinding::~QDeclarativeAbstractBinding()
{
- removeFromObject();
- if (m_mePtr)
- *m_mePtr = 0;
+ Q_ASSERT(m_prevBinding == 0);
+ Q_ASSERT(m_mePtr == 0);
}
void QDeclarativeAbstractBinding::destroy()
{
+ removeFromObject();
+ clear();
+
delete this;
}
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index 2d3acf5..598f09f 100644
--- a/src/declarative/qml/qdeclarativebinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -164,6 +164,6 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QDeclarativeBinding*);
+Q_DECLARE_METATYPE(QDeclarativeBinding*)
#endif // QDECLARATIVEBINDING_P_H
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 6596aba..f55d330 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -572,7 +572,7 @@ struct QDeclarativeBindingCompilerPrivate
QDeclarativeParser::Object *component;
QDeclarativeParser::Property *destination;
QHash<QString, QDeclarativeParser::Object *> ids;
- QDeclarativeEnginePrivate::Imports imports;
+ QDeclarativeImports imports;
QDeclarativeEnginePrivate *engine;
QString contextName() const { return QLatin1String("$$$SCOPE_") + QString::number((intptr_t)context, 16); }
@@ -1624,6 +1624,8 @@ bool QDeclarativeBindingCompilerPrivate::compile(QDeclarativeJS::AST::Node *node
return false;
int convertReg = acquireReg();
+ if (convertReg == -1)
+ return false;
if (destination->type == QMetaType::QReal) {
Instr convert;
@@ -1795,8 +1797,8 @@ bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type
if (nameParts.at(ii + 1).at(0).isUpper())
return false;
- QDeclarativeEnginePrivate::ImportedNamespace *ns = 0;
- if (!engine->resolveType(imports, name.toUtf8(), &attachType, 0, 0, 0, &ns))
+ QDeclarativeImportedNamespace *ns = 0;
+ if (!engine->importDatabase.resolveType(imports, name.toUtf8(), &attachType, 0, 0, 0, &ns))
return false;
if (ns || !attachType || !attachType->attachedPropertiesType())
return false;
@@ -2011,6 +2013,8 @@ bool QDeclarativeBindingCompilerPrivate::parseArith(QDeclarativeJS::AST::Node *n
AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
type.reg = acquireReg();
+ if (type.reg == -1)
+ return false;
Result lhs;
Result rhs;
@@ -2062,6 +2066,8 @@ bool QDeclarativeBindingCompilerPrivate::numberArith(Result &type, const Result
return false;
lhsTmp = acquireReg();
+ if (lhsTmp == -1)
+ return false;
Instr conv;
conv.common.type = Instr::ConvertGenericToReal;
@@ -2075,6 +2081,8 @@ bool QDeclarativeBindingCompilerPrivate::numberArith(Result &type, const Result
return false;
rhsTmp = acquireReg();
+ if (rhsTmp == -1)
+ return false;
Instr conv;
conv.common.type = Instr::ConvertGenericToReal;
@@ -2123,6 +2131,8 @@ bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result
return false;
lhsTmp = acquireReg(Instr::CleanupString);
+ if (lhsTmp == -1)
+ return false;
Instr convert;
convert.common.type = Instr::ConvertGenericToString;
@@ -2136,6 +2146,8 @@ bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result
return false;
rhsTmp = acquireReg(Instr::CleanupString);
+ if (rhsTmp == -1)
+ return false;
Instr convert;
convert.common.type = Instr::ConvertGenericToString;
@@ -2145,6 +2157,9 @@ bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result
}
type.reg = acquireReg(Instr::CleanupString);
+ if (type.reg == -1)
+ return false;
+
type.type = QMetaType::QString;
Instr add;
@@ -2185,6 +2200,9 @@ bool QDeclarativeBindingCompilerPrivate::parseLogic(QDeclarativeJS::AST::Node *n
if (!parseExpression(expression->right, rhs)) return false;
type.reg = acquireReg();
+ if (type.reg == -1)
+ return false;
+
type.metaObject = 0;
type.type = QVariant::Bool;
@@ -2310,6 +2328,8 @@ bool QDeclarativeBindingCompilerPrivate::parseConstant(QDeclarativeJS::AST::Node
type.metaObject = 0;
type.type = -1;
type.reg = acquireReg();
+ if (type.reg == -1)
+ return false;
if (node->kind == AST::Node::Kind_TrueLiteral) {
type.type = QVariant::Bool;
@@ -2398,6 +2418,9 @@ bool QDeclarativeBindingCompilerPrivate::parseMethod(QDeclarativeJS::AST::Node *
releaseReg(r1.reg);
op.binaryop.output = acquireReg();
+ if (op.binaryop.output == -1)
+ return false;
+
op.binaryop.src1 = r0.reg;
op.binaryop.src2 = r1.reg;
bytecode << op;
@@ -2473,6 +2496,8 @@ bool QDeclarativeBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo
if (rv.type == QMetaType::QString) {
int tmp = acquireReg();
+ if (tmp == -1)
+ return false;
Instr copy;
copy.common.type = Instr::Copy;
copy.copy.reg = tmp;
@@ -2549,6 +2574,8 @@ int QDeclarativeBindingCompilerPrivate::registerLiteralString(const QString &str
data += strdata;
int reg = acquireReg(Instr::CleanupString);
+ if (reg == -1)
+ return false;
Instr string;
string.common.type = Instr::String;
diff --git a/src/declarative/qml/qdeclarativecompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h
index a17bc84..a9772cc 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings_p.h
+++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h
@@ -77,7 +77,7 @@ public:
QDeclarativeParser::Property *property;
QDeclarativeParser::Variant expression;
QHash<QString, QDeclarativeParser::Object *> ids;
- QDeclarativeEnginePrivate::Imports imports;
+ QDeclarativeImports imports;
};
// -1 on failure, otherwise the binding index to use
@@ -104,8 +104,8 @@ protected:
int qt_metacall(QMetaObject::Call, int, void **);
private:
- Q_DISABLE_COPY(QDeclarativeCompiledBindings);
- Q_DECLARE_PRIVATE(QDeclarativeCompiledBindings);
+ Q_DISABLE_COPY(QDeclarativeCompiledBindings)
+ Q_DECLARE_PRIVATE(QDeclarativeCompiledBindings)
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 1727687..a43b9ac 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -352,6 +352,10 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
instr.storeDouble.propertyIndex = prop.propertyIndex();
instr.storeDouble.value = n;
}
+ } else if(v->value.isBoolean()) {
+ instr.type = QDeclarativeInstruction::StoreVariantBool;
+ instr.storeBool.propertyIndex = prop.propertyIndex();
+ instr.storeBool.value = v->value.asBoolean();
} else {
instr.type = QDeclarativeInstruction::StoreVariant;
instr.storeString.propertyIndex = prop.propertyIndex();
@@ -607,6 +611,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
Q_ASSERT(root);
this->engine = engine;
+ this->enginePrivate = QDeclarativeEnginePrivate::get(engine);
this->unit = unit;
this->unitRoot = root;
compileTree(root);
@@ -624,6 +629,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
savedCompileStates.clear();
output = 0;
this->engine = 0;
+ this->enginePrivate = 0;
this->unit = 0;
this->unitRoot = 0;
@@ -688,14 +694,12 @@ void QDeclarativeCompiler::compileTree(Object *tree)
def.type = QDeclarativeInstruction::SetDefault;
output->bytecode << def;
- output->imports = unit->imports;
-
output->importCache = new QDeclarativeTypeNameCache(engine);
for (int ii = 0; ii < importedScriptIndexes.count(); ++ii)
output->importCache->add(importedScriptIndexes.at(ii), ii);
- output->imports.cache(output->importCache, engine);
+ unit->imports.cache(output->importCache, engine);
Q_ASSERT(tree->metatype);
@@ -706,7 +710,7 @@ void QDeclarativeCompiler::compileTree(Object *tree)
output->root = &output->rootData;
}
if (!tree->metadata.isEmpty())
- QDeclarativeEnginePrivate::get(engine)->registerCompositeType(output);
+ enginePrivate->registerCompositeType(output);
}
static bool ValuePtrLessThan(const Value *t1, const Value *t2)
@@ -938,19 +942,28 @@ void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj)
meta.storeMeta.propertyCache = output->propertyCaches.count();
// ### Surely the creation of this property cache could be more efficient
QDeclarativePropertyCache *propertyCache = 0;
- if (tr.component && QDeclarativeComponentPrivate::get(tr.component)->cc->rootPropertyCache) {
+ if (tr.component)
propertyCache = QDeclarativeComponentPrivate::get(tr.component)->cc->rootPropertyCache->copy();
- } else {
- propertyCache = QDeclarativePropertyCache::create(engine, obj->metaObject()->superClass());
- }
+ else
+ propertyCache = enginePrivate->cache(obj->metaObject()->superClass())->copy();
+
propertyCache->append(engine, obj->metaObject(), QDeclarativePropertyCache::Data::NoFlags,
QDeclarativePropertyCache::Data::IsVMEFunction);
+
if (obj == unitRoot) {
propertyCache->addref();
output->rootPropertyCache = propertyCache;
}
+
output->propertyCaches << propertyCache;
output->bytecode << meta;
+ } else if (obj == unitRoot) {
+ if (tr.component)
+ output->rootPropertyCache = QDeclarativeComponentPrivate::get(tr.component)->cc->rootPropertyCache;
+ else
+ output->rootPropertyCache = enginePrivate->cache(obj->metaObject());
+
+ output->rootPropertyCache->addref();
}
// Set the object id
@@ -1359,9 +1372,9 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
}
QDeclarativeType *type = 0;
- QDeclarativeEnginePrivate::ImportedNamespace *typeNamespace = 0;
- QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, prop->name,
- &type, 0, 0, 0, &typeNamespace);
+ QDeclarativeImportedNamespace *typeNamespace = 0;
+ enginePrivate->importDatabase.resolveType(unit->imports, prop->name,
+ &type, 0, 0, 0, &typeNamespace);
if (typeNamespace) {
// ### We might need to indicate that this property is a namespace
@@ -1436,7 +1449,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt));
- } else if (QDeclarativeEnginePrivate::get(engine)->isList(prop->type)) {
+ } else if (enginePrivate->isList(prop->type)) {
COMPILE_CHECK(buildListProperty(prop, obj, ctxt));
@@ -1453,11 +1466,10 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
return true;
}
-bool
-QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeEnginePrivate::ImportedNamespace *ns,
- QDeclarativeParser::Property *nsProp,
- QDeclarativeParser::Object *obj,
- const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespace *ns,
+ QDeclarativeParser::Property *nsProp,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt)
{
if (!nsProp->value)
COMPILE_EXCEPTION(nsProp, tr("Invalid use of namespace"));
@@ -1470,8 +1482,7 @@ QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeEnginePrivate::Import
// Setup attached property data
QDeclarativeType *type = 0;
- QDeclarativeEnginePrivate::get(engine)->resolveTypeInNamespace(ns, prop->name,
- &type, 0, 0, 0);
+ enginePrivate->importDatabase.resolveTypeInNamespace(ns, prop->name, &type, 0, 0, 0);
if (!type || !type->attachedPropertiesType())
COMPILE_EXCEPTION(prop, tr("Non-existent attached object"));
@@ -1492,7 +1503,7 @@ QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeEnginePrivate::Import
void QDeclarativeCompiler::genValueProperty(QDeclarativeParser::Property *prop,
QDeclarativeParser::Object *obj)
{
- if (QDeclarativeEnginePrivate::get(engine)->isList(prop->type)) {
+ if (enginePrivate->isList(prop->type)) {
genListProperty(prop, obj);
} else {
genPropertyAssignment(prop, obj);
@@ -1502,7 +1513,7 @@ void QDeclarativeCompiler::genValueProperty(QDeclarativeParser::Property *prop,
void QDeclarativeCompiler::genListProperty(QDeclarativeParser::Property *prop,
QDeclarativeParser::Object *obj)
{
- int listType = QDeclarativeEnginePrivate::get(engine)->listType(prop->type);
+ int listType = enginePrivate->listType(prop->type);
QDeclarativeInstruction fetch;
fetch.type = QDeclarativeInstruction::FetchQList;
@@ -1756,8 +1767,7 @@ bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeParser::Property *pr
} else {
// Load the nested property's meta type
- prop->value->metatype =
- QDeclarativeEnginePrivate::get(engine)->metaObjectForType(prop->type);
+ prop->value->metatype = enginePrivate->metaObjectForType(prop->type);
if (!prop->value->metatype)
COMPILE_EXCEPTION(prop, tr("Invalid grouped property access"));
@@ -1836,13 +1846,13 @@ bool QDeclarativeCompiler::buildListProperty(QDeclarativeParser::Property *prop,
QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
- Q_ASSERT(QDeclarativeEnginePrivate::get(engine)->isList(prop->type));
+ Q_ASSERT(enginePrivate->isList(prop->type));
int t = prop->type;
obj->addValueProperty(prop);
- int listType = QDeclarativeEnginePrivate::get(engine)->listType(t);
+ int listType = enginePrivate->listType(t);
bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType);
bool assignedBinding = false;
@@ -1957,8 +1967,7 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeParser::Pro
// We want to raw metaObject here as the raw metaobject is the
// actual property type before we applied any extensions that might
// effect the properties on the type, but don't effect assignability
- const QMetaObject *propertyMetaObject =
- QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(prop->type);
+ const QMetaObject *propertyMetaObject = enginePrivate->rawMetaObjectForType(prop->type);
// Will be true if the assgned type inherits propertyMetaObject
bool isAssignable = false;
@@ -2100,8 +2109,8 @@ bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop
QString typeName = parts.at(0);
QDeclarativeType *type = 0;
- QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, typeName.toUtf8(),
- &type, 0, 0, 0, 0);
+ enginePrivate->importDatabase.resolveType(unit->imports, typeName.toUtf8(),
+ &type, 0, 0, 0, 0);
if (!type || obj->typeName != type->qmlTypeName())
return true;
@@ -2128,7 +2137,7 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const
int dot = script.indexOf('.');
if (dot > 0) {
QDeclarativeType *type = 0;
- QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, script.left(dot), &type, 0, 0, 0, 0);
+ enginePrivate->importDatabase.resolveType(unit->imports, script.left(dot), &type, 0, 0, 0, 0);
if (!type)
return -1;
const QMetaObject *mo = type->metaObject();
@@ -2282,13 +2291,12 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, Dyn
QByteArray customTypeName;
QDeclarativeType *qmltype = 0;
QUrl url;
- QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(engine);
- if (!priv->resolveType(unit->imports, p.customType, &qmltype,
- &url, 0, 0, 0))
+ if (!enginePrivate->importDatabase.resolveType(unit->imports, p.customType, &qmltype,
+ &url, 0, 0, 0))
COMPILE_EXCEPTION(&p, tr("Invalid property type"));
if (!qmltype) {
- QDeclarativeCompositeTypeData *tdata = priv->typeManager.get(url);
+ QDeclarativeCompositeTypeData *tdata = enginePrivate->typeManager.get(url);
Q_ASSERT(tdata);
Q_ASSERT(tdata->status == QDeclarativeCompositeTypeData::Complete);
@@ -2460,7 +2468,7 @@ bool QDeclarativeCompiler::checkValidId(QDeclarativeParser::Value *v, const QStr
}
- if (QDeclarativeEnginePrivate::get(engine)->globalClass->illegalNames().contains(val))
+ if (enginePrivate->globalClass->illegalNames().contains(val))
COMPILE_EXCEPTION(v, tr( "ID illegally masks global JavaScript property"));
return true;
@@ -2653,8 +2661,8 @@ int QDeclarativeCompiler::genValueTypeData(QDeclarativeParser::Property *valueTy
{
QByteArray data =
QDeclarativePropertyPrivate::saveValueType(prop->parent->metaObject(), prop->index,
- QDeclarativeEnginePrivate::get(engine)->valueTypes[prop->type]->metaObject(),
- valueTypeProp->index);
+ enginePrivate->valueTypes[prop->type]->metaObject(),
+ valueTypeProp->index);
// valueTypeProp->index, valueTypeProp->type);
return output->indexForByteArray(data);
@@ -2690,7 +2698,7 @@ bool QDeclarativeCompiler::completeComponentBuild()
expr.expression = binding.expression;
expr.imports = unit->imports;
- int index = bindingCompiler.compile(expr, QDeclarativeEnginePrivate::get(engine));
+ int index = bindingCompiler.compile(expr, enginePrivate);
if (index != -1) {
binding.dataType = BindingReference::Experimental;
binding.compiledIndex = index;
@@ -2798,7 +2806,7 @@ void QDeclarativeCompiler::dumpStats()
bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeParser::Object *from)
{
const QMetaObject *toMo =
- QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(to);
+ enginePrivate->rawMetaObjectForType(to);
const QMetaObject *fromMo = from->metaObject();
while (fromMo) {
diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h
index fefab7a..908c703 100644
--- a/src/declarative/qml/qdeclarativecompiler_p.h
+++ b/src/declarative/qml/qdeclarativecompiler_p.h
@@ -84,7 +84,6 @@ public:
QString name;
QUrl url;
- QDeclarativeEnginePrivate::Imports imports;
QDeclarativeTypeNameCache *importCache;
struct TypeReference
@@ -192,7 +191,7 @@ private:
const BindingContext &);
bool buildProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
const BindingContext &);
- bool buildPropertyInNamespace(QDeclarativeEnginePrivate::ImportedNamespace *ns,
+ bool buildPropertyInNamespace(QDeclarativeImportedNamespace *ns,
QDeclarativeParser::Property *prop,
QDeclarativeParser::Object *obj,
const BindingContext &);
@@ -336,6 +335,7 @@ private:
QList<QDeclarativeError> exceptions;
QDeclarativeCompiledData *output;
QDeclarativeEngine *engine;
+ QDeclarativeEnginePrivate *enginePrivate;
QDeclarativeParser::Object *unitRoot;
QDeclarativeCompositeTypeData *unit;
};
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index d8bbb70..e757675 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -59,11 +59,11 @@
#include <QFileInfo>
#include <QtCore/qdebug.h>
#include <QApplication>
+#include <QGraphicsObject>
QT_BEGIN_NAMESPACE
class QByteArray;
-int statusId = qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status");
/*!
\class QDeclarativeComponent
@@ -242,10 +242,10 @@ QDeclarativeComponent::~QDeclarativeComponent()
\qmlproperty enumeration Component::status
This property holds the status of component loading. It can be one of:
\list
- \o Null - no data is available for the component
- \o Ready - the component has been loaded, and can be used to create instances.
- \o Loading - the component is currently being loaded
- \o Error - an error occurred while loading the component.
+ \o Component.Null - no data is available for the component
+ \o Component.Ready - the component has been loaded, and can be used to create instances.
+ \o Component.Loading - the component is currently being loaded
+ \o Component.Error - an error occurred while loading the component.
Calling errorsString() will provide a human-readable description of any errors.
\endlist
*/
@@ -269,19 +269,7 @@ QDeclarativeComponent::Status QDeclarativeComponent::status() const
}
/*!
- \qmlproperty bool Component::isNull
-
- Is true if the component is in the Null state, false otherwise.
-
- Equivalent to status == Component.Null.
-*/
-
-/*!
- \property QDeclarativeComponent::isNull
-
- Is true if the component is in the Null state, false otherwise.
-
- Equivalent to status() == QDeclarativeComponent::Null.
+ Returns true if status() == QDeclarativeComponent::Null.
*/
bool QDeclarativeComponent::isNull() const
{
@@ -289,19 +277,7 @@ bool QDeclarativeComponent::isNull() const
}
/*!
- \qmlproperty bool Component::isReady
-
- Is true if the component is in the Ready state, false otherwise.
-
- Equivalent to status == Component.Ready.
-*/
-
-/*!
- \property QDeclarativeComponent::isReady
-
- Is true if the component is in the Ready state, false otherwise.
-
- Equivalent to status() == QDeclarativeComponent::Ready.
+ Returns true if status() == QDeclarativeComponent::Ready.
*/
bool QDeclarativeComponent::isReady() const
{
@@ -309,21 +285,7 @@ bool QDeclarativeComponent::isReady() const
}
/*!
- \qmlproperty bool Component::isError
-
- Is true if the component is in the Error state, false otherwise.
-
- Equivalent to status == Component.Error.
-
- Calling errorsString() will provide a human-readable description of any errors.
-*/
-
-/*!
- \property QDeclarativeComponent::isError
-
- Is true if the component is in the Error state, false otherwise.
-
- Equivalent to status() == QDeclarativeComponent::Error.
+ Returns true if status() == QDeclarativeComponent::Error.
*/
bool QDeclarativeComponent::isError() const
{
@@ -331,19 +293,7 @@ bool QDeclarativeComponent::isError() const
}
/*!
- \qmlproperty bool Component::isLoading
-
- Is true if the component is in the Loading state, false otherwise.
-
- Equivalent to status == Component::Loading.
-*/
-
-/*!
- \property QDeclarativeComponent::isLoading
-
- Is true if the component is in the Loading state, false otherwise.
-
- Equivalent to status() == QDeclarativeComponent::Loading.
+ Returns true if status() == QDeclarativeComponent::Loading.
*/
bool QDeclarativeComponent::isLoading() const
{
@@ -421,7 +371,7 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const Q
{
Q_D(QDeclarativeComponent);
d->engine = engine;
- loadUrl(QUrl::fromLocalFile(fileName));
+ loadUrl(d->engine->baseUrl().resolved(QUrl::fromLocalFile(fileName)));
}
/*!
@@ -595,17 +545,24 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
}
/*!
- \qmlmethod object Component::createObject()
+ \qmlmethod object Component::createObject(parent)
Returns an object instance from this component, or null if object creation fails.
- The object will be created in the same context as the component was created in.
+ The object will be created in the same context as the one in which the component
+ was created.
+
+ Note that if the returned object is to be displayed, its \c parent must be set to
+ an existing item in a scene, or else the object will not be visible.
*/
/*!
\internal
A version of create which returns a scriptObject, for use in script
+
+ Sets graphics object parent because forgetting to do this is a frequent
+ and serious problem.
*/
-QScriptValue QDeclarativeComponent::createObject()
+QScriptValue QDeclarativeComponent::createObject(QObject* parent)
{
Q_D(QDeclarativeComponent);
QDeclarativeContext* ctxt = creationContext();
@@ -614,6 +571,20 @@ QScriptValue QDeclarativeComponent::createObject()
QObject* ret = create(ctxt);
if (!ret)
return QScriptValue(QScriptValue::NullValue);
+
+ QGraphicsObject* gobj = qobject_cast<QGraphicsObject*>(ret);
+ bool needParent = (gobj != 0);
+ if(parent){
+ ret->setParent(parent);
+ QGraphicsObject* gparent = qobject_cast<QGraphicsObject*>(parent);
+ if(gparent){
+ gobj->setParentItem(gparent);
+ needParent = false;
+ }
+ }
+ if(needParent)
+ qWarning("QDeclarativeComponent: Created graphical object was not placed in the graphics scene.");
+
QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine);
QDeclarativeData::get(ret, true)->setImplicitDestructible();
return priv->objectClass->newQObject(ret, QMetaType::QObjectStar);
@@ -754,6 +725,7 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *ctxt, QDe
state->bindValues = enginePriv->bindValues;
state->parserStatus = enginePriv->parserStatus;
+ state->finalizedParserStatus = enginePriv->finalizedParserStatus;
state->componentAttached = enginePriv->componentAttached;
if (state->componentAttached)
state->componentAttached->prev = &state->componentAttached;
@@ -761,6 +733,7 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *ctxt, QDe
enginePriv->componentAttached = 0;
enginePriv->bindValues.clear();
enginePriv->parserStatus.clear();
+ enginePriv->finalizedParserStatus.clear();
state->completePending = true;
enginePriv->inProgressCreations++;
}
@@ -785,6 +758,7 @@ void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *engi
state->bindValues = enginePriv->bindValues;
state->parserStatus = enginePriv->parserStatus;
+ state->finalizedParserStatus = enginePriv->finalizedParserStatus;
state->componentAttached = enginePriv->componentAttached;
if (state->componentAttached)
state->componentAttached->prev = &state->componentAttached;
@@ -792,6 +766,7 @@ void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *engi
enginePriv->componentAttached = 0;
enginePriv->bindValues.clear();
enginePriv->parserStatus.clear();
+ enginePriv->finalizedParserStatus.clear();
state->completePending = true;
enginePriv->inProgressCreations++;
}
@@ -826,6 +801,16 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
QDeclarativeEnginePrivate::clear(ps);
}
+ for (int ii = 0; ii < state->finalizedParserStatus.count(); ++ii) {
+ QPair<QDeclarativeGuard<QObject>, int> status = state->finalizedParserStatus.at(ii);
+ QObject *obj = status.first;
+ if (obj) {
+ void *args[] = { 0 };
+ QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
+ status.second, args);
+ }
+ }
+
while (state->componentAttached) {
QDeclarativeComponentAttached *a = state->componentAttached;
a->rem();
@@ -838,6 +823,7 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
state->bindValues.clear();
state->parserStatus.clear();
+ state->finalizedParserStatus.clear();
state->completePending = false;
enginePriv->inProgressCreations--;
diff --git a/src/declarative/qml/qdeclarativecomponent.h b/src/declarative/qml/qdeclarativecomponent.h
index f3cfe3c..688e233 100644
--- a/src/declarative/qml/qdeclarativecomponent.h
+++ b/src/declarative/qml/qdeclarativecomponent.h
@@ -64,10 +64,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeComponent)
- Q_PROPERTY(bool isNull READ isNull NOTIFY statusChanged)
- Q_PROPERTY(bool isReady READ isReady NOTIFY statusChanged)
- Q_PROPERTY(bool isError READ isError NOTIFY statusChanged)
- Q_PROPERTY(bool isLoading READ isLoading NOTIFY statusChanged)
+
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
Q_PROPERTY(QUrl url READ url CONSTANT)
@@ -112,7 +109,7 @@ Q_SIGNALS:
protected:
QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent);
- Q_INVOKABLE QScriptValue createObject();
+ Q_INVOKABLE QScriptValue createObject(QObject* parent);
private:
QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent);
diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h
index 24e5386..2a7d633 100644
--- a/src/declarative/qml/qdeclarativecomponent_p.h
+++ b/src/declarative/qml/qdeclarativecomponent_p.h
@@ -102,6 +102,7 @@ public:
ConstructionState() : componentAttached(0), completePending(false) {}
QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> > bindValues;
QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> > parserStatus;
+ QList<QPair<QDeclarativeGuard<QObject>, int> > finalizedParserStatus;
QDeclarativeComponentAttached *componentAttached;
QList<QDeclarativeError> errors;
bool completePending;
@@ -149,7 +150,7 @@ Q_SIGNALS:
void destruction();
private:
- friend class QDeclarativeContextData;;
+ friend class QDeclarativeContextData;
friend class QDeclarativeComponentPrivate;
};
diff --git a/src/declarative/qml/qdeclarativecompositetypedata_p.h b/src/declarative/qml/qdeclarativecompositetypedata_p.h
index 47cb3b3..a0e4cc2 100644
--- a/src/declarative/qml/qdeclarativecompositetypedata_p.h
+++ b/src/declarative/qml/qdeclarativecompositetypedata_p.h
@@ -83,7 +83,7 @@ public:
QList<QDeclarativeError> errors;
- QDeclarativeEnginePrivate::Imports imports;
+ QDeclarativeImports imports;
QList<QDeclarativeCompositeTypeData *> dependants;
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index 0eb7e1b..e4405f7 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -338,7 +338,7 @@ void QDeclarativeCompositeTypeManager::resourceReplyFinished()
// WARNING, there is a copy of this function in qdeclarativeengine.cpp
static QString toLocalFileOrQrc(const QUrl& url)
{
- if (url.scheme() == QLatin1String("qrc")) {
+ if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) {
if (url.authority().isEmpty())
return QLatin1Char(':') + url.path();
return QString();
@@ -360,7 +360,10 @@ void QDeclarativeCompositeTypeManager::loadResource(QDeclarativeCompositeTypeRes
} else {
resource->status = QDeclarativeCompositeTypeResource::Error;
}
+ } else if (url.scheme().isEmpty()) {
+ // We can't open this, so just declare as an error
+ resource->status = QDeclarativeCompositeTypeResource::Error;
} else {
QNetworkReply *reply =
@@ -382,27 +385,29 @@ void QDeclarativeCompositeTypeManager::loadSource(QDeclarativeCompositeTypeData
if (file.open(QFile::ReadOnly)) {
QByteArray data = file.readAll();
setData(unit, data, url);
- } else {
- QString errorDescription;
- // ### - Fill in error
- errorDescription = QLatin1String("File error for URL ") + url.toString();
- unit->status = QDeclarativeCompositeTypeData::Error;
- // ### FIXME
- QDeclarativeError error;
- error.setDescription(errorDescription);
- unit->errorType = QDeclarativeCompositeTypeData::AccessError;
- unit->errors << error;
- doComplete(unit);
+ return; // success
}
-
- } else {
+ } else if (!url.scheme().isEmpty()) {
QNetworkReply *reply =
engine->networkAccessManager()->get(QNetworkRequest(url));
QObject::connect(reply, SIGNAL(finished()),
this, SLOT(replyFinished()));
QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
this, SLOT(requestProgress(qint64,qint64)));
+ return; // waiting
}
+
+ // error happened
+ QString errorDescription;
+ // ### - Fill in error
+ errorDescription = QLatin1String("File error for URL ") + url.toString();
+ unit->status = QDeclarativeCompositeTypeData::Error;
+ // ### FIXME
+ QDeclarativeError error;
+ error.setDescription(errorDescription);
+ unit->errorType = QDeclarativeCompositeTypeData::AccessError;
+ unit->errors << error;
+ doComplete(unit);
}
void QDeclarativeCompositeTypeManager::requestProgress(qint64 received, qint64 total)
@@ -509,7 +514,9 @@ void QDeclarativeCompositeTypeManager::checkComplete(QDeclarativeCompositeTypeDa
unit->errors = u->errors;
doComplete(unit);
return;
- } else if (u->status == QDeclarativeCompositeTypeData::Waiting) {
+ } else if (u->status == QDeclarativeCompositeTypeData::Waiting
+ || u->status == QDeclarativeCompositeTypeData::WaitingResources)
+ {
waiting++;
}
}
@@ -525,16 +532,15 @@ void QDeclarativeCompositeTypeManager::checkComplete(QDeclarativeCompositeTypeDa
int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData *unit)
{
// not called until all resources are loaded (they include import URLs)
-
int waiting = 0;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeImportDatabase &importDatabase = ep->importDatabase;
- /*
- For local urls, add an implicit import "." as first (most overridden) lookup. This will also trigger
- the loading of the qmldir and the import of any native types from available plugins.
- */
+ // For local urls, add an implicit import "." as first (most overridden) lookup.
+ // This will also trigger the loading of the qmldir and the import of any native
+ // types from available plugins.
{
-
QDeclarativeDirComponents qmldircomponentsnetwork;
if (QDeclarativeCompositeTypeResource *resource
= resources.value(unit->imports.baseUrl().resolved(QUrl(QLatin1String("./qmldir"))))) {
@@ -544,14 +550,9 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
qmldircomponentsnetwork = parser.components();
}
- QDeclarativeEnginePrivate::get(engine)->
- addToImport(&unit->imports,
- qmldircomponentsnetwork,
- QLatin1String("."),
- QString(),
- -1, -1,
- QDeclarativeScriptParser::Import::File,
- 0); // error ignored (just means no fallback)
+ importDatabase.addToImport(&unit->imports, qmldircomponentsnetwork, QLatin1String("."),
+ QString(), -1, -1, QDeclarativeScriptParser::Import::File,
+ 0); // error ignored (just means no fallback)
}
@@ -588,9 +589,8 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
}
QString errorString;
- if (!QDeclarativeEnginePrivate::get(engine)->
- addToImport(&unit->imports, qmldircomponentsnetwork, imp.uri, imp.qualifier, vmaj, vmin, imp.type, &errorString))
- {
+ if (!importDatabase.addToImport(&unit->imports, qmldircomponentsnetwork, imp.uri, imp.qualifier,
+ vmaj, vmin, imp.type, &errorString)) {
QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
error.setDescription(errorString);
@@ -616,11 +616,10 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
QUrl url;
int majorVersion;
int minorVersion;
- QDeclarativeEnginePrivate::ImportedNamespace *typeNamespace = 0;
+ QDeclarativeImportedNamespace *typeNamespace = 0;
QString errorString;
- if (!QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion, &typeNamespace, &errorString)
- || typeNamespace)
- {
+ if (!importDatabase.resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion,
+ &typeNamespace, &errorString) || typeNamespace) {
// Known to not be a type:
// - known to be a namespace (Namespace {})
// - type with unknown namespace (UnknownNamespace.SomeType {})
@@ -724,8 +723,10 @@ void QDeclarativeCompositeTypeManager::compile(QDeclarativeCompositeTypeData *un
}
}
- QUrl importUrl = unit->imports.baseUrl().resolved(QUrl(QLatin1String("qmldir")));
- if (toLocalFileOrQrc(importUrl).isEmpty())
+ QUrl importUrl;
+ if (!unit->imports.baseUrl().scheme().isEmpty())
+ importUrl = unit->imports.baseUrl().resolved(QUrl(QLatin1String("qmldir")));
+ if (!importUrl.scheme().isEmpty() && toLocalFileOrQrc(importUrl).isEmpty())
resourceList.prepend(importUrl);
for (int ii = 0; ii < resourceList.count(); ++ii) {
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index ae4223e..6a13f15 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -528,13 +528,8 @@ void QDeclarativeContextData::invalidate()
parent = 0;
}
-void QDeclarativeContextData::destroy()
+void QDeclarativeContextData::clearExpressions()
{
- if (linkedContext)
- linkedContext->destroy();
-
- if (engine) invalidate();
-
QDeclarativeAbstractExpression *expression = expressions;
while (expression) {
QDeclarativeAbstractExpression *nextExpression = expression->m_nextExpression;
@@ -546,6 +541,16 @@ void QDeclarativeContextData::destroy()
expression = nextExpression;
}
expressions = 0;
+}
+
+void QDeclarativeContextData::destroy()
+{
+ if (linkedContext)
+ linkedContext->destroy();
+
+ if (engine) invalidate();
+
+ clearExpressions();
while (contextObjects) {
QDeclarativeData *co = contextObjects;
@@ -654,7 +659,7 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
if (iter == enginePriv->m_sharedScriptImports.end()) {
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
- scriptContext->pushScope(enginePriv->contextClass->newContext(0, 0));
+ scriptContext->pushScope(enginePriv->contextClass->newUrlContext(url));
scriptContext->pushScope(enginePriv->globalClass->globalObject());
QScriptValue scope = scriptEngine->newObject();
@@ -680,7 +685,7 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
- scriptContext->pushScope(enginePriv->contextClass->newContext(this, 0));
+ scriptContext->pushScope(enginePriv->contextClass->newUrlContext(this, 0, url));
scriptContext->pushScope(enginePriv->globalClass->globalObject());
QScriptValue scope = scriptEngine->newObject();
diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/declarative/qml/qdeclarativecontext.h
index 548869c..d87123a 100644
--- a/src/declarative/qml/qdeclarativecontext.h
+++ b/src/declarative/qml/qdeclarativecontext.h
@@ -107,7 +107,7 @@ private:
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QList<QObject*>);
+Q_DECLARE_METATYPE(QList<QObject*>)
QT_END_HEADER
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index c7fb099..6b6cd0a 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -113,6 +113,7 @@ class QDeclarativeContextData
public:
QDeclarativeContextData();
QDeclarativeContextData(QDeclarativeContext *);
+ void clearExpressions();
void destroy();
void invalidate();
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
index 1336a1a..1ebedbb 100644
--- a/src/declarative/qml/qdeclarativecontextscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
@@ -51,11 +51,13 @@ QT_BEGIN_NAMESPACE
struct ContextData : public QScriptDeclarativeClass::Object {
ContextData() : overrideObject(0), isSharedContext(true) {}
- ContextData(QDeclarativeContextData *c, QObject *o) : context(c), scopeObject(o), overrideObject(0), isSharedContext(false) {}
+ ContextData(QDeclarativeContextData *c, QObject *o)
+ : context(c), scopeObject(o), overrideObject(0), isSharedContext(false), isUrlContext(false) {}
QDeclarativeGuardedContextData context;
QDeclarativeGuard<QObject> scopeObject;
QObject *overrideObject;
- bool isSharedContext;
+ bool isSharedContext:1;
+ bool isUrlContext:1;
QDeclarativeContextData *getContext(QDeclarativeEngine *engine) {
if (isSharedContext) {
@@ -74,6 +76,18 @@ struct ContextData : public QScriptDeclarativeClass::Object {
}
};
+struct UrlContextData : public ContextData {
+ UrlContextData(QDeclarativeContextData *c, QObject *o, const QString &u)
+ : ContextData(c, o), url(u) {
+ isUrlContext = true;
+ }
+ UrlContextData(const QString &u)
+ : ContextData(0, 0), url(u) {
+ isUrlContext = true;
+ }
+ QString url;
+};
+
/*
The QDeclarativeContextScriptClass handles property access for a QDeclarativeContext
via QtScript.
@@ -95,6 +109,21 @@ QScriptValue QDeclarativeContextScriptClass::newContext(QDeclarativeContextData
return newObject(scriptEngine, this, new ContextData(context, scopeObject));
}
+QScriptValue QDeclarativeContextScriptClass::newUrlContext(QDeclarativeContextData *context, QObject *scopeObject,
+ const QString &url)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new UrlContextData(context, scopeObject, url));
+}
+
+QScriptValue QDeclarativeContextScriptClass::newUrlContext(const QString &url)
+{
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+
+ return newObject(scriptEngine, this, new UrlContextData(url));
+}
+
QScriptValue QDeclarativeContextScriptClass::newSharedContext()
{
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
@@ -111,6 +140,19 @@ QDeclarativeContextData *QDeclarativeContextScriptClass::contextFromValue(const
return data->getContext(engine);
}
+QUrl QDeclarativeContextScriptClass::urlFromValue(const QScriptValue &v)
+{
+ if (scriptClass(v) != this)
+ return QUrl();
+
+ ContextData *data = (ContextData *)object(v);
+ if (data->isUrlContext) {
+ return QUrl(static_cast<UrlContextData *>(data)->url);
+ } else {
+ return QUrl();
+ }
+}
+
QObject *QDeclarativeContextScriptClass::setOverrideObject(QScriptValue &v, QObject *override)
{
if (scriptClass(v) != this)
diff --git a/src/declarative/qml/qdeclarativecontextscriptclass_p.h b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
index 1936d38..1215b00 100644
--- a/src/declarative/qml/qdeclarativecontextscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
@@ -68,9 +68,13 @@ public:
~QDeclarativeContextScriptClass();
QScriptValue newContext(QDeclarativeContextData *, QObject * = 0);
+ QScriptValue newUrlContext(QDeclarativeContextData *, QObject *, const QString &);
+ QScriptValue newUrlContext(const QString &);
QScriptValue newSharedContext();
QDeclarativeContextData *contextFromValue(const QScriptValue &);
+ QUrl urlFromValue(const QScriptValue &);
+
QObject *setOverrideObject(QScriptValue &, QObject *);
protected:
diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h
index 4a56536..e916273 100644
--- a/src/declarative/qml/qdeclarativedata_p.h
+++ b/src/declarative/qml/qdeclarativedata_p.h
@@ -152,11 +152,11 @@ public:
template<class T>
void QDeclarativeGuard<T>::addGuard()
{
- if (QObjectPrivate::get(o)->wasDeleted) {
- if (prev) remGuard();
+ Q_ASSERT(!prev);
+
+ if (QObjectPrivate::get(o)->wasDeleted)
return;
- }
-
+
QDeclarativeData *data = QDeclarativeData::get(o, true);
next = data->guards;
if (next) reinterpret_cast<QDeclarativeGuard<T> *>(next)->prev = &next;
@@ -167,6 +167,8 @@ void QDeclarativeGuard<T>::addGuard()
template<class T>
void QDeclarativeGuard<T>::remGuard()
{
+ Q_ASSERT(prev);
+
if (next) reinterpret_cast<QDeclarativeGuard<T> *>(next)->prev = prev;
*prev = next;
next = 0;
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 0ee6dfe..79f8a17 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -67,6 +67,7 @@
#include "qdeclarativeextensioninterface.h"
#include "private/qdeclarativelist_p.h"
#include "private/qdeclarativetypenamecache_p.h"
+#include "private/qdeclarativeinclude_p.h"
#include <QtCore/qmetaobject.h>
#include <QScriptClass>
@@ -82,6 +83,7 @@
#include <QStack>
#include <QMap>
#include <QPluginLoader>
+#include <QtGui/qfontdatabase.h>
#include <QtCore/qlibraryinfo.h>
#include <QtCore/qthreadstorage.h>
#include <QtCore/qthread.h>
@@ -111,9 +113,6 @@ Q_DECLARE_METATYPE(QDeclarativeProperty)
QT_BEGIN_NAMESPACE
-DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE)
-DEFINE_BOOL_CONFIG_OPTION(qmlCheckTypes, QML_CHECK_TYPES)
-
/*!
\qmlclass QtObject QObject
\since 4.7
@@ -158,7 +157,7 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0),
inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0),
inBeginCreate(false), networkAccessManager(0), networkAccessManagerFactory(0),
- typeManager(e), uniqueId(1)
+ typeManager(e), importDatabase(e), uniqueId(1)
{
if (!qt_QmlQtModule_registered) {
qt_QmlQtModule_registered = true;
@@ -168,27 +167,6 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
QDeclarativeValueTypeFactory::registerValueTypes();
}
globalClass = new QDeclarativeGlobalScriptClass(&scriptEngine);
-
- // env import paths
- QByteArray envImportPath = qgetenv("QML_IMPORT_PATH");
- if (!envImportPath.isEmpty()) {
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
- QLatin1Char pathSep(';');
-#else
- QLatin1Char pathSep(':');
-#endif
- foreach (const QString &path, QString::fromLatin1(envImportPath).split(pathSep, QString::SkipEmptyParts)) {
- QString canonicalPath = QDir(path).canonicalPath();
- if (!canonicalPath.isEmpty() && !fileImportPath.contains(canonicalPath))
- fileImportPath.append(canonicalPath);
- }
- }
- QString builtinPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
- if (!builtinPath.isEmpty())
- fileImportPath += builtinPath;
-
- filePluginPath += QLatin1String(".");
-
}
QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
@@ -227,6 +205,11 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr
// XXX used to add Qt.Sound class.
//types
+ if (mainthread)
+ qtObject.setProperty(QLatin1String("include"), newFunction(QDeclarativeInclude::include, 2));
+ else
+ qtObject.setProperty(QLatin1String("include"), newFunction(QDeclarativeInclude::worker_include, 2));
+
qtObject.setProperty(QLatin1String("isQtObject"), newFunction(QDeclarativeEnginePrivate::isQtObject, 1));
qtObject.setProperty(QLatin1String("rgba"), newFunction(QDeclarativeEnginePrivate::rgba, 4));
qtObject.setProperty(QLatin1String("hsla"), newFunction(QDeclarativeEnginePrivate::hsla, 4));
@@ -249,6 +232,7 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr
//misc methods
qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QDeclarativeEnginePrivate::desktopOpenUrl, 1));
+ qtObject.setProperty(QLatin1String("fontFamilies"),newFunction(QDeclarativeEnginePrivate::fontFamilies, 0));
qtObject.setProperty(QLatin1String("md5"),newFunction(QDeclarativeEnginePrivate::md5, 1));
qtObject.setProperty(QLatin1String("btoa"),newFunction(QDeclarativeEnginePrivate::btoa, 1));
qtObject.setProperty(QLatin1String("atob"),newFunction(QDeclarativeEnginePrivate::atob, 1));
@@ -345,17 +329,17 @@ void QDeclarativeEnginePrivate::clear(SimpleList<QDeclarativeParserStatus> &pss)
}
Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer);
-typedef QMap<QString, QString> StringStringMap;
-Q_GLOBAL_STATIC(StringStringMap, qmlEnginePluginsWithRegisteredTypes); // stores the uri
-
void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o)
{
QObjectPrivate *p = QObjectPrivate::get(o);
- Q_ASSERT(p->declarativeData);
- QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
- if (d->ownContext)
- d->context->destroy();
+ if (p->declarativeData) {
+ QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
+ if (d->ownContext && d->context) {
+ d->context->destroy();
+ d->context = 0;
+ }
+ }
}
void QDeclarativeData::destroyed(QAbstractDeclarativeData *d, QObject *o)
@@ -374,6 +358,7 @@ void QDeclarativeEnginePrivate::init()
qRegisterMetaType<QVariant>("QVariant");
qRegisterMetaType<QDeclarativeScriptString>("QDeclarativeScriptString");
qRegisterMetaType<QScriptValue>("QScriptValue");
+ qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status");
QDeclarativeData::init();
@@ -456,7 +441,11 @@ QDeclarativeEngine::~QDeclarativeEngine()
}
/*! \fn void QDeclarativeEngine::quit()
- This signal is emitted when the QDeclarativeEngine quits.
+ This signal is emitted when the QDeclarativeEngine quits.
+ */
+
+/*! \fn void QDeclarativeEngine::warnings(const QList<QDeclarativeError> &warnings)
+ This signal is emitted when \a warnings messages are generated by QML.
*/
/*!
@@ -573,9 +562,9 @@ QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const
This example creates a provider with id \e colors:
- \snippet examples/declarative/imageprovider/imageprovider.cpp 0
+ \snippet examples/declarative/cppextensions/imageprovider/imageprovider.cpp 0
- \snippet examples/declarative/imageprovider/imageprovider-example.qml 0
+ \snippet examples/declarative/cppextensions/imageprovider/imageprovider-example.qml 0
\sa removeImageProvider()
*/
@@ -892,14 +881,10 @@ void QDeclarativeData::destroyed(QObject *object)
if (ownContext && context)
context->destroy();
- QDeclarativeGuard<QObject> *guard = guards;
- while (guard) {
- QDeclarativeGuard<QObject> *g = guard;
- guard = guard->next;
- g->o = 0;
- g->prev = 0;
- g->next = 0;
- g->objectDestroyed(object);
+ while (guards) {
+ QDeclarativeGuard<QObject> *guard = guards;
+ *guard = (QObject *)0;
+ guard->objectDestroyed(object);
}
if (scriptValue)
@@ -986,7 +971,7 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS
Q_ASSERT(context);
if(ctxt->argumentCount() != 1) {
- return ctxt->throwError("Qt.createComponent(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.createComponent(): Invalid arguments"));
}else{
QString arg = ctxt->argument(0).toString();
if (arg.isEmpty())
@@ -1006,7 +991,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
QDeclarativeEngine* activeEngine = activeEnginePriv->q_func();
if(ctxt->argumentCount() < 2 || ctxt->argumentCount() > 3)
- return ctxt->throwError("Qt.createQmlObject(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Invalid arguments"));
QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt);
Q_ASSERT(context);
@@ -1026,7 +1011,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1));
if(!parentArg)
- return ctxt->throwError("Qt.createQmlObject(): Missing parent object");
+ return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Missing parent object"));
QDeclarativeComponent component(activeEngine);
component.setData(qml.toUtf8(), url);
@@ -1051,9 +1036,12 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
}
if (!component.isReady())
- return ctxt->throwError("Qt.createQmlObject(): Component is not ready");
+ return ctxt->throwError(QLatin1String("Qt.createQmlObject(): Component is not ready"));
- QObject *obj = component.create(context->asQDeclarativeContext());
+ QObject *obj = component.beginCreate(context->asQDeclarativeContext());
+ if(obj)
+ QDeclarativeData::get(obj, true)->setImplicitDestructible();
+ component.completeCreate();
if(component.isError()) {
QList<QDeclarativeError> errors = component.errors();
@@ -1097,18 +1085,18 @@ QScriptValue QDeclarativeEnginePrivate::isQtObject(QScriptContext *ctxt, QScript
QScriptValue QDeclarativeEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 3)
- return ctxt->throwError("Qt.vector(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.vector(): Invalid arguments"));
qsreal x = ctxt->argument(0).toNumber();
qsreal y = ctxt->argument(1).toNumber();
qsreal z = ctxt->argument(2).toNumber();
- return engine->newVariant(qVariantFromValue(QVector3D(x, y, z)));
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QVector3D(x, y, z)));
}
QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptEngine*engine)
{
int argCount = ctxt->argumentCount();
if(argCount == 0 || argCount > 2)
- return ctxt->throwError("Qt.formatDate(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid arguments"));
QDate date = ctxt->argument(0).toDateTime().date();
Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate;
@@ -1119,7 +1107,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE
} else if (ctxt->argument(1).isNumber()) {
enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32());
} else {
- return ctxt->throwError("Qt.formatDate(): Invalid date format");
+ return ctxt->throwError(QLatin1String("Qt.formatDate(): Invalid date format"));
}
}
return engine->newVariant(qVariantFromValue(date.toString(enumFormat)));
@@ -1129,7 +1117,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE
{
int argCount = ctxt->argumentCount();
if(argCount == 0 || argCount > 2)
- return ctxt->throwError("Qt.formatTime(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid arguments"));
QTime date = ctxt->argument(0).toDateTime().time();
Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate;
@@ -1140,7 +1128,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE
} else if (ctxt->argument(1).isNumber()) {
enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32());
} else {
- return ctxt->throwError("Qt.formatTime(): Invalid time format");
+ return ctxt->throwError(QLatin1String("Qt.formatTime(): Invalid time format"));
}
}
return engine->newVariant(qVariantFromValue(date.toString(enumFormat)));
@@ -1150,7 +1138,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr
{
int argCount = ctxt->argumentCount();
if(argCount == 0 || argCount > 2)
- return ctxt->throwError("Qt.formatDateTime(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid arguments"));
QDateTime date = ctxt->argument(0).toDateTime();
Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate;
@@ -1161,7 +1149,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr
} else if (ctxt->argument(1).isNumber()) {
enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32());
} else {
- return ctxt->throwError("Qt.formatDateTime(): Invalid datetime format");
+ return ctxt->throwError(QLatin1String("Qt.formatDateTime(): Invalid datetime format"));
}
}
return engine->newVariant(qVariantFromValue(date.toString(enumFormat)));
@@ -1171,7 +1159,7 @@ QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine
{
int argCount = ctxt->argumentCount();
if(argCount < 3 || argCount > 4)
- return ctxt->throwError("Qt.rgba(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.rgba(): Invalid arguments"));
qsreal r = ctxt->argument(0).toNumber();
qsreal g = ctxt->argument(1).toNumber();
qsreal b = ctxt->argument(2).toNumber();
@@ -1193,7 +1181,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine
{
int argCount = ctxt->argumentCount();
if(argCount < 3 || argCount > 4)
- return ctxt->throwError("Qt.hsla(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.hsla(): Invalid arguments"));
qsreal h = ctxt->argument(0).toNumber();
qsreal s = ctxt->argument(1).toNumber();
qsreal l = ctxt->argument(2).toNumber();
@@ -1214,7 +1202,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine
QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 4)
- return ctxt->throwError("Qt.rect(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.rect(): Invalid arguments"));
qsreal x = ctxt->argument(0).toNumber();
qsreal y = ctxt->argument(1).toNumber();
@@ -1224,31 +1212,31 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
if (w < 0 || h < 0)
return engine->nullValue();
- return qScriptValueFromValue(engine, qVariantFromValue(QRectF(x, y, w, h)));
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QRectF(x, y, w, h)));
}
QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
- return ctxt->throwError("Qt.point(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.point(): Invalid arguments"));
qsreal x = ctxt->argument(0).toNumber();
qsreal y = ctxt->argument(1).toNumber();
- return qScriptValueFromValue(engine, qVariantFromValue(QPointF(x, y)));
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QPointF(x, y)));
}
QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
- return ctxt->throwError("Qt.size(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.size(): Invalid arguments"));
qsreal w = ctxt->argument(0).toNumber();
qsreal h = ctxt->argument(1).toNumber();
- return qScriptValueFromValue(engine, qVariantFromValue(QSizeF(w, h)));
+ return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(qVariantFromValue(QSizeF(w, h)));
}
QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine)
{
- if(ctxt->argumentCount() != 1)
- return ctxt->throwError("Qt.lighter(): Invalid arguments");
+ if(ctxt->argumentCount() != 1 && ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.lighter(): Invalid arguments"));
QVariant v = ctxt->argument(0).toVariant();
QColor color;
if (v.userType() == QVariant::Color)
@@ -1260,14 +1248,17 @@ QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEng
return engine->nullValue();
} else
return engine->nullValue();
- color = color.lighter();
+ qsreal factor = 1.5;
+ if (ctxt->argumentCount() == 2)
+ factor = ctxt->argument(1).toNumber();
+ color = color.lighter(int(qRound(factor*100.)));
return qScriptValueFromValue(engine, qVariantFromValue(color));
}
QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine)
{
- if(ctxt->argumentCount() != 1)
- return ctxt->throwError("Qt.darker(): Invalid arguments");
+ if(ctxt->argumentCount() != 1 && ctxt->argumentCount() != 2)
+ return ctxt->throwError(QLatin1String("Qt.darker(): Invalid arguments"));
QVariant v = ctxt->argument(0).toVariant();
QColor color;
if (v.userType() == QVariant::Color)
@@ -1279,7 +1270,10 @@ QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngi
return engine->nullValue();
} else
return engine->nullValue();
- color = color.darker();
+ qsreal factor = 2.0;
+ if (ctxt->argumentCount() == 2)
+ factor = ctxt->argument(1).toNumber();
+ color = color.darker(int(qRound(factor*100.)));
return qScriptValueFromValue(engine, qVariantFromValue(color));
}
@@ -1294,10 +1288,20 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc
return QScriptValue(e, ret);
}
+QScriptValue QDeclarativeEnginePrivate::fontFamilies(QScriptContext *ctxt, QScriptEngine *e)
+{
+ if(ctxt->argumentCount() != 0)
+ return ctxt->throwError(QLatin1String("Qt.fontFamilies(): Invalid arguments"));
+
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(e);
+ QFontDatabase database;
+ return p->scriptValueFromVariant(database.families());
+}
+
QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
{
if (ctxt->argumentCount() != 1)
- return ctxt->throwError("Qt.md5(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.md5(): Invalid arguments"));
QByteArray data = ctxt->argument(0).toString().toUtf8();
QByteArray result = QCryptographicHash::hash(data, QCryptographicHash::Md5);
@@ -1308,7 +1312,7 @@ QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine
QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *)
{
if (ctxt->argumentCount() != 1)
- return ctxt->throwError("Qt.btoa(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.btoa(): Invalid arguments"));
QByteArray data = ctxt->argument(0).toString().toUtf8();
@@ -1318,7 +1322,7 @@ QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine
QScriptValue QDeclarativeEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *)
{
if (ctxt->argumentCount() != 1)
- return ctxt->throwError("Qt.atob(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.atob(): Invalid arguments"));
QByteArray data = ctxt->argument(0).toString().toUtf8();
@@ -1419,7 +1423,7 @@ QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptE
QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
- return ctxt->throwError("Qt.tint(): Invalid arguments");
+ return ctxt->throwError(QLatin1String("Qt.tint(): Invalid arguments"));
//get color
QVariant v = ctxt->argument(0).toVariant();
QColor color;
@@ -1522,516 +1526,6 @@ QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val
return val.toVariant();
}
-// XXX this beyonds in QUrl::toLocalFile()
-// WARNING, there is a copy of this function in qdeclarativecompositetypemanager.cpp
-static QString toLocalFileOrQrc(const QUrl& url)
-{
- if (url.scheme() == QLatin1String("qrc")) {
- if (url.authority().isEmpty())
- return QLatin1Char(':') + url.path();
- return QString();
- }
- return url.toLocalFile();
-}
-
-/////////////////////////////////////////////////////////////
-struct QDeclarativeEnginePrivate::ImportedNamespace {
- QStringList uris;
- QStringList urls;
- QList<int> majversions;
- QList<int> minversions;
- QList<bool> isLibrary;
- QList<QDeclarativeDirComponents> qmlDirComponents;
-
-
- bool find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
- QDeclarativeType** type_return, QUrl* url_return,
- QUrl *base = 0, bool *typeRecursionDetected = 0)
- {
- int vmaj = majversions.at(i);
- int vmin = minversions.at(i);
-
- QByteArray qt = uris.at(i).toUtf8();
- qt += '/';
- qt += type;
-
- QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
- if (t) {
- if (vmajor) *vmajor = vmaj;
- if (vminor) *vminor = vmin;
- if (type_return)
- *type_return = t;
- return true;
- }
-
- QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
- QDeclarativeDirComponents qmldircomponents = qmlDirComponents.at(i);
-
- bool typeWasDeclaredInQmldir = false;
- if (!qmldircomponents.isEmpty()) {
- const QString typeName = QString::fromUtf8(type);
- foreach (const QDeclarativeDirParser::Component &c, qmldircomponents) {
- if (c.typeName == typeName) {
- typeWasDeclaredInQmldir = true;
-
- // importing version -1 means import ALL versions
- if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
- QUrl candidate = url.resolved(QUrl(c.fileName));
- if (c.internal && base) {
- if (base->resolved(QUrl(c.fileName)) != candidate)
- continue; // failed attempt to access an internal type
- }
- if (base && *base == candidate) {
- if (typeRecursionDetected)
- *typeRecursionDetected = true;
- continue; // no recursion
- }
- if (url_return)
- *url_return = candidate;
- return true;
- }
- }
- }
- }
-
- if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) {
- // XXX search non-files too! (eg. zip files, see QT-524)
- QFileInfo f(toLocalFileOrQrc(url));
- if (f.exists()) {
- if (base && *base == url) { // no recursion
- if (typeRecursionDetected)
- *typeRecursionDetected = true;
- } else {
- if (url_return)
- *url_return = url;
- return true;
- }
- }
- }
- return false;
- }
-
- bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
- QUrl* url_return, QUrl *base = 0, QString *errorString = 0)
- {
- bool typeRecursionDetected = false;
- for (int i=0; i<urls.count(); ++i) {
- if (find_helper(i, type, vmajor, vminor, type_return, url_return, base, &typeRecursionDetected)) {
- if (qmlCheckTypes()) {
- // check for type clashes
- for (int j = i+1; j<urls.count(); ++j) {
- if (find_helper(j, type, vmajor, vminor, 0, 0, base)) {
- if (errorString) {
- QString u1 = urls.at(i);
- QString u2 = urls.at(j);
- if (base) {
- QString b = base->toString();
- int slash = b.lastIndexOf(QLatin1Char('/'));
- if (slash >= 0) {
- b = b.left(slash+1);
- QString l = b.left(slash);
- if (u1.startsWith(b))
- u1 = u1.mid(b.count());
- else if (u1 == l)
- u1 = QDeclarativeEngine::tr("local directory");
- if (u2.startsWith(b))
- u2 = u2.mid(b.count());
- else if (u2 == l)
- u2 = QDeclarativeEngine::tr("local directory");
- }
- }
-
- if (u1 != u2)
- *errorString
- = QDeclarativeEngine::tr("is ambiguous. Found in %1 and in %2")
- .arg(u1).arg(u2);
- else
- *errorString
- = QDeclarativeEngine::tr("is ambiguous. Found in %1 in version %2.%3 and %4.%5")
- .arg(u1)
- .arg(majversions.at(i)).arg(minversions.at(i))
- .arg(majversions.at(j)).arg(minversions.at(j));
- }
- return false;
- }
- }
- }
- return true;
- }
- }
- if (errorString) {
- if (typeRecursionDetected)
- *errorString = QDeclarativeEngine::tr("is instantiated recursively");
- else
- *errorString = QDeclarativeEngine::tr("is not a type");
- }
- return false;
- }
-};
-
-static bool greaterThan(const QString &s1, const QString &s2)
-{
- return s1 > s2;
-}
-
-class QDeclarativeImportsPrivate {
-public:
- QDeclarativeImportsPrivate() : ref(1)
- {
- }
-
- ~QDeclarativeImportsPrivate()
- {
- foreach (QDeclarativeEnginePrivate::ImportedNamespace* s, set.values())
- delete s;
- }
-
- QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded;
-
- bool importExtension(const QString &absoluteFilePath, const QString &uri, QDeclarativeEngine *engine, QDeclarativeDirComponents* components, QString *errorString) {
- QFile file(absoluteFilePath);
- QString filecontent;
- if (file.open(QFile::ReadOnly)) {
- filecontent = QString::fromUtf8(file.readAll());
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::add: loaded" << absoluteFilePath;
- } else {
- if (errorString)
- *errorString = QDeclarativeEngine::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath);
- return false;
- }
- QDir dir = QFileInfo(file).dir();
-
- QDeclarativeDirParser qmldirParser;
- qmldirParser.setSource(filecontent);
- qmldirParser.parse();
-
- if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) {
- qmlDirFilesForWhichPluginsHaveBeenLoaded.insert(absoluteFilePath);
-
-
- foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser.plugins()) {
-
- QString resolvedFilePath =
- QDeclarativeEnginePrivate::get(engine)
- ->resolvePlugin(dir, plugin.path,
- plugin.name);
-
- if (!resolvedFilePath.isEmpty()) {
- if (!engine->importPlugin(resolvedFilePath, uri, errorString)) {
- if (errorString)
- *errorString = QDeclarativeEngine::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(*errorString);
- return false;
- }
- } else {
- if (errorString)
- *errorString = QDeclarativeEngine::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name);
- return false;
- }
- }
- }
-
- if (components)
- *components = qmldirParser.components();
-
- return true;
- }
-
- QString resolvedUri(const QString &dir_arg, QDeclarativeEngine *engine)
- {
- QString dir = dir_arg;
- if (dir.endsWith(QLatin1Char('/')) || dir.endsWith(QLatin1Char('\\')))
- dir.chop(1);
-
- QStringList paths = QDeclarativeEnginePrivate::get(engine)->fileImportPath;
- qSort(paths.begin(), paths.end(), greaterThan); // Ensure subdirs preceed their parents.
-
- QString stableRelativePath = dir;
- foreach( QString path, paths) {
- if (dir.startsWith(path)) {
- stableRelativePath = dir.mid(path.length()+1);
- break;
- }
- }
- stableRelativePath.replace(QLatin1Char('/'), QLatin1Char('.'));
- stableRelativePath.replace(QLatin1Char('\\'), QLatin1Char('.'));
- return stableRelativePath;
- }
-
-
-
-
- bool add(const QUrl& base, const QDeclarativeDirComponents &qmldircomponentsnetwork, const QString& uri_arg, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, QDeclarativeEngine *engine, QString *errorString)
- {
- QDeclarativeDirComponents qmldircomponents = qmldircomponentsnetwork;
- QString uri = uri_arg;
- QDeclarativeEnginePrivate::ImportedNamespace *s;
- if (prefix.isEmpty()) {
- s = &unqualifiedset;
- } else {
- s = set.value(prefix);
- if (!s)
- set.insert(prefix,(s=new QDeclarativeEnginePrivate::ImportedNamespace));
- }
-
-
-
- QString url = uri;
- if (importType == QDeclarativeScriptParser::Import::Library) {
- url.replace(QLatin1Char('.'), QLatin1Char('/'));
- bool found = false;
- QString dir;
-
-
- foreach (const QString &p,
- QDeclarativeEnginePrivate::get(engine)->fileImportPath) {
- dir = p+QLatin1Char('/')+url;
-
- QFileInfo fi(dir+QLatin1String("/qmldir"));
- const QString absoluteFilePath = fi.absoluteFilePath();
-
- if (fi.isFile()) {
- found = true;
-
- url = QUrl::fromLocalFile(fi.absolutePath()).toString();
- uri = resolvedUri(dir, engine);
- if (!importExtension(absoluteFilePath, uri, engine, &qmldircomponents, errorString))
- return false;
- break;
- }
- }
-
- if (!found) {
- found = QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin);
- if (!found) {
- if (errorString) {
- bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1);
- if (anyversion)
- *errorString = QDeclarativeEngine::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
- else
- *errorString = QDeclarativeEngine::tr("module \"%1\" is not installed").arg(uri_arg);
- }
- return false;
- }
- }
- } else {
-
- if (importType == QDeclarativeScriptParser::Import::File && qmldircomponents.isEmpty()) {
- QUrl importUrl = base.resolved(QUrl(uri + QLatin1String("/qmldir")));
- QString localFileOrQrc = toLocalFileOrQrc(importUrl);
- if (!localFileOrQrc.isEmpty()) {
- QString dir = toLocalFileOrQrc(base.resolved(QUrl(uri)));
- if (dir.isEmpty() || !QDir().exists(dir)) {
- if (errorString)
- *errorString = QDeclarativeEngine::tr("\"%1\": no such directory").arg(uri_arg);
- return false; // local import dirs must exist
- }
- uri = resolvedUri(toLocalFileOrQrc(base.resolved(QUrl(uri))), engine);
- if (uri.endsWith(QLatin1Char('/')))
- uri.chop(1);
- if (QFile::exists(localFileOrQrc)) {
- if (!importExtension(localFileOrQrc,uri,engine,&qmldircomponents,errorString))
- return false;
- }
- } else {
- if (prefix.isEmpty()) {
- // directory must at least exist for valid import
- QString localFileOrQrc = toLocalFileOrQrc(base.resolved(QUrl(uri)));
- if (localFileOrQrc.isEmpty() || !QDir().exists(localFileOrQrc)) {
- if (errorString) {
- if (localFileOrQrc.isEmpty())
- *errorString = QDeclarativeEngine::tr("import \"%1\" has no qmldir and no namespace").arg(uri);
- else
- *errorString = QDeclarativeEngine::tr("\"%1\": no such directory").arg(uri);
- }
- return false;
- }
- }
- }
- }
-
- url = base.resolved(QUrl(url)).toString();
- if (url.endsWith(QLatin1Char('/')))
- url.chop(1);
- }
-
- if (vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) {
- QList<QDeclarativeDirParser::Component>::ConstIterator it = qmldircomponents.begin();
- for (; it != qmldircomponents.end(); ++it) {
- if (it->majorVersion > vmaj || (it->majorVersion == vmaj && it->minorVersion >= vmin))
- break;
- }
- if (it == qmldircomponents.end()) {
- *errorString = QDeclarativeEngine::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
- return false;
- }
- }
-
- s->uris.prepend(uri);
- s->urls.prepend(url);
- s->majversions.prepend(vmaj);
- s->minversions.prepend(vmin);
- s->isLibrary.prepend(importType == QDeclarativeScriptParser::Import::Library);
- s->qmlDirComponents.prepend(qmldircomponents);
- return true;
- }
-
- bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
- QUrl* url_return, QString *errorString)
- {
- QDeclarativeEnginePrivate::ImportedNamespace *s = 0;
- int slash = type.indexOf('/');
- if (slash >= 0) {
- QString namespaceName = QString::fromUtf8(type.left(slash));
- s = set.value(namespaceName);
- if (!s) {
- if (errorString)
- *errorString = QDeclarativeEngine::tr("- %1 is not a namespace").arg(namespaceName);
- return false;
- }
- int nslash = type.indexOf('/',slash+1);
- if (nslash > 0) {
- if (errorString)
- *errorString = QDeclarativeEngine::tr("- nested namespaces not allowed");
- return false;
- }
- } else {
- s = &unqualifiedset;
- }
- QByteArray unqualifiedtype = slash < 0 ? type : type.mid(slash+1); // common-case opt (QString::mid works fine, but slower)
- if (s) {
- if (s->find(unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errorString))
- return true;
- if (s->urls.count() == 1 && !s->isLibrary[0] && url_return && s != &unqualifiedset) {
- // qualified, and only 1 url
- *url_return = QUrl(s->urls[0]+QLatin1Char('/')).resolved(QUrl(QString::fromUtf8(unqualifiedtype) + QLatin1String(".qml")));
- return true;
- }
- }
-
- return false;
- }
-
- QDeclarativeEnginePrivate::ImportedNamespace *findNamespace(const QString& type)
- {
- return set.value(type);
- }
-
- QUrl base;
- int ref;
-
-private:
- friend struct QDeclarativeEnginePrivate::Imports;
- QDeclarativeEnginePrivate::ImportedNamespace unqualifiedset;
- QHash<QString,QDeclarativeEnginePrivate::ImportedNamespace* > set;
-};
-
-QDeclarativeEnginePrivate::Imports::Imports(const Imports &copy) :
- d(copy.d)
-{
- ++d->ref;
-}
-
-QDeclarativeEnginePrivate::Imports &QDeclarativeEnginePrivate::Imports::operator =(const Imports &copy)
-{
- ++copy.d->ref;
- if (--d->ref == 0)
- delete d;
- d = copy.d;
- return *this;
-}
-
-QDeclarativeEnginePrivate::Imports::Imports() :
- d(new QDeclarativeImportsPrivate)
-{
-}
-
-QDeclarativeEnginePrivate::Imports::~Imports()
-{
- if (--d->ref == 0)
- delete d;
-}
-
-static QDeclarativeTypeNameCache *cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeEnginePrivate::ImportedNamespace &set, QDeclarativeTypeNameCache *cache)
-{
- if (!cache)
- cache = new QDeclarativeTypeNameCache(engine);
-
- QList<QDeclarativeType *> types = QDeclarativeMetaType::qmlTypes();
-
- for (int ii = 0; ii < set.uris.count(); ++ii) {
- QByteArray base = set.uris.at(ii).toUtf8() + '/';
- int major = set.majversions.at(ii);
- int minor = set.minversions.at(ii);
-
- foreach (QDeclarativeType *type, types) {
- if (type->qmlTypeName().startsWith(base) &&
- type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
- type->availableInVersion(major,minor))
- {
- QString name = QString::fromUtf8(type->qmlTypeName().mid(base.length()));
-
- cache->add(name, type);
- }
- }
- }
-
- return cache;
-}
-
-void QDeclarativeEnginePrivate::Imports::cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const
-{
- const QDeclarativeEnginePrivate::ImportedNamespace &set = d->unqualifiedset;
-
- for (QHash<QString,QDeclarativeEnginePrivate::ImportedNamespace* >::ConstIterator iter = d->set.begin();
- iter != d->set.end(); ++iter) {
-
- QDeclarativeTypeNameCache::Data *d = cache->data(iter.key());
- if (d) {
- if (!d->typeNamespace)
- cacheForNamespace(engine, *(*iter), d->typeNamespace);
- } else {
- QDeclarativeTypeNameCache *nc = cacheForNamespace(engine, *(*iter), 0);
- cache->add(iter.key(), nc);
- nc->release();
- }
- }
-
- cacheForNamespace(engine, set, cache);
-}
-
-/*
-QStringList QDeclarativeEnginePrivate::Imports::unqualifiedSet() const
-{
- QStringList rv;
-
- const QDeclarativeEnginePrivate::ImportedNamespace &set = d->unqualifiedset;
-
- for (int ii = 0; ii < set.urls.count(); ++ii) {
- if (set.isBuiltin.at(ii))
- rv << set.urls.at(ii);
- }
-
- return rv;
-}
-*/
-
-/*!
- Sets the base URL to be used for all relative file imports added.
-*/
-void QDeclarativeEnginePrivate::Imports::setBaseUrl(const QUrl& url)
-{
- d->base = url;
-}
-
-/*!
- Returns the base URL to be used for all relative file imports added.
-*/
-QUrl QDeclarativeEnginePrivate::Imports::baseUrl() const
-{
- return d->base;
-}
-
/*!
Adds \a path as a directory where the engine searches for
installed modules in a URL-based directory structure.
@@ -2042,19 +1536,10 @@ QUrl QDeclarativeEnginePrivate::Imports::baseUrl() const
*/
void QDeclarativeEngine::addImportPath(const QString& path)
{
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::addImportPath" << path;
Q_D(QDeclarativeEngine);
- QUrl url = QUrl(path);
- if (url.isRelative() || url.scheme() == QString::fromLocal8Bit("file")) {
- QDir dir = QDir(path);
- d->fileImportPath.prepend(dir.canonicalPath());
- } else {
- d->fileImportPath.prepend(path);
- }
+ d->importDatabase.addImportPath(path);
}
-
/*!
Returns the list of directories where the engine searches for
installed modules in a URL-based directory structure.
@@ -2073,11 +1558,11 @@ void QDeclarativeEngine::addImportPath(const QString& path)
QStringList QDeclarativeEngine::importPathList() const
{
Q_D(const QDeclarativeEngine);
- return d->fileImportPath;
+ return d->importDatabase.importPathList();
}
/*!
- Sets the list of directories where the engine searches for
+ Sets \a paths as the list of directories where the engine searches for
installed modules in a URL-based directory structure.
By default, the list contains the paths specified in the \c QML_IMPORT_PATH environment
@@ -2088,7 +1573,7 @@ QStringList QDeclarativeEngine::importPathList() const
void QDeclarativeEngine::setImportPathList(const QStringList &paths)
{
Q_D(QDeclarativeEngine);
- d->fileImportPath = paths;
+ d->importDatabase.setImportPathList(paths);
}
@@ -2105,16 +1590,8 @@ void QDeclarativeEngine::setImportPathList(const QStringList &paths)
*/
void QDeclarativeEngine::addPluginPath(const QString& path)
{
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::addPluginPath" << path;
Q_D(QDeclarativeEngine);
- QUrl url = QUrl(path);
- if (url.isRelative() || url.scheme() == QString::fromLocal8Bit("file")) {
- QDir dir = QDir(path);
- d->filePluginPath.prepend(dir.canonicalPath());
- } else {
- d->filePluginPath.prepend(path);
- }
+ d->importDatabase.addPluginPath(path);
}
@@ -2130,7 +1607,7 @@ void QDeclarativeEngine::addPluginPath(const QString& path)
QStringList QDeclarativeEngine::pluginPathList() const
{
Q_D(const QDeclarativeEngine);
- return d->filePluginPath;
+ return d->importDatabase.pluginPathList();
}
/*!
@@ -2146,7 +1623,7 @@ QStringList QDeclarativeEngine::pluginPathList() const
void QDeclarativeEngine::setPluginPathList(const QStringList &paths)
{
Q_D(QDeclarativeEngine);
- d->filePluginPath = paths;
+ d->importDatabase.setPluginPathList(paths);
}
@@ -2160,55 +1637,8 @@ void QDeclarativeEngine::setPluginPathList(const QStringList &paths)
*/
bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri, QString *errorString)
{
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::importPlugin" << uri << "from" << filePath;
- QFileInfo fileInfo(filePath);
- const QString absoluteFilePath = fileInfo.absoluteFilePath();
-
- QDeclarativeEnginePrivate *d = QDeclarativeEnginePrivate::get(this);
- bool engineInitialized = d->initializedPlugins.contains(absoluteFilePath);
- bool typesRegistered = qmlEnginePluginsWithRegisteredTypes()->contains(absoluteFilePath);
-
- if (typesRegistered) {
- Q_ASSERT_X(qmlEnginePluginsWithRegisteredTypes()->value(absoluteFilePath) == uri,
- "QDeclarativeEngine::importExtension",
- "Internal error: Plugin imported previously with different uri");
- }
-
- if (!engineInitialized || !typesRegistered) {
- QPluginLoader loader(absoluteFilePath);
-
- if (!loader.load()) {
- if (errorString)
- *errorString = loader.errorString();
- return false;
- }
-
- if (QDeclarativeExtensionInterface *iface = qobject_cast<QDeclarativeExtensionInterface *>(loader.instance())) {
-
- const QByteArray bytes = uri.toUtf8();
- const char *moduleId = bytes.constData();
- if (!typesRegistered) {
-
- // ### this code should probably be protected with a mutex.
- qmlEnginePluginsWithRegisteredTypes()->insert(absoluteFilePath, uri);
- iface->registerTypes(moduleId);
- }
- if (!engineInitialized) {
- // things on the engine (eg. adding new global objects) have to be done for every engine.
-
- // protect against double initialization
- d->initializedPlugins.insert(absoluteFilePath);
- iface->initializeEngine(this, moduleId);
- }
- } else {
- if (errorString)
- *errorString = loader.errorString();
- return false;
- }
- }
-
- return true;
+ Q_D(QDeclarativeEngine);
+ return d->importDatabase.importPlugin(filePath, uri, errorString);
}
/*!
@@ -2240,208 +1670,6 @@ QString QDeclarativeEngine::offlineStoragePath() const
return d->scriptEngine.offlineStoragePath;
}
-/*!
- \internal
-
- Returns the result of the merge of \a baseName with \a path, \a suffixes, and \a prefix.
- The \a prefix must contain the dot.
-
- \a qmldirPath is the location of the qmldir file.
- */
-QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, const QString &baseName,
- const QStringList &suffixes,
- const QString &prefix)
-{
- QStringList searchPaths = filePluginPath;
- bool qmldirPluginPathIsRelative = QDir::isRelativePath(qmldirPluginPath);
- if (!qmldirPluginPathIsRelative)
- searchPaths.prepend(qmldirPluginPath);
-
- foreach (const QString &pluginPath, searchPaths) {
-
- QString resolvedPath;
-
- if (pluginPath == QLatin1String(".")) {
- if (qmldirPluginPathIsRelative)
- resolvedPath = qmldirPath.absoluteFilePath(qmldirPluginPath);
- else
- resolvedPath = qmldirPath.absolutePath();
- } else {
- resolvedPath = pluginPath;
- }
-
- // hack for resources, should probably go away
- if (resolvedPath.startsWith(QLatin1Char(':')))
- resolvedPath = QCoreApplication::applicationDirPath();
-
- QDir dir(resolvedPath);
- foreach (const QString &suffix, suffixes) {
- QString pluginFileName = prefix;
-
- pluginFileName += baseName;
- pluginFileName += suffix;
-
- QFileInfo fileInfo(dir, pluginFileName);
-
- if (fileInfo.exists())
- return fileInfo.absoluteFilePath();
- }
- }
-
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::resolvePlugin: Could not resolve plugin" << baseName << "in" << qmldirPath.absolutePath();
- return QString();
-}
-
-/*!
- \internal
-
- Returns the result of the merge of \a baseName with \a dir and the platform suffix.
-
- \table
- \header \i Platform \i Valid suffixes
- \row \i Windows \i \c .dll
- \row \i Unix/Linux \i \c .so
- \row \i AIX \i \c .a
- \row \i HP-UX \i \c .sl, \c .so (HP-UXi)
- \row \i Mac OS X \i \c .dylib, \c .bundle, \c .so
- \row \i Symbian \i \c .dll
- \endtable
-
- Version number on unix are ignored.
-*/
-QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, const QString &baseName)
-{
-#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
- return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
- QStringList()
-# ifdef QT_DEBUG
- << QLatin1String("d.dll") // try a qmake-style debug build first
-# endif
- << QLatin1String(".dll"));
-#elif defined(Q_OS_SYMBIAN)
- return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
- QStringList()
- << QLatin1String(".dll")
- << QLatin1String(".qtplugin"));
-#else
-
-# if defined(Q_OS_DARWIN)
-
- return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
- QStringList()
-# ifdef QT_DEBUG
- << QLatin1String("_debug.dylib") // try a qmake-style debug build first
- << QLatin1String(".dylib")
-# else
- << QLatin1String(".dylib")
- << QLatin1String("_debug.dylib") // try a qmake-style debug build after
-# endif
- << QLatin1String(".so")
- << QLatin1String(".bundle"),
- QLatin1String("lib"));
-# else // Generic Unix
- QStringList validSuffixList;
-
-# if defined(Q_OS_HPUX)
-/*
- See "HP-UX Linker and Libraries User's Guide", section "Link-time Differences between PA-RISC and IPF":
- "In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),
- the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix."
- */
- validSuffixList << QLatin1String(".sl");
-# if defined __ia64
- validSuffixList << QLatin1String(".so");
-# endif
-# elif defined(Q_OS_AIX)
- validSuffixList << QLatin1String(".a") << QLatin1String(".so");
-# elif defined(Q_OS_UNIX)
- validSuffixList << QLatin1String(".so");
-# endif
-
- // Examples of valid library names:
- // libfoo.so
-
- return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, QLatin1String("lib"));
-# endif
-
-#endif
-}
-
-/*!
- \internal
-
- Adds information to \a imports such that subsequent calls to resolveType()
- will resolve types qualified by \a prefix by considering types found at the given \a uri.
-
- The uri is either a directory (if importType is FileImport), or a URI resolved using paths
- added via addImportPath() (if importType is LibraryImport).
-
- The \a prefix may be empty, in which case the import location is considered for
- unqualified types.
-
- The base URL must already have been set with Import::setBaseUrl().
-*/
-bool QDeclarativeEnginePrivate::addToImport(Imports* imports, const QDeclarativeDirComponents &qmldircomponentsnetwork, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, QString *errorString) const
-{
- QDeclarativeEngine *engine = QDeclarativeEnginePrivate::get(const_cast<QDeclarativeEnginePrivate *>(this));
- if (qmlImportTrace())
- qDebug().nospace() << "QDeclarativeEngine::addToImport " << imports << " " << uri << " " << vmaj << '.' << vmin << " " << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File") << " as " << prefix;
- bool ok = imports->d->add(imports->d->base,qmldircomponentsnetwork, uri,prefix,vmaj,vmin,importType, engine, errorString);
- return ok;
-}
-
-/*!
- \internal
-
- Using the given \a imports, the given (namespace qualified) \a type is resolved to either
- an ImportedNamespace stored at \a ns_return,
- a QDeclarativeType stored at \a type_return, or
- a component located at \a url_return.
-
- If any return pointer is 0, the corresponding search is not done.
-
- \sa addToImport()
-*/
-bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteArray& type, QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin, ImportedNamespace** ns_return, QString *errorString) const
-{
- ImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type));
- if (ns) {
- if (ns_return)
- *ns_return = ns;
- return true;
- }
- if (type_return || url_return) {
- if (imports.d->find(type,vmaj,vmin,type_return,url_return, errorString)) {
- if (qmlImportTrace()) {
- if (type_return && *type_return && url_return && !url_return->isEmpty())
- qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << (*type_return)->typeName() << *url_return;
- if (type_return && *type_return)
- qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << (*type_return)->typeName();
- if (url_return && !url_return->isEmpty())
- qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << *url_return;
- }
- return true;
- }
- }
- return false;
-}
-
-/*!
- \internal
-
- Searching \e only in the namespace \a ns (previously returned in a call to
- resolveType(), \a type is found and returned to either
- a QDeclarativeType stored at \a type_return, or
- a component located at \a url_return.
-
- If either return pointer is 0, the corresponding search is not done.
-*/
-void QDeclarativeEnginePrivate::resolveTypeInNamespace(ImportedNamespace* ns, const QByteArray& type, QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin ) const
-{
- ns->find(type,vmaj,vmin,type_return,url_return);
-}
-
static void voidptr_destructor(void *v)
{
void **ptr = (void **)v;
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 743275e..0b1c17d 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -57,6 +57,7 @@
#include "private/qdeclarativeclassfactory_p.h"
#include "private/qdeclarativecompositetypemanager_p.h"
+#include "private/qdeclarativeimport_p.h"
#include "private/qpodvector_p.h"
#include "qdeclarative.h"
#include "private/qdeclarativevaluetype_p.h"
@@ -90,6 +91,7 @@ class QDeclarativeEngine;
class QDeclarativeContextPrivate;
class QDeclarativeExpression;
class QDeclarativeContextScriptClass;
+class QDeclarativeImportDatabase;
class QDeclarativeObjectScriptClass;
class QDeclarativeTypeNameScriptClass;
class QDeclarativeValueTypeScriptClass;
@@ -164,7 +166,6 @@ public:
bool outputWarningsToStdErr;
- struct ImportedNamespace;
QDeclarativeContextScriptClass *contextClass;
QDeclarativeContextData *sharedContext;
QObject *sharedScope;
@@ -217,8 +218,13 @@ public:
QList<SimpleList<QDeclarativeAbstractBinding> > bindValues;
QList<SimpleList<QDeclarativeParserStatus> > parserStatus;
+ QList<QPair<QDeclarativeGuard<QObject>,int> > finalizedParserStatus;
QDeclarativeComponentAttached *componentAttached;
+ void registerFinalizedParserStatusObject(QObject *obj, int index) {
+ finalizedParserStatus.append(qMakePair(QDeclarativeGuard<QObject>(obj), index));
+ }
+
bool inBeginCreate;
QNetworkAccessManager *createNetworkAccessManager(QObject *parent) const;
@@ -232,8 +238,8 @@ public:
mutable QMutex mutex;
QDeclarativeCompositeTypeManager typeManager;
- QStringList fileImportPath;
- QStringList filePluginPath;
+ QDeclarativeImportDatabase importDatabase;
+
QString offlineStoragePath;
mutable quint32 uniqueId;
@@ -244,58 +250,8 @@ public:
QDeclarativeValueTypeFactory valueTypes;
QHash<const QMetaObject *, QDeclarativePropertyCache *> propertyCache;
- QDeclarativePropertyCache *cache(QObject *obj) {
- Q_Q(QDeclarativeEngine);
- if (!obj || QObjectPrivate::get(obj)->metaObject ||
- QObjectPrivate::get(obj)->wasDeleted) return 0;
- const QMetaObject *mo = obj->metaObject();
- QDeclarativePropertyCache *rv = propertyCache.value(mo);
- if (!rv) {
- rv = QDeclarativePropertyCache::create(q, mo);
- propertyCache.insert(mo, rv);
- }
- return rv;
- }
-
- // ### This whole class is embarrassing
- struct Imports {
- Imports();
- ~Imports();
- Imports(const Imports &copy);
- Imports &operator =(const Imports &copy);
-
- void setBaseUrl(const QUrl& url);
- QUrl baseUrl() const;
-
- void cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const;
-
- private:
- friend class QDeclarativeEnginePrivate;
- QDeclarativeImportsPrivate *d;
- };
-
-
- QSet<QString> initializedPlugins;
-
- QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, const QString &baseName,
- const QStringList &suffixes,
- const QString &prefix = QString());
- QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, const QString &baseName);
-
-
- bool addToImport(Imports*, const QDeclarativeDirComponents &qmldircomponentsnetwork,
- const QString& uri, const QString& prefix, int vmaj, int vmin,
- QDeclarativeScriptParser::Import::Type importType,
- QString *errorString) const;
- bool resolveType(const Imports&, const QByteArray& type,
- QDeclarativeType** type_return, QUrl* url_return,
- int *version_major, int *version_minor,
- ImportedNamespace** ns_return,
- QString *errorString = 0) const;
- void resolveTypeInNamespace(ImportedNamespace*, const QByteArray& type,
- QDeclarativeType** type_return, QUrl* url_return,
- int *version_major, int *version_minor ) const;
-
+ inline QDeclarativePropertyCache *cache(QObject *obj);
+ inline QDeclarativePropertyCache *cache(const QMetaObject *);
void registerCompositeType(QDeclarativeCompiledData *);
@@ -339,6 +295,7 @@ public:
static QScriptValue tint(QScriptContext*, QScriptEngine*);
static QScriptValue desktopOpenUrl(QScriptContext*, QScriptEngine*);
+ static QScriptValue fontFamilies(QScriptContext*, QScriptEngine*);
static QScriptValue md5(QScriptContext*, QScriptEngine*);
static QScriptValue btoa(QScriptContext*, QScriptEngine*);
static QScriptValue atob(QScriptContext*, QScriptEngine*);
@@ -361,6 +318,48 @@ public:
static void defineModule();
};
+/*!
+Returns a QDeclarativePropertyCache for \a obj if one is available.
+
+If \a obj is null, being deleted or contains a dynamic meta object 0
+is returned.
+*/
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(QObject *obj)
+{
+ Q_Q(QDeclarativeEngine);
+ if (!obj || QObjectPrivate::get(obj)->metaObject || QObjectPrivate::get(obj)->wasDeleted)
+ return 0;
+
+ const QMetaObject *mo = obj->metaObject();
+ QDeclarativePropertyCache *rv = propertyCache.value(mo);
+ if (!rv) {
+ rv = new QDeclarativePropertyCache(q, mo);
+ propertyCache.insert(mo, rv);
+ }
+ return rv;
+}
+
+/*!
+Returns a QDeclarativePropertyCache for \a metaObject.
+
+As the cache is persisted for the life of the engine, \a metaObject must be
+a static "compile time" meta-object, or a meta-object that is otherwise known to
+exist for the lifetime of the QDeclarativeEngine.
+*/
+QDeclarativePropertyCache *QDeclarativeEnginePrivate::cache(const QMetaObject *metaObject)
+{
+ Q_Q(QDeclarativeEngine);
+ Q_ASSERT(metaObject);
+
+ QDeclarativePropertyCache *rv = propertyCache.value(metaObject);
+ if (!rv) {
+ rv = new QDeclarativePropertyCache(q, metaObject);
+ propertyCache.insert(metaObject, rv);
+ }
+
+ return rv;
+}
+
QT_END_NAMESPACE
#endif // QDECLARATIVEENGINE_P_H
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index f561a7e..5ceb918 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -57,10 +57,12 @@ QT_BEGIN_NAMESPACE
bool QDeclarativeDelayedError::addError(QDeclarativeEnginePrivate *e)
{
- if (!e || prevError) return false;
+ if (!e) return false;
if (e->inProgressCreations == 0) return false; // Not in construction
+ if (prevError) return true; // Already in error chain
+
prevError = &e->erroredBindings;
nextError = e->erroredBindings;
e->erroredBindings = this;
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
index 2c15385..c2e8300 100644
--- a/src/declarative/qml/qdeclarativeextensionplugin.cpp
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
See \l {Tutorial: Writing QML extensions with C++} for details on creating
QML extensions, including how to build a plugin with with QDeclarativeExtensionPlugin.
- For a simple overview, see the \l{declarative/plugins}{plugins} example.
+ For a simple overview, see the \l{declarative/cppextensions/plugins}{plugins} example.
Also see \l {How to Create Qt Plugins} for general Qt plugin documentation.
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
index fc802b4..6e107fb 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
@@ -53,19 +53,29 @@ QT_BEGIN_NAMESPACE
QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engine)
: QScriptClass(engine)
{
+ QString eval = QLatin1String("eval");
+
QScriptValue globalObject = engine->globalObject();
+
m_globalObject = engine->newObject();
+ QScriptValue newGlobalObject = engine->newObject();
QScriptValueIterator iter(globalObject);
+
while (iter.hasNext()) {
iter.next();
- m_globalObject.setProperty(iter.scriptName(), iter.value());
- m_illegalNames.insert(iter.name());
+
+ QString name = iter.name();
+
+ if (name != eval)
+ m_globalObject.setProperty(iter.scriptName(), iter.value());
+ newGlobalObject.setProperty(iter.scriptName(), iter.value());
+
+ m_illegalNames.insert(name);
}
- QScriptValue v = engine->newObject();
- v.setScriptClass(this);
- engine->setGlobalObject(v);
+ newGlobalObject.setScriptClass(this);
+ engine->setGlobalObject(newGlobalObject);
}
QScriptClass::QueryFlags
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
index 1b34aee..7690edd 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
@@ -76,6 +76,7 @@ public:
void explicitSetProperty(const QString &, const QScriptValue &);
const QScriptValue &globalObject() const { return m_globalObject; }
+
const QSet<QString> &illegalNames() const { return m_illegalNames; }
private:
diff --git a/src/declarative/qml/qdeclarativeguard_p.h b/src/declarative/qml/qdeclarativeguard_p.h
index be60ce4..02fed0b 100644
--- a/src/declarative/qml/qdeclarativeguard_p.h
+++ b/src/declarative/qml/qdeclarativeguard_p.h
@@ -97,7 +97,7 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QDeclarativeGuard<QObject>);
+Q_DECLARE_METATYPE(QDeclarativeGuard<QObject>)
#include "private/qdeclarativedata_p.h"
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
new file mode 100644
index 0000000..576e048
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -0,0 +1,925 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeimport_p.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qdir.h>
+#include <QtCore/qfileinfo.h>
+#include <QtCore/qpluginloader.h>
+#include <QtCore/qlibraryinfo.h>
+#include <QtDeclarative/qdeclarativeextensioninterface.h>
+#include <private/qdeclarativeglobal_p.h>
+#include <private/qdeclarativetypenamecache_p.h>
+
+QT_BEGIN_NAMESPACE
+
+DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE)
+DEFINE_BOOL_CONFIG_OPTION(qmlCheckTypes, QML_CHECK_TYPES)
+
+static QString toLocalFileOrQrc(const QUrl& url)
+{
+ if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) {
+ if (url.authority().isEmpty())
+ return QLatin1Char(':') + url.path();
+ return QString();
+ }
+ return url.toLocalFile();
+}
+
+static bool greaterThan(const QString &s1, const QString &s2)
+{
+ return s1 > s2;
+}
+
+typedef QMap<QString, QString> StringStringMap;
+Q_GLOBAL_STATIC(StringStringMap, qmlEnginePluginsWithRegisteredTypes); // stores the uri
+
+class QDeclarativeImportedNamespace
+{
+public:
+ QStringList uris;
+ QStringList urls;
+ QList<int> majversions;
+ QList<int> minversions;
+ QList<bool> isLibrary;
+ QList<QDeclarativeDirComponents> qmlDirComponents;
+
+
+ bool find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return,
+ QUrl *base = 0, bool *typeRecursionDetected = 0);
+ bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QUrl *base = 0, QString *errorString = 0);
+};
+
+class QDeclarativeImportsPrivate {
+public:
+ QDeclarativeImportsPrivate();
+ ~QDeclarativeImportsPrivate();
+
+ bool importExtension(const QString &absoluteFilePath, const QString &uri,
+ QDeclarativeImportDatabase *database, QDeclarativeDirComponents* components,
+ QString *errorString);
+
+ QString resolvedUri(const QString &dir_arg, QDeclarativeImportDatabase *database);
+ bool add(const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ const QString& uri_arg, const QString& prefix,
+ int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType,
+ QDeclarativeImportDatabase *database, QString *errorString);
+ bool find(const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return, QString *errorString);
+
+ QDeclarativeImportedNamespace *findNamespace(const QString& type);
+
+ QUrl base;
+ int ref;
+
+ QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded;
+ QDeclarativeImportedNamespace unqualifiedset;
+ QHash<QString,QDeclarativeImportedNamespace* > set;
+};
+
+QDeclarativeImports::QDeclarativeImports(const QDeclarativeImports &copy)
+: d(copy.d)
+{
+ ++d->ref;
+}
+
+QDeclarativeImports &
+QDeclarativeImports::operator =(const QDeclarativeImports &copy)
+{
+ ++copy.d->ref;
+ if (--d->ref == 0)
+ delete d;
+ d = copy.d;
+ return *this;
+}
+
+QDeclarativeImports::QDeclarativeImports()
+: d(new QDeclarativeImportsPrivate)
+{
+}
+
+QDeclarativeImports::~QDeclarativeImports()
+{
+ if (--d->ref == 0)
+ delete d;
+}
+
+/*!
+ Sets the base URL to be used for all relative file imports added.
+*/
+void QDeclarativeImports::setBaseUrl(const QUrl& url)
+{
+ d->base = url;
+}
+
+/*!
+ Returns the base URL to be used for all relative file imports added.
+*/
+QUrl QDeclarativeImports::baseUrl() const
+{
+ return d->base;
+}
+
+static QDeclarativeTypeNameCache *
+cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeImportedNamespace &set,
+ QDeclarativeTypeNameCache *cache)
+{
+ if (!cache)
+ cache = new QDeclarativeTypeNameCache(engine);
+
+ QList<QDeclarativeType *> types = QDeclarativeMetaType::qmlTypes();
+
+ for (int ii = 0; ii < set.uris.count(); ++ii) {
+ QByteArray base = set.uris.at(ii).toUtf8() + '/';
+ int major = set.majversions.at(ii);
+ int minor = set.minversions.at(ii);
+
+ foreach (QDeclarativeType *type, types) {
+ if (type->qmlTypeName().startsWith(base) &&
+ type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
+ type->availableInVersion(major,minor))
+ {
+ QString name = QString::fromUtf8(type->qmlTypeName().mid(base.length()));
+
+ cache->add(name, type);
+ }
+ }
+ }
+
+ return cache;
+}
+
+void QDeclarativeImports::cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const
+{
+ const QDeclarativeImportedNamespace &set = d->unqualifiedset;
+
+ for (QHash<QString,QDeclarativeImportedNamespace* >::ConstIterator iter = d->set.begin();
+ iter != d->set.end(); ++iter) {
+
+ QDeclarativeTypeNameCache::Data *d = cache->data(iter.key());
+ if (d) {
+ if (!d->typeNamespace)
+ cacheForNamespace(engine, *(*iter), d->typeNamespace);
+ } else {
+ QDeclarativeTypeNameCache *nc = cacheForNamespace(engine, *(*iter), 0);
+ cache->add(iter.key(), nc);
+ nc->release();
+ }
+ }
+
+ cacheForNamespace(engine, set, cache);
+}
+bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return,
+ QUrl *base, bool *typeRecursionDetected)
+{
+ int vmaj = majversions.at(i);
+ int vmin = minversions.at(i);
+
+ QByteArray qt = uris.at(i).toUtf8();
+ qt += '/';
+ qt += type;
+
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
+ if (t) {
+ if (vmajor) *vmajor = vmaj;
+ if (vminor) *vminor = vmin;
+ if (type_return)
+ *type_return = t;
+ return true;
+ }
+
+ QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
+ QDeclarativeDirComponents qmldircomponents = qmlDirComponents.at(i);
+
+ bool typeWasDeclaredInQmldir = false;
+ if (!qmldircomponents.isEmpty()) {
+ const QString typeName = QString::fromUtf8(type);
+ foreach (const QDeclarativeDirParser::Component &c, qmldircomponents) {
+ if (c.typeName == typeName) {
+ typeWasDeclaredInQmldir = true;
+
+ // importing version -1 means import ALL versions
+ if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
+ QUrl candidate = url.resolved(QUrl(c.fileName));
+ if (c.internal && base) {
+ if (base->resolved(QUrl(c.fileName)) != candidate)
+ continue; // failed attempt to access an internal type
+ }
+ if (base && *base == candidate) {
+ if (typeRecursionDetected)
+ *typeRecursionDetected = true;
+ continue; // no recursion
+ }
+ if (url_return)
+ *url_return = candidate;
+ return true;
+ }
+ }
+ }
+ }
+
+ if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) {
+ // XXX search non-files too! (eg. zip files, see QT-524)
+ QFileInfo f(toLocalFileOrQrc(url));
+ if (f.exists()) {
+ if (base && *base == url) { // no recursion
+ if (typeRecursionDetected)
+ *typeRecursionDetected = true;
+ } else {
+ if (url_return)
+ *url_return = url;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+QDeclarativeImportsPrivate::QDeclarativeImportsPrivate()
+: ref(1)
+{
+}
+
+QDeclarativeImportsPrivate::~QDeclarativeImportsPrivate()
+{
+ foreach (QDeclarativeImportedNamespace* s, set.values())
+ delete s;
+}
+
+bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath, const QString &uri,
+ QDeclarativeImportDatabase *database,
+ QDeclarativeDirComponents* components, QString *errorString)
+{
+ QFile file(absoluteFilePath);
+ QString filecontent;
+ if (file.open(QFile::ReadOnly)) {
+ filecontent = QString::fromUtf8(file.readAll());
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeImportDatabase::add: loaded" << absoluteFilePath;
+ } else {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath);
+ return false;
+ }
+ QDir dir = QFileInfo(file).dir();
+
+ QDeclarativeDirParser qmldirParser;
+ qmldirParser.setSource(filecontent);
+ qmldirParser.parse();
+
+ if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) {
+ qmlDirFilesForWhichPluginsHaveBeenLoaded.insert(absoluteFilePath);
+
+
+ foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser.plugins()) {
+
+ QString resolvedFilePath = database->resolvePlugin(dir, plugin.path, plugin.name);
+
+ if (!resolvedFilePath.isEmpty()) {
+ if (!database->importPlugin(resolvedFilePath, uri, errorString)) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(*errorString);
+ return false;
+ }
+ } else {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name);
+ return false;
+ }
+ }
+ }
+
+ if (components)
+ *components = qmldirParser.components();
+
+ return true;
+}
+
+QString QDeclarativeImportsPrivate::resolvedUri(const QString &dir_arg, QDeclarativeImportDatabase *database)
+{
+ QString dir = dir_arg;
+ if (dir.endsWith(QLatin1Char('/')) || dir.endsWith(QLatin1Char('\\')))
+ dir.chop(1);
+
+ QStringList paths = database->fileImportPath;
+ qSort(paths.begin(), paths.end(), greaterThan); // Ensure subdirs preceed their parents.
+
+ QString stableRelativePath = dir;
+ foreach( QString path, paths) {
+ if (dir.startsWith(path)) {
+ stableRelativePath = dir.mid(path.length()+1);
+ break;
+ }
+ }
+ stableRelativePath.replace(QLatin1Char('/'), QLatin1Char('.'));
+ stableRelativePath.replace(QLatin1Char('\\'), QLatin1Char('.'));
+ return stableRelativePath;
+}
+
+bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ const QString& uri_arg, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ QDeclarativeImportDatabase *database, QString *errorString)
+{
+ QDeclarativeDirComponents qmldircomponents = qmldircomponentsnetwork;
+ QString uri = uri_arg;
+ QDeclarativeImportedNamespace *s;
+ if (prefix.isEmpty()) {
+ s = &unqualifiedset;
+ } else {
+ s = set.value(prefix);
+ if (!s)
+ set.insert(prefix,(s=new QDeclarativeImportedNamespace));
+ }
+
+ QString url = uri;
+ if (importType == QDeclarativeScriptParser::Import::Library) {
+ url.replace(QLatin1Char('.'), QLatin1Char('/'));
+ bool found = false;
+ QString dir;
+
+
+ foreach (const QString &p, database->fileImportPath) {
+ dir = p+QLatin1Char('/')+url;
+
+ QFileInfo fi(dir+QLatin1String("/qmldir"));
+ const QString absoluteFilePath = fi.absoluteFilePath();
+
+ if (fi.isFile()) {
+ found = true;
+
+ url = QUrl::fromLocalFile(fi.absolutePath()).toString();
+ uri = resolvedUri(dir, database);
+ if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errorString))
+ return false;
+ break;
+ }
+ }
+
+ if (!found) {
+ found = QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin);
+ if (!found) {
+ if (errorString) {
+ bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1);
+ if (anyversion)
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
+ else
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" is not installed").arg(uri_arg);
+ }
+ return false;
+ }
+ }
+ } else {
+
+ if (importType == QDeclarativeScriptParser::Import::File && qmldircomponents.isEmpty()) {
+ QUrl importUrl = base.resolved(QUrl(uri + QLatin1String("/qmldir")));
+ QString localFileOrQrc = toLocalFileOrQrc(importUrl);
+ if (!localFileOrQrc.isEmpty()) {
+ QString dir = toLocalFileOrQrc(base.resolved(QUrl(uri)));
+ if (dir.isEmpty() || !QDir().exists(dir)) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("\"%1\": no such directory").arg(uri_arg);
+ return false; // local import dirs must exist
+ }
+ uri = resolvedUri(toLocalFileOrQrc(base.resolved(QUrl(uri))), database);
+ if (uri.endsWith(QLatin1Char('/')))
+ uri.chop(1);
+ if (QFile::exists(localFileOrQrc)) {
+ if (!importExtension(localFileOrQrc,uri,database,&qmldircomponents,errorString))
+ return false;
+ }
+ } else {
+ if (prefix.isEmpty()) {
+ // directory must at least exist for valid import
+ QString localFileOrQrc = toLocalFileOrQrc(base.resolved(QUrl(uri)));
+ if (localFileOrQrc.isEmpty() || !QDir().exists(localFileOrQrc)) {
+ if (errorString) {
+ if (localFileOrQrc.isEmpty())
+ *errorString = QDeclarativeImportDatabase::tr("import \"%1\" has no qmldir and no namespace").arg(uri);
+ else
+ *errorString = QDeclarativeImportDatabase::tr("\"%1\": no such directory").arg(uri);
+ }
+ return false;
+ }
+ }
+ }
+ }
+
+ url = base.resolved(QUrl(url)).toString();
+ if (url.endsWith(QLatin1Char('/')))
+ url.chop(1);
+ }
+
+ if (vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) {
+ QList<QDeclarativeDirParser::Component>::ConstIterator it = qmldircomponents.begin();
+ for (; it != qmldircomponents.end(); ++it) {
+ if (it->majorVersion > vmaj || (it->majorVersion == vmaj && it->minorVersion >= vmin))
+ break;
+ }
+ if (it == qmldircomponents.end()) {
+ *errorString = QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin);
+ return false;
+ }
+ }
+
+ s->uris.prepend(uri);
+ s->urls.prepend(url);
+ s->majversions.prepend(vmaj);
+ s->minversions.prepend(vmin);
+ s->isLibrary.prepend(importType == QDeclarativeScriptParser::Import::Library);
+ s->qmlDirComponents.prepend(qmldircomponents);
+ return true;
+}
+
+bool QDeclarativeImportsPrivate::find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QString *errorString)
+{
+ QDeclarativeImportedNamespace *s = 0;
+ int slash = type.indexOf('/');
+ if (slash >= 0) {
+ QString namespaceName = QString::fromUtf8(type.left(slash));
+ s = set.value(namespaceName);
+ if (!s) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("- %1 is not a namespace").arg(namespaceName);
+ return false;
+ }
+ int nslash = type.indexOf('/',slash+1);
+ if (nslash > 0) {
+ if (errorString)
+ *errorString = QDeclarativeImportDatabase::tr("- nested namespaces not allowed");
+ return false;
+ }
+ } else {
+ s = &unqualifiedset;
+ }
+ QByteArray unqualifiedtype = slash < 0 ? type : type.mid(slash+1); // common-case opt (QString::mid works fine, but slower)
+ if (s) {
+ if (s->find(unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errorString))
+ return true;
+ if (s->urls.count() == 1 && !s->isLibrary[0] && url_return && s != &unqualifiedset) {
+ // qualified, and only 1 url
+ *url_return = QUrl(s->urls[0]+QLatin1Char('/')).resolved(QUrl(QString::fromUtf8(unqualifiedtype) + QLatin1String(".qml")));
+ return true;
+ }
+ }
+
+ return false;
+}
+
+QDeclarativeImportedNamespace *QDeclarativeImportsPrivate::findNamespace(const QString& type)
+{
+ return set.value(type);
+}
+
+bool QDeclarativeImportedNamespace::find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QUrl *base, QString *errorString)
+{
+ bool typeRecursionDetected = false;
+ for (int i=0; i<urls.count(); ++i) {
+ if (find_helper(i, type, vmajor, vminor, type_return, url_return, base, &typeRecursionDetected)) {
+ if (qmlCheckTypes()) {
+ // check for type clashes
+ for (int j = i+1; j<urls.count(); ++j) {
+ if (find_helper(j, type, vmajor, vminor, 0, 0, base)) {
+ if (errorString) {
+ QString u1 = urls.at(i);
+ QString u2 = urls.at(j);
+ if (base) {
+ QString b = base->toString();
+ int slash = b.lastIndexOf(QLatin1Char('/'));
+ if (slash >= 0) {
+ b = b.left(slash+1);
+ QString l = b.left(slash);
+ if (u1.startsWith(b))
+ u1 = u1.mid(b.count());
+ else if (u1 == l)
+ u1 = QDeclarativeImportDatabase::tr("local directory");
+ if (u2.startsWith(b))
+ u2 = u2.mid(b.count());
+ else if (u2 == l)
+ u2 = QDeclarativeImportDatabase::tr("local directory");
+ }
+ }
+
+ if (u1 != u2)
+ *errorString
+ = QDeclarativeImportDatabase::tr("is ambiguous. Found in %1 and in %2")
+ .arg(u1).arg(u2);
+ else
+ *errorString
+ = QDeclarativeImportDatabase::tr("is ambiguous. Found in %1 in version %2.%3 and %4.%5")
+ .arg(u1)
+ .arg(majversions.at(i)).arg(minversions.at(i))
+ .arg(majversions.at(j)).arg(minversions.at(j));
+ }
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+ if (errorString) {
+ if (typeRecursionDetected)
+ *errorString = QDeclarativeImportDatabase::tr("is instantiated recursively");
+ else
+ *errorString = QDeclarativeImportDatabase::tr("is not a type");
+ }
+ return false;
+}
+
+QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
+: engine(e)
+{
+ filePluginPath << QLatin1String(".");
+
+ QString builtinPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
+ if (!builtinPath.isEmpty())
+ addImportPath(builtinPath);
+
+ // env import paths
+ QByteArray envImportPath = qgetenv("QML_IMPORT_PATH");
+ if (!envImportPath.isEmpty()) {
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+ QLatin1Char pathSep(';');
+#else
+ QLatin1Char pathSep(':');
+#endif
+ QStringList paths = QString::fromLatin1(envImportPath).split(pathSep, QString::SkipEmptyParts);
+ for (int ii = paths.count() - 1; ii >= 0; --ii)
+ addImportPath(paths.at(ii));
+ }
+}
+
+QDeclarativeImportDatabase::~QDeclarativeImportDatabase()
+{
+}
+
+/*!
+ \internal
+
+ Adds information to \a imports such that subsequent calls to resolveType()
+ will resolve types qualified by \a prefix by considering types found at the given \a uri.
+
+ The uri is either a directory (if importType is FileImport), or a URI resolved using paths
+ added via addImportPath() (if importType is LibraryImport).
+
+ The \a prefix may be empty, in which case the import location is considered for
+ unqualified types.
+
+ The base URL must already have been set with Import::setBaseUrl().
+*/
+bool QDeclarativeImportDatabase::addToImport(QDeclarativeImports* imports,
+ const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ const QString& uri, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ QString *errorString)
+{
+ if (qmlImportTrace())
+ qDebug().nospace() << "QDeclarativeImportDatabase::addToImport " << imports << " " << uri << " "
+ << vmaj << '.' << vmin << " "
+ << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File")
+ << " as " << prefix;
+
+ bool ok = imports->d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, this, errorString);
+ return ok;
+}
+
+/*!
+ \internal
+
+ Using the given \a imports, the given (namespace qualified) \a type is resolved to either
+ a QDeclarativeImportedNamespace stored at \a ns_return,
+ a QDeclarativeType stored at \a type_return, or
+ a component located at \a url_return.
+
+ If any return pointer is 0, the corresponding search is not done.
+
+ \sa addToImport()
+*/
+bool QDeclarativeImportDatabase::resolveType(const QDeclarativeImports& imports, const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin,
+ QDeclarativeImportedNamespace** ns_return, QString *errorString) const
+{
+ QDeclarativeImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type));
+ if (ns) {
+ if (ns_return)
+ *ns_return = ns;
+ return true;
+ }
+ if (type_return || url_return) {
+ if (imports.d->find(type,vmaj,vmin,type_return,url_return, errorString)) {
+ if (qmlImportTrace()) {
+ if (type_return && *type_return && url_return && !url_return->isEmpty())
+ qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << (*type_return)->typeName() << *url_return;
+ if (type_return && *type_return)
+ qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << (*type_return)->typeName();
+ if (url_return && !url_return->isEmpty())
+ qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << *url_return;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+/*!
+ \internal
+
+ Searching \e only in the namespace \a ns (previously returned in a call to
+ resolveType(), \a type is found and returned to either
+ a QDeclarativeType stored at \a type_return, or
+ a component located at \a url_return.
+
+ If either return pointer is 0, the corresponding search is not done.
+*/
+void QDeclarativeImportDatabase::resolveTypeInNamespace(QDeclarativeImportedNamespace* ns, const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *vmaj, int *vmin) const
+{
+ ns->find(type,vmaj,vmin,type_return,url_return);
+}
+
+/*!
+ \internal
+
+ Returns the result of the merge of \a baseName with \a path, \a suffixes, and \a prefix.
+ The \a prefix must contain the dot.
+
+ \a qmldirPath is the location of the qmldir file.
+ */
+QString QDeclarativeImportDatabase::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName, const QStringList &suffixes,
+ const QString &prefix)
+{
+ QStringList searchPaths = filePluginPath;
+ bool qmldirPluginPathIsRelative = QDir::isRelativePath(qmldirPluginPath);
+ if (!qmldirPluginPathIsRelative)
+ searchPaths.prepend(qmldirPluginPath);
+
+ foreach (const QString &pluginPath, searchPaths) {
+
+ QString resolvedPath;
+
+ if (pluginPath == QLatin1String(".")) {
+ if (qmldirPluginPathIsRelative)
+ resolvedPath = qmldirPath.absoluteFilePath(qmldirPluginPath);
+ else
+ resolvedPath = qmldirPath.absolutePath();
+ } else {
+ resolvedPath = pluginPath;
+ }
+
+ // hack for resources, should probably go away
+ if (resolvedPath.startsWith(QLatin1Char(':')))
+ resolvedPath = QCoreApplication::applicationDirPath();
+
+ QDir dir(resolvedPath);
+ foreach (const QString &suffix, suffixes) {
+ QString pluginFileName = prefix;
+
+ pluginFileName += baseName;
+ pluginFileName += suffix;
+
+ QFileInfo fileInfo(dir, pluginFileName);
+
+ if (fileInfo.exists())
+ return fileInfo.absoluteFilePath();
+ }
+ }
+
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeImportDatabase::resolvePlugin: Could not resolve plugin" << baseName
+ << "in" << qmldirPath.absolutePath();
+
+ return QString();
+}
+
+/*!
+ \internal
+
+ Returns the result of the merge of \a baseName with \a dir and the platform suffix.
+
+ \table
+ \header \i Platform \i Valid suffixes
+ \row \i Windows \i \c .dll
+ \row \i Unix/Linux \i \c .so
+ \row \i AIX \i \c .a
+ \row \i HP-UX \i \c .sl, \c .so (HP-UXi)
+ \row \i Mac OS X \i \c .dylib, \c .bundle, \c .so
+ \row \i Symbian \i \c .dll
+ \endtable
+
+ Version number on unix are ignored.
+*/
+QString QDeclarativeImportDatabase::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName)
+{
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
+ QStringList()
+# ifdef QT_DEBUG
+ << QLatin1String("d.dll") // try a qmake-style debug build first
+# endif
+ << QLatin1String(".dll"));
+#elif defined(Q_OS_SYMBIAN)
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
+ QStringList()
+ << QLatin1String(".dll")
+ << QLatin1String(".qtplugin"));
+#else
+
+# if defined(Q_OS_DARWIN)
+
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName,
+ QStringList()
+# ifdef QT_DEBUG
+ << QLatin1String("_debug.dylib") // try a qmake-style debug build first
+ << QLatin1String(".dylib")
+# else
+ << QLatin1String(".dylib")
+ << QLatin1String("_debug.dylib") // try a qmake-style debug build after
+# endif
+ << QLatin1String(".so")
+ << QLatin1String(".bundle"),
+ QLatin1String("lib"));
+# else // Generic Unix
+ QStringList validSuffixList;
+
+# if defined(Q_OS_HPUX)
+/*
+ See "HP-UX Linker and Libraries User's Guide", section "Link-time Differences between PA-RISC and IPF":
+ "In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),
+ the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix."
+ */
+ validSuffixList << QLatin1String(".sl");
+# if defined __ia64
+ validSuffixList << QLatin1String(".so");
+# endif
+# elif defined(Q_OS_AIX)
+ validSuffixList << QLatin1String(".a") << QLatin1String(".so");
+# elif defined(Q_OS_UNIX)
+ validSuffixList << QLatin1String(".so");
+# endif
+
+ // Examples of valid library names:
+ // libfoo.so
+
+ return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, QLatin1String("lib"));
+# endif
+
+#endif
+}
+
+QStringList QDeclarativeImportDatabase::pluginPathList() const
+{
+ return filePluginPath;
+}
+
+void QDeclarativeImportDatabase::setPluginPathList(const QStringList &paths)
+{
+ filePluginPath = paths;
+}
+
+void QDeclarativeImportDatabase::addPluginPath(const QString& path)
+{
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeImportDatabase::addPluginPath" << path;
+
+ QUrl url = QUrl(path);
+ if (url.isRelative() || url.scheme() == QString::fromLocal8Bit("file")) {
+ QDir dir = QDir(path);
+ filePluginPath.prepend(dir.canonicalPath());
+ } else {
+ filePluginPath.prepend(path);
+ }
+}
+
+void QDeclarativeImportDatabase::addImportPath(const QString& path)
+{
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeImportDatabase::addImportPath" << path;
+
+ QUrl url = QUrl(path);
+ QString cPath;
+
+ if (url.isRelative() || url.scheme() == QString::fromLocal8Bit("file")) {
+ QDir dir = QDir(path);
+ cPath = dir.canonicalPath();
+ } else {
+ cPath = path;
+ }
+
+ if (!fileImportPath.contains(cPath))
+ fileImportPath.prepend(cPath);
+}
+
+QStringList QDeclarativeImportDatabase::importPathList() const
+{
+ return fileImportPath;
+}
+
+void QDeclarativeImportDatabase::setImportPathList(const QStringList &paths)
+{
+ fileImportPath = paths;
+}
+
+
+bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QString &uri, QString *errorString)
+{
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeImportDatabase::importPlugin" << uri << "from" << filePath;
+
+ QFileInfo fileInfo(filePath);
+ const QString absoluteFilePath = fileInfo.absoluteFilePath();
+
+ bool engineInitialized = initializedPlugins.contains(absoluteFilePath);
+ bool typesRegistered = qmlEnginePluginsWithRegisteredTypes()->contains(absoluteFilePath);
+
+ if (typesRegistered) {
+ Q_ASSERT_X(qmlEnginePluginsWithRegisteredTypes()->value(absoluteFilePath) == uri,
+ "QDeclarativeImportDatabase::importExtension",
+ "Internal error: Plugin imported previously with different uri");
+ }
+
+ if (!engineInitialized || !typesRegistered) {
+ QPluginLoader loader(absoluteFilePath);
+
+ if (!loader.load()) {
+ if (errorString)
+ *errorString = loader.errorString();
+ return false;
+ }
+
+ if (QDeclarativeExtensionInterface *iface = qobject_cast<QDeclarativeExtensionInterface *>(loader.instance())) {
+
+ const QByteArray bytes = uri.toUtf8();
+ const char *moduleId = bytes.constData();
+ if (!typesRegistered) {
+
+ // ### this code should probably be protected with a mutex.
+ qmlEnginePluginsWithRegisteredTypes()->insert(absoluteFilePath, uri);
+ iface->registerTypes(moduleId);
+ }
+ if (!engineInitialized) {
+ // things on the engine (eg. adding new global objects) have to be done for every engine.
+
+ // protect against double initialization
+ initializedPlugins.insert(absoluteFilePath);
+ iface->initializeEngine(engine, moduleId);
+ }
+ } else {
+ if (errorString)
+ *errorString = loader.errorString();
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/declarative/qml/qdeclarativeimport_p.h
new file mode 100644
index 0000000..62b0517
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeimport_p.h
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEIMPORT_P_H
+#define QDECLARATIVEIMPORT_P_H
+
+#include <QtCore/qurl.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qset.h>
+#include <private/qdeclarativedirparser_p.h>
+#include <private/qdeclarativescriptparser_p.h>
+#include <private/qdeclarativemetatype_p.h>
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeTypeNameCache;
+class QDeclarativeEngine;
+class QDir;
+
+class QDeclarativeImportedNamespace;
+class QDeclarativeImportsPrivate;
+class QDeclarativeImports
+{
+public:
+ QDeclarativeImports();
+ QDeclarativeImports(const QDeclarativeImports &);
+ ~QDeclarativeImports();
+ QDeclarativeImports &operator=(const QDeclarativeImports &);
+
+ void setBaseUrl(const QUrl &url);
+ QUrl baseUrl() const;
+
+ void cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const;
+private:
+ friend class QDeclarativeImportDatabase;
+ QDeclarativeImportsPrivate *d;
+};
+
+class QDeclarativeImportDatabase
+{
+ Q_DECLARE_TR_FUNCTIONS(QDeclarativeImportDatabase)
+public:
+ QDeclarativeImportDatabase(QDeclarativeEngine *);
+ ~QDeclarativeImportDatabase();
+
+ bool importPlugin(const QString &filePath, const QString &uri, QString *errorString);
+
+ QStringList importPathList() const;
+ void setImportPathList(const QStringList &paths);
+ void addImportPath(const QString& dir);
+
+ QStringList pluginPathList() const;
+ void setPluginPathList(const QStringList &paths);
+ void addPluginPath(const QString& path);
+
+
+ bool addToImport(QDeclarativeImports*, const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ const QString& uri, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ QString *errorString);
+ bool resolveType(const QDeclarativeImports&, const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *version_major, int *version_minor,
+ QDeclarativeImportedNamespace** ns_return,
+ QString *errorString = 0) const;
+ void resolveTypeInNamespace(QDeclarativeImportedNamespace*, const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *version_major, int *version_minor ) const;
+
+
+private:
+ friend class QDeclarativeImportsPrivate;
+ QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName, const QStringList &suffixes,
+ const QString &prefix = QString());
+ QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
+ const QString &baseName);
+
+
+ QStringList filePluginPath;
+ QStringList fileImportPath;
+
+ QSet<QString> initializedPlugins;
+ QDeclarativeEngine *engine;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEIMPORT_P_H
+
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
new file mode 100644
index 0000000..619264a
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -0,0 +1,316 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeclarativeinclude_p.h"
+
+#include <QtScript/qscriptengine.h>
+#include <QtNetwork/qnetworkrequest.h>
+#include <QtNetwork/qnetworkreply.h>
+#include <QtCore/qfile.h>
+
+#include <private/qdeclarativeengine_p.h>
+#include <private/qdeclarativeglobalscriptclass_p.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeInclude::QDeclarativeInclude(const QUrl &url,
+ QDeclarativeEngine *engine,
+ QScriptContext *ctxt)
+: QObject(engine), m_engine(engine), m_network(0), m_reply(0), m_url(url), m_redirectCount(0)
+{
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ m_context = ep->contextClass->contextFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
+
+ m_scope[0] = QScriptDeclarativeClass::scopeChainValue(ctxt, -4);
+ m_scope[1] = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
+
+ m_scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ m_network = QDeclarativeScriptEngine::get(m_scriptEngine)->networkAccessManager();
+
+ m_result = resultValue(m_scriptEngine);
+
+ QNetworkRequest request;
+ request.setUrl(url);
+
+ m_reply = m_network->get(request);
+ QObject::connect(m_reply, SIGNAL(finished()), this, SLOT(finished()));
+}
+
+QDeclarativeInclude::~QDeclarativeInclude()
+{
+ delete m_reply;
+}
+
+QScriptValue QDeclarativeInclude::resultValue(QScriptEngine *engine, Status status)
+{
+ QScriptValue result = engine->newObject();
+ result.setProperty(QLatin1String("OK"), QScriptValue(engine, Ok));
+ result.setProperty(QLatin1String("LOADING"), QScriptValue(engine, Loading));
+ result.setProperty(QLatin1String("NETWORK_ERROR"), QScriptValue(engine, NetworkError));
+ result.setProperty(QLatin1String("EXCEPTION"), QScriptValue(engine, Exception));
+
+ result.setProperty(QLatin1String("status"), QScriptValue(engine, status));
+ return result;
+}
+
+QScriptValue QDeclarativeInclude::result() const
+{
+ return m_result;
+}
+
+void QDeclarativeInclude::setCallback(const QScriptValue &c)
+{
+ m_callback = c;
+}
+
+QScriptValue QDeclarativeInclude::callback() const
+{
+ return m_callback;
+}
+
+#define INCLUDE_MAXIMUM_REDIRECT_RECURSION 15
+void QDeclarativeInclude::finished()
+{
+ m_redirectCount++;
+
+ if (m_redirectCount < INCLUDE_MAXIMUM_REDIRECT_RECURSION) {
+ QVariant redirect = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
+ if (redirect.isValid()) {
+ m_url = m_url.resolved(redirect.toUrl());
+ delete m_reply;
+
+ QNetworkRequest request;
+ request.setUrl(m_url);
+
+ m_reply = m_network->get(request);
+ QObject::connect(m_reply, SIGNAL(finished()), this, SLOT(finished()));
+ return;
+ }
+ }
+
+ if (m_reply->error() == QNetworkReply::NoError) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(m_engine);
+
+ QByteArray data = m_reply->readAll();
+
+ QString code = QString::fromUtf8(data);
+
+ QString urlString = m_url.toString();
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(m_scriptEngine);
+ scriptContext->pushScope(ep->contextClass->newUrlContext(m_context, 0, urlString));
+ scriptContext->pushScope(m_scope[0]);
+
+ scriptContext->pushScope(m_scope[1]);
+ scriptContext->setActivationObject(m_scope[1]);
+
+ m_scriptEngine->evaluate(code, urlString, 1);
+
+ m_scriptEngine->popContext();
+
+ if (m_scriptEngine->hasUncaughtException()) {
+ m_result.setProperty(QLatin1String("status"), QScriptValue(m_scriptEngine, Exception));
+ m_result.setProperty(QLatin1String("exception"), m_scriptEngine->uncaughtException());
+ m_scriptEngine->clearExceptions();
+ } else {
+ m_result.setProperty(QLatin1String("status"), QScriptValue(m_scriptEngine, Ok));
+ }
+ } else {
+ m_result.setProperty(QLatin1String("status"), QScriptValue(m_scriptEngine, NetworkError));
+ }
+
+ callback(m_scriptEngine, m_callback, m_result);
+
+ disconnect();
+ deleteLater();
+}
+
+void QDeclarativeInclude::callback(QScriptEngine *engine, QScriptValue &callback, QScriptValue &status)
+{
+ if (callback.isValid()) {
+ QScriptValue args = engine->newArray(1);
+ args.setProperty(0, status);
+ callback.call(QScriptValue(), args);
+ }
+}
+
+static QString toLocalFileOrQrc(const QUrl& url)
+{
+ if (url.scheme() == QLatin1String("qrc")) {
+ if (url.authority().isEmpty())
+ return QLatin1Char(':') + url.path();
+ return QString();
+ }
+ return url.toLocalFile();
+}
+
+QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if (ctxt->argumentCount() == 0)
+ return engine->undefinedValue();
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ QUrl contextUrl = ep->contextClass->urlFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
+ if (contextUrl.isEmpty())
+ return ctxt->throwError(QLatin1String("Qt.include(): Can only be called from JavaScript files"));
+
+ QString urlString = ctxt->argument(0).toString();
+ QUrl url(ctxt->argument(0).toString());
+ if (url.isRelative()) {
+ url = QUrl(contextUrl).resolved(url);
+ urlString = url.toString();
+ }
+
+ QString localFile = toLocalFileOrQrc(url);
+
+ QScriptValue func = ctxt->argument(1);
+ if (!func.isFunction())
+ func = QScriptValue();
+
+ QScriptValue result;
+ if (localFile.isEmpty()) {
+ QDeclarativeInclude *i =
+ new QDeclarativeInclude(url, QDeclarativeEnginePrivate::getEngine(engine), ctxt);
+
+ if (func.isValid())
+ i->setCallback(func);
+
+ result = i->result();
+ } else {
+
+ QFile f(localFile);
+ if (f.open(QIODevice::ReadOnly)) {
+ QByteArray data = f.readAll();
+ QString code = QString::fromUtf8(data);
+
+ QDeclarativeContextData *context =
+ ep->contextClass->contextFromValue(QScriptDeclarativeClass::scopeChainValue(ctxt, -3));
+
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
+ scriptContext->pushScope(ep->contextClass->newUrlContext(context, 0, urlString));
+ scriptContext->pushScope(ep->globalClass->globalObject());
+ QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
+ scriptContext->pushScope(scope);
+ scriptContext->setActivationObject(scope);
+
+ engine->evaluate(code, urlString, 1);
+
+ engine->popContext();
+
+ if (engine->hasUncaughtException()) {
+ result = resultValue(engine, Exception);
+ result.setProperty(QLatin1String("exception"), engine->uncaughtException());
+ engine->clearExceptions();
+ } else {
+ result = resultValue(engine, Ok);
+ }
+ callback(engine, func, result);
+ } else {
+ result = resultValue(engine, NetworkError);
+ callback(engine, func, result);
+ }
+ }
+
+ return result;
+}
+
+QScriptValue QDeclarativeInclude::worker_include(QScriptContext *ctxt, QScriptEngine *engine)
+{
+ if (ctxt->argumentCount() == 0)
+ return engine->undefinedValue();
+
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+
+ QString urlString = ctxt->argument(0).toString();
+ QUrl url(ctxt->argument(0).toString());
+ if (url.isRelative()) {
+ QString contextUrl = QScriptDeclarativeClass::scopeChainValue(ctxt, -3).data().toString();
+ Q_ASSERT(!contextUrl.isEmpty());
+
+ url = QUrl(contextUrl).resolved(url);
+ urlString = url.toString();
+ }
+
+ QString localFile = toLocalFileOrQrc(url);
+
+ QScriptValue func = ctxt->argument(1);
+ if (!func.isFunction())
+ func = QScriptValue();
+
+ QScriptValue result;
+ if (!localFile.isEmpty()) {
+
+ QFile f(localFile);
+ if (f.open(QIODevice::ReadOnly)) {
+ QByteArray data = f.readAll();
+ QString code = QString::fromUtf8(data);
+
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
+ QScriptValue urlContext = engine->newObject();
+ urlContext.setData(QScriptValue(engine, urlString));
+ scriptContext->pushScope(urlContext);
+
+ QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -4);
+ scriptContext->pushScope(scope);
+ scriptContext->setActivationObject(scope);
+
+ engine->evaluate(code, urlString, 1);
+
+ engine->popContext();
+
+ if (engine->hasUncaughtException()) {
+ result = resultValue(engine, Exception);
+ result.setProperty(QLatin1String("exception"), engine->uncaughtException());
+ engine->clearExceptions();
+ } else {
+ result = resultValue(engine, Ok);
+ }
+ callback(engine, func, result);
+ } else {
+ result = resultValue(engine, NetworkError);
+ callback(engine, func, result);
+ }
+ }
+
+ return result;
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeinclude_p.h b/src/declarative/qml/qdeclarativeinclude_p.h
new file mode 100644
index 0000000..3124374
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinclude_p.h
@@ -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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEINCLUDE_P_H
+#define QDECLARATIVEINCLUDE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtScript/qscriptvalue.h>
+
+#include <private/qdeclarativecontext_p.h>
+#include <private/qdeclarativeguard_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QScriptContext;
+class QScriptEngine;
+class QNetworkAccessManager;
+class QNetworkReply;
+class QDeclarativeInclude : public QObject
+{
+ Q_OBJECT
+public:
+ enum Status {
+ Ok = 0,
+ Loading = 1,
+ NetworkError = 2,
+ Exception = 3
+ };
+
+ QDeclarativeInclude(const QUrl &, QDeclarativeEngine *, QScriptContext *ctxt);
+ ~QDeclarativeInclude();
+
+ void setCallback(const QScriptValue &);
+ QScriptValue callback() const;
+
+ QScriptValue result() const;
+
+ static QScriptValue resultValue(QScriptEngine *, Status status = Loading);
+ static void callback(QScriptEngine *, QScriptValue &callback, QScriptValue &status);
+
+ static QScriptValue include(QScriptContext *ctxt, QScriptEngine *engine);
+ static QScriptValue worker_include(QScriptContext *ctxt, QScriptEngine *engine);
+
+public slots:
+ void finished();
+
+private:
+ QDeclarativeEngine *m_engine;
+ QScriptEngine *m_scriptEngine;
+ QNetworkAccessManager *m_network;
+ QDeclarativeGuard<QNetworkReply> m_reply;
+
+ QUrl m_url;
+ int m_redirectCount;
+ QScriptValue m_callback;
+ QScriptValue m_result;
+ QDeclarativeGuardedContextData m_context;
+ QScriptValue m_scope[2];
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVEINCLUDE_P_H
+
diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp
index ffed14e..c980a2a 100644
--- a/src/declarative/qml/qdeclarativeinfo.cpp
+++ b/src/declarative/qml/qdeclarativeinfo.cpp
@@ -78,8 +78,9 @@ QT_BEGIN_NAMESPACE
\endcode
*/
-struct QDeclarativeInfoPrivate
+class QDeclarativeInfoPrivate
{
+public:
QDeclarativeInfoPrivate() : ref (1), object(0) {}
int ref;
diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp
index 99f1cc8..0236950 100644
--- a/src/declarative/qml/qdeclarativeinstruction.cpp
+++ b/src/declarative/qml/qdeclarativeinstruction.cpp
@@ -136,6 +136,9 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx)
case QDeclarativeInstruction::StoreVariantDouble:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
break;
+ case QDeclarativeInstruction::StoreVariantBool:
+ qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
+ break;
case QDeclarativeInstruction::StoreObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex;
break;
diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h
index c09b157..dc5f2f8 100644
--- a/src/declarative/qml/qdeclarativeinstruction_p.h
+++ b/src/declarative/qml/qdeclarativeinstruction_p.h
@@ -116,6 +116,7 @@ public:
StoreVariant, /* storeString */
StoreVariantInteger, /* storeInteger */
StoreVariantDouble, /* storeDouble */
+ StoreVariantBool, /* storeBool */
StoreObject, /* storeObject */
StoreVariantObject, /* storeObject */
StoreInterface, /* storeObject */
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index bb5c8b7..8b64e0e 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -104,7 +104,8 @@ QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (!object)
- return newObject(scriptEngine, this, new ObjectData(object, type));
+ return scriptEngine->nullValue();
+// return newObject(scriptEngine, this, new ObjectData(object, type));
if (QObjectPrivate::get(object)->wasDeleted)
return scriptEngine->undefinedValue();
@@ -265,7 +266,7 @@ QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name)
void *args[] = { &rv, 0 };
QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
return Value(scriptEngine, rv);
- } else if (lastData->propType == QMetaType::Int) {
+ } else if (lastData->propType == QMetaType::Int || lastData->flags & QDeclarativePropertyCache::Data::IsEnumType) {
int rv = 0;
void *args[] = { &rv, 0 };
QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
@@ -368,6 +369,9 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
QString error = QLatin1String("Cannot assign [undefined] to ") +
QLatin1String(QMetaType::typeName(lastData->propType));
context->throwError(error);
+ } else if (!value.isRegExp() && value.isFunction()) {
+ QString error = QLatin1String("Cannot assign a function to a property.");
+ context->throwError(error);
} else {
QVariant v;
if (lastData->flags & QDeclarativePropertyCache::Data::IsQList)
@@ -441,7 +445,7 @@ QScriptValue QDeclarativeObjectScriptClass::destroy(QScriptContext *context, QSc
QDeclarativeData *ddata = QDeclarativeData::get(data->object, false);
if (!ddata || ddata->indestructible)
- return engine->currentContext()->throwError(QLatin1String("Invalid attempt to destroy() an indestructible object"));
+ return engine->currentContext()->throwError(QLatin1String("Invalid attempt to destroy() an indestructible object"));
QObject *obj = data->object;
int delay = 0;
@@ -772,7 +776,8 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e)
return QScriptDeclarativeClass::Value(engine, *((QString *)&data));
} else if (type == QMetaType::QObjectStar) {
QObject *object = *((QObject **)&data);
- QDeclarativeData::get(object, true)->setImplicitDestructible();
+ if (object)
+ QDeclarativeData::get(object, true)->setImplicitDestructible();
QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e);
return QScriptDeclarativeClass::Value(engine, priv->objectClass->newQObject(object));
} else if (type == qMetaTypeId<QList<QObject *> >()) {
diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h
index 0870cfb..25777f5 100644
--- a/src/declarative/qml/qdeclarativeparser_p.h
+++ b/src/declarative/qml/qdeclarativeparser_p.h
@@ -188,9 +188,6 @@ namespace QDeclarativeParser
QList<int> lineNumbers;
QList<Pragmas> pragmas;
};
-#if 0
- QList<ScriptBlock> scripts;
-#endif
// The bytes to cast instances by to get to the QDeclarativeParserStatus
// interface. -1 indicates the type doesn't support this interface.
diff --git a/src/declarative/qml/qdeclarativeparserstatus.cpp b/src/declarative/qml/qdeclarativeparserstatus.cpp
index 978bfb4..4c4e429 100644
--- a/src/declarative/qml/qdeclarativeparserstatus.cpp
+++ b/src/declarative/qml/qdeclarativeparserstatus.cpp
@@ -91,19 +91,17 @@ QDeclarativeParserStatus::~QDeclarativeParserStatus()
}
/*!
+ \fn void QDeclarativeParserStatus::classBegin()
+
Invoked after class creation, but before any properties have been set.
*/
-void QDeclarativeParserStatus::classBegin()
-{
-}
/*!
+ \fn void QDeclarativeParserStatus::componentComplete()
+
Invoked after the root component that caused this instantiation has
completed construction. At this point all static values and binding values
have been assigned to the class.
*/
-void QDeclarativeParserStatus::componentComplete()
-{
-}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeparserstatus.h b/src/declarative/qml/qdeclarativeparserstatus.h
index 34528c1..60d423e 100644
--- a/src/declarative/qml/qdeclarativeparserstatus.h
+++ b/src/declarative/qml/qdeclarativeparserstatus.h
@@ -56,8 +56,8 @@ public:
QDeclarativeParserStatus();
virtual ~QDeclarativeParserStatus();
- virtual void classBegin();
- virtual void componentComplete();
+ virtual void classBegin()=0;
+ virtual void componentComplete()=0;
private:
friend class QDeclarativeVME;
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
index 888945b..839d79f 100644
--- a/src/declarative/qml/qdeclarativepropertycache.cpp
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -45,7 +45,7 @@
#include "private/qdeclarativebinding_p.h"
#include <QtCore/qdebug.h>
-Q_DECLARE_METATYPE(QScriptValue);
+Q_DECLARE_METATYPE(QScriptValue)
QT_BEGIN_NAMESPACE
@@ -106,9 +106,25 @@ void QDeclarativePropertyCache::Data::load(const QMetaMethod &m)
}
+/*!
+Creates a new empty QDeclarativePropertyCache.
+*/
QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e)
: QDeclarativeCleanup(e), engine(e)
{
+ Q_ASSERT(engine);
+}
+
+/*!
+Creates a new QDeclarativePropertyCache of \a metaObject.
+*/
+QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e, const QMetaObject *metaObject)
+: QDeclarativeCleanup(e), engine(e)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(metaObject);
+
+ update(engine, metaObject);
}
QDeclarativePropertyCache::~QDeclarativePropertyCache()
@@ -135,7 +151,7 @@ void QDeclarativePropertyCache::clear()
}
QDeclarativePropertyCache::Data QDeclarativePropertyCache::create(const QMetaObject *metaObject,
- const QString &property)
+ const QString &property)
{
Q_ASSERT(metaObject);
@@ -245,17 +261,6 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
}
}
-// ### Optimize - check engine for the parent meta object etc.
-QDeclarativePropertyCache *QDeclarativePropertyCache::create(QDeclarativeEngine *engine, const QMetaObject *metaObject)
-{
- Q_ASSERT(engine);
- Q_ASSERT(metaObject);
-
- QDeclarativePropertyCache *cache = new QDeclarativePropertyCache(engine);
- cache->update(engine, metaObject);
- return cache;
-}
-
void QDeclarativePropertyCache::update(QDeclarativeEngine *engine, const QMetaObject *metaObject)
{
Q_ASSERT(engine);
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index 6b64a96..b01e5cc 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -69,6 +69,7 @@ class QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarati
{
public:
QDeclarativePropertyCache(QDeclarativeEngine *);
+ QDeclarativePropertyCache(QDeclarativeEngine *, const QMetaObject *);
virtual ~QDeclarativePropertyCache();
struct Data {
diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
index a0ed78f..039998f 100644
--- a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
+++ b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
@@ -60,6 +60,9 @@ QDeclarativePropertyValueSource::QDeclarativePropertyValueSource()
{
}
+/*!
+ Destroys the value source.
+*/
QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource()
{
}
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 8b96733..219d759 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -104,17 +104,13 @@ public:
void operator()(const QString &code, AST::Node *node);
protected:
+
Object *defineObjectBinding(AST::UiQualifiedId *propertyName, bool onAssignment,
- AST::UiQualifiedId *objectTypeName,
+ const QString &objectType,
+ AST::SourceLocation typeLocation,
LocationSpan location,
AST::UiObjectInitializer *initializer = 0);
- Object *defineObjectBinding_helper(AST::UiQualifiedId *propertyName, bool onAssignment,
- const QString &objectType,
- AST::SourceLocation typeLocation,
- LocationSpan location,
- AST::UiObjectInitializer *initializer = 0);
-
QDeclarativeParser::Variant getVariant(AST::ExpressionNode *expr);
LocationSpan location(AST::SourceLocation start, AST::SourceLocation end);
@@ -240,12 +236,12 @@ QString ProcessAST::asString(AST::UiQualifiedId *node) const
}
Object *
-ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
- bool onAssignment,
- const QString &objectType,
- AST::SourceLocation typeLocation,
- LocationSpan location,
- AST::UiObjectInitializer *initializer)
+ProcessAST::defineObjectBinding(AST::UiQualifiedId *propertyName,
+ bool onAssignment,
+ const QString &objectType,
+ AST::SourceLocation typeLocation,
+ LocationSpan location,
+ AST::UiObjectInitializer *initializer)
{
int lastTypeDot = objectType.lastIndexOf(QLatin1Char('.'));
bool isType = !objectType.isEmpty() &&
@@ -355,41 +351,6 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
}
}
-Object *ProcessAST::defineObjectBinding(AST::UiQualifiedId *qualifiedId, bool onAssignment,
- AST::UiQualifiedId *objectTypeName,
- LocationSpan location,
- AST::UiObjectInitializer *initializer)
-{
- const QString objectType = asString(objectTypeName);
- const AST::SourceLocation typeLocation = objectTypeName->identifierToken;
-
- if (objectType == QLatin1String("Script")) {
-
- AST::UiObjectMemberList *it = initializer->members;
- for (; it; it = it->next) {
- AST::UiScriptBinding *scriptBinding = AST::cast<AST::UiScriptBinding *>(it->member);
- if (! scriptBinding)
- continue;
-
- QString propertyName = asString(scriptBinding->qualifiedId);
- if (propertyName == QLatin1String("source")) {
- if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement *>(scriptBinding->statement)) {
- QDeclarativeParser::Variant string = getVariant(stmt->expression);
- if (string.isStringList()) {
- QStringList urls = string.asStringList();
- // We need to add this as a resource
- for (int ii = 0; ii < urls.count(); ++ii)
- _parser->_refUrls << QUrl(urls.at(ii));
- }
- }
- }
- }
-
- }
-
- return defineObjectBinding_helper(qualifiedId, onAssignment, objectType, typeLocation, location, initializer);
-}
-
LocationSpan ProcessAST::location(AST::UiQualifiedId *id)
{
return location(id->identifierToken, id->identifierToken);
@@ -664,10 +625,11 @@ bool ProcessAST::visit(AST::UiObjectDefinition *node)
LocationSpan l = location(node->firstSourceLocation(),
node->lastSourceLocation());
- defineObjectBinding(/*propertyName = */ 0, false,
- node->qualifiedTypeNameId,
- l,
- node->initializer);
+ const QString objectType = asString(node->qualifiedTypeNameId);
+ const AST::SourceLocation typeLocation = node->qualifiedTypeNameId->identifierToken;
+
+ defineObjectBinding(/*propertyName = */ 0, false, objectType,
+ typeLocation, l, node->initializer);
return false;
}
@@ -679,10 +641,11 @@ bool ProcessAST::visit(AST::UiObjectBinding *node)
LocationSpan l = location(node->qualifiedTypeNameId->identifierToken,
node->initializer->rbraceToken);
- defineObjectBinding(node->qualifiedId, node->hasOnToken,
- node->qualifiedTypeNameId,
- l,
- node->initializer);
+ const QString objectType = asString(node->qualifiedTypeNameId);
+ const AST::SourceLocation typeLocation = node->qualifiedTypeNameId->identifierToken;
+
+ defineObjectBinding(node->qualifiedId, node->hasOnToken, objectType,
+ typeLocation, l, node->initializer);
return false;
}
diff --git a/src/declarative/qml/qdeclarativescriptstring.h b/src/declarative/qml/qdeclarativescriptstring.h
index 43bef44..fc92a9b 100644
--- a/src/declarative/qml/qdeclarativescriptstring.h
+++ b/src/declarative/qml/qdeclarativescriptstring.h
@@ -79,7 +79,7 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QDeclarativeScriptString);
+Q_DECLARE_METATYPE(QDeclarativeScriptString)
QT_END_HEADER
diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h
index 7afdfd3..97f72fc 100644
--- a/src/declarative/qml/qdeclarativestringconverters_p.h
+++ b/src/declarative/qml/qdeclarativestringconverters_p.h
@@ -80,7 +80,7 @@ namespace QDeclarativeStringConverters
QSizeF Q_DECLARATIVE_EXPORT sizeFFromString(const QString &, bool *ok = 0);
QRectF Q_DECLARATIVE_EXPORT rectFFromString(const QString &, bool *ok = 0);
QVector3D Q_DECLARATIVE_EXPORT vector3DFromString(const QString &, bool *ok = 0);
-};
+}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index c6fe161..dbc25bb 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -116,8 +116,16 @@ QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t)
return new QDeclarativeRectValueType;
case QVariant::RectF:
return new QDeclarativeRectFValueType;
+ case QVariant::Vector2D:
+ return new QDeclarativeVector2DValueType;
case QVariant::Vector3D:
return new QDeclarativeVector3DValueType;
+ case QVariant::Vector4D:
+ return new QDeclarativeVector4DValueType;
+ case QVariant::Quaternion:
+ return new QDeclarativeQuaternionValueType;
+ case QVariant::Matrix4x4:
+ return new QDeclarativeMatrix4x4ValueType;
case QVariant::EasingCurve:
return new QDeclarativeEasingValueType;
case QVariant::Font:
@@ -460,6 +468,54 @@ void QDeclarativeRectValueType::setHeight(int h)
rect.setHeight(h);
}
+QDeclarativeVector2DValueType::QDeclarativeVector2DValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeVector2DValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &vector, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeVector2DValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &vector, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeVector2DValueType::value()
+{
+ return QVariant(vector);
+}
+
+void QDeclarativeVector2DValueType::setValue(QVariant value)
+{
+ vector = qvariant_cast<QVector2D>(value);
+}
+
+qreal QDeclarativeVector2DValueType::x() const
+{
+ return vector.x();
+}
+
+qreal QDeclarativeVector2DValueType::y() const
+{
+ return vector.y();
+}
+
+void QDeclarativeVector2DValueType::setX(qreal x)
+{
+ vector.setX(x);
+}
+
+void QDeclarativeVector2DValueType::setY(qreal y)
+{
+ vector.setY(y);
+}
+
QDeclarativeVector3DValueType::QDeclarativeVector3DValueType(QObject *parent)
: QDeclarativeValueType(parent)
{
@@ -518,6 +574,170 @@ void QDeclarativeVector3DValueType::setZ(qreal z)
vector.setZ(z);
}
+QDeclarativeVector4DValueType::QDeclarativeVector4DValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeVector4DValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &vector, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeVector4DValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &vector, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeVector4DValueType::value()
+{
+ return QVariant(vector);
+}
+
+void QDeclarativeVector4DValueType::setValue(QVariant value)
+{
+ vector = qvariant_cast<QVector4D>(value);
+}
+
+qreal QDeclarativeVector4DValueType::x() const
+{
+ return vector.x();
+}
+
+qreal QDeclarativeVector4DValueType::y() const
+{
+ return vector.y();
+}
+
+qreal QDeclarativeVector4DValueType::z() const
+{
+ return vector.z();
+}
+
+qreal QDeclarativeVector4DValueType::w() const
+{
+ return vector.w();
+}
+
+void QDeclarativeVector4DValueType::setX(qreal x)
+{
+ vector.setX(x);
+}
+
+void QDeclarativeVector4DValueType::setY(qreal y)
+{
+ vector.setY(y);
+}
+
+void QDeclarativeVector4DValueType::setZ(qreal z)
+{
+ vector.setZ(z);
+}
+
+void QDeclarativeVector4DValueType::setW(qreal w)
+{
+ vector.setW(w);
+}
+
+QDeclarativeQuaternionValueType::QDeclarativeQuaternionValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeQuaternionValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &quaternion, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeQuaternionValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &quaternion, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeQuaternionValueType::value()
+{
+ return QVariant(quaternion);
+}
+
+void QDeclarativeQuaternionValueType::setValue(QVariant value)
+{
+ quaternion = qvariant_cast<QQuaternion>(value);
+}
+
+qreal QDeclarativeQuaternionValueType::scalar() const
+{
+ return quaternion.scalar();
+}
+
+qreal QDeclarativeQuaternionValueType::x() const
+{
+ return quaternion.x();
+}
+
+qreal QDeclarativeQuaternionValueType::y() const
+{
+ return quaternion.y();
+}
+
+qreal QDeclarativeQuaternionValueType::z() const
+{
+ return quaternion.z();
+}
+
+void QDeclarativeQuaternionValueType::setScalar(qreal scalar)
+{
+ quaternion.setScalar(scalar);
+}
+
+void QDeclarativeQuaternionValueType::setX(qreal x)
+{
+ quaternion.setX(x);
+}
+
+void QDeclarativeQuaternionValueType::setY(qreal y)
+{
+ quaternion.setY(y);
+}
+
+void QDeclarativeQuaternionValueType::setZ(qreal z)
+{
+ quaternion.setZ(z);
+}
+
+QDeclarativeMatrix4x4ValueType::QDeclarativeMatrix4x4ValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeMatrix4x4ValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &matrix, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeMatrix4x4ValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &matrix, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeMatrix4x4ValueType::value()
+{
+ return QVariant(matrix);
+}
+
+void QDeclarativeMatrix4x4ValueType::setValue(QVariant value)
+{
+ matrix = qvariant_cast<QMatrix4x4>(value);
+}
+
QDeclarativeEasingValueType::QDeclarativeEasingValueType(QObject *parent)
: QDeclarativeValueType(parent)
{
diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h
index d1833bb..476c73d 100644
--- a/src/declarative/qml/qdeclarativevaluetype_p.h
+++ b/src/declarative/qml/qdeclarativevaluetype_p.h
@@ -60,7 +60,11 @@
#include <QtCore/qrect.h>
#include <QtCore/qeasingcurve.h>
#include <QtCore/qvariant.h>
+#include <QtGui/qvector2d.h>
#include <QtGui/qvector3d.h>
+#include <QtGui/qvector4d.h>
+#include <QtGui/qmatrix4x4.h>
+#include <QtGui/qquaternion.h>
#include <QtGui/qfont.h>
QT_BEGIN_NAMESPACE
@@ -241,6 +245,28 @@ private:
QRect rect;
};
+class Q_AUTOTEST_EXPORT QDeclarativeVector2DValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_OBJECT
+public:
+ QDeclarativeVector2DValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ void setX(qreal);
+ void setY(qreal);
+
+private:
+ QVector2D vector;
+};
+
class Q_AUTOTEST_EXPORT QDeclarativeVector3DValueType : public QDeclarativeValueType
{
Q_PROPERTY(qreal x READ x WRITE setX)
@@ -266,6 +292,127 @@ private:
QVector3D vector;
};
+class Q_AUTOTEST_EXPORT QDeclarativeVector4DValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_PROPERTY(qreal z READ z WRITE setZ)
+ Q_PROPERTY(qreal w READ w WRITE setW)
+ Q_OBJECT
+public:
+ QDeclarativeVector4DValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal x() const;
+ qreal y() const;
+ qreal z() const;
+ qreal w() const;
+ void setX(qreal);
+ void setY(qreal);
+ void setZ(qreal);
+ void setW(qreal);
+
+private:
+ QVector4D vector;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeQuaternionValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal scalar READ scalar WRITE setScalar)
+ Q_PROPERTY(qreal x READ x WRITE setX)
+ Q_PROPERTY(qreal y READ y WRITE setY)
+ Q_PROPERTY(qreal z READ z WRITE setZ)
+ Q_OBJECT
+public:
+ QDeclarativeQuaternionValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal scalar() const;
+ qreal x() const;
+ qreal y() const;
+ qreal z() const;
+ void setScalar(qreal);
+ void setX(qreal);
+ void setY(qreal);
+ void setZ(qreal);
+
+private:
+ QQuaternion quaternion;
+};
+
+class Q_AUTOTEST_EXPORT QDeclarativeMatrix4x4ValueType : public QDeclarativeValueType
+{
+ Q_PROPERTY(qreal m11 READ m11 WRITE setM11)
+ Q_PROPERTY(qreal m12 READ m12 WRITE setM12)
+ Q_PROPERTY(qreal m13 READ m13 WRITE setM13)
+ Q_PROPERTY(qreal m14 READ m14 WRITE setM14)
+ Q_PROPERTY(qreal m21 READ m21 WRITE setM21)
+ Q_PROPERTY(qreal m22 READ m22 WRITE setM22)
+ Q_PROPERTY(qreal m23 READ m23 WRITE setM23)
+ Q_PROPERTY(qreal m24 READ m24 WRITE setM24)
+ Q_PROPERTY(qreal m31 READ m31 WRITE setM31)
+ Q_PROPERTY(qreal m32 READ m32 WRITE setM32)
+ Q_PROPERTY(qreal m33 READ m33 WRITE setM33)
+ Q_PROPERTY(qreal m34 READ m34 WRITE setM34)
+ Q_PROPERTY(qreal m41 READ m41 WRITE setM41)
+ Q_PROPERTY(qreal m42 READ m42 WRITE setM42)
+ Q_PROPERTY(qreal m43 READ m43 WRITE setM43)
+ Q_PROPERTY(qreal m44 READ m44 WRITE setM44)
+ Q_OBJECT
+public:
+ QDeclarativeMatrix4x4ValueType(QObject *parent = 0);
+
+ virtual void read(QObject *, int);
+ virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags);
+ virtual QVariant value();
+ virtual void setValue(QVariant value);
+
+ qreal m11() const { return matrix(0, 0); }
+ qreal m12() const { return matrix(0, 1); }
+ qreal m13() const { return matrix(0, 2); }
+ qreal m14() const { return matrix(0, 3); }
+ qreal m21() const { return matrix(1, 0); }
+ qreal m22() const { return matrix(1, 1); }
+ qreal m23() const { return matrix(1, 2); }
+ qreal m24() const { return matrix(1, 3); }
+ qreal m31() const { return matrix(2, 0); }
+ qreal m32() const { return matrix(2, 1); }
+ qreal m33() const { return matrix(2, 2); }
+ qreal m34() const { return matrix(2, 3); }
+ qreal m41() const { return matrix(3, 0); }
+ qreal m42() const { return matrix(3, 1); }
+ qreal m43() const { return matrix(3, 2); }
+ qreal m44() const { return matrix(3, 3); }
+
+ void setM11(qreal value) { matrix(0, 0) = value; }
+ void setM12(qreal value) { matrix(0, 1) = value; }
+ void setM13(qreal value) { matrix(0, 2) = value; }
+ void setM14(qreal value) { matrix(0, 3) = value; }
+ void setM21(qreal value) { matrix(1, 0) = value; }
+ void setM22(qreal value) { matrix(1, 1) = value; }
+ void setM23(qreal value) { matrix(1, 2) = value; }
+ void setM24(qreal value) { matrix(1, 3) = value; }
+ void setM31(qreal value) { matrix(2, 0) = value; }
+ void setM32(qreal value) { matrix(2, 1) = value; }
+ void setM33(qreal value) { matrix(2, 2) = value; }
+ void setM34(qreal value) { matrix(2, 3) = value; }
+ void setM41(qreal value) { matrix(3, 0) = value; }
+ void setM42(qreal value) { matrix(3, 1) = value; }
+ void setM43(qreal value) { matrix(3, 2) = value; }
+ void setM44(qreal value) { matrix(3, 3) = value; }
+
+private:
+ QMatrix4x4 matrix;
+};
+
class Q_AUTOTEST_EXPORT QDeclarativeEasingValueType : public QDeclarativeValueType
{
Q_OBJECT
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index 57bf726..8ba79a6 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -360,6 +360,16 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
}
break;
+ case QDeclarativeInstruction::StoreVariantBool:
+ {
+ QObject *target = stack.top();
+ QVariant v(instr.storeBool.value);
+ void *a[] = { &v, 0, &status, &flags };
+ QMetaObject::metacall(target, QMetaObject::WriteProperty,
+ instr.storeString.propertyIndex, a);
+ }
+ break;
+
case QDeclarativeInstruction::StoreString:
{
QObject *target = stack.top();
@@ -898,6 +908,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
QDeclarativeEnginePrivate::clear(bindValues);
QDeclarativeEnginePrivate::clear(parserStatus);
+ ep->finalizedParserStatus.clear();
return 0;
}
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp
index 45f04a0..13e9c26 100644
--- a/src/declarative/qml/qdeclarativevmemetaobject.cpp
+++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp
@@ -106,8 +106,7 @@ QDeclarativeVMEVariant::~QDeclarativeVMEVariant()
void QDeclarativeVMEVariant::cleanup()
{
if (type == QVariant::Invalid) {
- } else if (type == QMetaType::QObjectStar ||
- type == QMetaType::Int ||
+ } else if (type == QMetaType::Int ||
type == QMetaType::Bool ||
type == QMetaType::Double) {
type = QVariant::Invalid;
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 138d979..4b687a9 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -289,7 +289,11 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
QScriptValue activation = getWorker(id);
- QScriptContext *ctxt = workerEngine->pushContext();
+ QScriptContext *ctxt = QScriptDeclarativeClass::pushCleanContext(workerEngine);
+ QScriptValue urlContext = workerEngine->newObject();
+ urlContext.setData(QScriptValue(workerEngine, fileName));
+ ctxt->pushScope(urlContext);
+ ctxt->pushScope(activation);
ctxt->setActivationObject(activation);
workerEngine->baseUrl = url;
@@ -538,7 +542,7 @@ void QDeclarativeWorkerScriptEngine::run()
by the \tt onMessage() handler of \tt myWorker.
*/
QDeclarativeWorkerScript::QDeclarativeWorkerScript(QObject *parent)
-: QObject(parent), m_engine(0), m_scriptId(-1)
+: QObject(parent), m_engine(0), m_scriptId(-1), m_componentComplete(true)
{
}
@@ -565,7 +569,7 @@ void QDeclarativeWorkerScript::setSource(const QUrl &source)
m_source = source;
- if (m_engine)
+ if (engine())
m_engine->executeUrl(m_scriptId, m_source);
emit sourceChanged();
@@ -580,7 +584,7 @@ void QDeclarativeWorkerScript::setSource(const QUrl &source)
*/
void QDeclarativeWorkerScript::sendMessage(const QScriptValue &message)
{
- if (!m_engine) {
+ if (!engine()) {
qWarning("QDeclarativeWorkerScript: Attempt to send message before WorkerScript establishment");
return;
}
@@ -588,13 +592,19 @@ void QDeclarativeWorkerScript::sendMessage(const QScriptValue &message)
m_engine->sendMessage(m_scriptId, QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(message));
}
-void QDeclarativeWorkerScript::componentComplete()
+void QDeclarativeWorkerScript::classBegin()
{
- if (!m_engine) {
+ m_componentComplete = false;
+}
+
+QDeclarativeWorkerScriptEngine *QDeclarativeWorkerScript::engine()
+{
+ if (m_engine) return m_engine;
+ if (m_componentComplete) {
QDeclarativeEngine *engine = qmlEngine(this);
if (!engine) {
- qWarning("QDeclarativeWorkerScript: componentComplete() called without qmlEngine() set");
- return;
+ qWarning("QDeclarativeWorkerScript: engine() called without qmlEngine() set");
+ return 0;
}
m_engine = QDeclarativeEnginePrivate::get(engine)->getWorkerScriptEngine();
@@ -602,7 +612,16 @@ void QDeclarativeWorkerScript::componentComplete()
if (m_source.isValid())
m_engine->executeUrl(m_scriptId, m_source);
+
+ return m_engine;
}
+ return 0;
+}
+
+void QDeclarativeWorkerScript::componentComplete()
+{
+ m_componentComplete = true;
+ engine(); // Get it started now.
}
/*!
diff --git a/src/declarative/qml/qdeclarativeworkerscript_p.h b/src/declarative/qml/qdeclarativeworkerscript_p.h
index 6cce799..dc73811 100644
--- a/src/declarative/qml/qdeclarativeworkerscript_p.h
+++ b/src/declarative/qml/qdeclarativeworkerscript_p.h
@@ -108,18 +108,21 @@ signals:
void message(const QScriptValue &messageObject);
protected:
+ virtual void classBegin();
virtual void componentComplete();
virtual bool event(QEvent *);
private:
+ QDeclarativeWorkerScriptEngine *engine();
QDeclarativeWorkerScriptEngine *m_engine;
int m_scriptId;
QUrl m_source;
+ bool m_componentComplete;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeWorkerScript);
+QML_DECLARE_TYPE(QDeclarativeWorkerScript)
QT_END_HEADER
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index b7e1832..80510f8 100644
--- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -46,6 +46,7 @@
#include "private/qdeclarativerefcount_p.h"
#include "private/qdeclarativeengine_p.h"
#include "private/qdeclarativeexpression_p.h"
+#include "qdeclarativeglobal_p.h"
#include <QtCore/qobject.h>
#include <QtScript/qscriptvalue.h>
@@ -94,6 +95,8 @@
QT_BEGIN_NAMESPACE
+DEFINE_BOOL_CONFIG_OPTION(xhrDump, QML_XHR_DUMP);
+
class DocumentImpl;
class NodeImpl
{
@@ -318,9 +321,9 @@ public:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(Node);
-Q_DECLARE_METATYPE(NodeList);
-Q_DECLARE_METATYPE(NamedNodeMap);
+Q_DECLARE_METATYPE(Node)
+Q_DECLARE_METATYPE(NodeList)
+Q_DECLARE_METATYPE(NamedNodeMap)
QT_BEGIN_NAMESPACE
@@ -1131,6 +1134,14 @@ void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url)
}
}
+ if (xhrDump()) {
+ qWarning().nospace() << "XMLHttpRequest: " << qPrintable(m_method) << " " << qPrintable(url.toString());
+ if (!m_data.isEmpty()) {
+ qWarning().nospace() << " "
+ << qPrintable(QString::fromUtf8(m_data));
+ }
+ }
+
if (m_method == QLatin1String("GET"))
m_network = networkAccessManager()->get(request);
else if (m_method == QLatin1String("HEAD"))
@@ -1264,6 +1275,16 @@ void QDeclarativeXMLHttpRequest::finished()
if (cbv.isError()) printError(cbv);
}
m_responseEntityBody.append(m_network->readAll());
+
+ if (xhrDump()) {
+ qWarning().nospace() << "XMLHttpRequest: RESPONSE " << qPrintable(m_url.toString());
+ if (!m_responseEntityBody.isEmpty()) {
+ qWarning().nospace() << " "
+ << qPrintable(QString::fromUtf8(m_responseEntityBody));
+ }
+ }
+
+
m_data.clear();
destroyNetwork();
if (m_state < Loading) {
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index 3848593..12f9794 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -9,6 +9,7 @@ SOURCES += \
$$PWD/qdeclarativeproperty.cpp \
$$PWD/qdeclarativecomponent.cpp \
$$PWD/qdeclarativecontext.cpp \
+ $$PWD/qdeclarativeinclude.cpp \
$$PWD/qdeclarativecustomparser.cpp \
$$PWD/qdeclarativepropertyvaluesource.cpp \
$$PWD/qdeclarativepropertyvalueinterceptor.cpp \
@@ -54,6 +55,7 @@ SOURCES += \
$$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
$$PWD/qdeclarativedirparser.cpp \
$$PWD/qdeclarativeextensionplugin.cpp \
+ $$PWD/qdeclarativeimport.cpp \
$$PWD/qdeclarativelist.cpp
HEADERS += \
@@ -91,6 +93,7 @@ HEADERS += \
$$PWD/qdeclarativeinfo.h \
$$PWD/qdeclarativeproperty_p.h \
$$PWD/qdeclarativecontext_p.h \
+ $$PWD/qdeclarativeinclude_p.h \
$$PWD/qdeclarativecompositetypedata_p.h \
$$PWD/qdeclarativecompositetypemanager_p.h \
$$PWD/qdeclarativelist.h \
@@ -128,6 +131,7 @@ HEADERS += \
$$PWD/qdeclarativenetworkaccessmanagerfactory.h \
$$PWD/qdeclarativedirparser_p.h \
$$PWD/qdeclarativeextensioninterface.h \
+ $$PWD/qdeclarativeimport_p.h \
$$PWD/qdeclarativeextensionplugin.h
QT += sql
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 4059522..67440b6 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -55,6 +55,7 @@
#include <qdeclarativemetatype_p.h>
#include <qdeclarativevaluetype_p.h>
#include <qdeclarativeproperty_p.h>
+#include <qdeclarativeengine_p.h>
#include <qvariant.h>
#include <qcolor.h>
@@ -178,6 +179,10 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
d->running = r;
if (r == false)
d->avoidPropertyValueSourceStart = true;
+ else {
+ QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this));
+ engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()"));
+ }
return;
}
@@ -268,6 +273,11 @@ void QDeclarativeAbstractAnimation::componentComplete()
{
Q_D(QDeclarativeAbstractAnimation);
d->componentComplete = true;
+}
+
+void QDeclarativeAbstractAnimation::componentFinalized()
+{
+ Q_D(QDeclarativeAbstractAnimation);
if (d->running) {
d->running = false;
setRunning(true);
@@ -745,7 +755,7 @@ void QDeclarativeScriptAction::setScript(const QDeclarativeScriptString &script)
}
/*!
- \qmlproperty QString ScriptAction::scriptName
+ \qmlproperty string ScriptAction::scriptName
This property holds the the name of the StateChangeScript to run.
This property is only valid when ScriptAction is used as part of a transition.
@@ -781,7 +791,7 @@ void QDeclarativeScriptActionPrivate::execute()
if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
expr.evaluate();
- if (expr.hasError())
+ if (expr.hasError())
qmlInfo(q) << expr.error();
}
}
@@ -834,7 +844,7 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
The PropertyAction is immediate -
the target property is not animated to the selected value in any way.
-
+
\sa QtDeclarative
*/
/*!
@@ -864,7 +874,7 @@ void QDeclarativePropertyActionPrivate::init()
This property holds an explicit target object to animate.
The exact effect of the \c target property depends on how the animation
- is being used. Refer to the \l animation documentation for details.
+ is being used. Refer to the \l {QML Animation} documentation for details.
*/
QObject *QDeclarativePropertyAction::target() const
@@ -1320,27 +1330,27 @@ void QDeclarativeRotationAnimation::setTo(qreal t)
/*!
\qmlproperty enumeration RotationAnimation::direction
The direction in which to rotate.
- Possible values are Numerical, Clockwise, Counterclockwise,
- or Shortest.
+
+ Possible values are:
\table
\row
- \o Numerical
+ \o RotationAnimation.Numerical
\o Rotate by linearly interpolating between the two numbers.
A rotation from 10 to 350 will rotate 340 degrees clockwise.
\row
- \o Clockwise
+ \o RotationAnimation.Clockwise
\o Rotate clockwise between the two values
\row
- \o Counterclockwise
+ \o RotationAnimation.Counterclockwise
\o Rotate counterclockwise between the two values
\row
- \o Shortest
+ \o RotationAnimation.Shortest
\o Rotate in the direction that produces the shortest animation path.
A rotation from 10 to 350 will rotate 20 degrees counterclockwise.
\endtable
- The default direction is Numerical.
+ The default direction is RotationAnimation.Numerical.
*/
QDeclarativeRotationAnimation::RotationDirection QDeclarativeRotationAnimation::direction() const
{
@@ -1605,7 +1615,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
Animate any objects that have changed their x or y properties in the target state using
an InOutQuad easing curve:
\qml
- Transition { PropertyAnimation { properties: "x,y"; easing.type: "InOutQuad" } }
+ Transition { PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } }
\endqml
\o In a Behavior
@@ -1754,189 +1764,189 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t)
Linear.
\qml
- PropertyAnimation { properties: "y"; easing.type: "InOutElastic"; easing.amplitude: 2.0; easing.period: 1.5 }
+ PropertyAnimation { properties: "y"; easing.type: Easing.InOutElastic; easing.amplitude: 2.0; easing.period: 1.5 }
\endqml
Available types are:
\table
\row
- \o \c Linear
+ \o \c Easing.Linear
\o Easing curve for a linear (t) function: velocity is constant.
\o \inlineimage qeasingcurve-linear.png
\row
- \o \c InQuad
+ \o \c Easing.InQuad
\o Easing curve for a quadratic (t^2) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-inquad.png
\row
- \o \c OutQuad
+ \o \c Easing.OutQuad
\o Easing curve for a quadratic (t^2) function: decelerating to zero velocity.
\o \inlineimage qeasingcurve-outquad.png
\row
- \o \c InOutQuad
+ \o \c Easing.InOutQuad
\o Easing curve for a quadratic (t^2) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutquad.png
\row
- \o \c OutInQuad
+ \o \c Easing.OutInQuad
\o Easing curve for a quadratic (t^2) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinquad.png
\row
- \o \c InCubic
+ \o \c Easing.InCubic
\o Easing curve for a cubic (t^3) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-incubic.png
\row
- \o \c OutCubic
+ \o \c Easing.OutCubic
\o Easing curve for a cubic (t^3) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outcubic.png
\row
- \o \c InOutCubic
+ \o \c Easing.InOutCubic
\o Easing curve for a cubic (t^3) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutcubic.png
\row
- \o \c OutInCubic
+ \o \c Easing.OutInCubic
\o Easing curve for a cubic (t^3) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outincubic.png
\row
- \o \c InQuart
+ \o \c Easing.InQuart
\o Easing curve for a quartic (t^4) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-inquart.png
\row
- \o \c OutQuart
+ \o \c Easing.OutQuart
\o Easing curve for a cubic (t^4) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outquart.png
\row
- \o \c InOutQuart
+ \o \c Easing.InOutQuart
\o Easing curve for a cubic (t^4) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutquart.png
\row
- \o \c OutInQuart
+ \o \c Easing.OutInQuart
\o Easing curve for a cubic (t^4) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinquart.png
\row
- \o \c InQuint
+ \o \c Easing.InQuint
\o Easing curve for a quintic (t^5) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-inquint.png
\row
- \o \c OutQuint
+ \o \c Easing.OutQuint
\o Easing curve for a cubic (t^5) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outquint.png
\row
- \o \c InOutQuint
+ \o \c Easing.InOutQuint
\o Easing curve for a cubic (t^5) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutquint.png
\row
- \o \c OutInQuint
+ \o \c Easing.OutInQuint
\o Easing curve for a cubic (t^5) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinquint.png
\row
- \o \c InSine
+ \o \c Easing.InSine
\o Easing curve for a sinusoidal (sin(t)) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-insine.png
\row
- \o \c OutSine
+ \o \c Easing.OutSine
\o Easing curve for a sinusoidal (sin(t)) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outsine.png
\row
- \o \c InOutSine
+ \o \c Easing.InOutSine
\o Easing curve for a sinusoidal (sin(t)) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutsine.png
\row
- \o \c OutInSine
+ \o \c Easing.OutInSine
\o Easing curve for a sinusoidal (sin(t)) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinsine.png
\row
- \o \c InExpo
+ \o \c Easing.InExpo
\o Easing curve for an exponential (2^t) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-inexpo.png
\row
- \o \c OutExpo
+ \o \c Easing.OutExpo
\o Easing curve for an exponential (2^t) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outexpo.png
\row
- \o \c InOutExpo
+ \o \c Easing.InOutExpo
\o Easing curve for an exponential (2^t) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutexpo.png
\row
- \o \c OutInExpo
+ \o \c Easing.OutInExpo
\o Easing curve for an exponential (2^t) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinexpo.png
\row
- \o \c InCirc
+ \o \c Easing.InCirc
\o Easing curve for a circular (sqrt(1-t^2)) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-incirc.png
\row
- \o \c OutCirc
+ \o \c Easing.OutCirc
\o Easing curve for a circular (sqrt(1-t^2)) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outcirc.png
\row
- \o \c InOutCirc
+ \o \c Easing.InOutCirc
\o Easing curve for a circular (sqrt(1-t^2)) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutcirc.png
\row
- \o \c OutInCirc
+ \o \c Easing.OutInCirc
\o Easing curve for a circular (sqrt(1-t^2)) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outincirc.png
\row
- \o \c InElastic
+ \o \c Easing.InElastic
\o Easing curve for an elastic (exponentially decaying sine wave) function: accelerating from zero velocity.
\br The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter.
\o \inlineimage qeasingcurve-inelastic.png
\row
- \o \c OutElastic
+ \o \c Easing.OutElastic
\o Easing curve for an elastic (exponentially decaying sine wave) function: decelerating from zero velocity.
\br The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter.
\o \inlineimage qeasingcurve-outelastic.png
\row
- \o \c InOutElastic
+ \o \c Easing.InOutElastic
\o Easing curve for an elastic (exponentially decaying sine wave) function: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutelastic.png
\row
- \o \c OutInElastic
+ \o \c Easing.OutInElastic
\o Easing curve for an elastic (exponentially decaying sine wave) function: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinelastic.png
\row
- \o \c InBack
+ \o \c Easing.InBack
\o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity.
\o \inlineimage qeasingcurve-inback.png
\row
- \o \c OutBack
+ \o \c Easing.OutBack
\o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out: decelerating to zero velocity.
\o \inlineimage qeasingcurve-outback.png
\row
- \o \c InOutBack
+ \o \c Easing.InOutBack
\o Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutback.png
\row
- \o \c OutInBack
+ \o \c Easing.OutInBack
\o Easing curve for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinback.png
\row
- \o \c InBounce
+ \o \c Easing.InBounce
\o Easing curve for a bounce (exponentially decaying parabolic bounce) function: accelerating from zero velocity.
\o \inlineimage qeasingcurve-inbounce.png
\row
- \o \c OutBounce
+ \o \c Easing.OutBounce
\o Easing curve for a bounce (exponentially decaying parabolic bounce) function: decelerating from zero velocity.
\o \inlineimage qeasingcurve-outbounce.png
\row
- \o \c InOutBounce
+ \o \c Easing.InOutBounce
\o Easing curve for a bounce (exponentially decaying parabolic bounce) function easing in/out: acceleration until halfway, then deceleration.
\o \inlineimage qeasingcurve-inoutbounce.png
\row
- \o \c OutInBounce
+ \o \c Easing.OutInBounce
\o Easing curve for a bounce (exponentially decaying parabolic bounce) function easing out/in: deceleration until halfway, then acceleration.
\o \inlineimage qeasingcurve-outinbounce.png
\endtable
- easing.amplitude is not applicable for all curve types. It is only applicable for bounce and elastic curves (curves of type
- QEasingCurve::InBounce, QEasingCurve::OutBounce, QEasingCurve::InOutBounce, QEasingCurve::OutInBounce, QEasingCurve::InElastic,
- QEasingCurve::OutElastic, QEasingCurve::InOutElastic or QEasingCurve::OutInElastic).
+ easing.amplitude is only applicable for bounce and elastic curves (curves of type
+ Easing.InBounce, Easing.OutBounce, Easing.InOutBounce, Easing.OutInBounce, Easing.InElastic,
+ Easing.OutElastic, Easing.InOutElastic or Easing.OutInElastic).
- easing.overshoot is not applicable for all curve types. It is only applicable if type is: QEasingCurve::InBack, QEasingCurve::OutBack,
- QEasingCurve::InOutBack or QEasingCurve::OutInBack.
+ easing.overshoot is only applicable if type is: Easing.InBack, Easing.OutBack,
+ Easing.InOutBack or Easing.OutInBack.
- easing.period is not applicable for all curve types. It is only applicable if type is: QEasingCurve::InElastic, QEasingCurve::OutElastic,
- QEasingCurve::InOutElastic or QEasingCurve::OutInElastic.
+ easing.period is only applicable if type is: Easing.InElastic, Easing.OutElastic,
+ Easing.InOutElastic or Easing.OutInElastic.
*/
QEasingCurve QDeclarativePropertyAnimation::easing() const
{
@@ -2337,7 +2347,7 @@ QDeclarativeParentAnimation::~QDeclarativeParentAnimation()
}
/*!
- \qmlproperty item ParentAnimation::target
+ \qmlproperty Item ParentAnimation::target
The item to reparent.
When used in a transition, if no target is specified all
@@ -2360,7 +2370,7 @@ void QDeclarativeParentAnimation::setTarget(QDeclarativeItem *target)
}
/*!
- \qmlproperty item ParentAnimation::newParent
+ \qmlproperty Item ParentAnimation::newParent
The new parent to animate to.
If not set, then the parent defined in the end state of the transition.
@@ -2382,7 +2392,7 @@ void QDeclarativeParentAnimation::setNewParent(QDeclarativeItem *newParent)
}
/*!
- \qmlproperty item ParentAnimation::via
+ \qmlproperty Item ParentAnimation::via
The item to reparent via. This provides a way to do an unclipped animation
when both the old parent and new parent are clipped
@@ -2526,13 +2536,13 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions,
viaData->pc << vpc;
viaData->actions << myAction;
QDeclarativeAction dummyAction;
- QDeclarativeAction &xAction = pc->xIsSet() ? actions[++i] : dummyAction;
- QDeclarativeAction &yAction = pc->yIsSet() ? actions[++i] : dummyAction;
- QDeclarativeAction &sAction = pc->scaleIsSet() ? actions[++i] : dummyAction;
- QDeclarativeAction &rAction = pc->rotationIsSet() ? actions[++i] : dummyAction;
+ QDeclarativeAction &xAction = pc->xIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeAction &yAction = pc->yIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeAction &sAction = pc->scaleIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
+ QDeclarativeAction &rAction = pc->rotationIsSet() && i < actions.size()-1 ? actions[++i] : dummyAction;
bool forward = (direction == QDeclarativeAbstractAnimation::Forward);
QDeclarativeItem *target = pc->object();
- QDeclarativeItem *targetParent = forward ? pc->parent() : pc->originalParent();
+ QDeclarativeItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent();
//### this mirrors the logic in QDeclarativeParentChange.
bool ok;
@@ -2573,9 +2583,9 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions,
if (ok && target->transformOrigin() != QDeclarativeItem::TopLeft) {
qreal w = target->width();
qreal h = target->height();
- if (pc->widthIsSet())
+ if (pc->widthIsSet() && i < actions.size() - 1)
w = actions[++i].toValue.toReal();
- if (pc->heightIsSet())
+ if (pc->heightIsSet() && i < actions.size() - 1)
h = actions[++i].toValue.toReal();
const QPointF &transformOrigin
= d->computeTransformOrigin(target->transformOrigin(), w,h);
@@ -2730,7 +2740,7 @@ void QDeclarativeAnchorAnimation::setDuration(int duration)
Linear.
\qml
- AnchorAnimation { easing.type: "InOutQuad" }
+ AnchorAnimation { easing.type: Easing.InOutQuad }
\endqml
See the \l{PropertyAnimation::easing.type} documentation for information
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
index 40c893c..e7cd8a8 100644
--- a/src/declarative/util/qdeclarativeanimation_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -133,6 +133,7 @@ public:
private Q_SLOTS:
void timelineComplete();
+ void componentFinalized();
private:
virtual void setTarget(const QDeclarativeProperty &);
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 1089d31..90e0ca3 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -48,6 +48,7 @@
#include <qdeclarativeinfo.h>
#include <qdeclarativeproperty_p.h>
#include <qdeclarativeguard_p.h>
+#include <qdeclarativeengine_p.h>
#include <private/qobject_p.h>
@@ -57,12 +58,14 @@ class QDeclarativeBehaviorPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeBehavior)
public:
- QDeclarativeBehaviorPrivate() : animation(0), enabled(true) {}
+ QDeclarativeBehaviorPrivate() : animation(0), enabled(true), finalized(false) {}
QDeclarativeProperty property;
QVariant currentValue;
+ QVariant targetValue;
QDeclarativeGuard<QDeclarativeAbstractAnimation> animation;
bool enabled;
+ bool finalized;
};
/*!
@@ -80,7 +83,7 @@ public:
y: 200 // initial value
Behavior on y {
NumberAnimation {
- easing.type: "OutBounce"
+ easing.type: Easing.OutBounce
easing.amplitude: 100
duration: 200
}
@@ -158,12 +161,17 @@ void QDeclarativeBehavior::write(const QVariant &value)
{
Q_D(QDeclarativeBehavior);
qmlExecuteDeferred(this);
- if (!d->animation || !d->enabled) {
+ if (!d->animation || !d->enabled || !d->finalized) {
QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
+ d->targetValue = value;
return;
}
+ if (value == d->targetValue)
+ return;
+
d->currentValue = d->property.read();
+ d->targetValue = value;
if (d->animation->qtAnimation()->duration() != -1)
d->animation->qtAnimation()->stop();
@@ -189,6 +197,15 @@ void QDeclarativeBehavior::setTarget(const QDeclarativeProperty &property)
d->currentValue = property.read();
if (d->animation)
d->animation->setDefaultTarget(property);
+
+ QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this));
+ engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()"));
+}
+
+void QDeclarativeBehavior::componentFinalized()
+{
+ Q_D(QDeclarativeBehavior);
+ d->finalized = true;
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativebehavior_p.h b/src/declarative/util/qdeclarativebehavior_p.h
index e8a809f..6c10eec 100644
--- a/src/declarative/util/qdeclarativebehavior_p.h
+++ b/src/declarative/util/qdeclarativebehavior_p.h
@@ -82,6 +82,9 @@ public:
Q_SIGNALS:
void enabledChanged();
+
+private Q_SLOTS:
+ void componentFinalized();
};
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp
index 5516628..5fab631 100644
--- a/src/declarative/util/qdeclarativebind.cpp
+++ b/src/declarative/util/qdeclarativebind.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeBindPrivate : public QObjectPrivate
{
public:
- QDeclarativeBindPrivate() : when(true), componentComplete(false), obj(0) {}
+ QDeclarativeBindPrivate() : when(true), componentComplete(true), obj(0) {}
bool when : 1;
bool componentComplete : 1;
@@ -98,7 +98,6 @@ public:
/*!
\internal
\class QDeclarativeBind
- \ingroup group_utility
\brief The QDeclarativeBind class allows arbitrary property bindings to be created.
Simple bindings are usually earier to do in-place rather than creating a
@@ -198,6 +197,12 @@ void QDeclarativeBind::setValue(const QVariant &v)
eval();
}
+void QDeclarativeBind::classBegin()
+{
+ Q_D(QDeclarativeBind);
+ d->componentComplete = false;
+}
+
void QDeclarativeBind::componentComplete()
{
Q_D(QDeclarativeBind);
diff --git a/src/declarative/util/qdeclarativebind_p.h b/src/declarative/util/qdeclarativebind_p.h
index f756e80..f89c2eb 100644
--- a/src/declarative/util/qdeclarativebind_p.h
+++ b/src/declarative/util/qdeclarativebind_p.h
@@ -80,6 +80,7 @@ public:
void setValue(const QVariant &);
protected:
+ virtual void classBegin();
virtual void componentComplete();
private:
diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp
index 20d878b..ffa160f 100644
--- a/src/declarative/util/qdeclarativeconnections.cpp
+++ b/src/declarative/util/qdeclarativeconnections.cpp
@@ -57,11 +57,13 @@ QT_BEGIN_NAMESPACE
class QDeclarativeConnectionsPrivate : public QObjectPrivate
{
public:
- QDeclarativeConnectionsPrivate() : target(0), componentcomplete(false) {}
+ QDeclarativeConnectionsPrivate() : target(0), targetSet(false), ignoreUnknownSignals(false), componentcomplete(true) {}
QList<QDeclarativeBoundSignal*> boundsignals;
QObject *target;
+ bool targetSet;
+ bool ignoreUnknownSignals;
bool componentcomplete;
QByteArray data;
@@ -139,17 +141,21 @@ QDeclarativeConnections::~QDeclarativeConnections()
\qmlproperty Object Connections::target
This property holds the object that sends the signal.
- By default, the target is assumed to be the parent of the Connections.
+ If not set at all, the target defaults to be the parent of the Connections.
+
+ If set to null, no connection is made and any signal handlers are ignored
+ until the target is not null.
*/
QObject *QDeclarativeConnections::target() const
{
Q_D(const QDeclarativeConnections);
- return d->target ? d->target : parent();
+ return d->targetSet ? d->target : parent();
}
void QDeclarativeConnections::setTarget(QObject *obj)
{
Q_D(QDeclarativeConnections);
+ d->targetSet = true; // even if setting to 0, it is *set*
if (d->target == obj)
return;
foreach (QDeclarativeBoundSignal *s, d->boundsignals) {
@@ -166,6 +172,29 @@ void QDeclarativeConnections::setTarget(QObject *obj)
emit targetChanged();
}
+/*!
+ \qmlproperty bool Connections::ignoreUnknownSignals
+
+ Normally, you will get a runtime error if you try to connect
+ to signals on an object which the object does not have.
+
+ By setting this flag to true, such errors are ignored. This is
+ useful if you intend to connect to different types of object, handling
+ a different set of signals for each.
+*/
+bool QDeclarativeConnections::ignoreUnknownSignals() const
+{
+ Q_D(const QDeclarativeConnections);
+ return d->ignoreUnknownSignals;
+}
+
+void QDeclarativeConnections::setIgnoreUnknownSignals(bool ignore)
+{
+ Q_D(QDeclarativeConnections);
+ d->ignoreUnknownSignals = ignore;
+}
+
+
QByteArray
QDeclarativeConnectionsParser::compile(const QList<QDeclarativeCustomParserProperty> &props)
@@ -220,7 +249,7 @@ void QDeclarativeConnectionsParser::setCustomData(QObject *object,
void QDeclarativeConnections::connectSignals()
{
Q_D(QDeclarativeConnections);
- if (!d->componentcomplete)
+ if (!d->componentcomplete || (d->targetSet && !target()))
return;
QDataStream ds(d->data);
@@ -230,19 +259,24 @@ void QDeclarativeConnections::connectSignals()
QString script;
ds >> script;
QDeclarativeProperty prop(target(), propName);
- if (!prop.isValid()) {
- qmlInfo(this) << tr("Cannot assign to non-existent property \"%1\"").arg(propName);
- } else if (prop.type() & QDeclarativeProperty::SignalProperty) {
+ if (prop.isValid() && (prop.type() & QDeclarativeProperty::SignalProperty)) {
QDeclarativeBoundSignal *signal =
new QDeclarativeBoundSignal(target(), prop.method(), this);
signal->setExpression(new QDeclarativeExpression(qmlContext(this), script, 0));
d->boundsignals += signal;
} else {
- qmlInfo(this) << tr("Cannot assign to non-existent property \"%1\"").arg(propName);
+ if (!d->ignoreUnknownSignals)
+ qmlInfo(this) << tr("Cannot assign to non-existent property \"%1\"").arg(propName);
}
}
}
+void QDeclarativeConnections::classBegin()
+{
+ Q_D(QDeclarativeConnections);
+ d->componentcomplete=false;
+}
+
void QDeclarativeConnections::componentComplete()
{
Q_D(QDeclarativeConnections);
diff --git a/src/declarative/util/qdeclarativeconnections_p.h b/src/declarative/util/qdeclarativeconnections_p.h
index 3eacf12..a914166 100644
--- a/src/declarative/util/qdeclarativeconnections_p.h
+++ b/src/declarative/util/qdeclarativeconnections_p.h
@@ -65,6 +65,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeConnections : public QObject, public QDec
Q_INTERFACES(QDeclarativeParserStatus)
Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(bool ignoreUnknownSignals READ ignoreUnknownSignals WRITE setIgnoreUnknownSignals)
public:
QDeclarativeConnections(QObject *parent=0);
@@ -73,11 +74,15 @@ public:
QObject *target() const;
void setTarget(QObject *);
+ bool ignoreUnknownSignals() const;
+ void setIgnoreUnknownSignals(bool ignore);
+
Q_SIGNALS:
void targetChanged();
private:
void connectSignals();
+ void classBegin();
void componentComplete();
};
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 4115193..adfcd62 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -78,7 +78,6 @@ public:
/*!
\qmlclass FontLoader QDeclarativeFontLoader
\since 4.7
- \ingroup group_utility
\brief This item allows using fonts by name or url.
Example:
@@ -186,10 +185,10 @@ void QDeclarativeFontLoader::setName(const QString &name)
This property holds the status of font loading. It can be one of:
\list
- \o Null - no font has been set
- \o Ready - the font has been loaded
- \o Loading - the font is currently being loaded
- \o Error - an error occurred while loading the font
+ \o FontLoader.Null - no font has been set
+ \o FontLoader.Ready - the font has been loaded
+ \o FontLoader.Loading - the font is currently being loaded
+ \o FontLoader.Error - an error occurred while loading the font
\endlist
Note that a change in the status property does not cause anything to happen
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 3810256..9a5c9de 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -207,11 +207,11 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
Here is an example that uses WorkerScript to periodically append the
current time to a list model:
- \snippet examples/declarative/listmodel-threaded/timedisplay.qml 0
+ \snippet examples/declarative/threading/threadedlistmodel/timedisplay.qml 0
The included file, \tt dataloader.js, looks like this:
- \snippet examples/declarative/listmodel-threaded/dataloader.js 0
+ \snippet examples/declarative/threading/threadedlistmodel/dataloader.js 0
The application's \tt Timer object periodically sends a message to the
worker script by calling \tt WorkerScript::sendMessage(). When this message
@@ -537,11 +537,7 @@ void QDeclarativeListModel::append(const QScriptValue& valuemap)
*/
QScriptValue QDeclarativeListModel::get(int index) const
{
- if (index >= count() || index < 0) {
- qmlInfo(this) << tr("get: index %1 out of range").arg(index);
- return 0;
- }
-
+ // the internal flat/nested class checks for bad index
return m_flat ? m_flat->get(index) : m_nested->get(index);
}
@@ -591,7 +587,7 @@ void QDeclarativeListModel::set(int index, const QScriptValue& valuemap)
Changes the \a property of the item at \a index in the list model to \a value.
\code
- fruitModel.set(3, "cost", 5.95)
+ fruitModel.setProperty(3, "cost", 5.95)
\endcode
The \a index must be an element in the list.
@@ -930,13 +926,14 @@ bool FlatListModel::insert(int index, const QScriptValue &value)
QScriptValue FlatListModel::get(int index) const
{
- Q_ASSERT(index >= 0 && index < m_values.count());
-
QScriptEngine *scriptEngine = m_scriptEngine ? m_scriptEngine : QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(m_listModel));
- if (!scriptEngine)
+ if (!scriptEngine)
return 0;
+ if (index < 0 || index >= m_values.count())
+ return scriptEngine->undefinedValue();
+
QScriptValue rv = scriptEngine->newObject();
QHash<int, QVariant> row = m_values.at(index);
@@ -999,7 +996,8 @@ bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *ro
QScriptValueIterator it(value);
while (it.hasNext()) {
it.next();
- if (it.value().isObject()) {
+ QScriptValue value = it.value();
+ if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) {
qmlInfo(m_listModel) << "Cannot add nested list values when modifying or after modification from a worker script";
return false;
}
@@ -1182,13 +1180,21 @@ bool NestedListModel::append(const QScriptValue& valuemap)
}
QScriptValue NestedListModel::get(int index) const
-{
- ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
- if (!node)
- return 0;
+{
QDeclarativeEngine *eng = qmlEngine(m_listModel);
if (!eng)
return 0;
+
+ if (index < 0 || index >= count()) {
+ QScriptEngine *seng = QDeclarativeEnginePrivate::getScriptEngine(eng);
+ if (seng)
+ return seng->undefinedValue();
+ return 0;
+ }
+
+ ModelNode *node = qvariant_cast<ModelNode *>(_root->values.at(index));
+ if (!node)
+ return 0;
return QDeclarativeEnginePrivate::qmlScriptObject(node->object(this), eng);
}
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
index 53d30c2..1622144 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
@@ -146,7 +146,7 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QDeclarativeListModelWorkerAgent::VariantRef);
+Q_DECLARE_METATYPE(QDeclarativeListModelWorkerAgent::VariantRef)
QT_END_HEADER
diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp
index 0e5aaa6..ba5d534 100644
--- a/src/declarative/util/qdeclarativeopenmetaobject.cpp
+++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp
@@ -305,7 +305,7 @@ void QDeclarativeOpenMetaObject::setCached(bool c)
QDeclarativeData *qmldata = QDeclarativeData::get(d->object, true);
if (d->cacheProperties) {
if (!d->type->d->cache)
- d->type->d->cache = QDeclarativePropertyCache::create(d->type->d->engine, this);
+ d->type->d->cache = new QDeclarativePropertyCache(d->type->d->engine, this);
qmldata->propertyCache = d->type->d->cache;
d->type->d->cache->addref();
} else {
diff --git a/src/declarative/util/qdeclarativepackage.cpp b/src/declarative/util/qdeclarativepackage.cpp
index 20e9907..9617b86 100644
--- a/src/declarative/util/qdeclarativepackage.cpp
+++ b/src/declarative/util/qdeclarativepackage.cpp
@@ -62,13 +62,13 @@ QT_BEGIN_NAMESPACE
delegate it should appear in. This allows an item to move
between views.
- \snippet examples/declarative/package/Delegate.qml 0
+ \snippet examples/declarative/modelviews/package/Delegate.qml 0
These named items are used as the delegates by the two views who
reference the special VisualDataModel.parts property to select
a model which provides the chosen delegate.
- \snippet examples/declarative/package/view.qml 0
+ \snippet examples/declarative/modelviews/package/view.qml 0
\sa QtDeclarative
*/
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index dbca326..d9ce42c 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -55,6 +55,7 @@
#include <QFile>
#include <QThread>
#include <QMutex>
+#include <QBuffer>
#include <QWaitCondition>
#include <QtCore/qdebug.h>
#include <private/qobject_p.h>
@@ -342,7 +343,10 @@ void QDeclarativeImageRequestHandler::networkRequestDone()
errorString = reply->errorString();
} else {
QSize read_impsize;
- if (readImage(reply->url(), reply, &image, &errorString, &read_impsize, job->forcedWidth(), job->forcedHeight())) {
+ QByteArray all = reply->readAll();
+ QBuffer buff(&all);
+ buff.open(QIODevice::ReadOnly);
+ if (readImage(reply->url(), &buff, &image, &errorString, &read_impsize, job->forcedWidth(), job->forcedHeight())) {
qmlOriginalSizes()->insert(reply->url(), read_impsize);
error = QDeclarativeImageReaderEvent::NoError;
} else {
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 4b2d5a0..12fef36 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -51,6 +51,7 @@
#include <qdeclarativecontext.h>
#include <qdeclarativeguard_p.h>
#include <qdeclarativeproperty_p.h>
+#include <qdeclarativecontext_p.h>
#include <QtCore/qdebug.h>
@@ -162,11 +163,15 @@ public:
virtual void execute(Reason) {
ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression);
+ if (ownedExpression == expression)
+ ownedExpression = 0;
}
virtual bool isReversable() { return true; }
virtual void reverse(Reason) {
ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression);
+ if (ownedExpression == reverseExpression)
+ ownedExpression = 0;
}
virtual void saveOriginals() {
@@ -174,11 +179,26 @@ public:
reverseExpression = rewindExpression;
}
+ /*virtual void copyOriginals(QDeclarativeActionEvent *other)
+ {
+ QDeclarativeReplaceSignalHandler *rsh = static_cast<QDeclarativeReplaceSignalHandler*>(other);
+ saveCurrentValues();
+ if (rsh == this)
+ return;
+ reverseExpression = rsh->reverseExpression;
+ if (rsh->ownedExpression == reverseExpression) {
+ ownedExpression = rsh->ownedExpression;
+ rsh->ownedExpression = 0;
+ }
+ }*/
+
virtual void rewind() {
ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression);
+ if (ownedExpression == rewindExpression)
+ ownedExpression = 0;
}
virtual void saveCurrentValues() {
- rewindExpression = QDeclarativePropertyPrivate::signalExpression(property);
+ rewindExpression = QDeclarativePropertyPrivate::signalExpression(property);
}
virtual bool override(QDeclarativeActionEvent*other) {
@@ -302,12 +322,18 @@ void QDeclarativePropertyChangesPrivate::decode()
QDeclarativeProperty prop = property(name); //### better way to check for signal property?
if (prop.type() & QDeclarativeProperty::SignalProperty) {
QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), data.toString(), object);
+ QDeclarativeData *ddata = QDeclarativeData::get(q);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
QDeclarativeReplaceSignalHandler *handler = new QDeclarativeReplaceSignalHandler;
handler->property = prop;
handler->expression = expression;
signalReplacements << handler;
} else if (isScript) {
QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), data.toString(), object);
+ QDeclarativeData *ddata = QDeclarativeData::get(q);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expression->setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
expressions << qMakePair(name, expression);
} else {
properties << qMakePair(name, data);
@@ -437,9 +463,11 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions()
if (d->isExplicit) {
a.toValue = d->expressions.at(ii).second->evaluate();
} else {
+ QDeclarativeExpression *e = d->expressions.at(ii).second;
QDeclarativeBinding *newBinding =
- new QDeclarativeBinding(d->expressions.at(ii).second->expression(), object(), qmlContext(this));
+ new QDeclarativeBinding(e->expression(), object(), qmlContext(this));
newBinding->setTarget(prop);
+ newBinding->setSourceLocation(e->sourceFile(), e->lineNumber());
a.toBinding = newBinding;
a.deletableToBinding = true;
}
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index 19a00ee..bd48ef0 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -388,10 +388,10 @@ void QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions
Sets how the SmoothedAnimation behaves if an animation direction is reversed.
- If reversing mode is \c Eased, the animation will smoothly decelerate, and
- then reverse direction. If the reversing mode is \c Immediate, the
+ If reversing mode is \c SmoothedAnimation.Eased, the animation will smoothly decelerate, and
+ then reverse direction. If the reversing mode is \c SmoothedAnimation.Immediate, the
animation will immediately begin accelerating in the reverse direction,
- begining with a velocity of 0. If the reversing mode is \c Sync, the
+ begining with a velocity of 0. If the reversing mode is \c SmoothedAnimation.Sync, the
property is immediately set to the target value.
*/
QDeclarativeSmoothedAnimation::ReversingMode QDeclarativeSmoothedAnimation::reversingMode() const
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p.h
index 17aafa4..f45d19f 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation_p.h
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p.h
@@ -96,7 +96,7 @@ Q_SIGNALS:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeSmoothedAnimation);
+QML_DECLARE_TYPE(QDeclarativeSmoothedAnimation)
QT_END_HEADER
diff --git a/src/declarative/util/qdeclarativesmoothedfollow.cpp b/src/declarative/util/qdeclarativesmoothedfollow.cpp
index 3ed9257..f70df9d 100644
--- a/src/declarative/util/qdeclarativesmoothedfollow.cpp
+++ b/src/declarative/util/qdeclarativesmoothedfollow.cpp
@@ -143,10 +143,10 @@ QDeclarativeSmoothedFollowPrivate::QDeclarativeSmoothedFollowPrivate()
Sets how the SmoothedFollow behaves if an animation direction is reversed.
- If reversing mode is \c Eased, the animation will smoothly decelerate, and
- then reverse direction. If the reversing mode is \c Immediate, the
+ If reversing mode is \c SmoothedFollow.Eased, the animation will smoothly decelerate, and
+ then reverse direction. If the reversing mode is \c SmoothedFollow.Immediate, the
animation will immediately begin accelerating in the reverse direction,
- begining with a velocity of 0. If the reversing mode is \c Sync, the
+ begining with a velocity of 0. If the reversing mode is \c SmoothedFollow.Sync, the
property is immediately set to the target value.
*/
QDeclarativeSmoothedFollow::ReversingMode QDeclarativeSmoothedFollow::reversingMode() const
diff --git a/src/declarative/util/qdeclarativesmoothedfollow_p.h b/src/declarative/util/qdeclarativesmoothedfollow_p.h
index d860052..6319192 100644
--- a/src/declarative/util/qdeclarativesmoothedfollow_p.h
+++ b/src/declarative/util/qdeclarativesmoothedfollow_p.h
@@ -106,7 +106,7 @@ Q_SIGNALS:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeSmoothedFollow);
+QML_DECLARE_TYPE(QDeclarativeSmoothedFollow)
QT_END_HEADER
diff --git a/src/declarative/util/qdeclarativespringfollow.cpp b/src/declarative/util/qdeclarativespringfollow.cpp
index 70077f3..aae66ac 100644
--- a/src/declarative/util/qdeclarativespringfollow.cpp
+++ b/src/declarative/util/qdeclarativespringfollow.cpp
@@ -227,7 +227,7 @@ void QDeclarativeSpringFollowPrivate::stop()
loops: Animation.Infinite
NumberAnimation {
to: 200
- easing.type: "OutBounce"
+ easing.type: Easing.OutBounce
easing.amplitude: 100
duration: 2000
}
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 861cbc8..b5f7900 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -149,7 +149,6 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje
\class QDeclarativeState
\brief The QDeclarativeState class allows you to define configurations of objects and properties.
- \ingroup group_states
QDeclarativeState allows you to specify a state as a set of batched changes from the default
configuration.
@@ -391,12 +390,13 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit
if (action.event->override(event)) {
found = true;
- if (action.event != d->revertList.at(jj).event) {
+ if (action.event != d->revertList.at(jj).event && action.event->needsCopy()) {
action.event->copyOriginals(d->revertList.at(jj).event);
QDeclarativeSimpleAction r(action);
additionalReverts << r;
d->revertList.removeAt(jj);
+ --jj;
} else if (action.event->isRewindable()) //###why needed?
action.event->saveCurrentValues();
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h
index 0ba67b0..25715c6 100644
--- a/src/declarative/util/qdeclarativestate_p.h
+++ b/src/declarative/util/qdeclarativestate_p.h
@@ -96,6 +96,7 @@ public:
virtual bool isReversable();
virtual void reverse(Reason reason = ActualChange);
virtual void saveOriginals() {}
+ virtual bool needsCopy() { return false; }
virtual void copyOriginals(QDeclarativeActionEvent *) {}
virtual bool isRewindable() { return isReversable(); }
diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp
index 5b51495..9b042d7 100644
--- a/src/declarative/util/qdeclarativestategroup.cpp
+++ b/src/declarative/util/qdeclarativestategroup.cpp
@@ -47,6 +47,7 @@
#include <qdeclarativebinding_p.h>
#include <qdeclarativeglobal_p.h>
+#include <QtCore/qstringbuilder.h>
#include <QtCore/qdebug.h>
#include <private/qobject_p.h>
@@ -62,7 +63,7 @@ class QDeclarativeStateGroupPrivate : public QObjectPrivate
public:
QDeclarativeStateGroupPrivate()
: nullState(0), componentComplete(true),
- ignoreTrans(false), applyingState(false) {}
+ ignoreTrans(false), applyingState(false), unnamedCount(0) {}
QString currentState;
QDeclarativeState *nullState;
@@ -78,6 +79,7 @@ public:
bool componentComplete;
bool ignoreTrans;
bool applyingState;
+ int unnamedCount;
QDeclarativeTransition *findTransition(const QString &from, const QString &to);
void setCurrentStateInternal(const QString &state, bool = false);
@@ -259,6 +261,12 @@ void QDeclarativeStateGroup::componentComplete()
Q_D(QDeclarativeStateGroup);
d->componentComplete = true;
+ for (int ii = 0; ii < d->states.count(); ++ii) {
+ QDeclarativeState *state = d->states.at(ii);
+ if (state->name().isEmpty())
+ state->setName(QLatin1String("anonymousState") % QString::number(++d->unnamedCount));
+ }
+
if (d->updateAutoState()) {
return;
} else if (!d->currentState.isEmpty()) {
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 689f53c..0326f6d 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -408,7 +408,7 @@ void QDeclarativeParentChange::saveOriginals()
d->origStackBefore = d->rewindStackBefore;
}
-void QDeclarativeParentChange::copyOriginals(QDeclarativeActionEvent *other)
+/*void QDeclarativeParentChange::copyOriginals(QDeclarativeActionEvent *other)
{
Q_D(QDeclarativeParentChange);
QDeclarativeParentChange *pc = static_cast<QDeclarativeParentChange*>(other);
@@ -417,7 +417,7 @@ void QDeclarativeParentChange::copyOriginals(QDeclarativeActionEvent *other)
d->origStackBefore = pc->d_func()->rewindStackBefore;
saveCurrentValues();
-}
+}*/
void QDeclarativeParentChange::execute(Reason)
{
@@ -1056,40 +1056,41 @@ void QDeclarativeAnchorChanges::execute(Reason reason)
if (!d->target)
return;
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
//incorporate any needed "reverts"
if (d->applyOrigLeft) {
if (!d->origLeftBinding)
- d->target->anchors()->resetLeft();
+ targetPrivate->anchors()->resetLeft();
QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding);
}
if (d->applyOrigRight) {
if (!d->origRightBinding)
- d->target->anchors()->resetRight();
+ targetPrivate->anchors()->resetRight();
QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding);
}
if (d->applyOrigHCenter) {
if (!d->origHCenterBinding)
- d->target->anchors()->resetHorizontalCenter();
+ targetPrivate->anchors()->resetHorizontalCenter();
QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding);
}
if (d->applyOrigTop) {
if (!d->origTopBinding)
- d->target->anchors()->resetTop();
+ targetPrivate->anchors()->resetTop();
QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding);
}
if (d->applyOrigBottom) {
if (!d->origBottomBinding)
- d->target->anchors()->resetBottom();
+ targetPrivate->anchors()->resetBottom();
QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding);
}
if (d->applyOrigVCenter) {
if (!d->origVCenterBinding)
- d->target->anchors()->resetVerticalCenter();
+ targetPrivate->anchors()->resetVerticalCenter();
QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding);
}
if (d->applyOrigBaseline) {
if (!d->origBaselineBinding)
- d->target->anchors()->resetBaseline();
+ targetPrivate->anchors()->resetBaseline();
QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding);
}
@@ -1105,31 +1106,31 @@ void QDeclarativeAnchorChanges::execute(Reason reason)
//reset any anchors that have been specified as "undefined"
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) {
- d->target->anchors()->resetLeft();
+ targetPrivate->anchors()->resetLeft();
QDeclarativePropertyPrivate::setBinding(d->leftProp, 0);
}
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) {
- d->target->anchors()->resetRight();
+ targetPrivate->anchors()->resetRight();
QDeclarativePropertyPrivate::setBinding(d->rightProp, 0);
}
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) {
- d->target->anchors()->resetHorizontalCenter();
+ targetPrivate->anchors()->resetHorizontalCenter();
QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0);
}
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) {
- d->target->anchors()->resetTop();
+ targetPrivate->anchors()->resetTop();
QDeclarativePropertyPrivate::setBinding(d->topProp, 0);
}
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) {
- d->target->anchors()->resetBottom();
+ targetPrivate->anchors()->resetBottom();
QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0);
}
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) {
- d->target->anchors()->resetVerticalCenter();
+ targetPrivate->anchors()->resetVerticalCenter();
QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0);
}
if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) {
- d->target->anchors()->resetBaseline();
+ targetPrivate->anchors()->resetBaseline();
QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0);
}
@@ -1161,51 +1162,52 @@ void QDeclarativeAnchorChanges::reverse(Reason reason)
if (!d->target)
return;
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
//reset any anchors set by the state
if (d->leftBinding) {
- d->target->anchors()->resetLeft();
+ targetPrivate->anchors()->resetLeft();
QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), 0);
if (reason == ActualChange) {
d->leftBinding->destroy(); d->leftBinding = 0;
}
}
if (d->rightBinding) {
- d->target->anchors()->resetRight();
+ targetPrivate->anchors()->resetRight();
QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), 0);
if (reason == ActualChange) {
d->rightBinding->destroy(); d->rightBinding = 0;
}
}
if (d->hCenterBinding) {
- d->target->anchors()->resetHorizontalCenter();
+ targetPrivate->anchors()->resetHorizontalCenter();
QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), 0);
if (reason == ActualChange) {
d->hCenterBinding->destroy(); d->hCenterBinding = 0;
}
}
if (d->topBinding) {
- d->target->anchors()->resetTop();
+ targetPrivate->anchors()->resetTop();
QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), 0);
if (reason == ActualChange) {
d->topBinding->destroy(); d->topBinding = 0;
}
}
if (d->bottomBinding) {
- d->target->anchors()->resetBottom();
+ targetPrivate->anchors()->resetBottom();
QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), 0);
if (reason == ActualChange) {
d->bottomBinding->destroy(); d->bottomBinding = 0;
}
}
if (d->vCenterBinding) {
- d->target->anchors()->resetVerticalCenter();
+ targetPrivate->anchors()->resetVerticalCenter();
QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), 0);
if (reason == ActualChange) {
d->vCenterBinding->destroy(); d->vCenterBinding = 0;
}
}
if (d->baselineBinding) {
- d->target->anchors()->resetBaseline();
+ targetPrivate->anchors()->resetBaseline();
QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), 0);
if (reason == ActualChange) {
d->baselineBinding->destroy(); d->baselineBinding = 0;
@@ -1239,24 +1241,28 @@ QList<QDeclarativeAction> QDeclarativeAnchorChanges::additionalActions()
Q_D(QDeclarativeAnchorChanges);
QList<QDeclarativeAction> extra;
+ QDeclarativeAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors;
+ bool hChange = combined & QDeclarativeAnchors::Horizontal_Mask;
+ bool vChange = combined & QDeclarativeAnchors::Vertical_Mask;
+
if (d->target) {
QDeclarativeAction a;
- if (d->fromX != d->toX) {
+ if (hChange && d->fromX != d->toX) {
a.property = QDeclarativeProperty(d->target, QLatin1String("x"));
a.toValue = d->toX;
extra << a;
}
- if (d->fromY != d->toY) {
+ if (vChange && d->fromY != d->toY) {
a.property = QDeclarativeProperty(d->target, QLatin1String("y"));
a.toValue = d->toY;
extra << a;
}
- if (d->fromWidth != d->toWidth) {
+ if (hChange && d->fromWidth != d->toWidth) {
a.property = QDeclarativeProperty(d->target, QLatin1String("width"));
a.toValue = d->toWidth;
extra << a;
}
- if (d->fromHeight != d->toHeight) {
+ if (vChange && d->fromHeight != d->toHeight) {
a.property = QDeclarativeProperty(d->target, QLatin1String("height"));
a.toValue = d->toHeight;
extra << a;
@@ -1335,37 +1341,38 @@ void QDeclarativeAnchorChanges::clearBindings()
d->fromWidth = d->target->width();
d->fromHeight = d->target->height();
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
//reset any anchors with corresponding reverts
//reset any anchors that have been specified as "undefined"
//reset any anchors that we'll be setting in the state
QDeclarativeAnchors::Anchors combined = d->anchorSet->d_func()->resetAnchors |
d->anchorSet->d_func()->usedAnchors;
if (d->applyOrigLeft || (combined & QDeclarativeAnchors::LeftAnchor)) {
- d->target->anchors()->resetLeft();
+ targetPrivate->anchors()->resetLeft();
QDeclarativePropertyPrivate::setBinding(d->leftProp, 0);
}
if (d->applyOrigRight || (combined & QDeclarativeAnchors::RightAnchor)) {
- d->target->anchors()->resetRight();
+ targetPrivate->anchors()->resetRight();
QDeclarativePropertyPrivate::setBinding(d->rightProp, 0);
}
if (d->applyOrigHCenter || (combined & QDeclarativeAnchors::HCenterAnchor)) {
- d->target->anchors()->resetHorizontalCenter();
+ targetPrivate->anchors()->resetHorizontalCenter();
QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0);
}
if (d->applyOrigTop || (combined & QDeclarativeAnchors::TopAnchor)) {
- d->target->anchors()->resetTop();
+ targetPrivate->anchors()->resetTop();
QDeclarativePropertyPrivate::setBinding(d->topProp, 0);
}
if (d->applyOrigBottom || (combined & QDeclarativeAnchors::BottomAnchor)) {
- d->target->anchors()->resetBottom();
+ targetPrivate->anchors()->resetBottom();
QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0);
}
if (d->applyOrigVCenter || (combined & QDeclarativeAnchors::VCenterAnchor)) {
- d->target->anchors()->resetVerticalCenter();
+ targetPrivate->anchors()->resetVerticalCenter();
QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0);
}
if (d->applyOrigBaseline || (combined & QDeclarativeAnchors::BaselineAnchor)) {
- d->target->anchors()->resetBaseline();
+ targetPrivate->anchors()->resetBaseline();
QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0);
}
}
@@ -1387,21 +1394,22 @@ void QDeclarativeAnchorChanges::rewind()
if (!d->target)
return;
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
//restore previous anchors
if (d->rewindLeft.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setLeft(d->rewindLeft);
+ targetPrivate->anchors()->setLeft(d->rewindLeft);
if (d->rewindRight.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setRight(d->rewindRight);
+ targetPrivate->anchors()->setRight(d->rewindRight);
if (d->rewindHCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setHorizontalCenter(d->rewindHCenter);
+ targetPrivate->anchors()->setHorizontalCenter(d->rewindHCenter);
if (d->rewindTop.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setTop(d->rewindTop);
+ targetPrivate->anchors()->setTop(d->rewindTop);
if (d->rewindBottom.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setBottom(d->rewindBottom);
+ targetPrivate->anchors()->setBottom(d->rewindBottom);
if (d->rewindVCenter.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setVerticalCenter(d->rewindVCenter);
+ targetPrivate->anchors()->setVerticalCenter(d->rewindVCenter);
if (d->rewindBaseline.anchorLine != QDeclarativeAnchorLine::Invalid)
- d->target->anchors()->setBaseline(d->rewindBaseline);
+ targetPrivate->anchors()->setBaseline(d->rewindBaseline);
d->target->setX(d->rewindX);
d->target->setY(d->rewindY);
@@ -1415,13 +1423,14 @@ void QDeclarativeAnchorChanges::saveCurrentValues()
if (!d->target)
return;
- d->rewindLeft = d->target->anchors()->left();
- d->rewindRight = d->target->anchors()->right();
- d->rewindHCenter = d->target->anchors()->horizontalCenter();
- d->rewindTop = d->target->anchors()->top();
- d->rewindBottom = d->target->anchors()->bottom();
- d->rewindVCenter = d->target->anchors()->verticalCenter();
- d->rewindBaseline = d->target->anchors()->baseline();
+ QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target);
+ d->rewindLeft = targetPrivate->anchors()->left();
+ d->rewindRight = targetPrivate->anchors()->right();
+ d->rewindHCenter = targetPrivate->anchors()->horizontalCenter();
+ d->rewindTop = targetPrivate->anchors()->top();
+ d->rewindBottom = targetPrivate->anchors()->bottom();
+ d->rewindVCenter = targetPrivate->anchors()->verticalCenter();
+ d->rewindBaseline = targetPrivate->anchors()->baseline();
d->rewindX = d->target->x();
d->rewindY = d->target->y();
diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h
index e22c1e2..21a86f5 100644
--- a/src/declarative/util/qdeclarativestateoperations_p.h
+++ b/src/declarative/util/qdeclarativestateoperations_p.h
@@ -107,7 +107,7 @@ public:
virtual ActionList actions();
virtual void saveOriginals();
- virtual void copyOriginals(QDeclarativeActionEvent*);
+ //virtual void copyOriginals(QDeclarativeActionEvent*);
virtual void execute(Reason reason = ActualChange);
virtual bool isReversable();
virtual void reverse(Reason reason = ActualChange);
@@ -277,6 +277,7 @@ public:
virtual bool override(QDeclarativeActionEvent*other);
virtual bool changesBindings();
virtual void saveOriginals();
+ virtual bool needsCopy() { return true; }
virtual void copyOriginals(QDeclarativeActionEvent*);
virtual void clearBindings();
virtual void rewind();
diff --git a/src/declarative/util/qdeclarativesystempalette.cpp b/src/declarative/util/qdeclarativesystempalette.cpp
index 9bb3f69..6c62446 100644
--- a/src/declarative/util/qdeclarativesystempalette.cpp
+++ b/src/declarative/util/qdeclarativesystempalette.cpp
@@ -59,7 +59,6 @@ public:
/*!
\qmlclass SystemPalette QDeclarativeSystemPalette
\since 4.7
- \ingroup group_utility
\brief The SystemPalette item gives access to the Qt palettes.
\sa QPalette
diff --git a/src/declarative/util/qdeclarativetimeline.cpp b/src/declarative/util/qdeclarativetimeline.cpp
index 656c62b..0258b3c 100644
--- a/src/declarative/util/qdeclarativetimeline.cpp
+++ b/src/declarative/util/qdeclarativetimeline.cpp
@@ -255,7 +255,6 @@ qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, boo
/*!
\internal
\class QDeclarativeTimeLine
- \ingroup group_animation
\brief The QDeclarativeTimeLine class provides a timeline for controlling animations.
QDeclarativeTimeLine is similar to QTimeLine except:
@@ -387,7 +386,10 @@ void QDeclarativeTimeLine::set(QDeclarativeTimeLineValue &timeLineValue, qreal v
*/
int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration)
{
- if ((velocity > 0.0f) == (acceleration > 0.0f))
+ if (acceleration == 0.0f)
+ return -1;
+
+ if ((velocity > 0.0f) == (acceleration > 0.0f))
acceleration = acceleration * -1.0f;
int time = static_cast<int>(-1000 * velocity / acceleration);
@@ -410,13 +412,16 @@ int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal
*/
int QDeclarativeTimeLine::accel(QDeclarativeTimeLineValue &timeLineValue, qreal velocity, qreal acceleration, qreal maxDistance)
{
- Q_ASSERT(acceleration >= 0.0f && maxDistance >= 0.0f);
+ if (maxDistance == 0.0f || acceleration == 0.0f)
+ return -1;
+
+ Q_ASSERT(acceleration > 0.0f && maxDistance > 0.0f);
qreal maxAccel = (velocity * velocity) / (2.0f * maxDistance);
if (maxAccel > acceleration)
acceleration = maxAccel;
- if ((velocity > 0.0f) == (acceleration > 0.0f))
+ if ((velocity > 0.0f) == (acceleration > 0.0f))
acceleration = acceleration * -1.0f;
int time = static_cast<int>(-1000 * velocity / acceleration);
@@ -438,6 +443,7 @@ int QDeclarativeTimeLine::accelDistance(QDeclarativeTimeLineValue &timeLineValue
{
if (distance == 0.0f || velocity == 0.0f)
return -1;
+
Q_ASSERT((distance >= 0.0f) == (velocity >= 0.0f));
int time = static_cast<int>(1000 * (2.0f * distance) / velocity);
@@ -868,7 +874,6 @@ void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v)
/*!
\internal
\class QDeclarativeTimeLineValue
- \ingroup group_animation
\brief The QDeclarativeTimeLineValue class provides a value that can be modified by QDeclarativeTimeLine.
*/
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index f284156..ab8b116 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Transition QDeclarativeTransition
- \since 4.7
+ \since 4.7
\brief The Transition element defines animated transitions that occur on state changes.
\sa {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative}
@@ -63,8 +63,6 @@ QT_BEGIN_NAMESPACE
\internal
\class QDeclarativeTransition
\brief The QDeclarativeTransition class allows you to define animated transitions that occur on state changes.
-
- \ingroup group_states
*/
//ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting
diff --git a/src/declarative/util/qdeclarativetransitionmanager_p_p.h b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
index 4131391..2e23898 100644
--- a/src/declarative/util/qdeclarativetransitionmanager_p_p.h
+++ b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
@@ -70,7 +70,7 @@ public:
void cancel();
private:
- Q_DISABLE_COPY(QDeclarativeTransitionManager);
+ Q_DISABLE_COPY(QDeclarativeTransitionManager)
QDeclarativeTransitionManagerPrivate *d;
void complete();
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index 62d913c..e68ef94 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -128,19 +128,18 @@ void FrameBreakAnimation::updateCurrentTime(int msecs)
server->frameBreak();
}
-class QDeclarativeViewPrivate : public QDeclarativeItemChangeListener
+class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarativeItemChangeListener
{
+ Q_DECLARE_PUBLIC(QDeclarativeView)
public:
- QDeclarativeViewPrivate(QDeclarativeView *view)
- : q(view), root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject) {}
+ QDeclarativeViewPrivate()
+ : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject) {}
~QDeclarativeViewPrivate() { delete root; }
void execute();
void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
void initResize();
void updateSize();
- inline QSize rootObjectSize();
-
- QDeclarativeView *q;
+ inline QSize rootObjectSize() const;
QDeclarativeGuard<QGraphicsObject> root;
QDeclarativeGuard<QDeclarativeItem> declarativeItemRoot;
@@ -162,6 +161,7 @@ public:
void QDeclarativeViewPrivate::execute()
{
+ Q_Q(QDeclarativeView);
if (root) {
delete root;
root = 0;
@@ -182,6 +182,7 @@ void QDeclarativeViewPrivate::execute()
void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, const QRectF &newGeometry, const QRectF &oldGeometry)
{
+ Q_Q(QDeclarativeView);
if (resizeItem == root && resizeMode == QDeclarativeView::SizeViewToRootObject) {
// wait for both width and height to be changed
resizetimer.start(0,q);
@@ -250,8 +251,9 @@ void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem,
Constructs a QDeclarativeView with the given \a parent.
*/
QDeclarativeView::QDeclarativeView(QWidget *parent)
-: QGraphicsView(parent), d(new QDeclarativeViewPrivate(this))
+ : QGraphicsView(*(new QDeclarativeViewPrivate), parent)
{
+ Q_D(QDeclarativeView);
setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
d->init();
}
@@ -262,8 +264,9 @@ QDeclarativeView::QDeclarativeView(QWidget *parent)
Constructs a QDeclarativeView with the given QML \a source and \a parent.
*/
QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent)
-: QGraphicsView(parent), d(new QDeclarativeViewPrivate(this))
+ : QGraphicsView(*(new QDeclarativeViewPrivate), parent)
{
+ Q_D(QDeclarativeView);
setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
d->init();
setSource(source);
@@ -271,6 +274,7 @@ QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent)
void QDeclarativeViewPrivate::init()
{
+ Q_Q(QDeclarativeView);
q->setScene(&scene);
q->setOptimizationFlags(QGraphicsView::DontSavePainterState);
@@ -288,12 +292,10 @@ void QDeclarativeViewPrivate::init()
}
/*!
- The destructor clears the view's \l {QGraphicsObject} {items} and
- deletes the internal representation.
+ Destroys the view.
*/
QDeclarativeView::~QDeclarativeView()
{
- delete d;
}
/*! \property QDeclarativeView::source
@@ -316,6 +318,7 @@ QDeclarativeView::~QDeclarativeView()
*/
void QDeclarativeView::setSource(const QUrl& url)
{
+ Q_D(QDeclarativeView);
d->source = url;
d->execute();
}
@@ -327,6 +330,7 @@ void QDeclarativeView::setSource(const QUrl& url)
*/
QUrl QDeclarativeView::source() const
{
+ Q_D(const QDeclarativeView);
return d->source;
}
@@ -336,6 +340,7 @@ QUrl QDeclarativeView::source() const
*/
QDeclarativeEngine* QDeclarativeView::engine()
{
+ Q_D(QDeclarativeView);
return &d->engine;
}
@@ -348,6 +353,7 @@ QDeclarativeEngine* QDeclarativeView::engine()
*/
QDeclarativeContext* QDeclarativeView::rootContext()
{
+ Q_D(QDeclarativeView);
return d->engine.rootContext();
}
@@ -376,6 +382,7 @@ QDeclarativeContext* QDeclarativeView::rootContext()
QDeclarativeView::Status QDeclarativeView::status() const
{
+ Q_D(const QDeclarativeView);
if (!d->component)
return QDeclarativeView::Null;
@@ -388,6 +395,7 @@ QDeclarativeView::Status QDeclarativeView::status() const
*/
QList<QDeclarativeError> QDeclarativeView::errors() const
{
+ Q_D(const QDeclarativeView);
if (d->component)
return d->component->errors();
return QList<QDeclarativeError>();
@@ -410,6 +418,7 @@ QList<QDeclarativeError> QDeclarativeView::errors() const
void QDeclarativeView::setResizeMode(ResizeMode mode)
{
+ Q_D(QDeclarativeView);
if (d->resizeMode == mode)
return;
@@ -433,6 +442,7 @@ void QDeclarativeView::setResizeMode(ResizeMode mode)
void QDeclarativeViewPrivate::initResize()
{
+ Q_Q(QDeclarativeView);
if (declarativeItemRoot) {
if (resizeMode == QDeclarativeView::SizeViewToRootObject) {
QDeclarativeItemPrivate *p =
@@ -449,6 +459,7 @@ void QDeclarativeViewPrivate::initResize()
void QDeclarativeViewPrivate::updateSize()
{
+ Q_Q(QDeclarativeView);
if (!root)
return;
if (declarativeItemRoot) {
@@ -479,15 +490,12 @@ void QDeclarativeViewPrivate::updateSize()
q->updateGeometry();
}
-QSize QDeclarativeViewPrivate::rootObjectSize()
+QSize QDeclarativeViewPrivate::rootObjectSize() const
{
QSize rootObjectSize(0,0);
int widthCandidate = -1;
int heightCandidate = -1;
- if (declarativeItemRoot) {
- widthCandidate = declarativeItemRoot->width();
- heightCandidate = declarativeItemRoot->height();
- } else if (root) {
+ if (root) {
QSizeF size = root->boundingRect().size();
widthCandidate = size.width();
heightCandidate = size.height();
@@ -503,6 +511,7 @@ QSize QDeclarativeViewPrivate::rootObjectSize()
QDeclarativeView::ResizeMode QDeclarativeView::resizeMode() const
{
+ Q_D(const QDeclarativeView);
return d->resizeMode;
}
@@ -511,7 +520,7 @@ QDeclarativeView::ResizeMode QDeclarativeView::resizeMode() const
*/
void QDeclarativeView::continueExecute()
{
-
+ Q_D(QDeclarativeView);
disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute()));
if (d->component->isError()) {
@@ -544,6 +553,7 @@ void QDeclarativeView::continueExecute()
*/
void QDeclarativeView::setRootObject(QObject *obj)
{
+ Q_D(QDeclarativeView);
if (d->root == obj)
return;
if (QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem *>(obj)) {
@@ -593,6 +603,7 @@ void QDeclarativeView::setRootObject(QObject *obj)
*/
void QDeclarativeView::timerEvent(QTimerEvent* e)
{
+ Q_D(QDeclarativeView);
if (!e || e->timerId() == d->resizetimer.timerId()) {
d->updateSize();
d->resizetimer.stop();
@@ -602,6 +613,7 @@ void QDeclarativeView::timerEvent(QTimerEvent* e)
/*! \reimp */
bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e)
{
+ Q_D(QDeclarativeView);
if (watched == d->root && d->resizeMode == SizeViewToRootObject) {
if (d->graphicsWidgetRoot) {
if (e->type() == QEvent::GraphicsSceneResize) {
@@ -614,16 +626,16 @@ bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e)
/*!
\internal
- Preferred size follows the root object in
- resize mode SizeViewToRootObject and
- the view in resize mode SizeRootObjectToView.
+ Preferred size follows the root object geometry.
*/
QSize QDeclarativeView::sizeHint() const
{
- if (d->resizeMode == SizeRootObjectToView) {
+ Q_D(const QDeclarativeView);
+ QSize rootObjectSize = d->rootObjectSize();
+ if (rootObjectSize.isEmpty()) {
return size();
- } else { // d->resizeMode == SizeViewToRootObject
- return d->rootObjectSize();
+ } else {
+ return rootObjectSize;
}
}
@@ -632,6 +644,7 @@ QSize QDeclarativeView::sizeHint() const
*/
QGraphicsObject *QDeclarativeView::rootObject() const
{
+ Q_D(const QDeclarativeView);
return d->root;
}
@@ -642,6 +655,7 @@ QGraphicsObject *QDeclarativeView::rootObject() const
*/
void QDeclarativeView::resizeEvent(QResizeEvent *e)
{
+ Q_D(QDeclarativeView);
if (d->resizeMode == SizeRootObjectToView) {
d->updateSize();
}
@@ -661,6 +675,7 @@ void QDeclarativeView::resizeEvent(QResizeEvent *e)
*/
void QDeclarativeView::paintEvent(QPaintEvent *event)
{
+ Q_D(QDeclarativeView);
int time = 0;
if (frameRateDebug() || QDeclarativeViewDebugServer::isDebuggingEnabled())
time = d->frameTimer.restart();
diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h
index 3513c04..e9cff32 100644
--- a/src/declarative/util/qdeclarativeview.h
+++ b/src/declarative/util/qdeclarativeview.h
@@ -106,9 +106,8 @@ protected:
virtual bool eventFilter(QObject *watched, QEvent *e);
private:
- friend class QDeclarativeViewPrivate;
- QDeclarativeViewPrivate *d;
Q_DISABLE_COPY(QDeclarativeView)
+ Q_DECLARE_PRIVATE(QDeclarativeView)
};
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index bdebadf..4a374a5 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -472,40 +472,71 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
\since 4.7
\brief The XmlListModel element is used to specify a model using XPath expressions.
- XmlListModel is used to create a model from XML data that can be used as a data source
+ XmlListModel is used to create a model from XML data. XmlListModel can be used as a data source
for the view classes (such as ListView, PathView, GridView) and other classes that interact with model
- data (such as Repeater).
+ data (such as \l Repeater).
+
+ For example, if there is a XML document at http://www.mysite.com/feed.xml like this:
+
+ \code
+ <?xml version="1.0" encoding="utf-8"?>
+ <rss version="2.0">
+ ...
+ <channel>
+ <item>
+ <title>Item A</title>
+ <pubDate>Sat, 07 Sep 2010 10:00:01 GMT</pubDate>
+ </item>
+ <item>
+ <title>Item B</title>
+ <pubDate>Sat, 07 Sep 2010 15:35:01 GMT</pubDate>
+ </item>
+ </channel>
+ </rss>
+ \endcode
+
+ Then it could be used to create the following model:
- Here is an example of a model containing news from a Yahoo RSS feed:
\qml
XmlListModel {
- id: feedModel
- source: "http://rss.news.yahoo.com/rss/oceania"
+ source: "http://www.mysite.com/feed.xml"
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "pubDate"; query: "pubDate/string()" }
- XmlRole { name: "description"; query: "description/string()" }
}
\endqml
- You can also define certain roles as "keys" so that the model only adds data
- that contains new values for these keys when reload() is called.
+ The \l {XmlListModel::query}{query} value of "/rss/channel/item" specifies that the XmlListModel should generate
+ a model item for each \c <item> in the XML document. The XmlRole objects define the
+ model item attributes; here, each model item will have \c title and \c pubDate
+ attributes that match the \c title and \c pubDate values of its corresponding \c <item>.
- For example, if the roles above were defined like this:
+
+ \section2 Using key XML roles
+
+ You can define certain roles as "keys" so that when reload() is called,
+ the model will only add and refresh data that contains new values for
+ these keys.
+
+ For example, if above role for "pubDate" was defined like this instead:
\qml
- XmlRole { name: "title"; query: "title/string()"; isKey: true }
XmlRole { name: "pubDate"; query: "pubDate/string()"; isKey: true }
\endqml
- Then when reload() is called, the model will only add new items with a
- "title" and "pubDate" value combination that is not already present in
- the model.
+ Then when reload() is called, the model will only add and reload
+ items with a "pubDate" value that is not already
+ present in the model.
- This is useful to provide incremental updates and avoid repainting an
- entire model in a view.
+ This is useful when displaying the contents of XML documents that
+ are incrementally updated (such as RSS feeds) to avoid repainting the
+ entire contents of a model in a view.
- \sa {QtDeclarative}
+ If multiple key roles are specified, the model only adds and reload items
+ with a combined value of all key roles that is not already present in
+ the model.
+
+ \sa {declarative/xml/xmldata}{XML data example}
*/
QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
@@ -626,8 +657,8 @@ void QDeclarativeXmlListModel::setXml(const QString &xml)
/*!
\qmlproperty string XmlListModel::query
- An absolute XPath query representing the base query for the model items. The query should start with
- '/' or '//'.
+ An absolute XPath query representing the base query for creating model items
+ from this model's XmlRole objects. The query should start with '/' or '//'.
*/
QString QDeclarativeXmlListModel::query() const
{
@@ -652,7 +683,20 @@ void QDeclarativeXmlListModel::setQuery(const QString &query)
/*!
\qmlproperty string XmlListModel::namespaceDeclarations
- A set of declarations for the namespaces used in the query.
+ The namespace declarations to be used in the XPath queries.
+
+ The namespaces should be declared as in XQuery. For example, if a requested document
+ at http://mysite.com/feed.xml uses the namespace "http://www.w3.org/2005/Atom",
+ this can be declared as the default namespace:
+
+ \qml
+ XmlListModel {
+ source: "http://mysite.com/feed.xml"
+ query: "/feed/entry"
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+ XmlRole { name: "title"; query: "title/string()" }
+ }
+ \endqml
*/
QString QDeclarativeXmlListModel::namespaceDeclarations() const
{
@@ -675,10 +719,10 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati
Specifies the model loading status, which can be one of the following:
\list
- \o Null - No XML data has been set for this model.
- \o Ready - The XML data has been loaded into the model.
- \o Loading - The model is in the process of reading and loading XML data.
- \o Error - An error occurred while the model was loading.
+ \o XmlListModel.Null - No XML data has been set for this model.
+ \o XmlListModel.Ready - The XML data has been loaded into the model.
+ \o XmlListModel.Loading - The model is in the process of reading and loading XML data.
+ \o XmlListModel.Error - An error occurred while the model was loading.
\endlist
\sa progress
@@ -735,7 +779,7 @@ void QDeclarativeXmlListModel::componentComplete()
Otherwise, items are only added if the model does not already
contain items with matching key role values.
- \sa XmlRole::isKey
+ \sa {Using key XML roles}, XmlRole::isKey
*/
void QDeclarativeXmlListModel::reload()
{
@@ -752,8 +796,11 @@ void QDeclarativeXmlListModel::reload()
if (d->reply) {
d->reply->abort();
- d->reply->deleteLater();
- d->reply = 0;
+ if (d->reply) {
+ // abort will generally have already done this (and more)
+ d->reply->deleteLater();
+ d->reply = 0;
+ }
}
if (!d->xml.isEmpty()) {
diff --git a/src/gui/dialogs/qcolordialog_mac.mm b/src/gui/dialogs/qcolordialog_mac.mm
index 8af0d2b..82cfa24 100644
--- a/src/gui/dialogs/qcolordialog_mac.mm
+++ b/src/gui/dialogs/qcolordialog_mac.mm
@@ -65,9 +65,9 @@ typedef float CGFloat; // Should only not be defined on 32-bit platforms
QT_USE_NAMESPACE
-@class QCocoaColorPanelDelegate;
+@class QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate);
-@interface QCocoaColorPanelDelegate : NSObject<NSWindowDelegate> {
+@interface QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) : NSObject<NSWindowDelegate> {
NSColorPanel *mColorPanel;
NSView *mStolenContentView;
NSButton *mOkButton;
@@ -99,7 +99,7 @@ QT_USE_NAMESPACE
- (void)setResultSet:(BOOL)result;
@end
-@implementation QCocoaColorPanelDelegate
+@implementation QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate)
- (id)initWithColorPanel:(NSColorPanel *)panel
stolenContentView:(NSView *)stolenContentView
okButton:(NSButton *)okButton
@@ -432,26 +432,26 @@ void QColorDialogPrivate::openCocoaColorPanel(const QColor &initial,
[colorPanel setDefaultButtonCell:[okButton cell]];
}
- delegate = [[QCocoaColorPanelDelegate alloc] initWithColorPanel:colorPanel
+ delegate = [[QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) alloc] initWithColorPanel:colorPanel
stolenContentView:stolenContentView
okButton:okButton
cancelButton:cancelButton
priv:this];
- [colorPanel setDelegate:static_cast<QCocoaColorPanelDelegate *>(delegate)];
+ [colorPanel setDelegate:static_cast<QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *>(delegate)];
}
[delegate setResultSet:false];
setCocoaPanelColor(initial);
- [static_cast<QCocoaColorPanelDelegate *>(delegate) showColorPanel];
+ [static_cast<QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *>(delegate) showColorPanel];
}
void QColorDialogPrivate::closeCocoaColorPanel()
{
- [static_cast<QCocoaColorPanelDelegate *>(delegate) onCancelClicked];
+ [static_cast<QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *>(delegate) onCancelClicked];
}
void QColorDialogPrivate::releaseCocoaColorPanelDelegate()
{
- [static_cast<QCocoaColorPanelDelegate *>(delegate) release];
+ [static_cast<QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *>(delegate) release];
}
void QColorDialogPrivate::mac_nativeDialogModalHelp()
@@ -471,13 +471,13 @@ void QColorDialogPrivate::mac_nativeDialogModalHelp()
void QColorDialogPrivate::_q_macRunNativeAppModalPanel()
{
- [static_cast<QCocoaColorPanelDelegate *>(delegate) exec];
+ [static_cast<QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *>(delegate) exec];
}
void QColorDialogPrivate::setCocoaPanelColor(const QColor &color)
{
QMacCocoaAutoReleasePool pool;
- QCocoaColorPanelDelegate *theDelegate = static_cast<QCocoaColorPanelDelegate *>(delegate);
+ QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *theDelegate = static_cast<QT_MANGLE_NAMESPACE(QCocoaColorPanelDelegate) *>(delegate);
NSColor *nsColor;
const QColor::Spec spec = color.spec();
if (spec == QColor::Cmyk) {
diff --git a/src/gui/dialogs/qfiledialog.h b/src/gui/dialogs/qfiledialog.h
index 97fac4e..16cb317 100644
--- a/src/gui/dialogs/qfiledialog.h
+++ b/src/gui/dialogs/qfiledialog.h
@@ -67,6 +67,7 @@ class Q_GUI_EXPORT QFileDialog : public QDialog
{
Q_OBJECT
Q_ENUMS(ViewMode FileMode AcceptMode Option)
+ Q_FLAGS(Options)
Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode)
Q_PROPERTY(AcceptMode acceptMode READ acceptMode WRITE setAcceptMode)
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index 28acf24..b07b1ea 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -82,9 +82,9 @@ QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QFileInfo)
QT_USE_NAMESPACE
-@class QNSOpenSavePanelDelegate;
+@class QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate);
-@interface QNSOpenSavePanelDelegate : NSObject {
+@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) : NSObject {
@public
NSOpenPanel *mOpenPanel;
NSSavePanel *mSavePanel;
@@ -123,7 +123,7 @@ QT_USE_NAMESPACE
@end
-@implementation QNSOpenSavePanelDelegate
+@implementation QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
- (id)initWithAcceptMode:(QT_PREPEND_NAMESPACE(QFileDialog::AcceptMode))acceptMode
title:(const QString &)title
@@ -554,7 +554,7 @@ void QFileDialogPrivate::setDirectory_sys(const QString &directory)
}
#else
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
[delegate->mSavePanel setDirectory:qt_mac_QStringToNSString(directory)];
#endif
}
@@ -565,7 +565,7 @@ QString QFileDialogPrivate::directory_sys() const
return mCurrentLocation;
#else
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
return qt_mac_NSStringToQString([delegate->mSavePanel directory]);
#endif
}
@@ -622,7 +622,7 @@ QStringList QFileDialogPrivate::selectedFiles_sys() const
}
#else
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
return [delegate selectedFiles];
#endif
}
@@ -633,7 +633,7 @@ void QFileDialogPrivate::setNameFilters_sys(const QStringList &filters)
Q_UNUSED(filters);
#else
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
bool hideDetails = q_func()->testOption(QFileDialog::HideNameFilterDetails);
[delegate setNameFilters:filters hideDetails:hideDetails];
#endif
@@ -645,7 +645,7 @@ void QFileDialogPrivate::setFilter_sys()
#else
Q_Q(QFileDialog);
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
*(delegate->mQDirFilter) = model->filter();
delegate->mFileMode = fileMode;
[delegate->mSavePanel setTitle:qt_mac_QStringToNSString(q->windowTitle())];
@@ -668,7 +668,7 @@ void QFileDialogPrivate::selectNameFilter_sys(const QString &filter)
NavCustomControl(mDialog, kNavCtlSelectCustomType, &navSpec);
#else
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
[delegate->mPopUpButton selectItemAtIndex:index];
[delegate filterChanged:nil];
#endif
@@ -681,7 +681,7 @@ QString QFileDialogPrivate::selectedNameFilter_sys() const
int index = filterInfo.currentSelection;
#else
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
int index = [delegate->mPopUpButton indexOfSelectedItem];
#endif
return index != -1 ? nameFilters.at(index) : QString();
@@ -696,7 +696,7 @@ void QFileDialogPrivate::deleteNativeDialog_sys()
mDialogStarted = false;
#else
QMacCocoaAutoReleasePool pool;
- [reinterpret_cast<QNSOpenSavePanelDelegate *>(mDelegate) release];
+ [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate) release];
mDelegate = 0;
#endif
nativeDialogInUse = false;
@@ -1034,7 +1034,7 @@ void QFileDialogPrivate::createNSOpenSavePanelDelegate()
bool selectDir = q->selectedFiles().isEmpty();
QString selection(selectDir ? q->directory().absolutePath() : q->selectedFiles().value(0));
- QNSOpenSavePanelDelegate *delegate = [[QNSOpenSavePanelDelegate alloc]
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) alloc]
initWithAcceptMode:acceptMode
title:q->windowTitle()
nameFilters:q->nameFilters()
@@ -1055,7 +1055,7 @@ bool QFileDialogPrivate::showCocoaFilePanel()
Q_Q(QFileDialog);
QMacCocoaAutoReleasePool pool;
createNSOpenSavePanelDelegate();
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
if (qt_mac_is_macsheet(q))
[delegate showWindowModalSheet:q->parentWidget()];
else
@@ -1071,7 +1071,7 @@ bool QFileDialogPrivate::hideCocoaFilePanel()
return false;
} else {
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
[delegate closePanel];
// Even when we hide it, we are still using a
// native dialog, so return true:
@@ -1104,7 +1104,7 @@ void QFileDialogPrivate::_q_macRunNativeAppModalPanel()
#else
Q_Q(QFileDialog);
QMacCocoaAutoReleasePool pool;
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
[delegate runApplicationModalPanel];
dialogResultCode_sys() == QDialog::Accepted ? q->accept() : q->reject();
#endif
@@ -1119,7 +1119,7 @@ QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys()
else
return QDialog::Accepted;
#else
- QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
+ QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
return [delegate dialogResultCode];
#endif
}
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 3b279ae..af0506f 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -55,7 +55,18 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_FILESYSTEMMODEL
-bool QFileInfoGatherer::fetchedRoot = false;
+#ifdef QT_BUILD_INTERNAL
+static bool fetchedRoot = false;
+Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot()
+{
+ fetchedRoot = false;
+}
+
+Q_AUTOTEST_EXPORT bool qt_test_isFetchedRoot()
+{
+ return fetchedRoot;
+}
+#endif
/*!
Creates thread
@@ -278,7 +289,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
// List drives
if (path.isEmpty()) {
-#if defined Q_AUTOTEST_EXPORT
+#ifdef QT_BUILD_INTERNAL
fetchedRoot = true;
#endif
QFileInfoList infoList;
diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h
index 5abcd94..8681eb5 100644
--- a/src/gui/dialogs/qfileinfogatherer_p.h
+++ b/src/gui/dialogs/qfileinfogatherer_p.h
@@ -195,9 +195,6 @@ private:
uint userId;
uint groupId;
#endif
-public :
- //for testing purpose
- static bool fetchedRoot;
};
#endif // QT_NO_FILESYSTEMMODEL
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 919790b..bb8ef3f 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -82,7 +82,7 @@ const CGFloat DialogSideMargin = 9.0;
const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
-@class QCocoaFontPanelDelegate;
+@class QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate);
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
@@ -93,7 +93,7 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
#endif
-@interface QCocoaFontPanelDelegate : NSObject <NSWindowDelegate> {
+@interface QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) : NSObject <NSWindowDelegate> {
NSFontPanel *mFontPanel;
NSView *mStolenContentView;
NSButton *mOkButton;
@@ -156,7 +156,7 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
return newFont;
}
-@implementation QCocoaFontPanelDelegate
+@implementation QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate)
- (id)initWithFontPanel:(NSFontPanel *)panel
stolenContentView:(NSView *)stolenContentView
okButton:(NSButton *)okButton
@@ -478,7 +478,7 @@ QT_BEGIN_NAMESPACE
void QFontDialogPrivate::closeCocoaFontPanel()
{
QMacCocoaAutoReleasePool pool;
- QCocoaFontPanelDelegate *theDelegate = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *theDelegate = static_cast<QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *>(delegate);
NSWindow *ourPanel = [theDelegate actualPanel];
[ourPanel close];
[theDelegate cleanUpAfterMyself];
@@ -519,7 +519,7 @@ void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
}
[mgr setSelectedFont:nsFont isMultiple:NO];
- [static_cast<QCocoaFontPanelDelegate *>(delegate) setQtFont:font];
+ [static_cast<QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *>(delegate) setQtFont:font];
}
void QFontDialogPrivate::createNSFontPanelDelegate()
@@ -584,7 +584,7 @@ void QFontDialogPrivate::createNSFontPanelDelegate()
}
// create the delegate and set it
- QCocoaFontPanelDelegate *del = [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
+ QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *del = [[QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) alloc] initWithFontPanel:sharedFontPanel
stolenContentView:stolenContentView
okButton:okButton
cancelButton:cancelButton
@@ -637,7 +637,7 @@ void QFontDialogPrivate::mac_nativeDialogModalHelp()
void QFontDialogPrivate::_q_macRunNativeAppModalPanel()
{
createNSFontPanelDelegate();
- QCocoaFontPanelDelegate *del = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *del = static_cast<QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *>(delegate);
[del runApplicationModalPanel];
}
@@ -649,7 +649,7 @@ bool QFontDialogPrivate::showCocoaFontPanel()
Q_Q(QFontDialog);
QMacCocoaAutoReleasePool pool;
createNSFontPanelDelegate();
- QCocoaFontPanelDelegate *del = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *del = static_cast<QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *>(delegate);
if (qt_mac_is_macsheet(q))
[del showWindowModalSheet:q->parentWidget()];
else
diff --git a/src/gui/dialogs/qmessagebox.h b/src/gui/dialogs/qmessagebox.h
index bc6170d..f1ff6cc 100644
--- a/src/gui/dialogs/qmessagebox.h
+++ b/src/gui/dialogs/qmessagebox.h
@@ -354,7 +354,7 @@ if (!qApp){ \
QString s = QApplication::tr("Executable '%1' requires Qt "\
"%2, found Qt %3.").arg(qAppName()).arg(QString::fromLatin1(\
str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplication::tr(\
-"Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal(s.toLatin1().data()); }}
+"Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal("%s", s.toLatin1().data()); }}
#endif // QT_NO_MESSAGEBOX
diff --git a/src/gui/dialogs/qnspanelproxy_mac.mm b/src/gui/dialogs/qnspanelproxy_mac.mm
index 3229a4d..0bd5c63 100644
--- a/src/gui/dialogs/qnspanelproxy_mac.mm
+++ b/src/gui/dialogs/qnspanelproxy_mac.mm
@@ -52,9 +52,9 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
-@class QNSPanelProxy;
+@class QT_MANGLE_NAMESPACE(QNSPanelProxy);
-@interface QNSPanelProxy : NSWindow {
+@interface QT_MANGLE_NAMESPACE(QNSPanelProxy) : NSWindow {
}
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle
backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation;
@@ -66,7 +66,7 @@ QT_USE_NAMESPACE
backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation screen:(NSScreen *)screen;
@end
-@implementation QNSPanelProxy
+@implementation QT_MANGLE_NAMESPACE(QNSPanelProxy)
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle
backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
@@ -108,15 +108,15 @@ QT_USE_NAMESPACE
}
@end
-@class QNSWindowProxy;
+@class QT_MANGLE_NAMESPACE(QNSWindowProxy);
-@interface QNSWindowProxy : NSWindow {
+@interface QT_MANGLE_NAMESPACE(QNSWindowProxy) : NSWindow {
}
- (void)setTitle:(NSString *)title;
- (void)qt_fakeSetTitle:(NSString *)title;
@end
-@implementation QNSWindowProxy
+@implementation QT_MANGLE_NAMESPACE(QNSWindowProxy)
- (void)setTitle:(NSString *)title
{
QCFString cftitle(currentWindow->windowTitle());
@@ -190,10 +190,10 @@ void macStartInterceptNSPanelCtor()
{
macStartIntercept(@selector(initWithContentRect:styleMask:backing:defer:),
@selector(qt_fakeInitWithContentRect:styleMask:backing:defer:),
- [NSPanel class], [QNSPanelProxy class]);
+ [NSPanel class], [QT_MANGLE_NAMESPACE(QNSPanelProxy) class]);
macStartIntercept(@selector(initWithContentRect:styleMask:backing:defer:screen:),
@selector(qt_fakeInitWithContentRect:styleMask:backing:defer:screen:),
- [NSPanel class], [QNSPanelProxy class]);
+ [NSPanel class], [QT_MANGLE_NAMESPACE(QNSPanelProxy) class]);
}
/*
@@ -203,10 +203,10 @@ void macStopInterceptNSPanelCtor()
{
macStopIntercept(@selector(initWithContentRect:styleMask:backing:defer:screen:),
@selector(qt_fakeInitWithContentRect:styleMask:backing:defer:screen:),
- [NSPanel class], [QNSPanelProxy class]);
+ [NSPanel class], [QT_MANGLE_NAMESPACE(QNSPanelProxy) class]);
macStopIntercept(@selector(initWithContentRect:styleMask:backing:defer:),
@selector(qt_fakeInitWithContentRect:styleMask:backing:defer:),
- [NSPanel class], [QNSPanelProxy class]);
+ [NSPanel class], [QT_MANGLE_NAMESPACE(QNSPanelProxy) class]);
}
/*
@@ -217,7 +217,7 @@ void macStartInterceptWindowTitle(QWidget *window)
{
currentWindow = window;
macStartIntercept(@selector(setTitle:), @selector(qt_fakeSetTitle:),
- [NSWindow class], [QNSWindowProxy class]);
+ [NSWindow class], [QT_MANGLE_NAMESPACE(QNSWindowProxy) class]);
}
/*
@@ -227,7 +227,7 @@ void macStopInterceptWindowTitle()
{
currentWindow = 0;
macStopIntercept(@selector(setTitle:), @selector(qt_fakeSetTitle:),
- [NSWindow class], [QNSWindowProxy class]);
+ [NSWindow class], [QT_MANGLE_NAMESPACE(QNSWindowProxy) class]);
}
/*
diff --git a/src/gui/dialogs/qpagesetupdialog_mac.mm b/src/gui/dialogs/qpagesetupdialog_mac.mm
index cfcde0f..0302be4 100644
--- a/src/gui/dialogs/qpagesetupdialog_mac.mm
+++ b/src/gui/dialogs/qpagesetupdialog_mac.mm
@@ -50,9 +50,9 @@
QT_USE_NAMESPACE
-@class QCocoaPageLayoutDelegate;
+@class QT_MANGLE_NAMESPACE(QCocoaPageLayoutDelegate);
-@interface QCocoaPageLayoutDelegate : NSObject {
+@interface QT_MANGLE_NAMESPACE(QCocoaPageLayoutDelegate) : NSObject {
QMacPrintEnginePrivate *pe;
}
- (id)initWithMacPrintEngine:(QMacPrintEnginePrivate *)printEngine;
@@ -60,7 +60,7 @@ QT_USE_NAMESPACE
returnCode:(int)returnCode contextInfo:(void *)contextInfo;
@end
-@implementation QCocoaPageLayoutDelegate
+@implementation QT_MANGLE_NAMESPACE(QCocoaPageLayoutDelegate)
- (id)initWithMacPrintEngine:(QMacPrintEnginePrivate *)printEngine;
{
self = [super init];
@@ -213,7 +213,7 @@ void QPageSetupDialogPrivate::openCocoaPageLayout(Qt::WindowModality modality)
pageLayout = [NSPageLayout pageLayout];
// Keep a copy to this since we plan on using it for a bit.
[pageLayout retain];
- QCocoaPageLayoutDelegate *delegate = [[QCocoaPageLayoutDelegate alloc] initWithMacPrintEngine:ep];
+ QT_MANGLE_NAMESPACE(QCocoaPageLayoutDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPageLayoutDelegate) alloc] initWithMacPrintEngine:ep];
if (modality == Qt::ApplicationModal) {
int rval = [pageLayout runModalWithPrintInfo:ep->printInfo];
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm
index 6a8d6a4..84a72db 100644
--- a/src/gui/dialogs/qprintdialog_mac.mm
+++ b/src/gui/dialogs/qprintdialog_mac.mm
@@ -124,15 +124,15 @@ QT_USE_NAMESPACE
#ifdef QT_MAC_USE_COCOA
-@class QCocoaPrintPanelDelegate;
+@class QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate);
-@interface QCocoaPrintPanelDelegate : NSObject {
+@interface QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) : NSObject {
}
- (void)printPanelDidEnd:(NSPrintPanel *)printPanel
returnCode:(int)returnCode contextInfo:(void *)contextInfo;
@end
-@implementation QCocoaPrintPanelDelegate
+@implementation QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate)
- (void)printPanelDidEnd:(NSPrintPanel *)printPanel
returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
@@ -313,7 +313,7 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
macStartInterceptWindowTitle(q);
printPanel = [NSPrintPanel printPanel];
- QCocoaPrintPanelDelegate *delegate = [[QCocoaPrintPanelDelegate alloc] init];
+ QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) alloc] init];
[printPanel setOptions:macOptions];
if (modality == Qt::ApplicationModal) {
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index 1390b21..e406cba 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -237,7 +237,8 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
*/
QVistaHelper::QVistaHelper(QWizard *wizard)
- : pressed(false)
+ : QObject(wizard)
+ , pressed(false)
, wizard(wizard)
, backButton_(0)
{
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index ce4ce6a..5e4e49e 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -326,7 +326,7 @@ QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offse
}
QPixmap pm;
- if (d->m_cachedSystem == system && d->m_cachedMode == mode)
+ if (item && d->m_cachedSystem == system && d->m_cachedMode == mode)
QPixmapCache::find(d->m_cacheKey, &pm);
if (pm.isNull()) {
diff --git a/src/gui/egl/qegl_qws.cpp b/src/gui/egl/qegl_qws.cpp
index 56383a5..50db397 100644
--- a/src/gui/egl/qegl_qws.cpp
+++ b/src/gui/egl/qegl_qws.cpp
@@ -94,7 +94,7 @@ void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
EGLNativeDisplayType QEgl::nativeDisplay()
{
- return EGL_DEFAULT_DISPLAY;
+ return EGLNativeDisplayType(EGL_DEFAULT_DISPLAY);
}
EGLNativeWindowType QEgl::nativeWindow(QWidget* widget)
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index cb8dcda..969acc4 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -163,6 +163,11 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
int matchingCount = 0;
chosenVisualInfo = XGetVisualInfo(X11->display, VisualIDMask, &visualInfoTemplate, &matchingCount);
if (chosenVisualInfo) {
+ // Skip size checks if implementation supports non-matching visual
+ // and config (http://bugreports.qt.nokia.com/browse/QTBUG-9444).
+ if (QEgl::hasExtension("EGL_NV_post_convert_replication"))
+ return visualId;
+
int visualRedSize = countBits(chosenVisualInfo->red_mask);
int visualGreenSize = countBits(chosenVisualInfo->green_mask);
int visualBlueSize = countBits(chosenVisualInfo->blue_mask);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 326f130..5e0d46f 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1090,6 +1090,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
if (newParent == parent)
return;
+ if (isWidget)
+ static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent &&
+ newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0,
+ scene);
if (scene) {
// Deliver the change to the index
if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex)
@@ -1423,6 +1427,13 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->inDestructor = 1;
d_ptr->removeExtraItemCache();
+ if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
+ QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
+ QGestureManager *manager = QGestureManager::instance();
+ foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
+ manager->cleanupCachedGestures(o, type);
+ }
+
clearFocus();
// Update focus scope item ptr.
@@ -1796,9 +1807,6 @@ static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::Graphics
*/
void QGraphicsItem::setFlags(GraphicsItemFlags flags)
{
- if (isWindow())
- flags |= ItemIsPanel;
-
// Notify change and check for adjustment.
if (quint32(d_ptr->flags) == quint32(flags))
return;
@@ -1812,7 +1820,7 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable);
bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask);
if (fullUpdate)
- d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
+ d_ptr->updatePaintedViewBoundingRects(/*children=*/true);
// Keep the old flags to compare the diff.
GraphicsItemFlags oldFlags = GraphicsItemFlags(d_ptr->flags);
@@ -5432,6 +5440,24 @@ void QGraphicsItemPrivate::removeExtraItemCache()
unsetExtra(ExtraCacheData);
}
+void QGraphicsItemPrivate::updatePaintedViewBoundingRects(bool updateChildren)
+{
+ if (!scene)
+ return;
+
+ for (int i = 0; i < scene->d_func()->views.size(); ++i) {
+ QGraphicsViewPrivate *viewPrivate = scene->d_func()->views.at(i)->d_func();
+ QRect rect = paintedViewBoundingRects.value(viewPrivate->viewport);
+ rect.translate(viewPrivate->dirtyScrollOffset);
+ viewPrivate->updateRect(rect);
+ }
+
+ if (updateChildren) {
+ for (int i = 0; i < children.size(); ++i)
+ children.at(i)->d_ptr->updatePaintedViewBoundingRects(true);
+ }
+}
+
// Traverses all the ancestors up to the top-level and updates the pointer to
// always point to the top-most item that has a dirty scene transform.
// It then backtracks to the top-most dirty item and start calculating the
@@ -5635,8 +5661,9 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect)
// Adjust with 2 pixel margin. Notice the loss of precision
// when converting to QRect.
int adjust = 2;
+ QRectF scrollRect = !rect.isNull() ? rect : boundingRect();
QRectF br = boundingRect().adjusted(-adjust, -adjust, adjust, adjust);
- QRect irect = rect.toRect().translated(-br.x(), -br.y());
+ QRect irect = scrollRect.toRect().translated(-br.x(), -br.y());
pix.scroll(dx, dy, irect);
@@ -5644,11 +5671,11 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect)
// Translate the existing expose.
foreach (QRectF exposedRect, c->exposed)
- c->exposed += exposedRect.translated(dx, dy) & rect;
+ c->exposed += exposedRect.translated(dx, dy) & scrollRect;
// Calculate exposure.
QRegion exposed;
- QRect r = rect.toRect();
+ QRect r = scrollRect.toRect();
exposed += r;
exposed -= r.translated(dx, dy);
foreach (QRect rect, exposed.rects())
@@ -7131,7 +7158,11 @@ void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
// calculate their diff by mapping viewport coordinates
// directly to parent coordinates.
// COMBINE
- QTransform viewToParentTransform = (item->d_func()->transformData->computedFullTransform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()))
+ QTransform itemTransform;
+ if (item->d_ptr->transformData)
+ itemTransform = item->d_ptr->transformData->computedFullTransform();
+ itemTransform.translate(item->d_ptr->pos.x(), item->d_ptr->pos.y());
+ QTransform viewToParentTransform = itemTransform
* (item->sceneTransform() * view->viewportTransform()).inverted();
currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos())));
buttonDownParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton))));
@@ -7637,7 +7668,13 @@ void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
manager->cleanupCachedGestures(this, gesture);
}
}
+/*!
+ Updates the item's micro focus. This is slot for convenience.
+
+ \since 4.7
+ \sa QInputContext
+*/
void QGraphicsObject::updateMicroFocus()
{
QGraphicsItem::updateMicroFocus();
@@ -7946,6 +7983,13 @@ void QGraphicsItemPrivate::resetHeight()
*/
/*!
+ \property QGraphicsObject::effect
+ \brief the effect attached to this item
+
+ \sa QGraphicsItem::setGraphicsEffect(), QGraphicsItem::graphicsEffect()
+*/
+
+/*!
\class QAbstractGraphicsShapeItem
\brief The QAbstractGraphicsShapeItem class provides a common base for
all path items.
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 569a329..e812f29 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -377,6 +377,7 @@ public:
QGraphicsItemCache *extraItemCache() const;
void removeExtraItemCache();
+ void updatePaintedViewBoundingRects(bool updateChildren);
void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem);
inline void ensureSceneTransform()
{
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 0d4e48a..9b7cf12 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -290,13 +290,19 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
updateAll(false),
calledEmitUpdated(false),
processDirtyItemsEmitted(false),
- selectionChanging(0),
needSortTopLevelItems(true),
holesInTopLevelSiblingIndex(false),
topLevelSequentialOrdering(true),
scenePosDescendantsUpdatePending(false),
stickyFocus(false),
hasFocus(false),
+ lastMouseGrabberItemHasImplicitMouseGrab(false),
+ allItemsIgnoreHoverEvents(true),
+ allItemsUseDefaultCursor(true),
+ painterStateProtection(true),
+ sortCacheEnabled(false),
+ allItemsIgnoreTouchEvents(true),
+ selectionChanging(0),
rectAdjust(2),
focusItem(0),
lastFocusItem(0),
@@ -306,16 +312,10 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
activationRefCount(0),
childExplicitActivation(0),
lastMouseGrabberItem(0),
- lastMouseGrabberItemHasImplicitMouseGrab(false),
dragDropItem(0),
enterWidget(0),
lastDropAction(Qt::IgnoreAction),
- allItemsIgnoreHoverEvents(true),
- allItemsUseDefaultCursor(true),
- painterStateProtection(true),
- sortCacheEnabled(false),
- style(0),
- allItemsIgnoreTouchEvents(true)
+ style(0)
{
}
@@ -690,6 +690,10 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
if (item == lastMouseGrabberItem)
lastMouseGrabberItem = 0;
+ // Reset the current drop item
+ if (item == dragDropItem)
+ dragDropItem = 0;
+
// Reenable selectionChanged() for individual items
--selectionChanging;
if (!selectionChanging && selectedItems.size() != oldSelectedItemsSize)
@@ -1316,10 +1320,10 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
setFocus = true;
break;
}
- if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) {
+ if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable))) {
if (!item->isWidget() || ((QGraphicsWidget *)item)->focusPolicy() & Qt::ClickFocus) {
setFocus = true;
- if (item != q->focusItem())
+ if (item != q->focusItem() && item->d_ptr->mouseSetsFocus)
q->setFocusItem(item, Qt::MouseFocusReason);
break;
}
@@ -5116,9 +5120,15 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
// Process children.
if (itemHasChildren && item->d_ptr->dirtyChildren) {
+ const bool itemClipsChildrenToShape = item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape;
+ if (itemClipsChildrenToShape) {
+ // Make sure child updates are clipped to the item's bounding rect.
+ for (int i = 0; i < views.size(); ++i)
+ views.at(i)->d_func()->setUpdateClip(item);
+ }
if (!dirtyAncestorContainsChildren) {
dirtyAncestorContainsChildren = item->d_ptr->fullUpdatePending
- && (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape);
+ && itemClipsChildrenToShape;
}
const bool allChildrenDirty = item->d_ptr->allChildrenDirty;
const bool parentIgnoresVisible = item->d_ptr->ignoreVisible;
@@ -5141,6 +5151,12 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
}
processDirtyItemsRecursive(child, dirtyAncestorContainsChildren, opacity);
}
+
+ if (itemClipsChildrenToShape) {
+ // Reset updateClip.
+ for (int i = 0; i < views.size(); ++i)
+ views.at(i)->d_func()->setUpdateClip(0);
+ }
} else if (wasDirtyParentSceneTransform) {
item->d_ptr->invalidateChildrenSceneTransform();
}
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 0a85f0e..77bf450 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -97,24 +97,36 @@ public:
int lastItemCount;
QRectF sceneRect;
- bool hasSceneRect;
- bool dirtyGrowingItemsBoundingRect;
+
+ quint32 hasSceneRect : 1;
+ quint32 dirtyGrowingItemsBoundingRect : 1;
+ quint32 updateAll : 1;
+ quint32 calledEmitUpdated : 1;
+ quint32 processDirtyItemsEmitted : 1;
+ quint32 needSortTopLevelItems : 1;
+ quint32 holesInTopLevelSiblingIndex : 1;
+ quint32 topLevelSequentialOrdering : 1;
+ quint32 scenePosDescendantsUpdatePending : 1;
+ quint32 stickyFocus : 1;
+ quint32 hasFocus : 1;
+ quint32 lastMouseGrabberItemHasImplicitMouseGrab : 1;
+ quint32 allItemsIgnoreHoverEvents : 1;
+ quint32 allItemsUseDefaultCursor : 1;
+ quint32 painterStateProtection : 1;
+ quint32 sortCacheEnabled : 1; // for compatibility
+ quint32 allItemsIgnoreTouchEvents : 1;
+ quint32 padding : 15;
+
QRectF growingItemsBoundingRect;
void _q_emitUpdated();
QList<QRectF> updatedRects;
- bool updateAll;
- bool calledEmitUpdated;
- bool processDirtyItemsEmitted;
QPainterPath selectionArea;
int selectionChanging;
QSet<QGraphicsItem *> selectedItems;
QVector<QGraphicsItem *> unpolishedItems;
QList<QGraphicsItem *> topLevelItems;
- bool needSortTopLevelItems;
- bool holesInTopLevelSiblingIndex;
- bool topLevelSequentialOrdering;
QMap<QGraphicsItem *, QPointF> movingItemsInitialPositions;
void registerTopLevelItem(QGraphicsItem *item);
@@ -125,7 +137,6 @@ public:
void _q_processDirtyItems();
QSet<QGraphicsItem *> scenePosItems;
- bool scenePosDescendantsUpdatePending;
void setScenePosItemEnabled(QGraphicsItem *item, bool enabled);
void registerScenePosItem(QGraphicsItem *item);
void unregisterScenePosItem(QGraphicsItem *item);
@@ -136,9 +147,6 @@ public:
QBrush backgroundBrush;
QBrush foregroundBrush;
- quint32 stickyFocus : 1;
- quint32 hasFocus : 1;
- quint32 padding : 30;
quint32 rectAdjust;
QGraphicsItem *focusItem;
QGraphicsItem *lastFocusItem;
@@ -155,7 +163,6 @@ public:
void removePopup(QGraphicsWidget *widget, bool itemIsDying = false);
QGraphicsItem *lastMouseGrabberItem;
- bool lastMouseGrabberItemHasImplicitMouseGrab;
QList<QGraphicsItem *> mouseGrabberItems;
void grabMouse(QGraphicsItem *item, bool implicit = false);
void ungrabMouse(QGraphicsItem *item, bool itemIsDying = false);
@@ -172,8 +179,6 @@ public:
QList<QGraphicsItem *> cachedItemsUnderMouse;
QList<QGraphicsItem *> hoverItems;
QPointF lastSceneMousePos;
- bool allItemsIgnoreHoverEvents;
- bool allItemsUseDefaultCursor;
void enableMouseTrackingOnViews();
QMap<Qt::MouseButton, QPointF> mouseGrabberButtonDownPos;
QMap<Qt::MouseButton, QPointF> mouseGrabberButtonDownScenePos;
@@ -187,8 +192,6 @@ public:
void addView(QGraphicsView *view);
void removeView(QGraphicsView *view);
- bool painterStateProtection;
-
QMultiMap<QGraphicsItem *, QGraphicsItem *> sceneEventFilters;
void installSceneEventFilter(QGraphicsItem *watched, QGraphicsItem *filter);
void removeSceneEventFilter(QGraphicsItem *watched, QGraphicsItem *filter);
@@ -210,8 +213,6 @@ public:
void mousePressEventHandler(QGraphicsSceneMouseEvent *mouseEvent);
QGraphicsWidget *windowForItem(const QGraphicsItem *item) const;
- bool sortCacheEnabled; // for compatibility
-
void drawItemHelper(QGraphicsItem *item, QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget,
bool painterStateProtection);
@@ -295,7 +296,6 @@ public:
int findClosestTouchPointId(const QPointF &scenePos);
void touchEventHandler(QTouchEvent *touchEvent);
bool sendTouchBeginEvent(QGraphicsItem *item, QTouchEvent *touchEvent);
- bool allItemsIgnoreTouchEvents;
void enableTouchEventsOnViews();
QList<QGraphicsObject *> cachedTargetItems;
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 0bba7e9..d2964ca 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -327,16 +327,21 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
dragMode(QGraphicsView::NoDrag),
sceneInteractionAllowed(true), hasSceneRect(false),
connectedToScene(false),
- mousePressButton(Qt::NoButton),
+ useLastMouseEvent(false),
identityMatrix(true),
dirtyScroll(true),
accelerateScrolling(true),
+ keepLastCenterPoint(true),
+ transforming(false),
+ handScrolling(false),
+ mustAllocateStyleOptions(false),
+ mustResizeBackgroundPixmap(true),
+ fullUpdatePending(true),
+ hasUpdateClip(false),
+ mousePressButton(Qt::NoButton),
leftIndent(0), topIndent(0),
lastMouseEvent(QEvent::None, QPoint(), Qt::NoButton, 0, 0),
- useLastMouseEvent(false),
- keepLastCenterPoint(true),
alignment(Qt::AlignCenter),
- transforming(false),
transformationAnchor(QGraphicsView::AnchorViewCenter), resizeAnchor(QGraphicsView::NoAnchor),
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
optimizationFlags(0),
@@ -345,14 +350,11 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
rubberBanding(false),
rubberBandSelectionMode(Qt::IntersectsItemShape),
#endif
- handScrolling(false), handScrollMotions(0), cacheMode(0),
- mustAllocateStyleOptions(false),
- mustResizeBackgroundPixmap(true),
+ handScrollMotions(0), cacheMode(0),
#ifndef QT_NO_CURSOR
hasStoredOriginalCursor(false),
#endif
lastDragDropEvent(0),
- fullUpdatePending(true),
updateSceneSlotReimplementedChecked(false)
{
styleOptions.reserve(QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS);
@@ -879,6 +881,52 @@ static inline void QRect_unite(QRect *rect, const QRect &other)
}
}
+/*
+ Calling this function results in update rects being clipped to the item's
+ bounding rect. Note that updates prior to this function call is not clipped.
+ The clip is removed by passing 0.
+*/
+void QGraphicsViewPrivate::setUpdateClip(QGraphicsItem *item)
+{
+ Q_Q(QGraphicsView);
+ // We simply ignore the request if the update mode is either FullViewportUpdate
+ // or NoViewportUpdate; in that case there's no point in clipping anything.
+ if (!item || viewportUpdateMode == QGraphicsView::NoViewportUpdate
+ || viewportUpdateMode == QGraphicsView::FullViewportUpdate) {
+ hasUpdateClip = false;
+ return;
+ }
+
+ // Calculate the clip (item's bounding rect in view coordinates).
+ // Optimized version of:
+ // QRect clip = item->deviceTransform(q->viewportTransform())
+ // .mapRect(item->boundingRect()).toAlignedRect();
+ QRect clip;
+ if (item->d_ptr->itemIsUntransformable()) {
+ QTransform xform = item->deviceTransform(q->viewportTransform());
+ clip = xform.mapRect(item->boundingRect()).toAlignedRect();
+ } else if (item->d_ptr->sceneTransformTranslateOnly && identityMatrix) {
+ QRectF r(item->boundingRect());
+ r.translate(item->d_ptr->sceneTransform.dx() - horizontalScroll(),
+ item->d_ptr->sceneTransform.dy() - verticalScroll());
+ clip = r.toAlignedRect();
+ } else if (!q->isTransformed()) {
+ clip = item->d_ptr->sceneTransform.mapRect(item->boundingRect()).toAlignedRect();
+ } else {
+ QTransform xform = item->d_ptr->sceneTransform;
+ xform *= q->viewportTransform();
+ clip = xform.mapRect(item->boundingRect()).toAlignedRect();
+ }
+
+ if (hasUpdateClip) {
+ // Intersect with old clip.
+ updateClip &= clip;
+ } else {
+ updateClip = clip;
+ hasUpdateClip = true;
+ }
+}
+
bool QGraphicsViewPrivate::updateRegion(const QRectF &rect, const QTransform &xform)
{
if (rect.isEmpty())
@@ -909,6 +957,8 @@ bool QGraphicsViewPrivate::updateRegion(const QRectF &rect, const QTransform &xf
viewRect.adjust(-1, -1, 1, 1);
else
viewRect.adjust(-2, -2, 2, 2);
+ if (hasUpdateClip)
+ viewRect &= updateClip;
dirtyRegion += viewRect;
}
@@ -930,7 +980,10 @@ bool QGraphicsViewPrivate::updateRect(const QRect &r)
viewport->update();
break;
case QGraphicsView::BoundingRectViewportUpdate:
- QRect_unite(&dirtyBoundingRect, r);
+ if (hasUpdateClip)
+ QRect_unite(&dirtyBoundingRect, r & updateClip);
+ else
+ QRect_unite(&dirtyBoundingRect, r);
if (containsViewport(dirtyBoundingRect, viewport->width(), viewport->height())) {
fullUpdatePending = true;
viewport->update();
@@ -938,7 +991,10 @@ bool QGraphicsViewPrivate::updateRect(const QRect &r)
break;
case QGraphicsView::SmartViewportUpdate: // ### DEPRECATE
case QGraphicsView::MinimalViewportUpdate:
- dirtyRegion += r;
+ if (hasUpdateClip)
+ dirtyRegion += r & updateClip;
+ else
+ dirtyRegion += r;
break;
default:
break;
@@ -1819,8 +1875,6 @@ void QGraphicsView::centerOn(const QGraphicsItem *item)
void QGraphicsView::ensureVisible(const QRectF &rect, int xmargin, int ymargin)
{
Q_D(QGraphicsView);
- Q_UNUSED(xmargin);
- Q_UNUSED(ymargin);
qreal width = viewport()->width();
qreal height = viewport()->height();
QRectF viewRect = d->matrix.mapRect(rect);
diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h
index aeff28a..7bd9ecb 100644
--- a/src/gui/graphicsview/qgraphicsview_p.h
+++ b/src/gui/graphicsview/qgraphicsview_p.h
@@ -77,11 +77,25 @@ public:
QPainter::RenderHints renderHints;
QGraphicsView::DragMode dragMode;
- bool sceneInteractionAllowed;
+
+ quint32 sceneInteractionAllowed : 1;
+ quint32 hasSceneRect : 1;
+ quint32 connectedToScene : 1;
+ quint32 useLastMouseEvent : 1;
+ quint32 identityMatrix : 1;
+ quint32 dirtyScroll : 1;
+ quint32 accelerateScrolling : 1;
+ quint32 keepLastCenterPoint : 1;
+ quint32 transforming : 1;
+ quint32 handScrolling : 1;
+ quint32 mustAllocateStyleOptions : 1;
+ quint32 mustResizeBackgroundPixmap : 1;
+ quint32 fullUpdatePending : 1;
+ quint32 hasUpdateClip : 1;
+ quint32 padding : 18;
+
QRectF sceneRect;
- bool hasSceneRect;
void updateLastCenterPoint();
- bool connectedToScene;
qint64 horizontalScroll() const;
qint64 verticalScroll() const;
@@ -89,6 +103,7 @@ public:
QRectF mapRectToScene(const QRect &rect) const;
QRectF mapRectFromScene(const QRectF &rect) const;
+ QRect updateClip;
QPointF mousePressItemPoint;
QPointF mousePressScenePoint;
QPoint mousePressViewPoint;
@@ -98,26 +113,20 @@ public:
QPoint dirtyScrollOffset;
Qt::MouseButton mousePressButton;
QTransform matrix;
- bool identityMatrix;
qint64 scrollX, scrollY;
- bool dirtyScroll;
void updateScroll();
- bool accelerateScrolling;
qreal leftIndent;
qreal topIndent;
// Replaying mouse events
QMouseEvent lastMouseEvent;
- bool useLastMouseEvent;
void replayLastMouseEvent();
void storeMouseEvent(QMouseEvent *event);
void mouseMoveEventHandler(QMouseEvent *event);
QPointF lastCenterPoint;
- bool keepLastCenterPoint;
Qt::Alignment alignment;
- bool transforming;
QGraphicsView::ViewportAnchor transformationAnchor;
QGraphicsView::ViewportAnchor resizeAnchor;
@@ -131,20 +140,17 @@ public:
bool rubberBanding;
Qt::ItemSelectionMode rubberBandSelectionMode;
#endif
- bool handScrolling;
int handScrollMotions;
QGraphicsView::CacheMode cacheMode;
QVector<QStyleOptionGraphicsItem> styleOptions;
- bool mustAllocateStyleOptions;
QStyleOptionGraphicsItem *allocStyleOptionsArray(int numItems);
void freeStyleOptionsArray(QStyleOptionGraphicsItem *array);
QBrush backgroundBrush;
QBrush foregroundBrush;
QPixmap backgroundPixmap;
- bool mustResizeBackgroundPixmap;
QRegion backgroundPixmapExposed;
#ifndef QT_NO_CURSOR
@@ -161,7 +167,6 @@ public:
QRect mapToViewRect(const QGraphicsItem *item, const QRectF &rect) const;
QRegion mapToViewRegion(const QGraphicsItem *item, const QRectF &rect) const;
- bool fullUpdatePending;
QRegion dirtyRegion;
QRect dirtyBoundingRect;
void processPendingUpdates();
@@ -192,6 +197,8 @@ public:
#endif
}
+ void setUpdateClip(QGraphicsItem *);
+
inline bool updateRectF(const QRectF &rect)
{
if (rect.isEmpty())
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 06a44b7..478c0c3 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -747,6 +747,17 @@ QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c
}
/*!
+ \property QGraphicsWidget::layout
+ \brief The layout of the widget
+*/
+
+/*!
+ \fn void QGraphicsWidget::layoutChanged()
+ This signal gets emitted whenever the layout of the item changes
+ \internal
+*/
+
+/*!
Returns this widget's layout, or 0 if no layout is currently managing this
widget.
@@ -1094,9 +1105,6 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &
}
break;
case ItemParentChange: {
- QGraphicsItem *parent = qVariantValue<QGraphicsItem *>(value);
- d->fixFocusChainBeforeReparenting((parent && parent->isWidget()) ? static_cast<QGraphicsWidget *>(parent) : 0, scene());
-
// Deliver ParentAboutToChange.
QEvent event(QEvent::ParentAboutToChange);
QApplication::sendEvent(this, &event);
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index 6e397b6..50b315a 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -71,14 +71,17 @@ void QGraphicsWidgetPrivate::init(QGraphicsItem *parentItem, Qt::WindowFlags wFl
adjustWindowFlags(&wFlags);
windowFlags = wFlags;
- q->setParentItem(parentItem);
+ if (parentItem)
+ setParentItemHelper(parentItem, 0, 0);
+
q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::DefaultType));
q->setGraphicsItem(q);
resolveLayoutDirection();
q->unsetWindowFrameMargins();
- q->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption);
- q->setFlag(QGraphicsItem::ItemSendsGeometryChanges);
+ flags |= QGraphicsItem::ItemUsesExtendedStyleOption | QGraphicsItem::ItemSendsGeometryChanges;
+ if (windowFlags & Qt::Window)
+ flags |= QGraphicsItem::ItemIsPanel;
}
qreal QGraphicsWidgetPrivate::titleBarHeight(const QStyleOptionTitleBar &options) const
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 5fc605a..7a6a73f 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#define Q_TEST_QPIXMAPCACHE
#include "qpixmapcache.h"
#include "qobject.h"
#include "qdebug.h"
@@ -194,6 +195,9 @@ public:
static QPixmapCache::KeyData* getKeyData(QPixmapCache::Key *key);
+ QList< QPair<QString,QPixmap> > allPixmaps() const;
+ void flushDetachedPixmaps(bool nt);
+
private:
int *keyArray;
int theid;
@@ -235,10 +239,9 @@ QPMCache::~QPMCache()
When the last pixmap has been deleted from the cache, kill the
timer so Qt won't keep the CPU from going into sleep mode.
*/
-void QPMCache::timerEvent(QTimerEvent *)
+void QPMCache::flushDetachedPixmaps(bool nt)
{
int mc = maxCost();
- bool nt = totalCost() == ps;
setMaxCost(nt ? totalCost() * 3 / 4 : totalCost() -1);
setMaxCost(mc);
ps = totalCost();
@@ -252,6 +255,12 @@ void QPMCache::timerEvent(QTimerEvent *)
++it;
}
}
+}
+
+void QPMCache::timerEvent(QTimerEvent *)
+{
+ bool nt = totalCost() == ps;
+ flushDetachedPixmaps(nt);
if (!size()) {
killTimer(theid);
@@ -263,6 +272,7 @@ void QPMCache::timerEvent(QTimerEvent *)
}
}
+
QPixmap *QPMCache::object(const QString &key) const
{
QPixmapCache::Key cacheKey = cacheKeys.value(key);
@@ -422,6 +432,20 @@ QPixmapCache::KeyData* QPMCache::getKeyData(QPixmapCache::Key *key)
return key->d;
}
+QList< QPair<QString,QPixmap> > QPMCache::allPixmaps() const
+{
+ QList< QPair<QString,QPixmap> > r;
+ QHash<QString, QPixmapCache::Key>::const_iterator it = cacheKeys.begin();
+ while (it != cacheKeys.end()) {
+ QPixmap *ptr = QCache<QPixmapCache::Key, QPixmapCacheEntry>::object(it.value());
+ if (ptr)
+ r.append(QPair<QString,QPixmap>(it.key(),*ptr));
+ ++it;
+ }
+ return r;
+}
+
+
Q_GLOBAL_STATIC(QPMCache, pm_cache)
int Q_AUTOTEST_EXPORT q_QPixmapCache_keyHashSize()
@@ -633,4 +657,19 @@ void QPixmapCache::clear()
}
}
+void QPixmapCache::flushDetachedPixmaps()
+{
+ pm_cache()->flushDetachedPixmaps(true);
+}
+
+int QPixmapCache::totalUsed()
+{
+ return (pm_cache()->totalCost()+1023) / 1024;
+}
+
+QList< QPair<QString,QPixmap> > QPixmapCache::allPixmaps()
+{
+ return pm_cache()->allPixmaps();
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h
index 50a9369..e9c8c15 100644
--- a/src/gui/image/qpixmapcache.h
+++ b/src/gui/image/qpixmapcache.h
@@ -44,6 +44,10 @@
#include <QtGui/qpixmap.h>
+#ifdef Q_TEST_QPIXMAPCACHE
+#include <QtCore/qpair.h>
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -83,6 +87,12 @@ public:
static void remove(const QString &key);
static void remove(const Key &key);
static void clear();
+
+#ifdef Q_TEST_QPIXMAPCACHE
+ static void flushDetachedPixmaps();
+ static int totalUsed();
+ static QList< QPair<QString,QPixmap> > allPixmaps();
+#endif
};
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h
index 86a1b78..825f272 100644
--- a/src/gui/image/qpixmapcache_p.h
+++ b/src/gui/image/qpixmapcache_p.h
@@ -95,6 +95,8 @@ public:
QPixmapCache::Key key;
};
+inline bool qIsDetached(QPixmapCacheEntry &t) { return t.isDetached(); }
+
QT_END_NAMESPACE
#endif // QPIXMAPCACHE_P_H
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index dce5c6a..b12cd45 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -1099,7 +1099,7 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
if (!source_top_left.isValid() || !source_bottom_right.isValid())
return;
QModelIndex source_parent = source_top_left.parent();
- IndexMap::const_iterator it = create_mapping(source_parent);
+ IndexMap::const_iterator it = source_index_mapping.find(source_parent);
if (it == source_index_mapping.constEnd()) {
// Don't care, since we don't have mapping for this index
return;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index ec635d4..7b62de1 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -788,6 +788,10 @@ void QApplicationPrivate::construct(
qt_gui_eval_init(application_type);
#endif
+#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
+ symbianInit();
+#endif
+
#ifndef QT_NO_LIBRARY
if(load_testability) {
QLibrary testLib(QLatin1String("qttestability"));
@@ -2364,6 +2368,19 @@ bool QApplication::event(QEvent *e)
if (!(w->windowType() == Qt::Desktop))
postEvent(w, new QEvent(QEvent::LanguageChange));
}
+#ifndef Q_OS_WIN
+ } else if (e->type() == QEvent::LocaleChange) {
+ // on Windows the event propagation is taken care by the
+ // WM_SETTINGCHANGE event handler.
+ QWidgetList list = topLevelWidgets();
+ for (int i = 0; i < list.size(); ++i) {
+ QWidget *w = list.at(i);
+ if (!(w->windowType() == Qt::Desktop)) {
+ if (!w->testAttribute(Qt::WA_SetLocale))
+ w->d_func()->setLocale_helper(QLocale(), true);
+ }
+ }
+#endif
} else if (e->type() == QEvent::Timer) {
QTimerEvent *te = static_cast<QTimerEvent*>(e);
Q_ASSERT(te != 0);
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index fb2837e..50b9759 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -1936,6 +1936,8 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
QLocalePrivate::updateSystemPrivate();
if (!widget->testAttribute(Qt::WA_SetLocale))
widget->dptr()->setLocale_helper(QLocale(), true);
+ QEvent e(QEvent::LocaleChange);
+ QApplication::sendEvent(qApp, &e);
}
}
else if (msg.wParam == SPI_SETICONTITLELOGFONT) {
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm
index 24498f8..2b9cf85 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac.mm
+++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm
@@ -202,6 +202,11 @@ static void cleanupCocoaWindowDelegate()
QWindowStateChangeEvent e(Qt::WindowStates(widgetData->window_state
& ~Qt::WindowMaximized));
qt_sendSpontaneousEvent(qwidget, &e);
+ } else {
+ widgetData->window_state = widgetData->window_state & ~Qt::WindowMaximized;
+ QWindowStateChangeEvent e(Qt::WindowStates(widgetData->window_state
+ | Qt::WindowMaximized));
+ qt_sendSpontaneousEvent(qwidget, &e);
}
NSRect rect = [[window contentView] frame];
const QSize newSize(rect.size.width, rect.size.height);
@@ -305,9 +310,19 @@ static void cleanupCocoaWindowDelegate()
Q_UNUSED(newFrame);
// saving the current window geometry before the window is maximized
QWidget *qwidget = m_windowHash->value(window);
- if (qwidget->isWindow() && !(qwidget->windowState() & Qt::WindowMaximized)) {
- QWidgetPrivate *widgetPrivate = qt_widget_private(qwidget);
- widgetPrivate->topData()->normalGeometry = qwidget->geometry();
+ QWidgetPrivate *widgetPrivate = qt_widget_private(qwidget);
+ if (qwidget->isWindow()) {
+ if(qwidget->windowState() & Qt::WindowMaximized) {
+ // Restoring
+ widgetPrivate->topData()->wasMaximized = false;
+ } else {
+ // Maximizing
+ widgetPrivate->topData()->normalGeometry = qwidget->geometry();
+ // If the window was maximized we need to update the coordinates since now it will start at 0,0.
+ // We do this in a special field that is only used when not restoring but manually resizing the window.
+ // Since the coordinates are fixed we just set a boolean flag.
+ widgetPrivate->topData()->wasMaximized = true;
+ }
}
return YES;
}
diff --git a/src/gui/kernel/qdnd_qws.cpp b/src/gui/kernel/qdnd_qws.cpp
index e47de00..7e5afc7 100644
--- a/src/gui/kernel/qdnd_qws.cpp
+++ b/src/gui/kernel/qdnd_qws.cpp
@@ -192,6 +192,10 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
return false;
switch(e->type()) {
+ case QEvent::ShortcutOverride:
+ // prevent accelerators from firing while dragging
+ e->accept();
+ return true;
case QEvent::KeyPress:
case QEvent::KeyRelease:
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 0a05d8e..2b12317 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -1299,6 +1299,12 @@ bool QDragManager::eventFilter(QObject * o, QEvent * e)
return true;
}
+ if (e->type() == QEvent::ShortcutOverride) {
+ // prevent accelerators from firing while dragging
+ e->accept();
+ return true;
+ }
+
if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) {
QKeyEvent *ke = ((QKeyEvent*)e);
if (ke->key() == Qt::Key_Escape && e->type() == QEvent::KeyPress) {
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index aa6720e..9495f40 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -132,20 +132,21 @@ void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g);
if (list.contains(recognizer)) {
m_deletedRecognizers.insert(g, recognizer);
- m_gestureToRecognizer.remove(g);
}
}
- foreach (QGestureRecognizer *recognizer, list) {
- QList<QGesture *> obsoleteGestures;
- QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin();
- while (iter != m_objectGestures.end()) {
- ObjectGesture objectGesture = iter.key();
- if (objectGesture.gesture == type)
- obsoleteGestures << iter.value();
- ++iter;
+ QMap<ObjectGesture, QList<QGesture *> >::const_iterator iter = m_objectGestures.begin();
+ while (iter != m_objectGestures.end()) {
+ ObjectGesture objectGesture = iter.key();
+ if (objectGesture.gesture == type) {
+ foreach (QGesture *g, iter.value()) {
+ if (QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g)) {
+ m_gestureToRecognizer.remove(g);
+ m_obsoleteGestures[recognizer].insert(g);
+ }
+ }
}
- m_obsoleteGestures.insert(recognizer, obsoleteGestures);
+ ++iter;
}
}
@@ -155,7 +156,14 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
while (iter != m_objectGestures.end()) {
ObjectGesture objectGesture = iter.key();
if (objectGesture.gesture == type && target == objectGesture.object.data()) {
- qDeleteAll(iter.value());
+ QSet<QGesture *> gestures = iter.value().toSet();
+ for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator
+ it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) {
+ it.value() -= gestures;
+ }
+ foreach (QGesture *g, gestures)
+ m_deletedRecognizers.remove(g);
+ qDeleteAll(gestures);
iter = m_objectGestures.erase(iter);
} else {
++iter;
@@ -177,6 +185,9 @@ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recogni
#ifndef QT_NO_GRAPHICSVIEW
} else {
Q_ASSERT(qobject_cast<QGraphicsObject *>(object));
+ QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(object);
+ if (graphicsObject->QGraphicsItem::d_func()->inDestructor)
+ return 0;
#endif
}
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index a0ff83f..c105c9b 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -127,7 +127,7 @@ private:
int m_lastCustomGestureId;
- QHash<QGestureRecognizer *, QList<QGesture *> > m_obsoleteGestures;
+ QHash<QGestureRecognizer *, QSet<QGesture *> > m_obsoleteGestures;
QHash<QGesture *, QGestureRecognizer *> m_deletedRecognizers;
void cleanupGesturesForRemovedRecognizer(QGesture *gesture);
diff --git a/src/gui/kernel/qsound_mac.mm b/src/gui/kernel/qsound_mac.mm
index 71fd663..2aff44d 100644
--- a/src/gui/kernel/qsound_mac.mm
+++ b/src/gui/kernel/qsound_mac.mm
@@ -88,14 +88,14 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
-@interface QMacSoundDelegate : NSObject<NSSoundDelegate> {
+@interface QT_MANGLE_NAMESPACE(QMacSoundDelegate) : NSObject<NSSoundDelegate> {
QSound *qSound; // may be null.
QAuServerMac* server;
}
-(id)initWithQSound:(QSound*)sound:(QAuServerMac*)server;
@end
-@implementation QMacSoundDelegate
+@implementation QT_MANGLE_NAMESPACE(QMacSoundDelegate)
-(id)initWithQSound:(QSound*)s:(QAuServerMac*)serv {
self = [super init];
if(self) {
@@ -172,7 +172,7 @@ NSSound *QAuServerMac::createNSSound(const QString &fileName, QSound *qSound)
{
NSString *nsFileName = const_cast<NSString *>(reinterpret_cast<const NSString *>(QCFString::toCFStringRef(fileName)));
NSSound * const nsSound = [[NSSound alloc] initWithContentsOfFile: nsFileName byReference:YES];
- QMacSoundDelegate * const delegate = [[QMacSoundDelegate alloc] initWithQSound:qSound:this];
+ QT_MANGLE_NAMESPACE(QMacSoundDelegate) * const delegate = [[QT_MANGLE_NAMESPACE(QMacSoundDelegate) alloc] initWithQSound:qSound:this];
[nsSound setDelegate:delegate];
[nsFileName release];
return nsSound;
diff --git a/src/gui/kernel/qt_mac_p.h b/src/gui/kernel/qt_mac_p.h
index 3341ce1..ca9541a 100644
--- a/src/gui/kernel/qt_mac_p.h
+++ b/src/gui/kernel/qt_mac_p.h
@@ -57,7 +57,9 @@
#ifdef __OBJC__
#include <Cocoa/Cocoa.h>
+#ifdef QT_MAC_USE_COCOA
#include <objc/runtime.h>
+#endif // QT_MAC_USE_COCOA
#endif
#include <CoreServices/CoreServices.h>
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 20d1d30..1f2cd8c 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1388,6 +1388,9 @@ QWidget::~QWidget()
qWarning("QWidget: %s (%s) deleted while being painted", className(), name());
#endif
+ foreach (Qt::GestureType type, d->gestureContext.keys())
+ ungrabGesture(type);
+
// force acceptDrops false before winId is destroyed.
d->registerDropSite(false);
@@ -1578,6 +1581,11 @@ void QWidgetPrivate::createTLExtra()
x->inTopLevelResize = false;
x->inRepaint = false;
x->embedded = 0;
+#ifdef Q_WS_MAC
+#ifdef QT_MAC_USE_COCOA
+ x->wasMaximized = false;
+#endif // QT_MAC_USE_COCOA
+#endif // Q_WS_MAC
createTLSysExtra();
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
@@ -2535,7 +2543,7 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
Q_Q(QWidget);
QStyle *oldStyle = q->style();
#ifndef QT_NO_STYLE_STYLESHEET
- QStyle *origStyle = 0;
+ QWeakPointer<QStyle> origStyle;
#endif
#ifdef Q_WS_MAC
@@ -2549,7 +2557,7 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
createExtra();
#ifndef QT_NO_STYLE_STYLESHEET
- origStyle = extra->style;
+ origStyle = extra->style.data();
#endif
extra->style = newStyle;
}
@@ -2578,23 +2586,23 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
}
}
- QEvent e(QEvent::StyleChange);
- QApplication::sendEvent(q, &e);
-#ifdef QT3_SUPPORT
- q->styleChange(*oldStyle);
-#endif
-
#ifndef QT_NO_STYLE_STYLESHEET
if (!qobject_cast<QStyleSheetStyle*>(newStyle)) {
- if (const QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle)) {
+ if (const QStyleSheetStyle* cssStyle = qobject_cast<QStyleSheetStyle*>(origStyle.data())) {
cssStyle->clearWidgetFont(q);
}
}
#endif
+ QEvent e(QEvent::StyleChange);
+ QApplication::sendEvent(q, &e);
+#ifdef QT3_SUPPORT
+ q->styleChange(*oldStyle);
+#endif
+
#ifndef QT_NO_STYLE_STYLESHEET
// dereference the old stylesheet style
- if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle))
+ if (QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle *>(origStyle.data()))
proxy->deref();
#endif
}
@@ -5583,52 +5591,23 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
pixmapOffset = painterTransform.map(pixmapOffset);
}
-
QRect effectRect;
- if (mode == QGraphicsEffect::PadToEffectiveBoundingRect) {
+ if (mode == QGraphicsEffect::PadToEffectiveBoundingRect)
effectRect = m_widget->graphicsEffect()->boundingRectFor(sourceRect).toAlignedRect();
-
- } else if (mode == QGraphicsEffect::PadToTransparentBorder) {
+ else if (mode == QGraphicsEffect::PadToTransparentBorder)
effectRect = sourceRect.adjusted(-1, -1, 1, 1).toAlignedRect();
-
- } else {
+ else
effectRect = sourceRect.toAlignedRect();
- }
-
if (offset)
*offset = effectRect.topLeft();
- if (deviceCoordinates) {
- // Clip to device rect.
- int left, top, right, bottom;
- effectRect.getCoords(&left, &top, &right, &bottom);
- if (left < 0) {
- if (offset)
- offset->rx() += -left;
- effectRect.setX(0);
- }
- if (top < 0) {
- if (offset)
- offset->ry() += -top;
- effectRect.setY(0);
- }
- // NB! We use +-1 for historical reasons (see QRect documentation).
- QPaintDevice *device = context->painter->device();
- const int deviceWidth = device->width();
- const int deviceHeight = device->height();
- if (right + 1 > deviceWidth)
- effectRect.setRight(deviceWidth - 1);
- if (bottom + 1 > deviceHeight)
- effectRect.setBottom(deviceHeight -1);
- }
-
pixmapOffset -= effectRect.topLeft();
QPixmap pixmap(effectRect.size());
pixmap.fill(Qt::transparent);
- m_widget->render(&pixmap, pixmapOffset);
+ m_widget->render(&pixmap, pixmapOffset, QRegion(), QWidget::DrawChildren);
return pixmap;
}
#endif //QT_NO_GRAPHICSEFFECT
@@ -6232,6 +6211,12 @@ void QWidget::setFocus(Qt::FocusReason reason)
QApplication::sendEvent(that->style(), &event);
}
if (!isHidden()) {
+#ifndef QT_NO_GRAPHICSVIEW
+ // Update proxy state
+ if (QWExtra *topData = window()->d_func()->extra)
+ if (topData->proxyWidget && topData->proxyWidget->hasFocus())
+ topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget();
+#endif
// Send event to self
QFocusEvent event(QEvent::FocusIn, reason);
QPointer<QWidget> that = f;
@@ -6740,6 +6725,18 @@ void QWidget::setGeometry(const QRect &r)
*/
QByteArray QWidget::saveGeometry() const
{
+#ifdef QT_MAC_USE_COCOA
+ // We check if the window was maximized during this invocation. If so, we need to record the
+ // starting position as 0,0.
+ Q_D(const QWidget);
+ QRect newFramePosition = frameGeometry();
+ QRect newNormalPosition = normalGeometry();
+ if(d->topData()->wasMaximized && !(windowState() & Qt::WindowMaximized)) {
+ // Change the starting position
+ newFramePosition.moveTo(0, 0);
+ newNormalPosition.moveTo(0, 0);
+ }
+#endif // QT_MAC_USE_COCOA
QByteArray array;
QDataStream stream(&array, QIODevice::WriteOnly);
stream.setVersion(QDataStream::Qt_4_0);
@@ -6749,8 +6746,13 @@ QByteArray QWidget::saveGeometry() const
stream << magicNumber
<< majorVersion
<< minorVersion
+#ifdef QT_MAC_USE_COCOA
+ << newFramePosition
+ << newNormalPosition
+#else
<< frameGeometry()
<< normalGeometry()
+#endif // QT_MAC_USE_COCOA
<< qint32(QApplication::desktop()->screenNumber(this))
<< quint8(windowState() & Qt::WindowMaximized)
<< quint8(windowState() & Qt::WindowFullScreen);
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index e29b755..f12c956 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3824,9 +3824,35 @@ void QWidgetPrivate::raise_sys()
#if QT_MAC_USE_COCOA
QMacCocoaAutoReleasePool pool;
if (isRealWindow()) {
- // Calling orderFront shows the window on Cocoa too.
+ // With the introduction of spaces it is not as simple as just raising the window.
+ // First we need to check if we are in the right space. If we are, then we just continue
+ // as usual. The problem comes when we are not in the active space. There are two main cases:
+ // 1. Our parent was moved to a new space. In this case we want the window to be raised
+ // in the same space as its parent.
+ // 2. We don't have a parent. For this case we will just raise the window and let Cocoa
+ // switch to the corresponding space.
+ // NOTICE: There are a lot of corner cases here. We are keeping this simple for now, if
+ // required we will introduce special handling for some of them.
if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) {
- [qt_mac_window_for(q) orderFront:qt_mac_window_for(q)];
+ OSWindowRef window = qt_mac_window_for(q);
+ // isOnActiveSpace is available only from 10.6 onwards, so we need to check if it is
+ // available before calling it.
+ if([window respondsToSelector:@selector(isOnActiveSpace)]) {
+ if(![window performSelector:@selector(isOnActiveSpace)]) {
+ QWidget *parentWidget = q->parentWidget();
+ if(parentWidget) {
+ OSWindowRef parentWindow = qt_mac_window_for(parentWidget);
+ if(parentWindow && [parentWindow isOnActiveSpace]) {
+ // The window was created in a different space. Therefore if we want
+ // to show it in the current space we need to recreate it in the new
+ // space.
+ recreateMacWindow();
+ window = qt_mac_window_for(q);
+ }
+ }
+ }
+ }
+ [window orderFront:window];
}
if (qt_mac_raise_process) { //we get to be the active process now
ProcessSerialNumber psn;
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index cad60b5..3f494d8 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -170,6 +170,14 @@ struct QTLWExtra {
WindowGroupRef group;
IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys.
quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys()
+#ifdef QT_MAC_USE_COCOA
+ // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and
+ // manually resized.
+ // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the
+ // starting position as 0,0 instead of the normal starting position.
+ bool wasMaximized;
+#endif // QT_MAC_USE_COCOA
+
#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
#ifndef QT_NO_QWS_MANAGER
QWSManager *qwsManager;
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 7d647b7..5482da3 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -123,9 +123,11 @@ static PtrWTClose ptrWTClose = 0;
static PtrWTInfo ptrWTInfo = 0;
static PtrWTQueueSizeGet ptrWTQueueSizeGet = 0;
static PtrWTQueueSizeSet ptrWTQueueSizeSet = 0;
+#ifndef QT_NO_TABLETEVENT
static void init_wintab_functions();
static void qt_tablet_init();
static void qt_tablet_cleanup();
+#endif // QT_NO_TABLETEVENT
extern HCTX qt_tablet_context;
extern bool qt_tablet_tilt_support;
@@ -136,6 +138,8 @@ QWidget* qt_get_tablet_widget()
}
extern bool qt_is_gui_used;
+
+#ifndef QT_NO_TABLETEVENT
static void init_wintab_functions()
{
#if defined(Q_OS_WINCE)
@@ -227,6 +231,7 @@ static void qt_tablet_cleanup()
delete qt_tablet_widget;
qt_tablet_widget = 0;
}
+#endif // QT_NO_TABLETEVENT
const QString qt_reg_winclass(QWidget *w); // defined in qapplication_win.cpp
@@ -512,8 +517,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
DestroyWindow(destroyw);
}
+#ifndef QT_NO_TABLETEVENT
if (q != qt_tablet_widget && QWidgetPrivate::mapper)
qt_tablet_init();
+#endif // QT_NO_TABLETEVENT
if (q->testAttribute(Qt::WA_DropSiteRegistered))
registerDropSite(true);
diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp
index 509847b..fc1e52c 100644
--- a/src/gui/kernel/qwidget_wince.cpp
+++ b/src/gui/kernel/qwidget_wince.cpp
@@ -63,6 +63,7 @@ typedef BOOL (API *PtrWTGet)(HCTX, LPLOGCONTEXT);
typedef int (API *PtrWTQueueSizeGet)(HCTX);
typedef BOOL (API *PtrWTQueueSizeSet)(HCTX, int);
+#ifndef QT_NO_TABLETEVENT
static void qt_tablet_init_wce();
static void qt_tablet_cleanup_wce();
@@ -135,6 +136,7 @@ static void qt_tablet_cleanup_wce() {
delete qt_tablet_widget;
qt_tablet_widget = 0;
}
+#endif // QT_NO_TABLETEVENT
// The internal qWinRequestConfig, defined in qapplication_win.cpp, stores move,
@@ -358,8 +360,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
DestroyWindow(destroyw);
}
+#ifndef QT_NO_TABLETEVENT
if (q != qt_tablet_widget && QWidgetPrivate::mapper)
qt_tablet_init_wce();
+#endif // QT_NO_TABLETEVENT
if (q->testAttribute(Qt::WA_DropSiteRegistered))
registerDropSite(true);
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 37ac6bf..43f510c 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -3000,7 +3000,7 @@ Picture QX11Data::getSolidFill(int screen, const QColor &c)
return X11->solid_fills[i].picture;
}
// none found, replace one
- int i = rand() % 16;
+ int i = qrand() % 16;
if (X11->solid_fills[i].screen != screen && X11->solid_fills[i].picture) {
XRenderFreePicture (X11->display, X11->solid_fills[i].picture);
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 7ff2a37..2a9b31a 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -93,7 +93,7 @@ QBezier QBezier::fromPoints(const QPointF &p1, const QPointF &p2,
/*!
\internal
*/
-QPolygonF QBezier::toPolygon() const
+QPolygonF QBezier::toPolygon(qreal bezier_flattening_threshold) const
{
// flattening is done by splitting the bezier until we can replace the segment by a straight
// line. We split further until the control points are close enough to the line connecting the
@@ -108,7 +108,7 @@ QPolygonF QBezier::toPolygon() const
QPolygonF polygon;
polygon.append(QPointF(x1, y1));
- addToPolygon(&polygon);
+ addToPolygon(&polygon, bezier_flattening_threshold);
return polygon;
}
@@ -117,34 +117,6 @@ QBezier QBezier::mapBy(const QTransform &transform) const
return QBezier::fromPoints(transform.map(pt1()), transform.map(pt2()), transform.map(pt3()), transform.map(pt4()));
}
-//0.05 is really low, but required for scaled-up beziers...
-static const qreal flatness = 0.05;
-
-//based on "Fast, precise flattening of cubic Bezier path and offset curves"
-// by T. F. Hain, A. L. Ahmad, S. V. R. Racherla and D. D. Langan
-static inline void flattenBezierWithoutInflections(QBezier &bez,
- QPolygonF *&p)
-{
- QBezier left;
-
- while (1) {
- qreal dx = bez.x2 - bez.x1;
- qreal dy = bez.y2 - bez.y1;
-
- qreal normalized = qSqrt(dx * dx + dy * dy);
- if (qFuzzyIsNull(normalized))
- break;
-
- qreal d = qAbs(dx * (bez.y3 - bez.y2) - dy * (bez.x3 - bez.x2));
-
- qreal t = qSqrt(4. / 3. * normalized * flatness / d);
- if (t > 1 || qFuzzyIsNull(t - (qreal)1.))
- break;
- bez.parameterSplitLeft(t, &left);
- p->append(bez.pt1());
- }
-}
-
QBezier QBezier::getSubRange(qreal t0, qreal t1) const
{
QBezier result;
@@ -223,7 +195,7 @@ static inline bool findInflections(qreal a, qreal b, qreal c,
}
-void QBezier::addToPolygon(QPolygonF *polygon) const
+void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold) const
{
QBezier beziers[32];
beziers[0] = *this;
@@ -243,7 +215,7 @@ void QBezier::addToPolygon(QPolygonF *polygon) const
qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
l = 1.;
}
- if (d < flatness*l || b == beziers + 31) {
+ if (d < bezier_flattening_threshold*l || b == beziers + 31) {
// good enough, we pop it off and add the endpoint
polygon->append(QPointF(b->x4, b->y4));
--b;
@@ -255,55 +227,6 @@ void QBezier::addToPolygon(QPolygonF *polygon) const
}
}
-void QBezier::addToPolygonMixed(QPolygonF *polygon) const
-{
- qreal ax = -x1 + 3*x2 - 3*x3 + x4;
- qreal ay = -y1 + 3*y2 - 3*y3 + y4;
- qreal bx = 3*x1 - 6*x2 + 3*x3;
- qreal by = 3*y1 - 6*y2 + 3*y3;
- qreal cx = -3*x1 + 3*x2;
- qreal cy = -3*y1 + 2*y2;
- qreal a = 6 * (ay * bx - ax * by);
- qreal b = 6 * (ay * cx - ax * cy);
- qreal c = 2 * (by * cx - bx * cy);
-
- if ((qFuzzyIsNull(a) && qFuzzyIsNull(b)) ||
- (b * b - 4 * a *c) < 0) {
- QBezier bez(*this);
- flattenBezierWithoutInflections(bez, polygon);
- polygon->append(QPointF(x4, y4));
- } else {
- QBezier beziers[32];
- beziers[0] = *this;
- QBezier *b = beziers;
-
- while (b >= beziers) {
- // check if we can pop the top bezier curve from the stack
- qreal y4y1 = b->y4 - b->y1;
- qreal x4x1 = b->x4 - b->x1;
- qreal l = qAbs(x4x1) + qAbs(y4y1);
- qreal d;
- if (l > 1.) {
- d = qAbs( (x4x1)*(b->y1 - b->y2) - (y4y1)*(b->x1 - b->x2) )
- + qAbs( (x4x1)*(b->y1 - b->y3) - (y4y1)*(b->x1 - b->x3) );
- } else {
- d = qAbs(b->x1 - b->x2) + qAbs(b->y1 - b->y2) +
- qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
- l = 1.;
- }
- if (d < .5*l || b == beziers + 31) {
- // good enough, we pop it off and add the endpoint
- polygon->append(QPointF(b->x4, b->y4));
- --b;
- } else {
- // split, second half of the polygon goes lower into the stack
- b->split(b+1, b);
- ++b;
- }
- }
- }
-}
-
QRectF QBezier::bounds() const
{
qreal xmin = x1;
@@ -824,147 +747,4 @@ QBezier QBezier::bezierOnInterval(qreal t0, qreal t1) const
return result;
}
-
-static inline void bindInflectionPoint(const QBezier &bez, const qreal t,
- qreal *tMinus , qreal *tPlus)
-{
- if (t <= 0) {
- *tMinus = *tPlus = -1;
- return;
- } else if (t >= 1) {
- *tMinus = *tPlus = 2;
- return;
- }
-
- QBezier left, right;
- splitBezierAt(bez, t, &left, &right);
-
- qreal ax = -right.x1 + 3*right.x2 - 3*right.x3 + right.x4;
- qreal ay = -right.y1 + 3*right.y2 - 3*right.y3 + right.y4;
- qreal ex = 3 * (right.x2 - right.x3);
- qreal ey = 3 * (right.y2 - right.y3);
-
- qreal s4 = qAbs(6 * (ey * ax - ex * ay) / qSqrt(ex * ex + ey * ey)) + 0.00001f;
- qreal tf = qPow(qreal(9 * flatness / s4), qreal(1./3.));
- *tMinus = t - (1 - t) * tf;
- *tPlus = t + (1 - t) * tf;
-}
-
-void QBezier::addToPolygonIterative(QPolygonF *p) const
-{
- qreal t1, t2, tcusp;
- qreal t1min, t1plus, t2min, t2plus;
-
- qreal ax = -x1 + 3*x2 - 3*x3 + x4;
- qreal ay = -y1 + 3*y2 - 3*y3 + y4;
- qreal bx = 3*x1 - 6*x2 + 3*x3;
- qreal by = 3*y1 - 6*y2 + 3*y3;
- qreal cx = -3*x1 + 3*x2;
- qreal cy = -3*y1 + 2*y2;
-
- if (findInflections(6 * (ay * bx - ax * by),
- 6 * (ay * cx - ax * cy),
- 2 * (by * cx - bx * cy),
- &t1, &t2, &tcusp)) {
- bindInflectionPoint(*this, t1, &t1min, &t1plus);
- bindInflectionPoint(*this, t2, &t2min, &t2plus);
-
- QBezier tmpBez = *this;
- QBezier left, right, bez1, bez2, bez3;
- if (t1min > 0) {
- if (t1min >= 1) {
- flattenBezierWithoutInflections(tmpBez, p);
- } else {
- splitBezierAt(tmpBez, t1min, &left, &right);
- flattenBezierWithoutInflections(left, p);
- p->append(tmpBez.pointAt(t1min));
-
- if (t2min < t1plus) {
- if (tcusp < 1) {
- p->append(tmpBez.pointAt(tcusp));
- }
- if (t2plus < 1) {
- splitBezierAt(tmpBez, t2plus, &left, &right);
- flattenBezierWithoutInflections(right, p);
- }
- } else if (t1plus < 1) {
- if (t2min < 1) {
- splitBezierAt(tmpBez, t2min, &bez3, &right);
- splitBezierAt(bez3, t1plus, &left, &bez2);
-
- flattenBezierWithoutInflections(bez2, p);
- p->append(tmpBez.pointAt(t2min));
-
- if (t2plus < 1) {
- splitBezierAt(tmpBez, t2plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- } else {
- splitBezierAt(tmpBez, t1plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- }
- }
- } else if (t1plus > 0) {
- p->append(QPointF(x1, y1));
- if (t2min < t1plus) {
- if (tcusp < 1) {
- p->append(tmpBez.pointAt(tcusp));
- }
- if (t2plus < 1) {
- splitBezierAt(tmpBez, t2plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- } else if (t1plus < 1) {
- if (t2min < 1) {
- splitBezierAt(tmpBez, t2min, &bez3, &right);
- splitBezierAt(bez3, t1plus, &left, &bez2);
-
- flattenBezierWithoutInflections(bez2, p);
-
- p->append(tmpBez.pointAt(t2min));
- if (t2plus < 1) {
- splitBezierAt(tmpBez, t2plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- } else {
- splitBezierAt(tmpBez, t1plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- }
- } else if (t2min > 0) {
- if (t2min < 1) {
- splitBezierAt(tmpBez, t2min, &bez1, &right);
- flattenBezierWithoutInflections(bez1, p);
- p->append(tmpBez.pointAt(t2min));
-
- if (t2plus < 1) {
- splitBezierAt(tmpBez, t2plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- } else {
- //### in here we should check whether the area of the
- // triangle formed between pt1/pt2/pt3 is smaller
- // or equal to 0 and then do iterative flattening
- // if not we should fallback and do the recursive
- // flattening.
- flattenBezierWithoutInflections(tmpBez, p);
- }
- } else if (t2plus > 0) {
- p->append(QPointF(x1, y1));
- if (t2plus < 1) {
- splitBezierAt(tmpBez, t2plus, &left, &bez2);
- flattenBezierWithoutInflections(bez2, p);
- }
- } else {
- flattenBezierWithoutInflections(tmpBez, p);
- }
- } else {
- QBezier bez = *this;
- flattenBezierWithoutInflections(bez, p);
- }
-
- p->append(QPointF(x4, y4));
-}
-
QT_END_NAMESPACE
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h
index 846635f..18ec116 100644
--- a/src/gui/painting/qbezier_p.h
+++ b/src/gui/painting/qbezier_p.h
@@ -79,10 +79,9 @@ public:
inline QPointF derivedAt(qreal t) const;
inline QPointF secondDerivedAt(qreal t) const;
- QPolygonF toPolygon() const;
- void addToPolygon(QPolygonF *p) const;
- void addToPolygonIterative(QPolygonF *p) const;
- void addToPolygonMixed(QPolygonF *p) const;
+ QPolygonF toPolygon(qreal bezier_flattening_threshold = 0.5) const;
+ void addToPolygon(QPolygonF *p, qreal bezier_flattening_threshold = 0.5) const;
+
QRectF bounds() const;
qreal length(qreal error = 0.01) const;
void addIfClose(qreal *length, qreal error) const;
diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h
index bc5f1ef..8f8544f 100644
--- a/src/gui/painting/qdatabuffer_p.h
+++ b/src/gui/painting/qdatabuffer_p.h
@@ -60,16 +60,20 @@ QT_BEGIN_NAMESPACE
template <typename Type> class QDataBuffer
{
public:
- QDataBuffer(int res = 64)
+ QDataBuffer(int res)
{
capacity = res;
- buffer = (Type*) qMalloc(capacity * sizeof(Type));
+ if (res)
+ buffer = (Type*) qMalloc(capacity * sizeof(Type));
+ else
+ buffer = 0;
siz = 0;
}
~QDataBuffer()
{
- qFree(buffer);
+ if (buffer)
+ qFree(buffer);
}
inline void reset() { siz = 0; }
@@ -104,6 +108,8 @@ public:
inline void reserve(int size) {
if (size > capacity) {
+ if (capacity == 0)
+ capacity = 1;
while (capacity < size)
capacity *= 2;
buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
@@ -112,7 +118,12 @@ public:
inline void shrink(int size) {
capacity = size;
- buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
+ if (size)
+ buffer = (Type*) qRealloc(buffer, capacity * sizeof(Type));
+ else {
+ qFree(buffer);
+ buffer = 0;
+ }
}
inline void swap(QDataBuffer<Type> &other) {
diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp
index a62f06b..ef9b18c 100644
--- a/src/gui/painting/qdrawutil.cpp
+++ b/src/gui/painting/qdrawutil.cpp
@@ -1137,6 +1137,15 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin
xTarget.resize(columns + 1);
yTarget.resize(rows + 1);
+ bool oldAA = painter->testRenderHint(QPainter::Antialiasing);
+ bool oldSmooth = painter->testRenderHint(QPainter::SmoothPixmapTransform);
+ if (painter->paintEngine()->type() != QPaintEngine::OpenGL
+ && painter->paintEngine()->type() != QPaintEngine::OpenGL2
+ && (oldSmooth || oldAA) && painter->combinedTransform().type() != QTransform::TxNone) {
+ painter->setRenderHint(QPainter::Antialiasing, false);
+ painter->setRenderHint(QPainter::SmoothPixmapTransform, false);
+ }
+
xTarget[0] = targetRect.left();
xTarget[1] = targetCenterLeft;
xTarget[columns - 1] = targetCenterRight;
@@ -1342,6 +1351,11 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin
painter->drawPixmapFragments(opaqueData.data(), opaqueData.size(), pixmap, QPainter::OpaqueHint);
if (translucentData.size())
painter->drawPixmapFragments(translucentData.data(), translucentData.size(), pixmap);
+
+ if (oldAA)
+ painter->setRenderHint(QPainter::Antialiasing, true);
+ if (oldSmooth)
+ painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index ad0c2eb..1b01960 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -154,7 +154,8 @@ QT_FT_Outline *QOutlineMapper::convertPath(const QVectorPath &path)
// ### We can kill this copying and just use the buffer straight...
m_elements.resize(count);
- memcpy(m_elements.data(), path.points(), count* sizeof(QPointF));
+ if (count)
+ memcpy(m_elements.data(), path.points(), count* sizeof(QPointF));
m_element_types.resize(0);
}
diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h
index d0ce1a9..39b7593 100644
--- a/src/gui/painting/qoutlinemapper_p.h
+++ b/src/gui/painting/qoutlinemapper_p.h
@@ -87,8 +87,15 @@ const int QT_RASTER_COORD_LIMIT = 32767;
class QOutlineMapper
{
public:
- QOutlineMapper()
- : m_round_coords(false)
+ QOutlineMapper() :
+ m_element_types(0),
+ m_elements(0),
+ m_elements_dev(0),
+ m_points(0),
+ m_tags(0),
+ m_contours(0),
+ m_polygon_dev(0),
+ m_round_coords(false)
{
}
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 9148ac2..6f395f6 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -251,6 +251,11 @@ static void qt_debug_path(const QPainterPath &path)
}
#endif
+QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() :
+ QPaintEngineExPrivate(),
+ cachedLines(0)
+{
+}
/*!
@@ -336,17 +341,6 @@ void QRasterPaintEngine::init()
d->hdc = 0;
#endif
- d->rasterPoolSize = 8192;
- d->rasterPoolBase =
-#if defined(Q_WS_WIN64)
- // We make use of setjmp and longjmp in qgrayraster.c which requires
- // 16-byte alignment, hence we hardcode this requirement here..
- (unsigned char *) _aligned_malloc(d->rasterPoolSize, sizeof(void*) * 2);
-#else
- (unsigned char *) malloc(d->rasterPoolSize);
-#endif
- Q_CHECK_PTR(d->rasterPoolBase);
-
// The antialiasing raster.
d->grayRaster.reset(new QT_FT_Raster);
Q_CHECK_PTR(d->grayRaster.data());
@@ -354,8 +348,6 @@ void QRasterPaintEngine::init()
QT_THROW(std::bad_alloc()); // an error creating the raster is caused by a bad malloc
- qt_ft_grays_raster.raster_reset(*d->grayRaster.data(), d->rasterPoolBase, d->rasterPoolSize);
-
d->rasterizer.reset(new QRasterizer);
d->rasterBuffer.reset(new QRasterBuffer());
d->outlineMapper.reset(new QOutlineMapper);
@@ -437,12 +429,6 @@ QRasterPaintEngine::~QRasterPaintEngine()
{
Q_D(QRasterPaintEngine);
-#if defined(Q_WS_WIN64)
- _aligned_free(d->rasterPoolBase);
-#else
- free(d->rasterPoolBase);
-#endif
-
qt_ft_grays_raster.raster_done(*d->grayRaster.data());
}
@@ -4090,6 +4076,22 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
return;
}
+ const int rasterPoolInitialSize = 8192;
+ int rasterPoolSize = rasterPoolInitialSize;
+ unsigned char *rasterPoolBase;
+#if defined(Q_WS_WIN64)
+ rasterPoolBase =
+ // We make use of setjmp and longjmp in qgrayraster.c which requires
+ // 16-byte alignment, hence we hardcode this requirement here..
+ (unsigned char *) _aligned_malloc(rasterPoolSize, sizeof(void*) * 2);
+#else
+ unsigned char rasterPoolOnStack[rasterPoolInitialSize];
+ rasterPoolBase = rasterPoolOnStack;
+#endif
+ Q_CHECK_PTR(rasterPoolBase);
+
+ qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);
+
void *data = userData;
QT_FT_BBox clip_box = { deviceRect.x(),
@@ -4122,13 +4124,14 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
int new_size = rasterPoolSize * 2;
if (new_size > 1024 * 1024) {
qWarning("QPainter: Rasterization of primitive failed");
- return;
+ break;
}
#if defined(Q_WS_WIN64)
_aligned_free(rasterPoolBase);
#else
- free(rasterPoolBase);
+ if (rasterPoolBase != rasterPoolOnStack) // initially on the stack
+ free(rasterPoolBase);
#endif
rasterPoolSize = new_size;
@@ -4149,6 +4152,13 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
done = true;
}
}
+
+#if defined(Q_WS_WIN64)
+ _aligned_free(rasterPoolBase);
+#else
+ if (rasterPoolBase != rasterPoolOnStack) // initially on the stack
+ free(rasterPoolBase);
+#endif
}
void QRasterPaintEnginePrivate::recalculateFastImages()
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 55eb82e..1016f8d 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -300,6 +300,7 @@ QRasterPaintEnginePrivate : public QPaintEngineExPrivate
{
Q_DECLARE_PUBLIC(QRasterPaintEngine)
public:
+ QRasterPaintEnginePrivate();
void rasterizeLine_dashed(QLineF line, qreal width,
int *dashIndex, qreal *dashOffset, bool *inDash);
@@ -354,8 +355,6 @@ public:
QScopedPointer<QDashStroker> dashStroker;
QScopedPointer<QT_FT_Raster> grayRaster;
- unsigned long rasterPoolSize;
- unsigned char *rasterPoolBase;
QDataBuffer<QLineF> cachedLines;
QSpanData image_filler;
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index da48fcb..aef8b80 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -315,7 +315,7 @@ static Picture getPatternFill(int screen, const QBrush &b)
return X11->pattern_fills[i].picture;
}
// none found, replace one
- int i = rand() % 16;
+ int i = qrand() % 16;
if (X11->pattern_fills[i].screen != screen && X11->pattern_fills[i].picture) {
XRenderFreePicture (X11->display, X11->pattern_fills[i].picture);
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index a78cafb..ff82d59 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -149,6 +149,7 @@ QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path)
struct StrokeHandler {
+ StrokeHandler(int reserve) : pts(reserve), types(reserve) {}
QDataBuffer<qreal> pts;
QDataBuffer<QPainterPath::ElementType> types;
};
@@ -394,7 +395,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
return;
if (!d->strokeHandler) {
- d->strokeHandler = new StrokeHandler;
+ d->strokeHandler = new StrokeHandler(path.elementCount()+4);
d->stroker.setMoveToHook(qpaintengineex_moveTo);
d->stroker.setLineToHook(qpaintengineex_lineTo);
d->stroker.setCubicToHook(qpaintengineex_cubicTo);
@@ -460,6 +461,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
// change the current transform. Normal transformed,
// non-cosmetic pens will be transformed as part of fill
// later, so they are also covered here..
+ d->activeStroker->setCurveThresholdFromTransform(state()->matrix);
d->activeStroker->begin(d->strokeHandler);
if (types) {
while (points < lastPoint) {
@@ -517,6 +519,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());
d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform());
} else {
+ d->activeStroker->setCurveThresholdFromTransform(state()->matrix);
d->activeStroker->begin(d->strokeHandler);
if (types) {
while (points < lastPoint) {
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index c910024..78553c9 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -278,7 +278,8 @@ private:
};
SegmentTree::SegmentTree(QPathSegments &segments)
- : m_segments(segments)
+ : m_segments(segments),
+ m_intersections(0)
{
m_bounds.x1 = qt_inf();
m_bounds.y1 = qt_inf();
@@ -806,7 +807,7 @@ void QWingedEdge::intersectAndAdd()
for (int i = 0; i < m_segments.points(); ++i)
addVertex(m_segments.pointAt(i));
- QDataBuffer<QPathSegments::Intersection> intersections;
+ QDataBuffer<QPathSegments::Intersection> intersections(m_segments.segments());
for (int i = 0; i < m_segments.segments(); ++i) {
intersections.reset();
@@ -857,11 +858,17 @@ void QWingedEdge::intersectAndAdd()
}
}
-QWingedEdge::QWingedEdge()
+QWingedEdge::QWingedEdge() :
+ m_edges(0),
+ m_vertices(0),
+ m_segments(0)
{
}
-QWingedEdge::QWingedEdge(const QPainterPath &subject, const QPainterPath &clip)
+QWingedEdge::QWingedEdge(const QPainterPath &subject, const QPainterPath &clip) :
+ m_edges(subject.length()),
+ m_vertices(subject.length()),
+ m_segments(subject.length())
{
m_segments.setPath(subject);
m_segments.addPath(clip);
@@ -1414,9 +1421,9 @@ bool QPathClipper::intersect()
else if (clipIsRect)
return subjectPath.intersects(r2);
- QPathSegments a;
+ QPathSegments a(subjectPath.length());
a.setPath(subjectPath);
- QPathSegments b;
+ QPathSegments b(clipPath.length());
b.setPath(clipPath);
QIntersectionFinder finder;
@@ -1459,9 +1466,9 @@ bool QPathClipper::contains()
if (clipIsRect)
return subjectPath.contains(r2);
- QPathSegments a;
+ QPathSegments a(subjectPath.length());
a.setPath(subjectPath);
- QPathSegments b;
+ QPathSegments b(clipPath.length());
b.setPath(clipPath);
QIntersectionFinder finder;
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index 7962400..fab618d 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -199,7 +199,7 @@ public:
};
- QPathSegments();
+ QPathSegments(int reserve);
void setPath(const QPainterPath &path);
void addPath(const QPainterPath &path);
@@ -345,7 +345,10 @@ inline QPathVertex::operator QPointF() const
return QPointF(x, y);
}
-inline QPathSegments::QPathSegments()
+inline QPathSegments::QPathSegments(int reserve) :
+ m_points(reserve),
+ m_segments(reserve),
+ m_intersections(reserve)
{
}
diff --git a/src/gui/painting/qpolygonclipper_p.h b/src/gui/painting/qpolygonclipper_p.h
index 1b4cbb3..cdaac1c 100644
--- a/src/gui/painting/qpolygonclipper_p.h
+++ b/src/gui/painting/qpolygonclipper_p.h
@@ -62,7 +62,8 @@ QT_BEGIN_NAMESPACE
template <typename InType, typename OutType, typename CastType> class QPolygonClipper
{
public:
- QPolygonClipper()
+ QPolygonClipper() :
+ buffer1(0), buffer2(0)
{
x1 = y1 = x2 = y2 = 0;
}
diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp
index b8bf15e..2955e39 100644
--- a/src/gui/painting/qprintengine_pdf.cpp
+++ b/src/gui/painting/qprintengine_pdf.cpp
@@ -931,29 +931,16 @@ void QPdfEnginePrivate::writeHeader()
void QPdfEnginePrivate::writeInfo()
{
info = addXrefEntry(-1);
-
- // The 'text string' type in PDF is encoded either as PDFDocEncoding, or
- // Unicode UTF-16 with a Unicode byte order mark as the first character
- // (0xfeff), with the high-order byte first.
- QByteArray array("<<\n/Title (\xfe\xff");
- const ushort *utf16Title = title.utf16();
- for (int i=0; i < title.size(); ++i) {
- array.append((*(utf16Title + i)) >> 8);
- array.append((*(utf16Title + i)) & 0xff);
- }
- array.append(")\n/Creator (\xfe\xff");
- const ushort *utf16Creator = creator.utf16();
- for (int i=0; i < creator.size(); ++i) {
- array.append((*(utf16Creator + i)) >> 8);
- array.append((*(utf16Creator + i)) & 0xff);
- }
- array.append(")\n/Producer (Qt " QT_VERSION_STR " (C) 2010 Nokia Corporation and/or its subsidiary(-ies))\n");
- write(array);
-
+ xprintf("<<\n/Title ");
+ printString(title);
+ xprintf("\n/Creator ");
+ printString(creator);
+ xprintf("\n/Producer ");
+ printString(QString::fromLatin1("Qt " QT_VERSION_STR " (C) 2010 Nokia Corporation and/or its subsidiary(-ies)"));
QDateTime now = QDateTime::currentDateTime().toUTC();
QTime t = now.time();
QDate d = now.date();
- xprintf("/CreationDate (D:%d%02d%02d%02d%02d%02d)\n",
+ xprintf("\n/CreationDate (D:%d%02d%02d%02d%02d%02d)\n",
d.year(),
d.month(),
d.day(),
@@ -1230,6 +1217,25 @@ int QPdfEnginePrivate::addXrefEntry(int object, bool printostr)
return object;
}
+void QPdfEnginePrivate::printString(const QString &string) {
+ // The 'text string' type in PDF is encoded either as PDFDocEncoding, or
+ // Unicode UTF-16 with a Unicode byte order mark as the first character
+ // (0xfeff), with the high-order byte first.
+ QByteArray array("(\xfe\xff");
+ const ushort *utf16 = string.utf16();
+
+ for (int i=0; i < string.size(); ++i) {
+ char part[2] = {char((*(utf16 + i)) >> 8), char((*(utf16 + i)) & 0xff)};
+ for(int j=0; j < 2; ++j) {
+ if (part[j] == '(' || part[j] == ')' || part[j] == '\\')
+ array.append('\\');
+ array.append(part[j]);
+ }
+ }
+ array.append(")");
+ write(array);
+}
+
QT_END_NAMESPACE
#endif // QT_NO_PRINTER
diff --git a/src/gui/painting/qprintengine_pdf_p.h b/src/gui/painting/qprintengine_pdf_p.h
index cb6c59d..e0ca56f 100644
--- a/src/gui/painting/qprintengine_pdf_p.h
+++ b/src/gui/painting/qprintengine_pdf_p.h
@@ -170,6 +170,7 @@ private:
void writePage();
int addXrefEntry(int object, bool printostr = true);
+ void printString(const QString &string);
void xprintf(const char* fmt, ...);
inline void write(const QByteArray &data) {
stream->writeRawData(data.constData(), data.size());
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 51d01c9..f8f8afb 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -198,9 +198,11 @@ public:
};
QScanConverter::QScanConverter()
- : m_alloc(0)
+ : m_lines(0)
+ , m_alloc(0)
, m_size(0)
, m_intersections(0)
+ , m_active(0)
{
}
@@ -310,6 +312,10 @@ struct QBoolToType
template <typename T>
void qScanConvert(QScanConverter &d, T allVertical)
{
+ if (!d.m_lines.size()) {
+ d.m_active.reset();
+ return;
+ }
qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder));
int line = 0;
for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) {
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index e43544c..eabbd8a 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -120,8 +120,8 @@ private:
class QSubpathFlatIterator
{
public:
- QSubpathFlatIterator(const QDataBuffer<QStrokerOps::Element> *path)
- : m_path(path), m_pos(0), m_curve_index(-1) { }
+ QSubpathFlatIterator(const QDataBuffer<QStrokerOps::Element> *path, qreal threshold)
+ : m_path(path), m_pos(0), m_curve_index(-1), m_curve_threshold(threshold) { }
inline bool hasNext() const { return m_curve_index >= 0 || m_pos < m_path->size(); }
@@ -152,7 +152,7 @@ public:
QPointF(qt_fixed_to_real(m_path->at(m_pos+1).x),
qt_fixed_to_real(m_path->at(m_pos+1).y)),
QPointF(qt_fixed_to_real(m_path->at(m_pos+2).x),
- qt_fixed_to_real(m_path->at(m_pos+2).y))).toPolygon();
+ qt_fixed_to_real(m_path->at(m_pos+2).y))).toPolygon(m_curve_threshold);
m_curve_index = 1;
e.type = QPainterPath::LineToElement;
e.x = m_curve.at(0).x();
@@ -169,6 +169,7 @@ private:
int m_pos;
QPolygonF m_curve;
int m_curve_index;
+ qreal m_curve_threshold;
};
template <class Iterator> bool qt_stroke_side(Iterator *it, QStroker *stroker,
@@ -187,7 +188,12 @@ static inline qreal adapted_angle_on_x(const QLineF &line)
}
QStrokerOps::QStrokerOps()
- : m_customData(0), m_moveTo(0), m_lineTo(0), m_cubicTo(0)
+ : m_elements(0)
+ , m_curveThreshold(qt_real_to_fixed(0.25))
+ , m_customData(0)
+ , m_moveTo(0)
+ , m_lineTo(0)
+ , m_cubicTo(0)
{
}
@@ -195,7 +201,6 @@ QStrokerOps::~QStrokerOps()
{
}
-
/*!
Prepares the stroker. Call this function once before starting a
stroke by calling moveTo, lineTo or cubicTo.
@@ -238,6 +243,7 @@ void QStrokerOps::strokePath(const QPainterPath &path, void *customData, const Q
if (path.isEmpty())
return;
+ setCurveThresholdFromTransform(matrix);
begin(customData);
int count = path.elementCount();
if (matrix.isIdentity()) {
@@ -308,6 +314,8 @@ void QStrokerOps::strokePolygon(const QPointF *points, int pointCount, bool impl
{
if (!pointCount)
return;
+
+ setCurveThresholdFromTransform(matrix);
begin(data);
if (matrix.isIdentity()) {
moveTo(qt_real_to_fixed(points[0].x()), qt_real_to_fixed(points[0].y()));
@@ -348,6 +356,7 @@ void QStrokerOps::strokeEllipse(const QRectF &rect, void *data, const QTransform
}
}
+ setCurveThresholdFromTransform(matrix);
begin(data);
moveTo(qt_real_to_fixed(start.x()), qt_real_to_fixed(start.y()));
for (int i=0; i<12; i+=3) {
@@ -366,12 +375,10 @@ QStroker::QStroker()
{
m_strokeWidth = qt_real_to_fixed(1);
m_miterLimit = qt_real_to_fixed(2);
- m_curveThreshold = qt_real_to_fixed(0.25);
}
QStroker::~QStroker()
{
-
}
Qt::PenCapStyle QStroker::capForJoinMode(LineJoinMode mode)
@@ -1135,7 +1142,7 @@ void QDashStroker::processCurrentSubpath()
QPainterPath dashPath;
- QSubpathFlatIterator it(&m_elements);
+ QSubpathFlatIterator it(&m_elements, m_curveThreshold);
qfixed2d prev = it.next();
bool clipping = !m_clip_rect.isEmpty();
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index 3e622a8..d646135 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -124,6 +124,9 @@ typedef void (*qStrokerCubicToHook)(qfixed c1x, qfixed c1y,
qfixed ex, qfixed ey,
void *data);
+// qtransform.cpp
+Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
+
class Q_GUI_EXPORT QStrokerOps
{
public:
@@ -161,6 +164,16 @@ public:
QRectF clipRect() const { return m_clip_rect; }
void setClipRect(const QRectF &clip) { m_clip_rect = clip; }
+ void setCurveThresholdFromTransform(const QTransform &transform)
+ {
+ qreal scale;
+ qt_scaleForTransform(transform, &scale);
+ setCurveThreshold(scale == 0 ? qreal(0.5) : (qreal(0.5) / scale));
+ }
+
+ void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
+ qfixed curveThreshold() const { return m_curveThreshold; }
+
protected:
inline void emitMoveTo(qfixed x, qfixed y);
inline void emitLineTo(qfixed x, qfixed y);
@@ -170,6 +183,7 @@ protected:
QDataBuffer<Element> m_elements;
QRectF m_clip_rect;
+ qfixed m_curveThreshold;
void *m_customData;
qStrokerMoveToHook m_moveTo;
@@ -208,9 +222,6 @@ public:
void setMiterLimit(qfixed length) { m_miterLimit = length; }
qfixed miterLimit() const { return m_miterLimit; }
- void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
- qfixed curveThreshold() const { return m_curveThreshold; }
-
void joinPoints(qfixed x, qfixed y, const QLineF &nextLine, LineJoinMode join);
inline void emitMoveTo(qfixed x, qfixed y);
inline void emitLineTo(qfixed x, qfixed y);
@@ -227,7 +238,6 @@ protected:
qfixed m_strokeWidth;
qfixed m_miterLimit;
- qfixed m_curveThreshold;
LineJoinMode m_capStyle;
LineJoinMode m_joinStyle;
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index 390fe51..a818978 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -125,7 +125,7 @@ protected:
};
-class QImageTextureGlyphCache : public QTextureGlyphCache
+class Q_GUI_EXPORT QImageTextureGlyphCache : public QTextureGlyphCache
{
public:
QImageTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix)
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 80b7520..aaa241f 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1545,12 +1545,19 @@ static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transfor
return true;
}
+Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
static inline bool cubicTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, const QPointF &c, const QPointF &d, bool needsMoveTo)
{
// Convert projective xformed curves to line
// segments so they can be transformed more accurately
- QPolygonF segment = QBezier::fromPoints(a, b, c, d).toPolygon();
+
+ qreal scale;
+ qt_scaleForTransform(transform, &scale);
+
+ qreal curveThreshold = scale == 0 ? qreal(0.25) : (qreal(0.25) / scale);
+
+ QPolygonF segment = QBezier::fromPoints(a, b, c, d).toPolygon(curveThreshold);
for (int i = 0; i < segment.size() - 1; ++i)
if (lineTo_clipped(path, transform, segment.at(i), segment.at(i+1), needsMoveTo))
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index 0f39b23..d9f7df0 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -1397,7 +1397,6 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
dark.lighter(135), 60);
QColor highlight = option->palette.highlight().color();
- QColor highlightText = option->palette.highlightedText().color();
switch(element) {
case CE_RadioButton: //fall through
@@ -2723,7 +2722,6 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
{
// Fill title bar gradient
QColor titlebarColor = QColor(active ? highlight: palette.background().color());
- QColor titleBarGradientStop(active ? highlight.darker(150): palette.background().color().darker(120));
QLinearGradient gradient(option->rect.center().x(), option->rect.top(),
option->rect.center().x(), option->rect.bottom());
@@ -2986,7 +2984,6 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
painter->fillRect(option->rect, option->palette.background());
- QRect rect = scrollBar->rect;
QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget);
QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget);
QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget);
@@ -3714,6 +3711,9 @@ int QCleanlooksStyle::pixelMetric(PixelMetric metric, const QStyleOption *option
{
int ret = -1;
switch (metric) {
+ case PM_ToolTipLabelFrameWidth:
+ ret = 2;
+ break;
case PM_ButtonDefaultIndicator:
ret = 0;
break;
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 9c61023..6c8d561 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -1163,7 +1163,6 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
if (const QStyleOptionTabBarBase *tbb
= qstyleoption_cast<const QStyleOptionTabBarBase *>(option)) {
QRect tabRect = tbb->rect;
- QRegion region(tabRect);
painter->save();
painter->setPen(QPen(option->palette.dark().color().dark(110), 0));
switch (tbb->shape) {
@@ -1245,8 +1244,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
else
alphaCornerColor = mergedColors(option->palette.background().color(), darkOutline);
- QPalette palette = option->palette;
-
switch (control) {
case CC_TitleBar:
@@ -1333,11 +1330,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
bool isEnabled = (comboBox->state & State_Enabled);
bool focus = isEnabled && (comboBox->state & State_HasFocus);
- QColor buttonShadow = option->palette.dark().color();
GtkStateType state = gtkPainter.gtkState(option);
int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget);
- QPixmap cache;
- QString pixmapName;
QStyleOptionComboBox comboBoxCopy = *comboBox;
comboBoxCopy.rect = option->rect;
@@ -1345,8 +1339,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
QRect rect = option->rect;
QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy,
SC_ComboBoxArrow, widget);
- QRect editRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy,
- SC_ComboBoxEditField, widget);
GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ?
GTK_SHADOW_IN : GTK_SHADOW_OUT;
@@ -1414,9 +1406,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
else if (option->state & State_MouseOver && comboBox->activeSubControls & SC_ComboBoxArrow)
buttonState = GTK_STATE_PRELIGHT;
- QRect buttonrect = QRect(gtkToggleButton->allocation.x, gtkToggleButton->allocation.y,
- gtkToggleButton->allocation.width, gtkToggleButton->allocation.height);
-
Q_ASSERT(gtkToggleButton);
gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState,
shadow, gtkToggleButton->style, buttonPath.toString() +
@@ -1436,8 +1425,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (focus)
GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);
- QHashableLatin1Literal buttonPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
- : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
// Draw the separator between label and arrows
QHashableLatin1Literal vSeparatorPath = comboBox->editable
@@ -1643,6 +1630,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
style = scrollbarWidget->style;
gboolean trough_under_steppers = true;
gboolean trough_side_details = false;
+ gboolean activate_slider = false;
gboolean stepper_size = 14;
gint trough_border = 1;
if (!d->gtk_check_version(2, 10, 0)) {
@@ -1650,6 +1638,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
"trough-border", &trough_border,
"trough-side-details", &trough_side_details,
"trough-under-steppers", &trough_under_steppers,
+ "activate-slider", &activate_slider,
"stepper-size", &stepper_size, NULL);
}
if (trough_under_steppers) {
@@ -1695,6 +1684,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (!(option->state & State_Enabled))
state = GTK_STATE_INSENSITIVE;
+ else if (activate_slider &&
+ option->state & State_Sunken && (scrollBar->activeSubControls & SC_ScrollBarSlider))
+ state = GTK_STATE_ACTIVE;
else if (option->state & State_MouseOver && (scrollBar->activeSubControls & SC_ScrollBarSlider))
state = GTK_STATE_PRELIGHT;
@@ -1932,14 +1924,11 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget);
QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget);
- QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget);
bool horizontal = slider->orientation == Qt::Horizontal;
bool ticksAbove = slider->tickPosition & QSlider::TicksAbove;
bool ticksBelow = slider->tickPosition & QSlider::TicksBelow;
- QColor activeHighlight = option->palette.color(QPalette::Normal, QPalette::Highlight);
- QPixmap cache;
QBrush oldBrush = painter->brush();
QPen oldPen = painter->pen();
@@ -1948,6 +1937,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
QColor highlightAlpha(Qt::white);
highlightAlpha.setAlpha(80);
+ QGtkStylePrivate::gtk_widget_set_direction(hScaleWidget, slider->upsideDown ?
+ GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
GtkWidget *scaleWidget = horizontal ? hScaleWidget : vScaleWidget;
style = scaleWidget->style;
@@ -1981,11 +1972,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
QRect lowerGroove = grooveRect;
if (horizontal) {
- upperGroove.setLeft(handle.center().x());
- lowerGroove.setRight(handle.center().x());
+ if (slider->upsideDown) {
+ lowerGroove.setLeft(handle.center().x());
+ upperGroove.setRight(handle.center().x());
+ } else {
+ upperGroove.setLeft(handle.center().x());
+ lowerGroove.setRight(handle.center().x());
+ }
} else {
- upperGroove.setBottom(handle.center().y());
- lowerGroove.setTop(handle.center().y());
+ if (!slider->upsideDown) {
+ lowerGroove.setBottom(handle.center().y());
+ upperGroove.setTop(handle.center().y());
+ } else {
+ upperGroove.setBottom(handle.center().y());
+ lowerGroove.setTop(handle.center().y());
+ }
}
gtkPainter.paintBox( scaleWidget, "trough-upper", upperGroove, state,
@@ -2543,7 +2544,6 @@ void QGtkStyle::drawControl(ControlElement element,
d->gtkWidget("GtkMenu.GtkMenuItem");
style = gtkPainter.getStyle(gtkMenuItem);
- QColor borderColor = option->palette.background().color().darker(160);
QColor shadow = option->palette.dark().color();
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
@@ -2768,8 +2768,6 @@ void QGtkStyle::drawControl(ControlElement element,
// Arrow
if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow
- QPoint buttonShift(pixelMetric(PM_ButtonShiftHorizontal, option, widget),
- proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget));
QFontMetrics fm(menuitem->font);
int arrow_size = fm.ascent() + fm.descent() - 2 * gtkMenuItem->style->ythickness;
@@ -3116,7 +3114,6 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
case CC_ComboBox:
if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
// We employ the gtk widget to position arrows and separators for us
- QString comboBoxPath = box->editable ? QLS("GtkComboBoxEntry") : QLS("GtkComboBox");
GtkWidget *gtkCombo = box->editable ? d->gtkWidget("GtkComboBoxEntry")
: d->gtkWidget("GtkComboBox");
d->gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index f5b0b0c..e065bcc 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -97,6 +97,7 @@
#include <qdebug.h>
#include <qlibrary.h>
#include <qdatetimeedit.h>
+#include <qmath.h>
#include <QtGui/qgraphicsproxywidget.h>
#include <QtGui/qgraphicsview.h>
#include <private/qt_cocoa_helpers_mac_p.h>
@@ -2142,6 +2143,9 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
// The combo box popup has no frame.
if (qstyleoption_cast<const QStyleOptionComboBox *>(opt) != 0)
ret = 0;
+ // Frame of mac style line edits is two pixels on top and one on the bottom
+ else if (qobject_cast<const QLineEdit *>(widget) != 0)
+ ret = 2;
else
ret = 1;
break;
@@ -5437,14 +5441,12 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
CGFloat height;
QCFString groupText = qt_mac_removeMnemonics(groupBox->text);
HIThemeGetTextDimensions(groupText, 0, &tti, &width, &height, 0);
- tw = int(width);
- h = int(height);
+ tw = qRound(width);
+ h = qCeil(height);
} else {
- QFontMetrics fm = groupBox->fontMetrics;
- if (!checkable && !fontIsSet)
- fm = QFontMetrics(qt_app_fonts_hash()->value("QSmallFont", QFont()));
- h = fm.height();
- tw = fm.size(Qt::TextShowMnemonic, groupBox->text).width();
+ QFontMetricsF fm = QFontMetricsF(groupBox->fontMetrics);
+ h = qCeil(fm.height());
+ tw = qCeil(fm.size(Qt::TextShowMnemonic, groupBox->text).width());
}
ret.setHeight(h);
@@ -5491,10 +5493,10 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
fm = QFontMetrics(qt_app_fonts_hash()->value("QSmallFont", QFont()));
yOffset = 5;
if (hasNoText)
- yOffset = -fm.height();
+ yOffset = -qCeil(QFontMetricsF(fm).height());
}
- ret = opt->rect.adjusted(0, fm.height() + yOffset, 0, 0);
+ ret = opt->rect.adjusted(0, qCeil(QFontMetricsF(fm).height()) + yOffset, 0, 0);
if (sc == SC_GroupBoxContents)
ret.adjust(3, 3, -3, -4); // guess
}
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 55aa6b0..46de9ef 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -50,17 +50,17 @@
#include "qapplication.h"
#include <w32std.h>
-#include <AknsConstants.h>
+#include <aknsconstants.h>
#include <aknconsts.h>
-#include <AknsItemID.h>
-#include <AknsUtils.h>
-#include <AknsDrawUtils.h>
-#include <AknsSkinInstance.h>
-#include <AknsBasicBackgroundControlContext.h>
+#include <aknsitemid.h>
+#include <aknsutils.h>
+#include <aknsdrawutils.h>
+#include <aknsskininstance.h>
+#include <aknsbasicbackgroundcontrolcontext.h>
#include <avkon.mbg>
#include <aknfontaccess.h>
#include <aknlayoutfont.h>
-#include <AknUtils.h>
+#include <aknutils.h>
#include <aknnavi.h>
#include <gulicon.h>
#include <aknbitmapanimation.h>
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index 5084442..f920032 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -170,7 +170,12 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) {
SOURCES += styles/qs60style.cpp
symbian {
SOURCES += styles/qs60style_s60.cpp
- LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils -legul -lbmpanim
+ LIBS += -legul -lbmpanim
+ contains(CONFIG, is_using_gnupoc) {
+ LIBS += -laknicon -laknskins -laknskinsrv -lfontutils
+ } else {
+ LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils
+ }
} else {
SOURCES += styles/qs60style_simulated.cpp
RESOURCES += styles/qstyle_s60_simulated.qrc
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index afba678..c7a9756 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1947,7 +1947,7 @@ QVariant QTextDocument::loadResource(int type, const QUrl &name)
#endif
// handle data: URLs
- if (r.isNull() && name.scheme() == QLatin1String("data"))
+ if (r.isNull() && name.scheme().compare(QLatin1String("data"), Qt::CaseInsensitive) == 0)
r = qDecodeDataUrl(name).second;
// if resource was not loaded try to load it here
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 5054b66..d92148f 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -389,7 +389,7 @@ struct Q_AUTOTEST_EXPORT QScriptLine
mutable uint gridfitted : 1;
uint hasTrailingSpaces : 1;
uint leadingIncluded : 1;
- QFixed height() const { return ascent + descent + 1
+ QFixed height() const { return (ascent + descent).ceil() + 1
+ (leadingIncluded? qMax(QFixed(),leading) : QFixed()); }
QFixed base() const { return ascent
+ (leadingIncluded ? qMax(QFixed(),leading) : QFixed()); }
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 8e7ec80..05fe744 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -873,7 +873,7 @@ void QCompleterPrivate::showPopup(const QRect& rect)
const QRect screen = QApplication::desktop()->availableGeometry(widget);
Qt::LayoutDirection dir = widget->layoutDirection();
QPoint pos;
- int rw, rh, w;
+ int rh, w;
int h = (popup->sizeHintForRow(0) * qMin(maxVisibleItems, popup->model()->rowCount()) + 3) + 3;
QScrollBar *hsb = popup->horizontalScrollBar();
if (hsb && hsb->isVisible())
@@ -881,21 +881,30 @@ void QCompleterPrivate::showPopup(const QRect& rect)
if (rect.isValid()) {
rh = rect.height();
- w = rw = rect.width();
+ w = rect.width();
pos = widget->mapToGlobal(dir == Qt::RightToLeft ? rect.bottomRight() : rect.bottomLeft());
} else {
rh = widget->height();
- rw = widget->width();
pos = widget->mapToGlobal(QPoint(0, widget->height() - 2));
w = widget->width();
}
- if ((pos.x() + rw) > (screen.x() + screen.width()))
+ if (w > screen.width())
+ w = screen.width();
+ if ((pos.x() + w) > (screen.x() + screen.width()))
pos.setX(screen.x() + screen.width() - w);
if (pos.x() < screen.x())
pos.setX(screen.x());
- if (((pos.y() + rh) > (screen.y() + screen.height())) && ((pos.y() - h - rh) >= 0))
- pos.setY(pos.y() - qMax(h, popup->minimumHeight()) - rh + 2);
+
+ int top = pos.y() - rh - screen.top() + 2;
+ int bottom = screen.bottom() - pos.y();
+ h = qMax(h, popup->minimumHeight());
+ if (h > bottom) {
+ h = qMin(qMax(top, bottom), h);
+
+ if (top > bottom)
+ pos.setY(pos.y() - h - rh + 2);
+ }
popup->setGeometry(pos.x(), pos.y(), w, h);
diff --git a/src/gui/util/qsystemtrayicon_mac.mm b/src/gui/util/qsystemtrayicon_mac.mm
index d943c8c..8aaaa0f 100644
--- a/src/gui/util/qsystemtrayicon_mac.mm
+++ b/src/gui/util/qsystemtrayicon_mac.mm
@@ -75,8 +75,6 @@
#define QT_MAC_SYSTEMTRAY_USE_GROWL
-@class QNSMenu;
-
#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qsystemtrayicon_p.h>
#include <qtemporaryfile.h>
@@ -98,13 +96,14 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
-@class QNSImageView;
+@class QT_MANGLE_NAMESPACE(QNSMenu);
+@class QT_MANGLE_NAMESPACE(QNSImageView);
-@interface QNSStatusItem : NSObject {
+@interface QT_MANGLE_NAMESPACE(QNSStatusItem) : NSObject {
NSStatusItem *item;
QSystemTrayIcon *icon;
QSystemTrayIconPrivate *iconPrivate;
- QNSImageView *imageCell;
+ QT_MANGLE_NAMESPACE(QNSImageView) *imageCell;
}
-(id)initWithIcon:(QSystemTrayIcon*)icon iconPrivate:(QSystemTrayIconPrivate *)iprivate;
-(void)dealloc;
@@ -115,11 +114,11 @@ QT_USE_NAMESPACE
- (void)doubleClickSelector:(id)sender;
@end
-@interface QNSImageView : NSImageView {
+@interface QT_MANGLE_NAMESPACE(QNSImageView) : NSImageView {
BOOL down;
- QNSStatusItem *parent;
+ QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
}
--(id)initWithParent:(QNSStatusItem*)myParent;
+-(id)initWithParent:(QT_MANGLE_NAMESPACE(QNSStatusItem)*)myParent;
-(QSystemTrayIcon*)icon;
-(void)menuTrackingDone:(NSNotification*)notification;
-(void)mousePressed:(NSEvent *)mouseEvent button:(Qt::MouseButton)mouseButton;
@@ -134,7 +133,7 @@ QT_USE_NAMESPACE
#endif
-@interface QNSMenu : NSMenu <NSMenuDelegate> {
+@interface QT_MANGLE_NAMESPACE(QNSMenu) : NSMenu <NSMenuDelegate> {
QMenu *qmenu;
}
-(QMenu*)menu;
@@ -148,14 +147,14 @@ class QSystemTrayIconSys
public:
QSystemTrayIconSys(QSystemTrayIcon *icon, QSystemTrayIconPrivate *d) {
QMacCocoaAutoReleasePool pool;
- item = [[QNSStatusItem alloc] initWithIcon:icon iconPrivate:d];
+ item = [[QT_MANGLE_NAMESPACE(QNSStatusItem) alloc] initWithIcon:icon iconPrivate:d];
}
~QSystemTrayIconSys() {
QMacCocoaAutoReleasePool pool;
[[[item item] view] setHidden: YES];
[item release];
}
- QNSStatusItem *item;
+ QT_MANGLE_NAMESPACE(QNSStatusItem) *item;
};
void QSystemTrayIconPrivate::install_sys()
@@ -299,8 +298,8 @@ QT_END_NAMESPACE
@implementation NSStatusItem (Qt)
@end
-@implementation QNSImageView
--(id)initWithParent:(QNSStatusItem*)myParent {
+@implementation QT_MANGLE_NAMESPACE(QNSImageView)
+-(id)initWithParent:(QT_MANGLE_NAMESPACE(QNSStatusItem)*)myParent {
self = [super init];
parent = myParent;
down = NO;
@@ -400,7 +399,7 @@ QT_END_NAMESPACE
}
@end
-@implementation QNSStatusItem
+@implementation QT_MANGLE_NAMESPACE(QNSStatusItem)
-(id)initWithIcon:(QSystemTrayIcon*)i iconPrivate:(QSystemTrayIconPrivate *)iPrivate
{
@@ -409,7 +408,7 @@ QT_END_NAMESPACE
icon = i;
iconPrivate = iPrivate;
item = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
- imageCell = [[QNSImageView alloc] initWithParent:self];
+ imageCell = [[QT_MANGLE_NAMESPACE(QNSImageView) alloc] initWithParent:self];
[item setView: imageCell];
}
return self;
@@ -453,7 +452,7 @@ QT_END_NAMESPACE
[[[self item] view] removeAllToolTips];
iconPrivate->updateToolTip_sys();
#endif
- NSMenu *m = [[QNSMenu alloc] initWithQMenu:icon->contextMenu()];
+ NSMenu *m = [[QT_MANGLE_NAMESPACE(QNSMenu) alloc] initWithQMenu:icon->contextMenu()];
[m setAutoenablesItems: NO];
[[NSNotificationCenter defaultCenter] addObserver:imageCell
selector:@selector(menuTrackingDone:)
@@ -481,7 +480,7 @@ private:
QSystemTrayIconQMenu();
};
-@implementation QNSMenu
+@implementation QT_MANGLE_NAMESPACE(QNSMenu)
-(id)initWithQMenu:(QMenu*)qm {
self = [super init];
if(self) {
@@ -494,7 +493,7 @@ private:
return qmenu;
}
-(void)menuNeedsUpdate:(NSMenu*)nsmenu {
- QNSMenu *menu = static_cast<QNSMenu *>(nsmenu);
+ QT_MANGLE_NAMESPACE(QNSMenu) *menu = static_cast<QT_MANGLE_NAMESPACE(QNSMenu) *>(nsmenu);
emit static_cast<QSystemTrayIconQMenu*>(menu->qmenu)->doAboutToShow();
for(int i = [menu numberOfItems]-1; i >= 0; --i)
[menu removeItemAtIndex:i];
@@ -539,7 +538,7 @@ private:
[nsimage release];
}
if(action->menu()) {
- QNSMenu *sub = [[QNSMenu alloc] initWithQMenu:action->menu()];
+ QT_MANGLE_NAMESPACE(QNSMenu) *sub = [[QT_MANGLE_NAMESPACE(QNSMenu) alloc] initWithQMenu:action->menu()];
[item setSubmenu:sub];
} else {
[item setAction:@selector(selectedAction:)];
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index 6a01d68..f38bae7 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -219,8 +219,12 @@ QAbstractSliderPrivate::QAbstractSliderPrivate()
#ifdef QT_KEYPAD_NAVIGATION
, isAutoRepeating(false)
, repeatMultiplier(1)
-#endif
{
+ firstRepeat.invalidate();
+#else
+{
+#endif
+
}
QAbstractSliderPrivate::~QAbstractSliderPrivate()
@@ -787,7 +791,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
}
}
- else if (!d->firstRepeat.isValid()) {
+ else if (d->firstRepeat.isValid()) {
d->firstRepeat.invalidate();
d->repeatMultiplier = 1;
}
diff --git a/src/gui/widgets/qcocoatoolbardelegate_mac.mm b/src/gui/widgets/qcocoatoolbardelegate_mac.mm
index b2a0e0c..e68ee7c 100644
--- a/src/gui/widgets/qcocoatoolbardelegate_mac.mm
+++ b/src/gui/widgets/qcocoatoolbardelegate_mac.mm
@@ -58,7 +58,7 @@ QT_FORWARD_DECLARE_CLASS(QMainWindowLayout);
QT_FORWARD_DECLARE_CLASS(QToolBar);
QT_FORWARD_DECLARE_CLASS(QCFString);
-@implementation QCocoaToolBarDelegate
+@implementation QT_MANGLE_NAMESPACE(QCocoaToolBarDelegate)
- (id)initWithMainWindowLayout:(QMainWindowLayout *)layout
{
diff --git a/src/gui/widgets/qcocoatoolbardelegate_mac_p.h b/src/gui/widgets/qcocoatoolbardelegate_mac_p.h
index 8e3d06f..b4af54f 100644
--- a/src/gui/widgets/qcocoatoolbardelegate_mac_p.h
+++ b/src/gui/widgets/qcocoatoolbardelegate_mac_p.h
@@ -61,7 +61,7 @@ QT_END_NAMESPACE
@class NSToolbarItem;
-@interface QCocoaToolBarDelegate : NSObject {
+@interface QT_MANGLE_NAMESPACE(QCocoaToolBarDelegate) : NSObject {
QT_PREPEND_NAMESPACE(QMainWindowLayout) *mainWindowLayout;
NSToolbarItem *toolbarItem;
}
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index ca58e6d..e0b09aa 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -56,6 +56,7 @@
#include <qscrollbar.h>
#include <qtreeview.h>
#include <qheaderview.h>
+#include <qmath.h>
#ifndef QT_NO_IM
#include "qinputcontext.h"
#endif
@@ -328,7 +329,7 @@ QSize QComboBoxPrivate::recomputeSizeHint(QSize &sh) const
// height
- sh.setHeight(qMax(fm.height(), 14) + 2);
+ sh.setHeight(qMax(qCeil(QFontMetricsF(fm).height()), 14) + 2);
if (hasIcon) {
sh.setHeight(qMax(sh.height(), iconSize.height() + 2));
}
diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp
index 6919bc0..e8fe299 100644
--- a/src/gui/widgets/qcommandlinkbutton.cpp
+++ b/src/gui/widgets/qcommandlinkbutton.cpp
@@ -46,6 +46,7 @@
#include "qtextlayout.h"
#include "qcolor.h"
#include "qfont.h"
+#include <qmath.h>
#include "private/qpushbutton_p.h"
@@ -242,7 +243,7 @@ int QCommandLinkButtonPrivate::descriptionHeight(int widgetWidth) const
}
layout.endLayout();
}
- return qRound(descriptionheight);
+ return qCeil(descriptionheight);
}
/*!
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index 806654c..171000b 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -225,7 +225,7 @@ static const int zero = 0;
QDockAreaLayoutInfo::QDockAreaLayoutInfo()
: sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0)
#ifndef QT_NO_TABBAR
- , tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth), tabBarVisible(false)
+ , tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth)
#endif
{
}
@@ -235,7 +235,7 @@ QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPositio
QMainWindow *window)
: sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window)
#ifndef QT_NO_TABBAR
- , tabbed(false), tabBar(0), tabBarShape(static_cast<QTabBar::Shape>(tbshape)), tabBarVisible(false)
+ , tabbed(false), tabBar(0), tabBarShape(static_cast<QTabBar::Shape>(tbshape))
#endif
{
#ifdef QT_NO_TABBAR
@@ -296,8 +296,8 @@ QSize QDockAreaLayoutInfo::minimumSize() const
rperp(o, result) = b;
#ifndef QT_NO_TABBAR
- if (tabbed) {
- QSize tbm = tabBarMinimumSize();
+ QSize tbm = tabBarMinimumSize();
+ if (!tbm.isNull()) {
switch (tabBarShape) {
case QTabBar::RoundedNorth:
case QTabBar::RoundedSouth:
@@ -369,8 +369,8 @@ QSize QDockAreaLayoutInfo::maximumSize() const
rperp(o, result) = b;
#ifndef QT_NO_TABBAR
- if (tabbed) {
- QSize tbh = tabBarSizeHint();
+ QSize tbh = tabBarSizeHint();
+ if (!tbh.isNull()) {
switch (tabBarShape) {
case QTabBar::RoundedNorth:
case QTabBar::RoundedSouth:
@@ -1500,7 +1500,7 @@ void QDockAreaLayoutInfo::apply(bool animate)
QRect tab_rect;
QSize tbh = tabBarSizeHint();
- if (tabBarVisible) {
+ if (!tbh.isNull()) {
switch (tabBarShape) {
case QTabBar::RoundedNorth:
case QTabBar::TriangularNorth:
@@ -2079,10 +2079,11 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const
#endif //QT_NO_TABBAR
#ifndef QT_NO_TABBAR
-void QDockAreaLayoutInfo::updateTabBar() const
+//returns whether the tabbar is visible or not
+bool QDockAreaLayoutInfo::updateTabBar() const
{
if (!tabbed)
- return;
+ return false;
QDockAreaLayoutInfo *that = const_cast<QDockAreaLayoutInfo*>(this);
@@ -2150,12 +2151,8 @@ void QDockAreaLayoutInfo::updateTabBar() const
tabBar->blockSignals(blocked);
- that->tabBarVisible = ( (gap ? 1 : 0) + tabBar->count()) > 1;
-
- if (changed || !tabBarMin.isValid() | !tabBarHint.isValid()) {
- that->tabBarMin = tabBar->minimumSizeHint();
- that->tabBarHint = tabBar->sizeHint();
- }
+ //returns if the tabbar is visible or not
+ return ( (gap ? 1 : 0) + tabBar->count()) > 1;
}
void QDockAreaLayoutInfo::setTabBarShape(int shape)
@@ -2163,11 +2160,8 @@ void QDockAreaLayoutInfo::setTabBarShape(int shape)
if (shape == tabBarShape)
return;
tabBarShape = shape;
- if (tabBar != 0) {
+ if (tabBar != 0)
tabBar->setShape(static_cast<QTabBar::Shape>(shape));
- tabBarMin = QSize();
- tabBarHint = QSize();
- }
for (int i = 0; i < item_list.count(); ++i) {
QDockAreaLayoutItem &item = item_list[i];
@@ -2178,22 +2172,18 @@ void QDockAreaLayoutInfo::setTabBarShape(int shape)
QSize QDockAreaLayoutInfo::tabBarMinimumSize() const
{
- if (!tabbed)
+ if (!updateTabBar())
return QSize(0, 0);
- updateTabBar();
-
- return tabBarMin;
+ return tabBar->minimumSizeHint();
}
QSize QDockAreaLayoutInfo::tabBarSizeHint() const
{
- if (!tabbed)
+ if (!updateTabBar())
return QSize(0, 0);
- updateTabBar();
-
- return tabBarHint;
+ return tabBar->sizeHint();
}
QSet<QTabBar*> QDockAreaLayoutInfo::usedTabBars() const
@@ -2240,7 +2230,7 @@ QRect QDockAreaLayoutInfo::tabContentRect() const
QRect result = rect;
QSize tbh = tabBarSizeHint();
- if (tabBarVisible) {
+ if (!tbh.isNull()) {
switch (tabBarShape) {
case QTabBar::RoundedNorth:
case QTabBar::TriangularNorth:
diff --git a/src/gui/widgets/qdockarealayout_p.h b/src/gui/widgets/qdockarealayout_p.h
index 0088f00..9cb77ba 100644
--- a/src/gui/widgets/qdockarealayout_p.h
+++ b/src/gui/widgets/qdockarealayout_p.h
@@ -208,11 +208,9 @@ public:
QRect tabContentRect() const;
bool tabbed;
QTabBar *tabBar;
- QSize tabBarMin, tabBarHint;
int tabBarShape;
- bool tabBarVisible;
- void updateTabBar() const;
+ bool updateTabBar() const;
void setTabBarShape(int shape);
QSize tabBarMinimumSize() const;
QSize tabBarSizeHint() const;
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp
index 54189de..11f0a94 100644
--- a/src/gui/widgets/qdockwidget.cpp
+++ b/src/gui/widgets/qdockwidget.cpp
@@ -1269,12 +1269,11 @@ void QDockWidget::setFloating(bool floating)
QRect r = d->undockedGeometry;
d->setWindowState(floating, false, floating ? r : QRect());
+
if (floating && r.isNull()) {
- QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(this->layout());
- QRect titleArea = layout->titleArea();
- int h = layout->verticalTitleBar ? titleArea.width() : titleArea.height();
- QPoint p = mapToGlobal(QPoint(h, h));
- move(p);
+ if (x() < 0 || y() < 0) //may happen if we have been hidden
+ move(QPoint());
+ setAttribute(Qt::WA_Moved, false); //we want it at the default position
}
}
diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm
index 9527057..b8cef93 100644
--- a/src/gui/widgets/qmainwindowlayout_mac.mm
+++ b/src/gui/widgets/qmainwindowlayout_mac.mm
@@ -410,7 +410,7 @@ void QMainWindowLayout::insertIntoMacToolbar(QToolBar *before, QToolBar *toolbar
macToolbar = [[NSToolbar alloc] initWithIdentifier:(NSString *)kQMainWindowMacToolbarID];
[macToolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
[macToolbar setSizeMode:NSToolbarSizeModeRegular];
- [macToolbar setDelegate:[[QCocoaToolBarDelegate alloc] initWithMainWindowLayout:this]];
+ [macToolbar setDelegate:[[QT_MANGLE_NAMESPACE(QCocoaToolBarDelegate) alloc] initWithMainWindowLayout:this]];
[window setToolbar:macToolbar];
[macToolbar release];
}
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 615c674..19afe0c 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -259,7 +259,7 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
bool accept = true;
for (Bindings::Iterator it = bindings.begin(); it != bindings.end(); ++it) {
if ((gesture = event->gesture(it.key()))) {
- it.value()->value();
+ it.value()->evaluate();
event->setAccepted(true); // XXX only if value returns true?
}
}
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 8562fb5..a45af95 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-SUBDIRS += widgets particles
+SUBDIRS += particles gestures
contains(QT_CONFIG, webkit): SUBDIRS += webkit
diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp
index 5db812c..36a25f6 100644
--- a/src/imports/webkit/qdeclarativewebview.cpp
+++ b/src/imports/webkit/qdeclarativewebview.cpp
@@ -42,11 +42,9 @@
#include "qdeclarativewebview_p.h"
#include "qdeclarativewebview_p_p.h"
-#include <private/qdeclarativepainteditem_p_p.h>
-
#include <qdeclarative.h>
#include <qdeclarativeengine.h>
-#include <private/qdeclarativestate_p.h>
+#include <qdeclarativecontext.h>
#include <QDebug>
#include <QPen>
@@ -61,29 +59,29 @@
#include <QtWebKit/QWebFrame>
#include <QtWebKit/QWebElement>
#include <QtWebKit/QWebSettings>
-#include <private/qlistmodelinterface_p.h>
QT_BEGIN_NAMESPACE
static const int MAX_DOUBLECLICK_TIME=500; // XXX need better gesture system
-class QDeclarativeWebViewPrivate : public QDeclarativePaintedItemPrivate
+class QDeclarativeWebViewPrivate
{
- Q_DECLARE_PUBLIC(QDeclarativeWebView)
-
public:
- QDeclarativeWebViewPrivate()
- : QDeclarativePaintedItemPrivate(), page(0), preferredwidth(0), preferredheight(0),
+ QDeclarativeWebViewPrivate(QDeclarativeWebView* qq)
+ : q(qq), page(0), preferredwidth(0), preferredheight(0),
progress(1.0), status(QDeclarativeWebView::Null), pending(PendingNone),
newWindowComponent(0), newWindowParent(0),
pressTime(400),
rendering(true)
{
+ QObject::connect(q, SIGNAL(focusChanged(bool)), q, SLOT(propagateFocusToWebPage(bool)));
}
- void focusChanged(bool);
+
+ QDeclarativeWebView *q;
QUrl url; // page url might be different if it has not loaded yet
QWebPage *page;
+ QGraphicsWebView* view;
int preferredwidth, preferredheight;
qreal progress;
@@ -101,7 +99,6 @@ public:
QPoint pressPoint;
int pressTime; // milliseconds before it's a "hold"
-
static void windowObjects_append(QDeclarativeListProperty<QObject> *prop, QObject *o) {
static_cast<QDeclarativeWebViewPrivate *>(prop->data)->windowObjects.append(o);
static_cast<QDeclarativeWebViewPrivate *>(prop->data)->updateWindowObjects();
@@ -129,6 +126,9 @@ public:
dynamically adjust to a size appropriate for the content.
This width may be large for typical online web pages.
+ If the width or height is explictly set, the rendered website
+ will be clipped, not scaled, to fit into the set dimensions.
+
If the preferredWidth is set, the width will be this amount or larger,
usually laying out the web content to fit the preferredWidth.
@@ -137,8 +137,8 @@ public:
WebView {
url: "http://www.nokia.com"
- width: 490
- height: 400
+ preferredWidth: 490
+ preferredHeight: 400
scale: 0.5
smooth: false
smoothCache: true
@@ -169,34 +169,39 @@ public:
*/
QDeclarativeWebView::QDeclarativeWebView(QDeclarativeItem *parent)
- : QDeclarativePaintedItem(*(new QDeclarativeWebViewPrivate), parent)
+ : QDeclarativeItem(parent)
{
init();
}
QDeclarativeWebView::~QDeclarativeWebView()
{
- Q_D(QDeclarativeWebView);
delete d->page;
+ delete d;
}
void QDeclarativeWebView::init()
{
- Q_D(QDeclarativeWebView);
+ d = new QDeclarativeWebViewPrivate(this);
QWebSettings::enablePersistentStorage();
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
- setFlag(QGraphicsItem::ItemHasNoContents, false);
+ setFlag(QGraphicsItem::ItemHasNoContents, true);
+ setClip(true);
d->page = 0;
+ d->view = new QGraphicsWebView(this);
+ d->view->setResizesToContents(true);
+ d->view->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
+ connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize()));
+ connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged()));
}
void QDeclarativeWebView::componentComplete()
{
- QDeclarativePaintedItem::componentComplete();
- Q_D(QDeclarativeWebView);
+ QDeclarativeItem::componentComplete();
switch (d->pending) {
case QDeclarativeWebViewPrivate::PendingUrl:
setUrl(d->pending_url);
@@ -216,7 +221,6 @@ void QDeclarativeWebView::componentComplete()
QDeclarativeWebView::Status QDeclarativeWebView::status() const
{
- Q_D(const QDeclarativeWebView);
return d->status;
}
@@ -230,13 +234,11 @@ QDeclarativeWebView::Status QDeclarativeWebView::status() const
*/
qreal QDeclarativeWebView::progress() const
{
- Q_D(const QDeclarativeWebView);
return d->progress;
}
void QDeclarativeWebView::doLoadStarted()
{
- Q_D(QDeclarativeWebView);
if (!d->url.isEmpty()) {
d->status = Loading;
@@ -247,7 +249,6 @@ void QDeclarativeWebView::doLoadStarted()
void QDeclarativeWebView::doLoadProgress(int p)
{
- Q_D(QDeclarativeWebView);
if (d->progress == p/100.0)
return;
d->progress = p/100.0;
@@ -256,12 +257,7 @@ void QDeclarativeWebView::doLoadProgress(int p)
void QDeclarativeWebView::pageUrlChanged()
{
- Q_D(QDeclarativeWebView);
-
- page()->setViewportSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth : width(),
- d->preferredheight>0 ? d->preferredheight : height()));
- expandToWebPage();
+ updateContentsSize();
if ((d->url.isEmpty() && page()->mainFrame()->url() != QUrl(QLatin1String("about:blank")))
|| (d->url != page()->mainFrame()->url() && !page()->mainFrame()->url().isEmpty()))
@@ -275,7 +271,6 @@ void QDeclarativeWebView::pageUrlChanged()
void QDeclarativeWebView::doLoadFinished(bool ok)
{
- Q_D(QDeclarativeWebView);
if (title().isEmpty())
pageUrlChanged(); // XXX bug 232556 - pages with no title never get urlChanged()
@@ -302,21 +297,17 @@ void QDeclarativeWebView::doLoadFinished(bool ok)
*/
QUrl QDeclarativeWebView::url() const
{
- Q_D(const QDeclarativeWebView);
return d->url;
}
void QDeclarativeWebView::setUrl(const QUrl &url)
{
- Q_D(QDeclarativeWebView);
if (url == d->url)
return;
if (isComponentComplete()) {
d->url = url;
- page()->setViewportSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth : width(),
- d->preferredheight>0 ? d->preferredheight : height()));
+ updateContentsSize();
QUrl seturl = url;
if (seturl.isEmpty())
seturl = QUrl(QLatin1String("about:blank"));
@@ -338,16 +329,14 @@ void QDeclarativeWebView::setUrl(const QUrl &url)
*/
int QDeclarativeWebView::preferredWidth() const
{
- Q_D(const QDeclarativeWebView);
return d->preferredwidth;
}
void QDeclarativeWebView::setPreferredWidth(int iw)
{
- Q_D(QDeclarativeWebView);
if (d->preferredwidth == iw) return;
d->preferredwidth = iw;
- //expandToWebPage();
+ updateContentsSize();
emit preferredWidthChanged();
}
@@ -358,14 +347,14 @@ void QDeclarativeWebView::setPreferredWidth(int iw)
*/
int QDeclarativeWebView::preferredHeight() const
{
- Q_D(const QDeclarativeWebView);
return d->preferredheight;
}
+
void QDeclarativeWebView::setPreferredHeight(int ih)
{
- Q_D(QDeclarativeWebView);
if (d->preferredheight == ih) return;
d->preferredheight = ih;
+ updateContentsSize();
emit preferredHeightChanged();
}
@@ -383,82 +372,86 @@ QVariant QDeclarativeWebView::evaluateJavaScript(const QString &scriptSource)
return this->page()->mainFrame()->evaluateJavaScript(scriptSource);
}
-void QDeclarativeWebViewPrivate::focusChanged(bool hasFocus)
+void QDeclarativeWebView::propagateFocusToWebPage(bool hasFocus)
{
- Q_Q(QDeclarativeWebView);
QFocusEvent e(hasFocus ? QEvent::FocusIn : QEvent::FocusOut);
- q->page()->event(&e);
- QDeclarativeItemPrivate::focusChanged(hasFocus);
+ page()->event(&e);
}
-void QDeclarativeWebView::initialLayout()
+void QDeclarativeWebView::updateDeclarativeWebViewSize()
{
- // nothing useful to do at this point
+ QSizeF size = d->view->geometry().size() * contentsScale();
+ setImplicitWidth(size.width());
+ setImplicitHeight(size.height());
}
-void QDeclarativeWebView::noteContentsSizeChanged(const QSize&)
+void QDeclarativeWebView::initialLayout()
{
- expandToWebPage();
+ // nothing useful to do at this point
}
-void QDeclarativeWebView::expandToWebPage()
+void QDeclarativeWebView::updateContentsSize()
{
- Q_D(QDeclarativeWebView);
- QSize cs = page()->mainFrame()->contentsSize();
- if (cs.width() < d->preferredwidth)
- cs.setWidth(d->preferredwidth);
- if (cs.height() < d->preferredheight)
- cs.setHeight(d->preferredheight);
- if (widthValid())
- cs.setWidth(width());
- if (heightValid())
- cs.setHeight(height());
- if (cs != page()->viewportSize()) {
- page()->setViewportSize(cs);
- }
- if (cs != contentsSize())
- setContentsSize(cs);
+ if (d->page)
+ d->page->setPreferredContentsSize(QSize(
+ d->preferredwidth>0 ? d->preferredwidth : width(),
+ d->preferredheight>0 ? d->preferredheight : height()));
}
void QDeclarativeWebView::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
- if (newGeometry.size() != oldGeometry.size())
- expandToWebPage();
- QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry);
-}
-
-void QDeclarativeWebView::paintPage(const QRect& r)
-{
- dirtyCache(r);
- update();
+ if (newGeometry.size() != oldGeometry.size() && d->page) {
+ QSize cs = d->page->preferredContentsSize();
+ if (widthValid())
+ cs.setWidth(width());
+ if (heightValid())
+ cs.setHeight(height());
+ if (cs != d->page->preferredContentsSize())
+ d->page->setPreferredContentsSize(cs);
+ }
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
}
/*!
\qmlproperty list<object> WebView::javaScriptWindowObjects
- This property is a list of object that are available from within
- the webview's JavaScript context.
+ A list of QML objects to expose to the web page.
+
+ Each object will be added as a property of the web frame's window object. The
+ property name is controlled by the value of \c WebView.windowObjectName
+ attached property.
+
+ Exposing QML objects to a web page allows JavaScript executing in the web
+ page itself to communicate with QML, by reading and writing properties and
+ by calling methods of the exposed QML objects.
- The \a object will be inserted as a child of the frame's window
- object, under the name given by the attached property \c WebView.windowObjectName.
+ This example shows how to call into a QML method using a window object.
\qml
WebView {
- javaScriptWindowObjects: Object {
- WebView.windowObjectName: "coordinates"
+ javaScriptWindowObjects: QtObject {
+ WebView.windowObjectName: "qml"
+
+ function qmlCall() {
+ console.log("This call is in QML!");
+ }
}
+
+ html: "<script>console.log(\"This is in WebKit!\"); window.qml.qmlCall();</script>"
}
\endqml
- Properties of the object will be exposed as JavaScript properties and slots as
- JavaScript methods.
+ The output of the example will be:
+ \code
+ This is in WebKit!
+ This call is in QML!
+ \endcode
- If Javascript is not enabled for this page, then this property does nothing.
+ If Javascript is not enabled for the page, then this property does nothing.
*/
QDeclarativeListProperty<QObject> QDeclarativeWebView::javaScriptWindowObjects()
{
- Q_D(QDeclarativeWebView);
return QDeclarativeListProperty<QObject>(this, d, &QDeclarativeWebViewPrivate::windowObjects_append);
}
@@ -469,8 +462,7 @@ QDeclarativeWebViewAttached *QDeclarativeWebView::qmlAttachedProperties(QObject
void QDeclarativeWebViewPrivate::updateWindowObjects()
{
- Q_Q(QDeclarativeWebView);
- if (!q->isComponentComplete() || !page)
+ if (!q->isComponentCompletePublic() || !page)
return;
for (int ii = 0; ii < windowObjects.count(); ++ii) {
@@ -484,29 +476,17 @@ void QDeclarativeWebViewPrivate::updateWindowObjects()
bool QDeclarativeWebView::renderingEnabled() const
{
- Q_D(const QDeclarativeWebView);
return d->rendering;
}
void QDeclarativeWebView::setRenderingEnabled(bool enabled)
{
- Q_D(QDeclarativeWebView);
if (d->rendering == enabled)
return;
d->rendering = enabled;
emit renderingEnabledChanged();
- setCacheFrozen(!enabled);
- if (enabled)
- clearCache();
-}
-
-
-void QDeclarativeWebView::drawContents(QPainter *p, const QRect &r)
-{
- Q_D(QDeclarativeWebView);
- if (d->rendering)
- page()->mainFrame()->render(p,r);
+ d->view->setTiledBackingStoreFrozen(!enabled);
}
QMouseEvent *QDeclarativeWebView::sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent *e)
@@ -541,7 +521,6 @@ QMouseEvent *QDeclarativeWebView::sceneHoverMoveEventToMouseEvent(QGraphicsScene
return me;
}
-
/*!
\qmlsignal WebView::onDoubleClick(clickx,clicky)
@@ -573,7 +552,6 @@ void QDeclarativeWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
*/
bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxzoom)
{
- Q_D(QDeclarativeWebView);
if (contentsScale() >= maxzoom/zoomFactor())
return false;
qreal ozf = contentsScale();
@@ -602,13 +580,11 @@ bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxzoom)
*/
int QDeclarativeWebView::pressGrabTime() const
{
- Q_D(const QDeclarativeWebView);
return d->pressTime;
}
void QDeclarativeWebView::setPressGrabTime(int ms)
{
- Q_D(QDeclarativeWebView);
if (d->pressTime == ms)
return;
d->pressTime = ms;
@@ -617,8 +593,6 @@ void QDeclarativeWebView::setPressGrabTime(int ms)
void QDeclarativeWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
- Q_D(QDeclarativeWebView);
-
setFocus (true);
QMouseEvent *me = sceneMouseEventToMouseEvent(event);
@@ -646,14 +620,12 @@ void QDeclarativeWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
);
delete me;
if (!event->isAccepted()) {
- QDeclarativePaintedItem::mousePressEvent(event);
+ QDeclarativeItem::mousePressEvent(event);
}
}
void QDeclarativeWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
- Q_D(QDeclarativeWebView);
-
QMouseEvent *me = sceneMouseEventToMouseEvent(event);
page()->event(me);
d->pressTimer.stop();
@@ -670,7 +642,7 @@ void QDeclarativeWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
);
delete me;
if (!event->isAccepted()) {
- QDeclarativePaintedItem::mouseReleaseEvent(event);
+ QDeclarativeItem::mouseReleaseEvent(event);
}
setKeepMouseGrab(false);
ungrabMouse();
@@ -678,7 +650,6 @@ void QDeclarativeWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void QDeclarativeWebView::timerEvent(QTimerEvent *event)
{
- Q_D(QDeclarativeWebView);
if (event->timerId() == d->pressTimer.timerId()) {
d->pressTimer.stop();
grabMouse();
@@ -688,8 +659,6 @@ void QDeclarativeWebView::timerEvent(QTimerEvent *event)
void QDeclarativeWebView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
- Q_D(QDeclarativeWebView);
-
QMouseEvent *me = sceneMouseEventToMouseEvent(event);
if (d->pressTimer.isActive()) {
if ((me->pos() - d->pressPoint).manhattanLength() > QApplication::startDragDistance()) {
@@ -713,9 +682,9 @@ void QDeclarativeWebView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
delete me;
if (!event->isAccepted())
- QDeclarativePaintedItem::mouseMoveEvent(event);
-
+ QDeclarativeItem::mouseMoveEvent(event);
}
+
void QDeclarativeWebView::hoverMoveEvent (QGraphicsSceneHoverEvent * event)
{
QMouseEvent *me = sceneHoverMoveEventToMouseEvent(event);
@@ -729,21 +698,7 @@ void QDeclarativeWebView::hoverMoveEvent (QGraphicsSceneHoverEvent * event)
);
delete me;
if (!event->isAccepted())
- QDeclarativePaintedItem::hoverMoveEvent(event);
-}
-
-void QDeclarativeWebView::keyPressEvent(QKeyEvent* event)
-{
- page()->event(event);
- if (!event->isAccepted())
- QDeclarativePaintedItem::keyPressEvent(event);
-}
-
-void QDeclarativeWebView::keyReleaseEvent(QKeyEvent* event)
-{
- page()->event(event);
- if (!event->isAccepted())
- QDeclarativePaintedItem::keyReleaseEvent(event);
+ QDeclarativeItem::hoverMoveEvent(event);
}
bool QDeclarativeWebView::sceneEvent(QEvent *event)
@@ -758,7 +713,7 @@ bool QDeclarativeWebView::sceneEvent(QEvent *event)
}
}
}
- return QDeclarativePaintedItem::sceneEvent(event);
+ return QDeclarativeItem::sceneEvent(event);
}
@@ -827,15 +782,11 @@ QPixmap QDeclarativeWebView::icon() const
*/
void QDeclarativeWebView::setZoomFactor(qreal factor)
{
- Q_D(QDeclarativeWebView);
if (factor == page()->mainFrame()->zoomFactor())
return;
page()->mainFrame()->setZoomFactor(factor);
- page()->setViewportSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth*factor : width()*factor,
- d->preferredheight>0 ? d->preferredheight*factor : height()*factor));
- expandToWebPage();
+ updateContentsSize();
emit zoomFactorChanged();
}
@@ -853,37 +804,27 @@ qreal QDeclarativeWebView::zoomFactor() const
*/
void QDeclarativeWebView::setStatusText(const QString& s)
{
- Q_D(QDeclarativeWebView);
d->statusText = s;
emit statusTextChanged();
}
void QDeclarativeWebView::windowObjectCleared()
{
- Q_D(QDeclarativeWebView);
d->updateWindowObjects();
}
QString QDeclarativeWebView::statusText() const
{
- Q_D(const QDeclarativeWebView);
return d->statusText;
}
QWebPage *QDeclarativeWebView::page() const
{
- Q_D(const QDeclarativeWebView);
if (!d->page) {
QDeclarativeWebView *self = const_cast<QDeclarativeWebView*>(this);
QWebPage *wp = new QDeclarativeWebPage(self);
- // QML items don't default to having a background,
- // even though most we pages will set one anyway.
- QPalette pal = QApplication::palette();
- pal.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0));
- wp->setPalette(pal);
-
wp->setNetworkAccessManager(qmlEngine(this)->networkAccessManager());
self->setPage(wp);
@@ -939,14 +880,12 @@ QWebPage *QDeclarativeWebView::page() const
*/
QDeclarativeWebSettings *QDeclarativeWebView::settingsObject() const
{
- Q_D(const QDeclarativeWebView);
d->settings.s = page()->settings();
return &d->settings;
}
void QDeclarativeWebView::setPage(QWebPage *page)
{
- Q_D(QDeclarativeWebView);
if (d->page == page)
return;
if (d->page) {
@@ -957,18 +896,15 @@ void QDeclarativeWebView::setPage(QWebPage *page)
}
}
d->page = page;
- d->page->setViewportSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth : width(),
- d->preferredheight>0 ? d->preferredheight : height()));
+ updateContentsSize();
d->page->mainFrame()->setScrollBarPolicy(Qt::Horizontal,Qt::ScrollBarAlwaysOff);
d->page->mainFrame()->setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff);
- connect(d->page,SIGNAL(repaintRequested(QRect)),this,SLOT(paintPage(QRect)));
connect(d->page->mainFrame(),SIGNAL(urlChanged(QUrl)),this,SLOT(pageUrlChanged()));
connect(d->page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
connect(d->page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged()));
connect(d->page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
- connect(d->page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SLOT(noteContentsSizeChanged(QSize)));
connect(d->page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout()));
+ connect(d->page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize)));
connect(d->page,SIGNAL(loadStarted()),this,SLOT(doLoadStarted()));
connect(d->page,SIGNAL(loadProgress(int)),this,SLOT(doLoadProgress(int)));
@@ -976,6 +912,10 @@ void QDeclarativeWebView::setPage(QWebPage *page)
connect(d->page,SIGNAL(statusBarMessage(QString)),this,SLOT(setStatusText(QString)));
connect(d->page->mainFrame(),SIGNAL(javaScriptWindowObjectCleared()),this,SLOT(windowObjectCleared()));
+
+ d->page->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true);
+
+ d->view->setPage(page);
}
/*!
@@ -1030,10 +970,7 @@ QString QDeclarativeWebView::html() const
*/
void QDeclarativeWebView::setHtml(const QString &html, const QUrl &baseUrl)
{
- Q_D(QDeclarativeWebView);
- page()->setViewportSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth : width(),
- d->preferredheight>0 ? d->preferredheight : height()));
+ updateContentsSize();
if (isComponentComplete())
page()->mainFrame()->setHtml(html, baseUrl);
else {
@@ -1046,10 +983,7 @@ void QDeclarativeWebView::setHtml(const QString &html, const QUrl &baseUrl)
void QDeclarativeWebView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
{
- Q_D(QDeclarativeWebView);
- page()->setViewportSize(QSize(
- d->preferredwidth>0 ? d->preferredwidth : width(),
- d->preferredheight>0 ? d->preferredheight : height()));
+ updateContentsSize();
if (isComponentComplete())
page()->mainFrame()->setContent(data,mimeType,qmlContext(this)->resolvedUrl(baseUrl));
@@ -1073,7 +1007,6 @@ QWebSettings *QDeclarativeWebView::settings() const
QDeclarativeWebView *QDeclarativeWebView::createWindow(QWebPage::WebWindowType type)
{
- Q_D(QDeclarativeWebView);
switch (type) {
case QWebPage::WebBrowserWindow: {
if (!d->newWindowComponent && d->newWindowParent)
@@ -1127,13 +1060,11 @@ QDeclarativeWebView *QDeclarativeWebView::createWindow(QWebPage::WebWindowType t
*/
QDeclarativeComponent *QDeclarativeWebView::newWindowComponent() const
{
- Q_D(const QDeclarativeWebView);
return d->newWindowComponent;
}
void QDeclarativeWebView::setNewWindowComponent(QDeclarativeComponent *newWindow)
{
- Q_D(QDeclarativeWebView);
if (newWindow == d->newWindowComponent)
return;
d->newWindowComponent = newWindow;
@@ -1150,13 +1081,11 @@ void QDeclarativeWebView::setNewWindowComponent(QDeclarativeComponent *newWindow
*/
QDeclarativeItem *QDeclarativeWebView::newWindowParent() const
{
- Q_D(const QDeclarativeWebView);
return d->newWindowParent;
}
void QDeclarativeWebView::setNewWindowParent(QDeclarativeItem *parent)
{
- Q_D(QDeclarativeWebView);
if (parent == d->newWindowParent)
return;
if (d->newWindowParent && parent) {
@@ -1169,6 +1098,25 @@ void QDeclarativeWebView::setNewWindowParent(QDeclarativeItem *parent)
emit newWindowParentChanged();
}
+QSize QDeclarativeWebView::contentsSize() const
+{
+ return d->page->mainFrame()->contentsSize() * contentsScale();
+}
+
+qreal QDeclarativeWebView::contentsScale() const
+{
+ return d->view->scale();
+}
+
+void QDeclarativeWebView::setContentsScale(qreal scale)
+{
+ if (scale == d->view->scale())
+ return;
+ d->view->setScale(scale);
+ updateDeclarativeWebViewSize();
+ emit contentsScaleChanged();
+}
+
/*!
Returns the area of the largest element at position (\a x,\a y) that is no larger
than \a maxwidth by \a maxheight pixels.
@@ -1265,3 +1213,4 @@ QWebPage *QDeclarativeWebPage::createWindow(WebWindowType type)
}
QT_END_NAMESPACE
+
diff --git a/src/imports/webkit/qdeclarativewebview_p.h b/src/imports/webkit/qdeclarativewebview_p.h
index 81581d8..87bd938 100644
--- a/src/imports/webkit/qdeclarativewebview_p.h
+++ b/src/imports/webkit/qdeclarativewebview_p.h
@@ -42,12 +42,13 @@
#ifndef QDECLARATIVEWEBVIEW_H
#define QDECLARATIVEWEBVIEW_H
-#include <private/qdeclarativepainteditem_p.h>
+#include <qdeclarativeitem.h>
#include <QtGui/QAction>
#include <QtCore/QUrl>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtWebKit/QWebPage>
+#include <QtWebKit/QGraphicsWebView>
QT_BEGIN_HEADER
@@ -61,6 +62,7 @@ class QDeclarativeWebSettings;
class QDeclarativeWebViewPrivate;
class QNetworkRequest;
class QDeclarativeWebView;
+class QDeclarativeWebViewPrivate;
class QDeclarativeWebPage : public QWebPage
{
@@ -85,7 +87,7 @@ class QDeclarativeWebViewAttached;
//### TODO: browser plugins
-class QDeclarativeWebView : public QDeclarativePaintedItem
+class QDeclarativeWebView : public QDeclarativeItem
{
Q_OBJECT
@@ -120,6 +122,9 @@ class QDeclarativeWebView : public QDeclarativePaintedItem
Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged)
+ Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged)
+ Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged)
+
public:
QDeclarativeWebView(QDeclarativeItem *parent=0);
~QDeclarativeWebView();
@@ -182,6 +187,13 @@ public:
QDeclarativeItem *newWindowParent() const;
void setNewWindowParent(QDeclarativeItem *newWindow);
+ bool isComponentCompletePublic() const { return isComponentComplete(); }
+
+ QSize contentsSize() const;
+
+ void setContentsScale(qreal scale);
+ qreal contentsScale() const;
+
Q_SIGNALS:
void preferredWidthChanged();
void preferredHeightChanged();
@@ -197,6 +209,8 @@ Q_SIGNALS:
void newWindowComponentChanged();
void newWindowParentChanged();
void renderingEnabledChanged();
+ void contentsSizeChanged(const QSize&);
+ void contentsScaleChanged();
void loadStarted();
void loadFinished();
@@ -212,38 +226,36 @@ public Q_SLOTS:
QVariant evaluateJavaScript(const QString&);
private Q_SLOTS:
- void expandToWebPage();
- void paintPage(const QRect&);
void doLoadStarted();
void doLoadProgress(int p);
void doLoadFinished(bool ok);
void setStatusText(const QString&);
void windowObjectCleared();
void pageUrlChanged();
- void noteContentsSizeChanged(const QSize&);
void initialLayout();
-protected:
- void drawContents(QPainter *, const QRect &);
+ void propagateFocusToWebPage(bool);
+ void updateDeclarativeWebViewSize();
+
+protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void timerEvent(QTimerEvent *event);
void hoverMoveEvent (QGraphicsSceneHoverEvent * event);
- void keyPressEvent(QKeyEvent* event);
- void keyReleaseEvent(QKeyEvent* event);
virtual void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry);
virtual bool sceneEvent(QEvent *event);
QDeclarativeWebView *createWindow(QWebPage::WebWindowType type);
private:
+ void updateContentsSize();
void init();
virtual void componentComplete();
Q_DISABLE_COPY(QDeclarativeWebView)
- Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeWebView)
+ QDeclarativeWebViewPrivate* d;
QMouseEvent *sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent *);
QMouseEvent *sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent *);
friend class QDeclarativeWebPage;
diff --git a/src/imports/widgets/qmldir b/src/imports/widgets/qmldir
deleted file mode 100644
index 6f19878..0000000
--- a/src/imports/widgets/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin widgets
diff --git a/src/imports/widgets/widgets.cpp b/src/imports/widgets/widgets.cpp
deleted file mode 100644
index 20de1fe..0000000
--- a/src/imports/widgets/widgets.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarative.h>
-#include <QGraphicsWidget>
-
-#include "graphicslayouts_p.h"
-#include <private/qdeclarativegraphicswidget_p.h>
-QT_BEGIN_NAMESPACE
-
-class QWidgetsQmlModule : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- virtual void registerTypes(const char *uri)
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.widgets"));
-
- qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem");
- qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout");
- qmlRegisterType<QGraphicsLinearLayoutStretchItemObject>(uri,4,7,"QGraphicsLinearLayoutStretchItem");
- qmlRegisterType<QGraphicsLinearLayoutObject>(uri,4,7,"QGraphicsLinearLayout");
- qmlRegisterType<QGraphicsGridLayoutObject>(uri,4,7,"QGraphicsGridLayout");
- }
-};
-
-QT_END_NAMESPACE
-
-#include "widgets.moc"
-
-Q_EXPORT_PLUGIN2(qtwidgetsqmlmodule, QT_PREPEND_NAMESPACE(QWidgetsQmlModule));
-
diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro
deleted file mode 100644
index 234ff1e..0000000
--- a/src/imports/widgets/widgets.pro
+++ /dev/null
@@ -1,30 +0,0 @@
-TARGET = widgets
-TARGETPATH = Qt/widgets
-include(../qimportbase.pri)
-
-QT += declarative
-
-SOURCES += \
- graphicslayouts.cpp \
- widgets.cpp
-
-HEADERS += \
- graphicslayouts_p.h
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
-target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-
-qmldir.files += $$PWD/qmldir
-qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
-
-symbian:{
- load(data_caging_paths)
- include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-
- importFiles.sources = widgets.dll qmldir
- importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
- DEPLOYMENT = importFiles
-}
-
-INSTALLS += target qmldir
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 559124f..31c64f0 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -343,9 +343,16 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
copyCredentials(i, auth, isProxy);
QMetaObject::invokeMethod(q, "_q_restartAuthPendingRequests", Qt::QueuedConnection);
}
+ } else if (priv->phase == QAuthenticatorPrivate::Start) {
+ // If the url's authenticator has a 'user' set we will end up here (phase is only set to 'Done' by
+ // parseHttpResponse above if 'user' is empty). So if credentials were supplied with the request,
+ // such as in the case of an XMLHttpRequest, this is our only opportunity to cache them.
+ emit q->cacheCredentials(reply->request(), auth, q);
}
- // changing values in QAuthenticator will reset the 'phase'
- if (priv->phase == QAuthenticatorPrivate::Done) {
+ // - Changing values in QAuthenticator will reset the 'phase'.
+ // - If withCredentials has been set to false (e.g. by QtWebKit for a cross-origin XMLHttpRequest) then
+ // we need to bail out if authentication is required.
+ if (priv->phase == QAuthenticatorPrivate::Done || !reply->request().withCredentials()) {
// authentication is cancelled, send the current contents to the user.
emit channels[i].reply->headerChanged();
emit channels[i].reply->readyRead();
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index b5bd300..51666d6 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -133,6 +133,8 @@ Q_SIGNALS:
#endif
void authenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *authenticator,
const QHttpNetworkConnection *connection = 0);
+ void cacheCredentials(const QHttpNetworkRequest &request, QAuthenticator *authenticator,
+ const QHttpNetworkConnection *connection = 0);
void error(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
private:
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 3b7bc9e..d24eb1f 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -173,7 +173,7 @@ bool QHttpNetworkConnectionChannel::sendRequest()
pendingEncrypt = false;
// if the url contains authentication parameters, use the new ones
// both channels will use the new authentication parameters
- if (!request.url().userInfo().isEmpty()) {
+ if (!request.url().userInfo().isEmpty() && request.withCredentials()) {
QUrl url = request.url();
QAuthenticator &auth = authenticator;
if (url.userName() != auth.user()
@@ -187,7 +187,10 @@ bool QHttpNetworkConnectionChannel::sendRequest()
url.setUserInfo(QString());
request.setUrl(url);
}
- connection->d_func()->createAuthorization(socket, request);
+ // Will only be false if QtWebKit is performing a cross-origin XMLHttpRequest
+ // and withCredentials has not been set to true.
+ if (request.withCredentials())
+ connection->d_func()->createAuthorization(socket, request);
#ifndef QT_NO_NETWORKPROXY
QByteArray header = QHttpNetworkRequestPrivate::header(request,
(connection->d_func()->networkProxy.type() != QNetworkProxy::NoProxy));
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp
index 9eb2399..639025e 100644
--- a/src/network/access/qhttpnetworkrequest.cpp
+++ b/src/network/access/qhttpnetworkrequest.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Operation op,
QHttpNetworkRequest::Priority pri, const QUrl &newUrl)
: QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0),
- autoDecompress(false), pipeliningAllowed(false)
+ autoDecompress(false), pipeliningAllowed(false), withCredentials(true)
{
}
@@ -62,6 +62,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest
autoDecompress = other.autoDecompress;
pipeliningAllowed = other.pipeliningAllowed;
customVerb = other.customVerb;
+ withCredentials = other.withCredentials;
}
QHttpNetworkRequestPrivate::~QHttpNetworkRequestPrivate()
@@ -274,6 +275,16 @@ void QHttpNetworkRequest::setPipeliningAllowed(bool b)
d->pipeliningAllowed = b;
}
+bool QHttpNetworkRequest::withCredentials() const
+{
+ return d->withCredentials;
+}
+
+void QHttpNetworkRequest::setWithCredentials(bool b)
+{
+ d->withCredentials = b;
+}
+
void QHttpNetworkRequest::setUploadByteDevice(QNonContiguousByteDevice *bd)
{
d->uploadByteDevice = bd;
diff --git a/src/network/access/qhttpnetworkrequest_p.h b/src/network/access/qhttpnetworkrequest_p.h
index 1b35a84..15cab73 100644
--- a/src/network/access/qhttpnetworkrequest_p.h
+++ b/src/network/access/qhttpnetworkrequest_p.h
@@ -113,6 +113,9 @@ public:
bool isPipeliningAllowed() const;
void setPipeliningAllowed(bool b);
+ bool withCredentials() const;
+ void setWithCredentials(bool b);
+
void setUploadByteDevice(QNonContiguousByteDevice *bd);
QNonContiguousByteDevice* uploadByteDevice() const;
@@ -142,6 +145,7 @@ public:
mutable QNonContiguousByteDevice* uploadByteDevice;
bool autoDecompress;
bool pipeliningAllowed;
+ bool withCredentials;
};
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index f188bd5..2a02c99 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -327,6 +327,11 @@ void QNetworkAccessBackend::authenticationRequired(QAuthenticator *authenticator
manager->authenticationRequired(this, authenticator);
}
+void QNetworkAccessBackend::cacheCredentials(QAuthenticator *authenticator)
+{
+ manager->addCredentials(this->reply->url, authenticator);
+}
+
void QNetworkAccessBackend::metaDataChanged()
{
reply->metaDataChanged();
diff --git a/src/network/access/qnetworkaccessbackend_p.h b/src/network/access/qnetworkaccessbackend_p.h
index 4ce37a6..4fe6de6 100644
--- a/src/network/access/qnetworkaccessbackend_p.h
+++ b/src/network/access/qnetworkaccessbackend_p.h
@@ -188,6 +188,7 @@ protected slots:
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth);
#endif
void authenticationRequired(QAuthenticator *auth);
+ void cacheCredentials(QAuthenticator *auth);
void metaDataChanged();
void redirectionRequested(const QUrl &destination);
void sslErrors(const QList<QSslError> &errors);
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 3154ed6..a6c5c02 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -346,6 +346,8 @@ void QNetworkAccessHttpBackend::setupConnection()
#endif
connect(http, SIGNAL(authenticationRequired(QHttpNetworkRequest,QAuthenticator*)),
SLOT(httpAuthenticationRequired(QHttpNetworkRequest,QAuthenticator*)));
+ connect(http, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
+ SLOT(httpCacheCredentials(QHttpNetworkRequest,QAuthenticator*)));
connect(http, SIGNAL(error(QNetworkReply::NetworkError,QString)),
SLOT(httpError(QNetworkReply::NetworkError,QString)));
#ifndef QT_NO_OPENSSL
@@ -578,6 +580,11 @@ void QNetworkAccessHttpBackend::postRequest()
if (request().attribute(QNetworkRequest::HttpPipeliningAllowedAttribute).toBool() == true)
httpRequest.setPipeliningAllowed(true);
+ if (static_cast<QNetworkRequest::LoadControl>
+ (request().attribute(QNetworkRequest::AuthenticationReuseAttribute,
+ QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Manual)
+ httpRequest.setWithCredentials(false);
+
httpReply = http->sendRequest(httpRequest);
httpReply->setParent(this);
#ifndef QT_NO_OPENSSL
@@ -861,6 +868,12 @@ void QNetworkAccessHttpBackend::httpAuthenticationRequired(const QHttpNetworkReq
authenticationRequired(auth);
}
+void QNetworkAccessHttpBackend::httpCacheCredentials(const QHttpNetworkRequest &,
+ QAuthenticator *auth)
+{
+ cacheCredentials(auth);
+}
+
void QNetworkAccessHttpBackend::httpError(QNetworkReply::NetworkError errorCode,
const QString &errorString)
{
diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h
index e5cc0ab..254907f 100644
--- a/src/network/access/qnetworkaccesshttpbackend_p.h
+++ b/src/network/access/qnetworkaccesshttpbackend_p.h
@@ -107,6 +107,7 @@ private slots:
void replyFinished();
void replyHeaderChanged();
void httpAuthenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *auth);
+ void httpCacheCredentials(const QHttpNetworkRequest &request, QAuthenticator *auth);
void httpError(QNetworkReply::NetworkError error, const QString &errorString);
bool sendCacheContents(const QNetworkCacheMetaData &metaData);
void finished(); // override
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index feb9d99..1c7661d 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -948,10 +948,15 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
// but the data that is outgoing is random-access
request.setHeader(QNetworkRequest::ContentLengthHeader, outgoingData->size());
}
- if (d->cookieJar) {
- QList<QNetworkCookie> cookies = d->cookieJar->cookiesForUrl(request.url());
- if (!cookies.isEmpty())
- request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies));
+
+ if (static_cast<QNetworkRequest::LoadControl>
+ (request.attribute(QNetworkRequest::CookieLoadControlAttribute,
+ QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Automatic) {
+ if (d->cookieJar) {
+ QList<QNetworkCookie> cookies = d->cookieJar->cookiesForUrl(request.url());
+ if (!cookies.isEmpty())
+ request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies));
+ }
}
// first step: create the reply
@@ -967,11 +972,15 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
priv->manager = this;
// second step: fetch cached credentials
- QNetworkAuthenticationCredential *cred = d->fetchCachedCredentials(url);
- if (cred) {
- url.setUserName(cred->user);
- url.setPassword(cred->password);
- priv->urlForLastAuthentication = url;
+ if (static_cast<QNetworkRequest::LoadControl>
+ (request.attribute(QNetworkRequest::AuthenticationReuseAttribute,
+ QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Automatic) {
+ QNetworkAuthenticationCredential *cred = d->fetchCachedCredentials(url);
+ if (cred) {
+ url.setUserName(cred->user);
+ url.setPassword(cred->password);
+ priv->urlForLastAuthentication = url;
+ }
}
// third step: find a backend
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 128d18f..31ee2a4 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -673,8 +673,12 @@ void QNetworkReplyImplPrivate::error(QNetworkReplyImpl::NetworkError code, const
void QNetworkReplyImplPrivate::metaDataChanged()
{
Q_Q(QNetworkReplyImpl);
- // do we have cookies?
- if (cookedHeaders.contains(QNetworkRequest::SetCookieHeader) && !manager.isNull()) {
+ // 1. do we have cookies?
+ // 2. are we allowed to set them?
+ if (cookedHeaders.contains(QNetworkRequest::SetCookieHeader) && !manager.isNull()
+ && (static_cast<QNetworkRequest::LoadControl>
+ (request.attribute(QNetworkRequest::CookieSaveControlAttribute,
+ QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Automatic)) {
QList<QNetworkCookie> cookies =
qvariant_cast<QList<QNetworkCookie> >(cookedHeaders.value(QNetworkRequest::SetCookieHeader));
QNetworkCookieJar *jar = manager->cookieJar();
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 61c116d..911eadc 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -190,6 +190,46 @@ QT_BEGIN_NAMESPACE
of other verbs than GET, POST, PUT and DELETE). This verb is set
when calling QNetworkAccessManager::sendCustomRequest().
+ \value CookieLoadControlAttribute
+ Requests only, type: QVariant::Int (default: QNetworkRequest::Automatic)
+ Indicates whether to send 'Cookie' headers in the request.
+
+ This attribute is set to false by QtWebKit when creating a cross-origin
+ XMLHttpRequest where withCredentials has not been set explicitly to true by the
+ Javascript that created the request.
+
+ See http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag for more information.
+
+ \since 4.7
+
+ \value CookieSaveControlAttribute
+ Requests only, type: QVariant::Int (default: QNetworkRequest::Automatic)
+ Indicates whether to save 'Cookie' headers received from the server in reply
+ to the request.
+
+ This attribute is set to false by QtWebKit when creating a cross-origin
+ XMLHttpRequest where withCredentials has not been set explicitly to true by the
+ Javascript that created the request.
+
+ See http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag for more information.
+
+ \since 4.7
+
+ \value AuthenticationReuseControlAttribute
+ Requests only, type: QVariant::Int (default: QNetworkRequest::Automatic)
+ Indicates whether to use cached authorization credentials in the request,
+ if available. If this is set to QNetworkRequest::Manual and the authentication
+ mechanism is 'Basic' or 'Digest', Qt will not send an an 'Authorization' HTTP
+ header with any cached credentials it may have for the request's URL.
+
+ This attribute is set to QNetworkRequest::Manual by QtWebKit when creating a cross-origin
+ XMLHttpRequest where withCredentials has not been set explicitly to true by the
+ Javascript that created the request.
+
+ See http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag for more information.
+
+ \since 4.7
+
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default
@@ -222,6 +262,18 @@ QT_BEGIN_NAMESPACE
if the item was not cached (i.e., off-line mode)
*/
+/*!
+ \enum QNetworkRequest::LoadControl
+ \since 4.7
+
+ Indicates if an aspect of the request's loading mechanism has been
+ manually overridden, e.g. by QtWebKit.
+
+ \value Automatic default value: indicates default behaviour.
+
+ \value Manual indicates behaviour has been manually overridden.
+*/
+
class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate
{
public:
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index a0ef1a6..d2945c4 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -79,6 +79,9 @@ public:
HttpPipeliningAllowedAttribute,
HttpPipeliningWasUsedAttribute,
CustomVerbAttribute,
+ CookieLoadControlAttribute,
+ AuthenticationReuseAttribute,
+ CookieSaveControlAttribute,
User = 1000,
UserMax = 32767
@@ -89,6 +92,10 @@ public:
PreferCache,
AlwaysCache
};
+ enum LoadControl {
+ Automatic = 0,
+ Manual
+ };
enum Priority {
HighPriority = 1,
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index f287630..28a6c84 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -471,6 +471,18 @@ void QHostInfoRunnable::run()
hostInfo.setLookupId(id);
resultEmitter.emitResultsReady(hostInfo);
+ // now also iterate through the postponed ones
+ QMutableListIterator<QHostInfoRunnable*> iterator(manager->postponedLookups);
+ while (iterator.hasNext()) {
+ QHostInfoRunnable* postponed = iterator.next();
+ if (toBeLookedUp == postponed->toBeLookedUp) {
+ // we can now emit
+ iterator.remove();
+ hostInfo.setLookupId(postponed->id);
+ postponed->resultEmitter.emitResultsReady(hostInfo);
+ }
+ }
+
manager->lookupFinished(this);
// thread goes back to QThreadPool
@@ -596,6 +608,23 @@ void QHostInfoLookupManager::abortLookup(int id)
return;
QMutexLocker locker(&this->mutex);
+
+ // is postponed? delete and return
+ for (int i = 0; i < postponedLookups.length(); i++) {
+ if (postponedLookups.at(i)->id == id) {
+ delete postponedLookups.takeAt(i);
+ return;
+ }
+ }
+
+ // is scheduled? delete and return
+ for (int i = 0; i < scheduledLookups.length(); i++) {
+ if (scheduledLookups.at(i)->id == id) {
+ delete scheduledLookups.takeAt(i);
+ return;
+ }
+ }
+
if (!abortedLookups.contains(id))
abortedLookups.append(id);
}
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index e11766b..85d14c2 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -84,7 +84,7 @@ public Q_SLOTS:
}
Q_SIGNALS:
- void resultsReady(const QHostInfo info);
+ void resultsReady(const QHostInfo &info);
};
// needs to be QObject because fromName calls tr()
@@ -173,6 +173,8 @@ public:
bool wasAborted(int id);
QHostInfoCache cache;
+
+ friend class QHostInfoRunnable;
protected:
QList<QHostInfoRunnable*> currentLookups; // in progress
QList<QHostInfoRunnable*> postponedLookups; // postponed because in progress for same host
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index d155357..70bb0da 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -425,6 +425,9 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16
case EBADF:
case EFAULT:
case ENOTSOCK:
+#ifdef Q_OS_SYMBIAN
+ case EPIPE:
+#endif
socketState = QAbstractSocket::UnconnectedState;
default:
break;
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp
index 932126d..55f926d 100644
--- a/src/network/socket/qtcpserver.cpp
+++ b/src/network/socket/qtcpserver.cpp
@@ -562,7 +562,7 @@ QTcpSocket *QTcpServer::nextPendingConnection()
to the other thread and create the QTcpSocket object there and
use its setSocketDescriptor() method.
- \sa newConnection(), nextPendingConnection()
+ \sa newConnection(), nextPendingConnection(), addPendingConnection()
*/
void QTcpServer::incomingConnection(int socketDescriptor)
{
@@ -572,6 +572,22 @@ void QTcpServer::incomingConnection(int socketDescriptor)
QTcpSocket *socket = new QTcpSocket(this);
socket->setSocketDescriptor(socketDescriptor);
+ addPendingConnection(socket);
+}
+
+/*!
+ This function is called by QTcpServer::incomingConnection()
+ to add a socket to the list of pending incoming connections.
+
+ \note Don't forget to call this member from reimplemented
+ incomingConnection() if you do not want to break the
+ Pending Connections mechanism.
+
+ \sa incomingConnection()
+ \since 4.7
+*/
+void QTcpServer::addPendingConnection(QTcpSocket* socket)
+{
d_func()->pendingConnections.append(socket);
}
diff --git a/src/network/socket/qtcpserver.h b/src/network/socket/qtcpserver.h
index 7aebffe..b206678 100644
--- a/src/network/socket/qtcpserver.h
+++ b/src/network/socket/qtcpserver.h
@@ -93,6 +93,7 @@ public:
protected:
virtual void incomingConnection(int handle);
+ void addPendingConnection(QTcpSocket* socket);
Q_SIGNALS:
void newConnection();
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
index adc69ee..46029b9 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
@@ -100,8 +100,10 @@ class QGL2PEXVertexArray
{
public:
QGL2PEXVertexArray() :
+ vertexArray(0), vertexArrayStops(0),
maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10),
- boundingRectDirty(true) {}
+ boundingRectDirty(true)
+ { }
inline void addRect(const QRectF &rect)
{
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 6ba0c42..0a046dc 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -177,6 +177,7 @@ public:
ctx(0),
useSystemClip(true),
elementIndicesVBOId(0),
+ opacityArray(0),
snapToPixelGrid(false),
addOffset(false),
nativePaintingActive(false),
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 994c1c9..410cf21 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -42,6 +42,10 @@
#include "qtextureglyphcache_gl_p.h"
#include "qpaintengineex_opengl2_p.h"
+#if defined QT_OPENGL_ES_2 && !defined(QT_NO_EGL)
+#include "private/qeglcontext_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
#ifdef Q_WS_WIN
@@ -49,12 +53,19 @@ extern Q_GUI_EXPORT bool qt_cleartype_enabled;
#endif
QGLTextureGlyphCache::QGLTextureGlyphCache(QGLContext *context, QFontEngineGlyphCache::Type type, const QTransform &matrix)
- : QTextureGlyphCache(type, matrix)
+ : QImageTextureGlyphCache(type, matrix)
, ctx(context)
, m_width(0)
, m_height(0)
{
- glGenFramebuffers(1, &m_fbo);
+ // broken FBO readback is a bug in the SGX 1.3 and 1.4 drivers for the N900 where
+ // copying between FBO's is broken if the texture is either GL_ALPHA or POT. The
+ // workaround is to use a system-memory copy of the glyph cache for this device.
+ // Switching to NPOT and GL_RGBA would both cost a lot more graphics memory and
+ // be slower, so that is not desireable.
+ if (!ctx->d_ptr->workaround_brokenFBOReadBack)
+ glGenFramebuffers(1, &m_fbo);
+
connect(QGLSignalProxy::instance(), SIGNAL(aboutToDestroyContext(const QGLContext*)),
SLOT(contextDestroyed(const QGLContext*)));
}
@@ -63,7 +74,9 @@ QGLTextureGlyphCache::~QGLTextureGlyphCache()
{
if (ctx) {
QGLShareContextScope scope(ctx);
- glDeleteFramebuffers(1, &m_fbo);
+
+ if (!ctx->d_ptr->workaround_brokenFBOReadBack)
+ glDeleteFramebuffers(1, &m_fbo);
if (m_width || m_height)
glDeleteTextures(1, &m_texture);
@@ -72,6 +85,18 @@ QGLTextureGlyphCache::~QGLTextureGlyphCache()
void QGLTextureGlyphCache::createTextureData(int width, int height)
{
+ // create in QImageTextureGlyphCache baseclass is meant to be called
+ // only to create the initial image and does not preserve the content,
+ // so we don't call when this function is called from resize.
+ if (ctx->d_ptr->workaround_brokenFBOReadBack && image().isNull())
+ QImageTextureGlyphCache::createTextureData(width, height);
+
+ // Make the lower glyph texture size 16 x 16.
+ if (width < 16)
+ width = 16;
+ if (height < 16)
+ height = 16;
+
glGenTextures(1, &m_texture);
glBindTexture(GL_TEXTURE_2D, m_texture);
@@ -93,14 +118,28 @@ void QGLTextureGlyphCache::createTextureData(int width, int height)
void QGLTextureGlyphCache::resizeTextureData(int width, int height)
{
- // ### the QTextureGlyphCache API needs to be reworked to allow
- // ### resizeTextureData to fail
-
int oldWidth = m_width;
int oldHeight = m_height;
+ // Make the lower glyph texture size 16 x 16.
+ if (width < 16)
+ width = 16;
+ if (height < 16)
+ height = 16;
+
GLuint oldTexture = m_texture;
createTextureData(width, height);
+
+ if (ctx->d_ptr->workaround_brokenFBOReadBack) {
+ QImageTextureGlyphCache::resizeTextureData(width, height);
+ Q_ASSERT(image().depth() == 8);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits());
+ glDeleteTextures(1, &oldTexture);
+ return;
+ }
+
+ // ### the QTextureGlyphCache API needs to be reworked to allow
+ // ### resizeTextureData to fail
glBindFramebuffer(GL_FRAMEBUFFER_EXT, m_fbo);
@@ -159,20 +198,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
glBindTexture(GL_TEXTURE_2D, m_texture);
-#ifdef QT_OPENGL_ES_2
- QDataBuffer<uchar> buffer(4*oldWidth*oldHeight);
- buffer.resize(4*oldWidth*oldHeight);
- glReadPixels(0, 0, oldWidth, oldHeight, GL_RGBA, GL_UNSIGNED_BYTE, buffer.data());
-
- // do an in-place conversion from GL_RGBA to GL_ALPHA
- for (int i=0; i<oldWidth*oldHeight; ++i)
- buffer.data()[i] = buffer.at(4*i + 3);
-
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight,
- GL_ALPHA, GL_UNSIGNED_BYTE, buffer.data());
-#else
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, oldWidth, oldHeight);
-#endif
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, 0);
@@ -187,6 +213,21 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
{
+ if (ctx->d_ptr->workaround_brokenFBOReadBack) {
+ QImageTextureGlyphCache::fillTexture(c, glyph);
+
+ glBindTexture(GL_TEXTURE_2D, m_texture);
+ const QImage &texture = image();
+ const uchar *bits = texture.constBits();
+ bits += c.y * texture.bytesPerLine() + c.x;
+ for (int i=0; i<c.h; ++i) {
+ glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y + i, c.w, 1, GL_ALPHA, GL_UNSIGNED_BYTE, bits);
+ bits += texture.bytesPerLine();
+ }
+
+ return;
+ }
+
QImage mask = textureMapForGlyph(glyph);
const int maskWidth = mask.width();
const int maskHeight = mask.height();
@@ -235,17 +276,6 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
}
}
-int QGLTextureGlyphCache::glyphMargin() const
-{
-#if defined(Q_WS_MAC)
- return 2;
-#elif defined (Q_WS_X11)
- return 0;
-#else
- return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
-#endif
-}
-
int QGLTextureGlyphCache::glyphPadding() const
{
return 1;
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index 75c2bb1..6bcd655 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
class QGL2PaintEngineExPrivate;
-class Q_OPENGL_EXPORT QGLTextureGlyphCache : public QObject, public QTextureGlyphCache
+class Q_OPENGL_EXPORT QGLTextureGlyphCache : public QObject, public QImageTextureGlyphCache
{
Q_OBJECT
public:
@@ -72,7 +72,6 @@ public:
virtual void createTextureData(int width, int height);
virtual void resizeTextureData(int width, int height);
virtual void fillTexture(const Coord &c, glyph_t glyph);
- virtual int glyphMargin() const;
virtual int glyphPadding() const;
inline GLuint texture() const { return m_texture; }
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
index f677ce1..9bc099d 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
@@ -481,7 +481,8 @@ static void qdashprocessor_cubicTo(qreal, qreal, qreal, qreal, qreal, qreal, voi
}
QDashedStrokeProcessor::QDashedStrokeProcessor()
- : m_dash_stroker(0), m_inv_scale(1)
+ : m_points(0), m_types(0),
+ m_dash_stroker(0), m_inv_scale(1)
{
m_dash_stroker.setMoveToHook(qdashprocessor_moveTo);
m_dash_stroker.setLineToHook(qdashprocessor_lineTo);
@@ -499,6 +500,8 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, c
m_points.reset();
m_types.reset();
+ m_points.reserve(path.elementCount());
+ m_types.reserve(path.elementCount());
qreal width = qpen_widthf(pen);
if (width == 0)
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
index 956d7cc..ab27ed6 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
@@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE
class QTriangulatingStroker
{
public:
+ QTriangulatingStroker() : m_vertices(0) {}
void process(const QVectorPath &path, const QPen &pen, const QRectF &clip);
inline int vertexCount() const { return m_vertices.size(); }
diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp
index ce917ff..df7cbc2 100644
--- a/src/opengl/gl2paintengineex/qtriangulator.cpp
+++ b/src/opengl/gl2paintengineex/qtriangulator.cpp
@@ -510,6 +510,7 @@ template <class T>
class QMaxHeap
{
public:
+ QMaxHeap() : m_data(0) {}
inline int size() const {return m_data.size();}
inline bool empty() const {return m_data.isEmpty();}
inline bool isEmpty() const {return m_data.isEmpty();}
@@ -1299,7 +1300,8 @@ public:
class ComplexToSimple
{
public:
- inline ComplexToSimple(QTriangulator *parent) : m_parent(parent) { }
+ inline ComplexToSimple(QTriangulator *parent) : m_parent(parent),
+ m_edges(0), m_events(0), m_splits(0) { }
void decompose();
private:
struct Edge
@@ -1412,7 +1414,7 @@ public:
class SimpleToMonotone
{
public:
- inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent) { }
+ inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent), m_edges(0), m_upperVertex(0) { }
void decompose();
private:
enum VertexType {MergeVertex, EndVertex, RegularVertex, StartVertex, SplitVertex};
@@ -1486,7 +1488,7 @@ public:
int m_length;
};
- inline QTriangulator() { }
+ inline QTriangulator() : m_vertices(0) { }
// Call this only once.
void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix);
@@ -2709,7 +2711,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition()
return;
Q_ASSERT(!m_edgeList.root);
- QDataBuffer<QPair<int, int> > diagonals;
+ QDataBuffer<QPair<int, int> > diagonals(m_upperVertex.size());
int i = 0;
for (int index = 1; index < m_edges.size(); ++index) {
@@ -2853,7 +2855,7 @@ bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j
void QTriangulator::MonotoneToTriangles::decompose()
{
QVector<quint32> result;
- QDataBuffer<int> stack;
+ QDataBuffer<int> stack(m_parent->m_indices.size());
m_first = 0;
// Require at least three more indices.
while (m_first + 3 <= m_parent->m_indices.size()) {
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index cfacf26..922a96c 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1612,6 +1612,9 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
current_fbo = 0;
default_fbo = 0;
active_engine = 0;
+ workaround_needsFullClearOnEveryFrame = false;
+ workaround_brokenFBOReadBack = false;
+ workaroundsCached = false;
for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
vertexAttributeArraysEnabledState[i] = false;
}
@@ -1723,7 +1726,6 @@ QGLTextureCache::QGLTextureCache()
QGLTextureCache::~QGLTextureCache()
{
- Q_ASSERT(size() == 0);
QImagePixmapCleanupHooks::instance()->removePixmapDataModificationHook(cleanupTexturesForPixampData);
QImagePixmapCleanupHooks::instance()->removePixmapDataDestructionHook(cleanupBeforePixmapDestruction);
QImagePixmapCleanupHooks::instance()->removeImageHook(cleanupTexturesForCacheKey);
@@ -2773,23 +2775,27 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex
/*!
\since 4.4
- Draws the given texture, \a textureId, to the given target rectangle,
- \a target, in OpenGL model space. The \a textureTarget should be a 2D
- texture target.
+ This function supports the following use cases:
+
+ \list
+ \i On OpenGL and OpenGL ES 1.x it draws the given texture, \a textureId,
+ to the given target rectangle, \a target, in OpenGL model space. The
+ \a textureTarget should be a 2D texture target.
+ \i On OpenGL and OpenGL ES 2.x, if a painter is active, not inside a
+ beginNativePainting / endNativePainting block, and uses the
+ engine with type QPaintEngine::OpenGL2, the function will draw the given
+ texture, \a textureId, to the given target rectangle, \a target,
+ respecting the current painter state. This will let you draw a texture
+ with the clip, transform, render hints, and composition mode set by the
+ painter. Note that the texture target needs to be GL_TEXTURE_2D for this
+ use case, and that this is the only supported use case under OpenGL ES 2.x.
+ \endlist
- \note This function is not supported under OpenGL/ES 2.0.
*/
void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget)
{
-#ifndef QT_OPENGL_ES_2
-#ifdef QT_OPENGL_ES
- if (textureTarget != GL_TEXTURE_2D) {
- qWarning("QGLContext::drawTexture(): texture target must be GL_TEXTURE_2D on OpenGL ES");
- return;
- }
-#else
-
- if (d_ptr->active_engine &&
+#if !defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2)
+ if (d_ptr->active_engine &&
d_ptr->active_engine->type() == QPaintEngine::OpenGL2) {
QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine);
if (!eng->isNativePaintingActive()) {
@@ -2799,7 +2805,15 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text
return;
}
}
+#endif
+#ifndef QT_OPENGL_ES_2
+#ifdef QT_OPENGL_ES
+ if (textureTarget != GL_TEXTURE_2D) {
+ qWarning("QGLContext::drawTexture(): texture target must be GL_TEXTURE_2D on OpenGL ES");
+ return;
+ }
+#else
const bool wasEnabled = glIsEnabled(GL_TEXTURE_2D);
GLint oldTexture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldTexture);
@@ -2821,7 +2835,7 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text
Q_UNUSED(target);
Q_UNUSED(textureId);
Q_UNUSED(textureTarget);
- qWarning("drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) not supported with OpenGL ES/2.0");
+ qWarning("drawTexture() with OpenGL ES 2.0 requires an active OpenGL2 paint engine");
#endif
}
@@ -2836,14 +2850,26 @@ void QGLContext::drawTexture(const QRectF &target, QMacCompatGLuint textureId, Q
/*!
\since 4.4
- Draws the given texture at the given \a point in OpenGL model
- space. The \a textureTarget should be a 2D texture target.
+ This function supports the following use cases:
+
+ \list
+ \i By default it draws the given texture, \a textureId,
+ at the given \a point in OpenGL model space. The
+ \a textureTarget should be a 2D texture target.
+ \i If a painter is active, not inside a
+ beginNativePainting / endNativePainting block, and uses the
+ engine with type QPaintEngine::OpenGL2, the function will draw the given
+ texture, \a textureId, at the given \a point,
+ respecting the current painter state. This will let you draw a texture
+ with the clip, transform, render hints, and composition mode set by the
+ painter. Note that the texture target needs to be GL_TEXTURE_2D for this
+ use case.
+ \endlist
- \note This function is not supported under OpenGL/ES.
+ \note This function is not supported under any version of OpenGL ES.
*/
void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget)
{
- // this would be ok on OpenGL ES 2.0, but currently we don't have a define for that
#ifdef QT_OPENGL_ES
Q_UNUSED(point);
Q_UNUSED(textureId);
@@ -2864,7 +2890,7 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_WIDTH, &textureWidth);
glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &textureHeight);
- if (d_ptr->active_engine &&
+ if (d_ptr->active_engine &&
d_ptr->active_engine->type() == QPaintEngine::OpenGL2) {
QGL2PaintEngineEx *eng = static_cast<QGL2PaintEngineEx*>(d_ptr->active_engine);
if (!eng->isNativePaintingActive()) {
@@ -4911,11 +4937,8 @@ void QGLWidget::deleteTexture(QMacCompatGLuint id)
/*!
\since 4.4
- Draws the given texture, \a textureId to the given target rectangle,
- \a target, in OpenGL model space. The \a textureTarget should be a 2D
- texture target.
-
- Equivalent to the corresponding QGLContext::drawTexture().
+ Calls the corresponding QGLContext::drawTexture() on
+ this widget's context.
*/
void QGLWidget::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget)
{
@@ -4935,10 +4958,8 @@ void QGLWidget::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QM
/*!
\since 4.4
- Draws the given texture, \a textureId, at the given \a point in OpenGL
- model space. The \a textureTarget should be a 2D texture target.
-
- Equivalent to the corresponding QGLContext::drawTexture().
+ Calls the corresponding QGLContext::drawTexture() on
+ this widget's context.
*/
void QGLWidget::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget)
{
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 92a064f..f297009 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -431,6 +431,7 @@ private:
friend class QGLFramebufferObjectPrivate;
friend class QGLFBOGLPaintDevice;
friend class QGLPaintDevice;
+ friend class QGLWidgetGLPaintDevice;
friend class QX11GLPixmapData;
friend class QX11GLSharedContexts;
private:
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 0fbbbf9..44e8ae9 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -185,8 +185,26 @@ void QGLContext::makeCurrent()
return;
}
- if (d->eglContext->makeCurrent(d->eglSurfaceForDevice()))
+ if (d->eglContext->makeCurrent(d->eglSurfaceForDevice())) {
QGLContextPrivate::setCurrentContext(this);
+ if (!d->workaroundsCached) {
+ d->workaroundsCached = true;
+ const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ if (strstr(renderer, "SGX") || strstr(renderer, "MBX")) {
+ // PowerVR MBX/SGX chips needs to clear all buffers when starting to render
+ // a new frame, otherwise there will be a performance penalty to pay for
+ // each frame.
+ d->workaround_needsFullClearOnEveryFrame = true;
+
+ // Older PowerVR SGX drivers (like the one in the N900) have a
+ // bug which prevents glCopyTexSubImage2D() to work with a POT
+ // or GL_ALPHA texture bound to an FBO. The only way to
+ // identify that driver is to check the EGL version number for it.
+ if (strstr(eglQueryString(d->eglContext->display(), EGL_VERSION), "1.3"))
+ d->workaround_brokenFBOReadBack = true;
+ }
+ }
+ }
}
void QGLContext::doneCurrent()
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index f19e394..d92f963 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -345,7 +345,7 @@ public:
HDC hbitmap_hdc;
#endif
#ifndef QT_NO_EGL
- bool ownsEglContext;
+ uint ownsEglContext : 1;
QEglContext *eglContext;
EGLSurface eglSurface;
void destroyEglSurfaceForDevice();
@@ -382,6 +382,12 @@ public:
uint internal_context : 1;
uint version_flags_cached : 1;
uint extension_flags_cached : 1;
+
+ // workarounds for driver/hw bugs on different platforms
+ uint workaround_needsFullClearOnEveryFrame : 1;
+ uint workaround_brokenFBOReadBack : 1;
+ uint workaroundsCached : 1;
+
QPaintDevice *paintDevice;
QColor transpColor;
QGLContext *q_ptr;
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index e874e85..e1dcbfd 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -175,7 +175,10 @@ void QGLWidgetGLPaintDevice::beginPaint()
float alpha = c.alphaF();
glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);
}
- glClear(GL_COLOR_BUFFER_BIT);
+ if (context()->d_func()->workaround_needsFullClearOnEveryFrame)
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ else
+ glClear(GL_COLOR_BUFFER_BIT);
}
}
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 306fd8b..08a50cb 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -668,6 +668,7 @@ public:
, last_created_state(0)
, shader_ctx(0)
, grad_palette(0)
+ , tess_points(0)
, drawable_texture(0)
, ref_cleaner(this)
{}
@@ -1950,6 +1951,8 @@ void QOpenGLPaintEnginePrivate::pathToVertexArrays(const QPainterPath &path)
void QOpenGLPaintEnginePrivate::drawVertexArrays()
{
+ if (tess_points_stops.count() == 0)
+ return;
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_DOUBLE, 0, tess_points.data());
int previous_stop = 0;
@@ -3947,7 +3950,7 @@ void QOpenGLPaintEnginePrivate::strokeLines(const QPainterPath &path)
enableClipping();
}
-extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
+Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
void QOpenGLPaintEnginePrivate::strokePath(const QPainterPath &path, bool use_cache)
{
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 1b9c8cc..3cd18fb 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -53,15 +53,17 @@
QT_BEGIN_NAMESPACE
QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
- : CActive(CActive::EPriorityStandard), engine(engine), ipConnectionNotifier(0),
- iError(QNetworkSession::UnknownSessionError),
- iALREnabled(0), iConnectInBackground(false)
+ : CActive(CActive::EPriorityUserInput), engine(engine),
+ ipConnectionNotifier(0), iHandleStateNotificationsFromManager(false),
+ iFirstSync(true), iStoppedByUser(false), iClosedByUser(false), iDeprecatedConnectionId(0),
+ iError(QNetworkSession::UnknownSessionError), iALREnabled(0), iConnectInBackground(false)
{
CActiveScheduler::Add(this);
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
iMobility = NULL;
#endif
+
TRAP_IGNORE(iConnectionMonitor.ConnectL());
}
@@ -90,18 +92,72 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
// Close global 'Open C' RConnection
setdefaultif(0);
-
- iConnectionMonitor.CancelNotifications();
+
iConnectionMonitor.Close();
}
+void QNetworkSessionPrivateImpl::configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState)
+{
+ if (iHandleStateNotificationsFromManager) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "configurationStateChanged from manager for IAP : " << QString::number(accessPointId)
+ << "configurationStateChanged connMon ID : " << QString::number(connMonId)
+ << " : to a state: " << newState
+ << " whereas my current state is: " << state;
+#endif
+ if (connMonId == iDeprecatedConnectionId) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "however status update from manager ignored because it related to already closed connection.";
+#endif
+ return;
+ }
+ this->newState(newState, accessPointId);
+ }
+}
+
+void QNetworkSessionPrivateImpl::configurationRemoved(QNetworkConfigurationPrivatePointer config)
+{
+ if (!publicConfig.isValid())
+ return;
+
+ SymbianNetworkConfigurationPrivate *symbianConfig = toSymbianConfig(config);
+
+ symbianConfig->mutex.lock();
+ TUint32 configNumericId = symbianConfig->numericId;
+ symbianConfig->mutex.unlock();
+
+ symbianConfig = toSymbianConfig(privateConfiguration(publicConfig));
+
+ symbianConfig->mutex.lock();
+ TUint32 publicNumericId = symbianConfig->numericId;
+ symbianConfig->mutex.unlock();
+
+ if (configNumericId == publicNumericId) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "configurationRemoved IAP: " << QString::number(publicNumericId) << " : going to State: Invalid";
+#endif
+ this->newState(QNetworkSession::Invalid, publicNumericId);
+ }
+}
+
void QNetworkSessionPrivateImpl::syncStateWithInterface()
{
if (!publicConfig.isValid())
return;
- // Start monitoring changes in IAP states
- TRAP_IGNORE(iConnectionMonitor.NotifyEventL(*this));
+ if (iFirstSync && publicConfig.isValid()) {
+ QObject::connect(engine, SIGNAL(configurationStateChanged(TUint32, TUint32, QNetworkSession::State)),
+ this, SLOT(configurationStateChanged(TUint32, TUint32, QNetworkSession::State)));
+ // Listen to configuration removals, so that in case the configuration
+ // this session is based on is removed, session knows to enter Invalid -state.
+ QObject::connect(engine, SIGNAL(configurationRemoved(QNetworkConfigurationPrivatePointer)),
+ this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
+ }
+ // Start listening IAP state changes from QNetworkConfigurationManagerPrivate
+ iHandleStateNotificationsFromManager = true;
// Check open connections to see if there is already
// an open connection to selected IAP or SNAP
@@ -137,11 +193,8 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
}
if (state != QNetworkSession::Connected) {
- // There were no open connections to used IAP or SNAP
- if (iError == QNetworkSession::InvalidConfigurationError) {
- newState(QNetworkSession::Invalid);
- } else if ((publicConfig.state() & QNetworkConfiguration::Discovered) ==
- QNetworkConfiguration::Discovered) {
+ if ((publicConfig.state() & QNetworkConfiguration::Discovered) ==
+ QNetworkConfiguration::Discovered) {
newState(QNetworkSession::Disconnected);
} else {
newState(QNetworkSession::NotAvailable);
@@ -245,13 +298,18 @@ QNetworkSession::SessionError QNetworkSessionPrivateImpl::error() const
void QNetworkSessionPrivateImpl::open()
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "open() called, session state is: " << state << " and isOpen is: "
+ << isOpen;
+#endif
if (isOpen || (state == QNetworkSession::Connecting)) {
return;
}
-
- // Cancel notifications from RConnectionMonitor
+
+ // Stop handling IAP state change signals from QNetworkConfigurationManagerPrivate
// => RConnection::ProgressNotification will be used for IAP/SNAP monitoring
- iConnectionMonitor.CancelNotifications();
+ iHandleStateNotificationsFromManager = false;
// Configuration may have been invalidated after session creation by platform
// (e.g. configuration has been deleted).
@@ -259,19 +317,25 @@ void QNetworkSessionPrivateImpl::open()
newState(QNetworkSession::Invalid);
iError = QNetworkSession::InvalidConfigurationError;
emit QNetworkSessionPrivate::error(iError);
- syncStateWithInterface();
return;
}
- // If opening a (un)defined configuration, session emits error and enters
- // NotAvailable -state.
- if (publicConfig.state() == QNetworkConfiguration::Undefined ||
- publicConfig.state() == QNetworkConfiguration::Defined) {
+ // If opening a undefined configuration, session emits error and enters
+ // NotAvailable -state. Note that we will try ones in 'defined' state to avoid excessive
+ // need for WLAN scans (via updateConfigurations()), because user may have walked
+ // into a WLAN range, but periodic background scan has not occurred yet -->
+ // we don't want to force application to make frequent updateConfigurations() calls
+ // to be able to try if e.g. home WLAN is available.
+ if (publicConfig.state() == QNetworkConfiguration::Undefined) {
newState(QNetworkSession::NotAvailable);
iError = QNetworkSession::InvalidConfigurationError;
emit QNetworkSessionPrivate::error(iError);
return;
}
-
+ // Clear possible previous states
+ iStoppedByUser = false;
+ iClosedByUser = false;
+ iDeprecatedConnectionId = 0;
+
TInt error = iSocketServ.Connect();
if (error != KErrNone) {
// Could not open RSocketServ
@@ -446,16 +510,18 @@ TUint QNetworkSessionPrivateImpl::iapClientCount(TUint aIAPId) const
void QNetworkSessionPrivateImpl::close(bool allowSignals)
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "close() called, session state is: " << state << " and isOpen is : "
+ << isOpen;
+#endif
if (!isOpen) {
return;
}
-
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(activeConfig));
-
- symbianConfig->mutex.lock();
- TUint activeIap = symbianConfig->numericId;
- symbianConfig->mutex.unlock();
+ // Mark this session as closed-by-user so that we are able to report
+ // distinguish between stop() and close() state transitions
+ // when reporting.
+ iClosedByUser = true;
isOpen = false;
activeConfig = QNetworkConfiguration();
@@ -469,8 +535,10 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
}
#endif
- if (ipConnectionNotifier) {
+ if (ipConnectionNotifier && !iHandleStateNotificationsFromManager) {
ipConnectionNotifier->StopNotifications();
+ // Start handling IAP state change signals from QNetworkConfigurationManagerPrivate
+ iHandleStateNotificationsFromManager = true;
}
iConnection.Close();
@@ -479,29 +547,31 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
// Close global 'Open C' RConnection
setdefaultif(0);
-#ifdef Q_CC_NOKIAX86
- if ((allowSignals && iapClientCount(activeIap) <= 0) ||
-#else
- if ((allowSignals && iapClientCount(activeIap) <= 1) ||
-#endif
- (publicConfig.type() == QNetworkConfiguration::UserChoice)) {
+ if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
newState(QNetworkSession::Closing);
+ newState(QNetworkSession::Disconnected);
}
- syncStateWithInterface();
if (allowSignals) {
- if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
- newState(QNetworkSession::Disconnected);
- }
emit closed();
}
}
void QNetworkSessionPrivateImpl::stop()
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "stop() called, session state is: " << state << " and isOpen is : "
+ << isOpen;
+#endif
if (!isOpen &&
publicConfig.isValid() &&
publicConfig.type() == QNetworkConfiguration::InternetAccessPoint) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "since session is not open, using RConnectionMonitor to stop() the interface";
+#endif
+ iStoppedByUser = true;
// If the publicConfig is type of IAP, enumerate through connections at
// connection monitor. If publicConfig is active in that list, stop it.
// Otherwise there is nothing to stop. Note: because this QNetworkSession is not open,
@@ -515,7 +585,7 @@ void QNetworkSessionPrivateImpl::stop()
}
TUint numSubConnections; // Not used but needed by GetConnectionInfo i/f
TUint connectionId;
- for (TInt i = 1; i <= count; ++i) {
+ for (TUint i = 1; i <= count; ++i) {
// Get (connection monitor's assigned) connection ID
TInt ret = iConnectionMonitor.GetConnectionInfo(i, connectionId, numSubConnections);
if (ret == KErrNone) {
@@ -532,11 +602,25 @@ void QNetworkSessionPrivateImpl::stop()
ETrue);
}
}
+ // Enter disconnected state right away since the session is not even open.
+ // Symbian^3 connection monitor does not emit KLinkLayerClosed when
+ // connection is stopped via connection monitor.
+ newState(QNetworkSession::Disconnected);
}
} else if (isOpen) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "since session is open, using RConnection to stop() the interface";
+#endif
// Since we are open, use RConnection to stop the interface
isOpen = false;
+ iStoppedByUser = true;
newState(QNetworkSession::Closing);
+ if (ipConnectionNotifier) {
+ ipConnectionNotifier->StopNotifications();
+ // Start handling IAP state change signals from QNetworkConfigurationManagerPrivate
+ iHandleStateNotificationsFromManager = true;
+ }
iConnection.Stop(RConnection::EStopAuthoritative);
isOpen = true;
close(false);
@@ -654,6 +738,10 @@ void QNetworkSessionPrivateImpl::NewCarrierActive(TAccessPointInfo /*aNewAPInfo*
void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "roaming Error() occured";
+#endif
if (isOpen) {
isOpen = false;
activeConfig = QNetworkConfiguration();
@@ -671,6 +759,11 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
// changes immediately to Disconnected.
newState(QNetworkSession::Disconnected);
emit closed();
+ } else if (iStoppedByUser) {
+ // If the user of this session has called the stop() and
+ // configuration is based on internet SNAP, this needs to be
+ // done here because platform might roam.
+ newState(QNetworkSession::Disconnected);
}
}
#endif
@@ -947,7 +1040,7 @@ void QNetworkSessionPrivateImpl::RunL()
#endif
if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
serviceConfig = QNetworkConfigurationManager()
- .configurationFromIdentifier(symbianConfig->serviceNetworkPtr->id);
+ .configurationFromIdentifier(symbianConfig->id);
}
symbianConfig->mutex.unlock();
@@ -975,7 +1068,12 @@ void QNetworkSessionPrivateImpl::RunL()
isOpen = false;
activeConfig = QNetworkConfiguration();
serviceConfig = QNetworkConfiguration();
- iError = QNetworkSession::UnknownSessionError;
+ if (publicConfig.state() == QNetworkConfiguration::Undefined ||
+ publicConfig.state() == QNetworkConfiguration::Defined) {
+ iError = QNetworkSession::InvalidConfigurationError;
+ } else {
+ iError = QNetworkSession::UnknownSessionError;
+ }
emit QNetworkSessionPrivate::error(iError);
Cancel();
if (ipConnectionNotifier) {
@@ -991,8 +1089,16 @@ void QNetworkSessionPrivateImpl::DoCancel()
iConnection.Close();
}
+// Enters newState if feasible according to current state.
+// AccessPointId may be given as parameter. If it is zero, state-change is assumed to
+// concern this session's configuration. If non-zero, the configuration is looked up
+// and checked if it matches the configuration this session is based on.
bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint accessPointId)
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "NEW STATE, IAP ID : " << QString::number(accessPointId) << " , newState : " << QString::number(newState);
+#endif
// Make sure that activeConfig is always updated when SNAP is signaled to be
// connected.
if (isOpen && publicConfig.type() == QNetworkConfiguration::ServiceNetwork &&
@@ -1027,9 +1133,29 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
if (state == QNetworkSession::Roaming && newState == QNetworkSession::Connecting) {
return false;
}
+
+ // Make sure that Connected state is not reported when Connection is
+ // already Closing.
+ // Note: Stopping connection results sometimes KLinkLayerOpen
+ // to be reported first (just before KLinkLayerClosed).
+ if (state == QNetworkSession::Closing && newState == QNetworkSession::Connected) {
+ return false;
+ }
+
+ // Make sure that some lagging 'closing' state-changes do not overwrite
+ // if we are already disconnected or closed.
+ if (state == QNetworkSession::Disconnected && newState == QNetworkSession::Closing) {
+ return false;
+ }
bool emitSessionClosed = false;
- if (isOpen && state == QNetworkSession::Connected && newState == QNetworkSession::Disconnected) {
+
+ // If we abruptly go down and user hasn't closed the session, we've been aborted.
+ // Note that session may be in 'closing' state and not in 'connected' state, because
+ // depending on platform the platform may report KConfigDaemonStartingDeregistration
+ // event before KLinkLayerClosed
+ if ((isOpen && state == QNetworkSession::Connected && newState == QNetworkSession::Disconnected) ||
+ (isOpen && !iClosedByUser && newState == QNetworkSession::Disconnected)) {
// Active & Connected state should change directly to Disconnected state
// only when something forces connection to close (eg. when another
// application or session stops connection or when network drops
@@ -1043,14 +1169,17 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
- // Start monitoring changes in IAP states
- TRAP_IGNORE(iConnectionMonitor.NotifyEventL(*this));
+ // Start handling IAP state change signals from QNetworkConfigurationManagerPrivate
+ iHandleStateNotificationsFromManager = true;
emitSessionClosed = true; // Emit SessionClosed after state change has been reported
}
bool retVal = false;
if (accessPointId == 0) {
state = newState;
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed A to: " << state;
+#endif
emit stateChanged(state);
retVal = true;
} else {
@@ -1063,6 +1192,9 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
configLocker.unlock();
state = newState;
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed B to: " << state;
+#endif
emit stateChanged(state);
retVal = true;
}
@@ -1075,6 +1207,9 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
configLocker.unlock();
state = newState;
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed C to: " << state;
+#endif
emit stateChanged(state);
retVal = true;
}
@@ -1087,21 +1222,14 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
QMutexLocker configLocker(&symbianConfig->mutex);
if (symbianConfig->numericId == accessPointId) {
- if (newState == QNetworkSession::Connected) {
- // Make sure that when AccessPoint is reported to be Connected
- // also state of the related configuration changes to Active.
- symbianConfig->state = QNetworkConfiguration::Active;
- configLocker.unlock();
-
+ if (newState != QNetworkSession::Disconnected) {
state = newState;
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed D to: " << state;
+#endif
emit stateChanged(state);
retVal = true;
} else {
- if (newState == QNetworkSession::Disconnected) {
- // Make sure that when AccessPoint is reported to be disconnected
- // also state of the related configuration changes from Active to Defined.
- symbianConfig->state = QNetworkConfiguration::Defined;
- }
QNetworkConfiguration config = bestConfigFromSNAP(publicConfig);
if ((config.state() == QNetworkConfiguration::Defined) ||
(config.state() == QNetworkConfiguration::Discovered)) {
@@ -1109,8 +1237,21 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
configLocker.unlock();
state = newState;
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed E to: " << state;
+#endif
emit stateChanged(state);
retVal = true;
+ } else if (config.state() == QNetworkConfiguration::Active) {
+ // Connection to used IAP was closed, but there is another
+ // IAP that's active in used SNAP
+ // => Change state back to Connected
+ state = QNetworkSession::Connected;
+ emit stateChanged(state);
+ retVal = true;
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed F to: " << state;
+#endif
}
}
}
@@ -1121,6 +1262,19 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
if (emitSessionClosed) {
emit closed();
}
+ if (state == QNetworkSession::Disconnected) {
+ // The connection has gone down, and processing of status updates must be
+ // stopped. Depending on platform, there may come 'connecting/connected' states
+ // considerably later (almost a second). Connection id is an increasing
+ // number, so this does not affect next _real_ 'conneting/connected' states.
+
+ SymbianNetworkConfigurationPrivate *symbianConfig =
+ toSymbianConfig(privateConfiguration(publicConfig));
+
+ symbianConfig->mutex.lock();
+ iDeprecatedConnectionId = symbianConfig->connectionId;
+ symbianConfig->mutex.unlock();
+ }
return retVal;
}
@@ -1129,6 +1283,9 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
TInt aError,
TUint accessPointId)
{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << QString::number(accessPointId) << " , status : " << QString::number(aConnectionStatus);
+#endif
switch (aConnectionStatus)
{
// Connection unitialised
@@ -1167,6 +1324,7 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
case KCsdGotLoginInfo:
break;
+ case KConfigDaemonStartingRegistration:
// Creating connection (e.g. GPRS activation)
case KCsdStartingConnect:
case KCsdFinishedConnect:
@@ -1193,6 +1351,7 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
case KDataTransferTemporarilyBlocked:
break;
+ case KConfigDaemonStartingDeregistration:
// Hangup or GRPS deactivation
case KConnectionStartingClose:
newState(QNetworkSession::Closing,accessPointId);
@@ -1200,137 +1359,27 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
// Connection closed
case KConnectionClosed:
- break;
-
case KLinkLayerClosed:
newState(QNetworkSession::Disconnected,accessPointId);
+ // Report manager about this to make sure this event
+ // is received by all interseted parties (mediated by
+ // manager because it does always receive all events from
+ // connection monitor).
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "reporting disconnection to manager.";
+#endif
+ if (publicConfig.isValid()) {
+ engine->configurationStateChangeReport(toSymbianConfig(privateConfiguration(publicConfig))->numericId, QNetworkSession::Disconnected);
+ }
break;
-
// Unhandled state
default:
break;
}
}
-void QNetworkSessionPrivateImpl::EventL(const CConnMonEventBase& aEvent)
-{
- switch (aEvent.EventType())
- {
- case EConnMonConnectionStatusChange:
- {
- CConnMonConnectionStatusChange* realEvent;
- realEvent = (CConnMonConnectionStatusChange*) &aEvent;
-
- TUint connectionId = realEvent->ConnectionId();
- TInt connectionStatus = realEvent->ConnectionStatus();
-
- // Try to Find IAP Id using connection Id
- TUint apId = 0;
- if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
- QList<QNetworkConfiguration> subConfigurations = publicConfig.children();
- for (int i = 0; i < subConfigurations.count(); i++ ) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(subConfigurations[i]));
-
- QMutexLocker configLocker(&symbianConfig->mutex);
-
- if (symbianConfig->connectionId == connectionId) {
- apId = symbianConfig->numericId;
- break;
- }
- }
- } else if (publicConfig.type() == QNetworkConfiguration::InternetAccessPoint) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(publicConfig));
-
- symbianConfig->mutex.lock();
- if (symbianConfig->connectionId == connectionId)
- apId = symbianConfig->numericId;
- symbianConfig->mutex.unlock();
- }
-
- if (apId > 0) {
- handleSymbianConnectionStatusChange(connectionStatus, KErrNone, apId);
- }
- }
- break;
-
- case EConnMonCreateConnection:
- {
- CConnMonCreateConnection* realEvent;
- realEvent = (CConnMonCreateConnection*) &aEvent;
- TUint apId;
- TUint connectionId = realEvent->ConnectionId();
- TRequestStatus status;
- iConnectionMonitor.GetUintAttribute(connectionId, 0, KIAPId, apId, status);
- User::WaitForRequest(status);
- if (status.Int() == KErrNone) {
- // Store connection id to related AccessPoint Configuration
- if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
- QList<QNetworkConfiguration> subConfigurations = publicConfig.children();
- for (int i = 0; i < subConfigurations.count(); i++ ) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(subConfigurations[i]));
-
- QMutexLocker configLocker(&symbianConfig->mutex);
-
- if (symbianConfig->numericId == apId) {
- symbianConfig->connectionId = connectionId;
- break;
- }
- }
- } else if (publicConfig.type() == QNetworkConfiguration::InternetAccessPoint) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(publicConfig));
-
- symbianConfig->mutex.lock();
- if (symbianConfig->numericId == apId)
- symbianConfig->connectionId = connectionId;
- symbianConfig->mutex.unlock();
- }
- }
- }
- break;
-
- case EConnMonDeleteConnection:
- {
- CConnMonDeleteConnection* realEvent;
- realEvent = (CConnMonDeleteConnection*) &aEvent;
- TUint connectionId = realEvent->ConnectionId();
- // Remove connection id from related AccessPoint Configuration
- if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
- QList<QNetworkConfiguration> subConfigurations = publicConfig.children();
- for (int i = 0; i < subConfigurations.count(); i++ ) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(subConfigurations[i]));
-
- QMutexLocker configLocker(&symbianConfig->mutex);
-
- if (symbianConfig->connectionId == connectionId) {
- symbianConfig->connectionId = 0;
- break;
- }
- }
- } else if (publicConfig.type() == QNetworkConfiguration::InternetAccessPoint) {
- SymbianNetworkConfigurationPrivate *symbianConfig =
- toSymbianConfig(privateConfiguration(publicConfig));
-
- symbianConfig->mutex.lock();
- if (symbianConfig->connectionId == connectionId)
- symbianConfig->connectionId = 0;
- symbianConfig->mutex.unlock();
- }
- }
- break;
-
- default:
- // For unrecognized events
- break;
- }
-}
-
-ConnectionProgressNotifier::ConnectionProgressNotifier(QNetworkSessionPrivateImpl &owner, RConnection &connection)
- : CActive(CActive::EPriorityStandard), iOwner(owner), iConnection(connection)
+ConnectionProgressNotifier::ConnectionProgressNotifier(QNetworkSessionPrivateImpl& owner, RConnection& connection)
+ : CActive(CActive::EPriorityUserInput), iOwner(owner), iConnection(connection)
{
CActiveScheduler::Add(this);
}
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index 7116519..9767293 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -75,9 +75,8 @@ class SymbianEngine;
class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate, public CActive,
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
- public MMobilityProtocolResp,
+ public MMobilityProtocolResp
#endif
- public MConnectionMonitorObserver
{
Q_OBJECT
public:
@@ -130,8 +129,9 @@ protected: // From CActive
void RunL();
void DoCancel();
-private: // MConnectionMonitorObserver
- void EventL(const CConnMonEventBase& aEvent);
+private Q_SLOTS:
+ void configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState);
+ void configurationRemoved(QNetworkConfigurationPrivatePointer config);
private:
TUint iapClientCount(TUint aIAPId) const;
@@ -157,6 +157,13 @@ private: // data
mutable RConnection iConnection;
mutable RConnectionMonitor iConnectionMonitor;
ConnectionProgressNotifier* ipConnectionNotifier;
+
+ bool iHandleStateNotificationsFromManager;
+ bool iFirstSync;
+ bool iStoppedByUser;
+ bool iClosedByUser;
+ TUint32 iDeprecatedConnectionId;
+
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
CActiveCommsMobilityApiExt* iMobility;
#endif
diff --git a/src/plugins/bearer/symbian/symbian.pro b/src/plugins/bearer/symbian/symbian.pro
index f915570..4f1e51c 100644
--- a/src/plugins/bearer/symbian/symbian.pro
+++ b/src/plugins/bearer/symbian/symbian.pro
@@ -11,6 +11,7 @@ SOURCES += symbianengine.cpp \
main.cpp
symbian {
+ TARGET.UID3=0x20021319
exists($${EPOCROOT}epoc32/release/winscw/udeb/cmmanager.lib)| \
exists($${EPOCROOT}epoc32/release/armv5/lib/cmmanager.lib) {
message("Building with SNAP support")
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 8e9675e..cea8b67 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -45,14 +45,14 @@
#include <commdb.h>
#include <cdbcols.h>
#include <d32dbms.h>
+#include <nifvar.h>
#include <QEventLoop>
#include <QTimer>
#include <QTime> // For randgen seeding
#include <QtCore> // For randgen seeding
-// #define QT_BEARERMGMT_CONFIGMGR_DEBUG
-#ifdef QT_BEARERMGMT_CONFIGMGR_DEBUG
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
#include <QDebug>
#endif
@@ -73,7 +73,9 @@
QT_BEGIN_NAMESPACE
-static const int KValueThatWillBeAddedToSNAPId = 1000;
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ static const int KValueThatWillBeAddedToSNAPId = 1000;
+#endif
static const int KUserChoiceIAPId = 0;
SymbianNetworkConfigurationPrivate::SymbianNetworkConfigurationPrivate()
@@ -657,26 +659,34 @@ void SymbianEngine::updateActiveAccessPoints()
iConnectionMonitor.GetConnectionCount(connectionCount, status);
User::WaitForRequest(status);
- // Go through all connections and set state of related IAPs to Active
+ // Go through all connections and set state of related IAPs to Active.
+ // Status needs to be checked carefully, because ConnMon lists also e.g.
+ // WLAN connections that are being currently tried --> we don't want to
+ // state these as active.
TUint connectionId;
TUint subConnectionCount;
TUint apId;
+ TInt connectionStatus;
if (status.Int() == KErrNone) {
for (TUint i = 1; i <= connectionCount; i++) {
iConnectionMonitor.GetConnectionInfo(i, connectionId, subConnectionCount);
iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
User::WaitForRequest(status);
QString ident = QString::number(qHash(apId));
-
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
if (ptr) {
- online = true;
- inactiveConfigs.removeOne(ident);
+ iConnectionMonitor.GetIntAttribute(connectionId, subConnectionCount, KConnectionStatus, connectionStatus, status);
+ User::WaitForRequest(status);
+ if (connectionStatus == KLinkLayerOpen) {
+ online = true;
+ inactiveConfigs.removeOne(ident);
- toSymbianConfig(ptr)->connectionId = connectionId;
+ QMutexLocker configLocker(&ptr->mutex);
+ toSymbianConfig(ptr)->connectionId = connectionId;
- // Configuration is Active
- changeConfigurationStateTo(ptr, QNetworkConfiguration::Active);
+ // Configuration is Active
+ changeConfigurationStateTo(ptr, QNetworkConfiguration::Active);
+ }
}
}
}
@@ -733,12 +743,12 @@ void SymbianEngine::accessPointScanningReady(TBool scanSuccessful, TConnMonIapIn
}
}
- // Make sure that state of rest of the IAPs won't be Discovered or Active
+ // Make sure that state of rest of the IAPs won't be Active
foreach (const QString &iface, unavailableConfigs) {
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
if (ptr) {
// Configuration is Defined
- changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined);
+ changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered);
}
}
}
@@ -894,21 +904,22 @@ void SymbianEngine::RunL()
QMutexLocker locker(&mutex);
if (iIgnoringUpdates) {
-#ifdef QT_BEARERMGMT_CONFIGMGR_DEBUG
- qDebug("CommsDB event handling postponed (postpone-timer running because IAPs/SNAPs were updated very recently).");
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug("QNCM CommsDB event handling postponed (postpone-timer running because IAPs/SNAPs were updated very recently).");
#endif
return;
}
if (iStatus != KErrCancel) {
RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
+
switch (event) {
case RDbNotifier::EUnlock: /** All read locks have been removed. */
case RDbNotifier::ECommit: /** A transaction has been committed. */
case RDbNotifier::ERollback: /** A transaction has been rolled back */
case RDbNotifier::ERecover: /** The database has been recovered */
-#ifdef QT_BEARERMGMT_CONFIGMGR_DEBUG
- qDebug("CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug("QNCM CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
#endif
iIgnoringUpdates = true;
// Other events than ECommit get lower priority. In practice with those events,
@@ -957,73 +968,95 @@ void SymbianEngine::DoCancel()
ipCommsDB->CancelRequestNotification();
}
-
void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
{
QMutexLocker locker(&mutex);
switch (aEvent.EventType()) {
- case EConnMonCreateConnection:
+ case EConnMonConnectionStatusChange:
{
- CConnMonCreateConnection* realEvent;
- realEvent = (CConnMonCreateConnection*) &aEvent;
- TUint subConnectionCount = 0;
- TUint apId;
- TUint connectionId = realEvent->ConnectionId();
- TRequestStatus status;
- iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
- User::WaitForRequest(status);
- QString ident = QString::number(qHash(apId));
-
- QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
- if (ptr) {
- toSymbianConfig(ptr)->connectionId = connectionId;
- // Configuration is Active
- if (changeConfigurationStateTo(ptr, QNetworkConfiguration::Active))
- updateStatesToSnaps();
-
- if (!iOnline) {
- iOnline = true;
-
- locker.unlock();
- emit this->onlineStateChanged(iOnline);
- locker.relock();
+ CConnMonConnectionStatusChange* realEvent;
+ realEvent = (CConnMonConnectionStatusChange*) &aEvent;
+ TInt connectionStatus = realEvent->ConnectionStatus();
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNCM Connection status : " << QString::number(connectionStatus) << " , connection monitor Id : " << realEvent->ConnectionId();
+#endif
+ if (connectionStatus == KConfigDaemonStartingRegistration) {
+ TUint connectionId = realEvent->ConnectionId();
+ TUint subConnectionCount = 0;
+ TUint apId;
+ TRequestStatus status;
+ iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
+ User::WaitForRequest(status);
+ QString ident = QString::number(qHash(apId));
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+ if (ptr) {
+ QMutexLocker configLocker(&ptr->mutex);
+ toSymbianConfig(ptr)->connectionId = connectionId;
+ emit this->configurationStateChanged(toSymbianConfig(ptr)->numericId, connectionId, QNetworkSession::Connecting);
}
- }
- }
- break;
-
- case EConnMonDeleteConnection:
- {
- CConnMonDeleteConnection* realEvent;
- realEvent = (CConnMonDeleteConnection*) &aEvent;
- TUint connectionId = realEvent->ConnectionId();
-
- QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
- if (ptr) {
- toSymbianConfig(ptr)->connectionId = 0;
- // Configuration is either Defined or Discovered
- if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered))
- updateStatesToSnaps();
- }
-
- bool online = false;
- foreach (const QString &iface, accessPointConfigurations.keys()) {
- QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
- if (ptr->state == QNetworkConfiguration::Active) {
- online = true;
- break;
+ } else if (connectionStatus == KLinkLayerOpen) {
+ // Connection has been successfully opened
+ TUint connectionId = realEvent->ConnectionId();
+ TUint subConnectionCount = 0;
+ TUint apId;
+ TRequestStatus status;
+ iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
+ User::WaitForRequest(status);
+ QString ident = QString::number(qHash(apId));
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+ if (ptr) {
+ QMutexLocker configLocker(&ptr->mutex);
+ toSymbianConfig(ptr)->connectionId = connectionId;
+ // Configuration is Active
+ if (changeConfigurationStateTo(ptr, QNetworkConfiguration::Active)) {
+ updateStatesToSnaps();
+ }
+ emit this->configurationStateChanged(toSymbianConfig(ptr)->numericId, connectionId, QNetworkSession::Connected);
+ if (!iOnline) {
+ iOnline = true;
+ emit this->onlineStateChanged(iOnline);
+ }
}
- }
- if (iOnline != online) {
- iOnline = online;
+ } else if (connectionStatus == KConfigDaemonStartingDeregistration) {
+ TUint connectionId = realEvent->ConnectionId();
+ QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
+ if (ptr) {
+ QMutexLocker configLocker(&ptr->mutex);
+ emit this->configurationStateChanged(toSymbianConfig(ptr)->numericId, connectionId, QNetworkSession::Closing);
+ }
+ } else if (connectionStatus == KLinkLayerClosed ||
+ connectionStatus == KConnectionClosed) {
+ // Connection has been closed. Which of the above events is reported, depends on the Symbian
+ // platform.
+ TUint connectionId = realEvent->ConnectionId();
+ QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
+ if (ptr) {
+ // Configuration is either Defined or Discovered
+ if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered)) {
+ updateStatesToSnaps();
+ }
- locker.unlock();
- emit this->onlineStateChanged(iOnline);
- locker.relock();
+ QMutexLocker configLocker(&ptr->mutex);
+ emit this->configurationStateChanged(toSymbianConfig(ptr)->numericId, connectionId, QNetworkSession::Disconnected);
+ }
+
+ bool online = false;
+ foreach (const QString &iface, accessPointConfigurations.keys()) {
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
+ QMutexLocker configLocker(&ptr->mutex);
+ if (ptr->state == QNetworkConfiguration::Active) {
+ online = true;
+ break;
+ }
+ }
+ if (iOnline != online) {
+ iOnline = online;
+ emit this->onlineStateChanged(iOnline);
+ }
}
}
- break;
+ break;
case EConnMonIapAvailabilityChange:
{
@@ -1051,21 +1084,78 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
}
break;
+ case EConnMonCreateConnection:
+ {
+ // This event is caught to keep connection monitor IDs up-to-date.
+ CConnMonCreateConnection* realEvent;
+ realEvent = (CConnMonCreateConnection*) &aEvent;
+ TUint subConnectionCount = 0;
+ TUint apId;
+ TUint connectionId = realEvent->ConnectionId();
+ TRequestStatus status;
+ iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
+ User::WaitForRequest(status);
+ QString ident = QString::number(qHash(apId));
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+ if (ptr) {
+ QMutexLocker configLocker(&ptr->mutex);
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNCM updating connection monitor ID : from, to, whose: " << toSymbianConfig(ptr)->connectionId << connectionId << ptr->name;
+#endif
+ toSymbianConfig(ptr)->connectionId = connectionId;
+ }
+ }
+ break;
default:
// For unrecognized events
break;
}
}
-// Waits for 1..4 seconds.
+// Sessions may use this function to report configuration state changes,
+// because on some Symbian platforms (especially Symbian^3) all state changes are not
+// reported by the RConnectionMonitor, in particular in relation to stop() call,
+// whereas they _are_ reported on RConnection progress notifier used by sessions --> centralize
+// this data here so that other sessions may benefit from it too (not all sessions necessarily have
+// RConnection progress notifiers available but they relay on having e.g. disconnected information from
+// manager). Currently only 'Disconnected' state is of interest because it has proven to be troublesome.
+void SymbianEngine::configurationStateChangeReport(TUint32 accessPointId, QNetworkSession::State newState)
+{
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNCM A session reported state change for IAP ID: " << accessPointId << " whose new state is: " << newState;
+#endif
+ switch (newState) {
+ case QNetworkSession::Disconnected:
+ {
+ QString ident = QString::number(qHash(accessPointId));
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+ if (ptr) {
+ // Configuration is either Defined or Discovered
+ if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered)) {
+ updateStatesToSnaps();
+ }
+
+ QMutexLocker configLocker(&ptr->mutex);
+ emit this->configurationStateChanged(toSymbianConfig(ptr)->numericId,
+ toSymbianConfig(ptr)->connectionId,
+ QNetworkSession::Disconnected);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+// Waits for 2..6 seconds.
void SymbianEngine::waitRandomTime()
{
- iTimeToWait = (qAbs(qrand()) % 5) * 1000;
- if (iTimeToWait < 1000) {
- iTimeToWait = 1000;
+ iTimeToWait = (qAbs(qrand()) % 7) * 1000;
+ if (iTimeToWait < 2000) {
+ iTimeToWait = 2000;
}
-#ifdef QT_BEARERMGMT_CONFIGMGR_DEBUG
- qDebug("QNetworkConfigurationManager waiting random time: %d ms", iTimeToWait);
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug("QNCM waiting random time: %d ms", iTimeToWait);
#endif
QTimer::singleShot(iTimeToWait, iIgnoreEventLoop, SLOT(quit()));
iIgnoreEventLoop->exec();
@@ -1076,11 +1166,11 @@ QNetworkConfigurationPrivatePointer SymbianEngine::dataByConnectionId(TUint aCon
QMutexLocker locker(&mutex);
QNetworkConfiguration item;
-
QHash<QString, QNetworkConfigurationPrivatePointer>::const_iterator i =
accessPointConfigurations.constBegin();
while (i != accessPointConfigurations.constEnd()) {
QNetworkConfigurationPrivatePointer ptr = i.value();
+ QMutexLocker configLocker(&ptr->mutex);
if (toSymbianConfig(ptr)->connectionId == aConnectionId)
return ptr;
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index afb37de..7d565db 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -52,6 +52,9 @@
#include <cmmanager.h>
#endif
+// Uncomment and compile QtBearer to gain detailed state tracing
+// #define QT_BEARERMGMT_SYMBIAN_DEBUG
+
class CCommsDatabase;
class QEventLoop;
@@ -90,7 +93,18 @@ public:
Bearer bearer;
+ // So called IAP id from the platform. Remains constant as long as the
+ // platform is aware of the configuration ie. it is stored in the databases
+ // --> does not depend on whether connections are currently open or not.
+ // In practice is the same for the lifetime of the QNetworkConfiguration.
TUint32 numericId;
+ // So called connection id, or connection monitor ID. A dynamic ID assigned
+ // by RConnectionMonitor whenever a new connection is opened. ConnectionID and
+ // numericId/IAP id have 1-to-1 mapping during the lifetime of the connection at
+ // connection monitor. Notably however it changes whenever a new connection to
+ // a given IAP is created. In a sense it is constant during the time the
+ // configuration remains between states Discovered..Active..Discovered, do not
+ // however relay on this.
TUint connectionId;
};
@@ -124,6 +138,9 @@ public:
Q_SIGNALS:
void onlineStateChanged(bool isOnline);
+ void configurationStateChanged(TUint32 accessPointId, TUint32 connMonId,
+ QNetworkSession::State newState);
+
public Q_SLOTS:
void updateConfigurations();
@@ -157,12 +174,17 @@ private:
void startMonitoringIAPData(TUint32 aIapId);
QNetworkConfigurationPrivatePointer dataByConnectionId(TUint aConnectionId);
-protected: // From CActive
+protected:
+ // From CActive
void RunL();
void DoCancel();
-private: // MConnectionMonitorObserver
+private:
+ // MConnectionMonitorObserver
void EventL(const CConnMonEventBase& aEvent);
+ // For QNetworkSessionPrivate to indicate about state changes
+ void configurationStateChangeReport(TUint32 accessPointId,
+ QNetworkSession::State newState);
private: // Data
bool iFirstUpdate;
@@ -181,6 +203,7 @@ private: // Data
friend class QNetworkSessionPrivate;
friend class AccessPointsAvailabilityScanner;
+ friend class QNetworkSessionPrivateImpl;
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
RCmManager iCmManager;
diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp
index 25d3dfa..8abc2d1 100644
--- a/src/plugins/imageformats/gif/qgifhandler.cpp
+++ b/src/plugins/imageformats/gif/qgifhandler.cpp
@@ -1119,8 +1119,11 @@ bool QGifHandler::write(const QImage &image)
bool QGifHandler::supportsOption(ImageOption option) const
{
- return option == Size
- || option == Animation;
+ if (!device() || device()->isSequential())
+ return option == Animation;
+ else
+ return option == Size
+ || option == Animation;
}
QVariant QGifHandler::option(ImageOption option) const
diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
index 8155569..7b8463d 100644
--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
+++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
@@ -82,15 +82,19 @@ bool QSvgIOHandlerPrivate::load(QIODevice *device)
if (q->format().isEmpty())
q->canRead();
+ // # The SVG renderer doesn't handle trailing, unrelated data, so we must
+ // assume that all available data in the device is to be read.
bool res = false;
QBuffer *buf = qobject_cast<QBuffer *>(device);
if (buf) {
- res = r.load(buf->data());
+ const QByteArray &ba = buf->data();
+ res = r.load(QByteArray::fromRawData(ba.constData() + buf->pos(), ba.size() - buf->pos()));
+ buf->seek(ba.size());
} else if (q->format() == "svgz") {
- res = r.load(device->readAll()); // ### can't stream svgz
+ res = r.load(device->readAll());
} else {
xmlReader.setDevice(device);
- res = r.load(&xmlReader); //### doesn't leave pos() correctly
+ res = r.load(&xmlReader);
}
if (res) {
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index e309e25..13b8157 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -4463,4 +4463,6 @@ EXPORTS
?parentChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@1@ZA @ 4462 NONAME ; void (*QAbstractDeclarativeData::parentChanged)(class QAbstractDeclarativeData *, class QObject *, class QObject *)
?destroyed@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4463 NONAME ; void (*QAbstractDeclarativeData::destroyed)(class QAbstractDeclarativeData *, class QObject *)
?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4464 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void)
+ ?setRawData@QByteArray@@QAEAAV1@PBDI@Z @ 4465 NONAME ; class QByteArray & QByteArray::setRawData(char const *, unsigned int)
+ ?setRawData@QString@@QAEAAV1@PBVQChar@@H@Z @ 4466 NONAME ; class QString & QString::setRawData(class QChar const *, int)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 5f05f08..18372a4 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -581,7 +581,7 @@ EXPORTS
?advance@QDeclarativeParticleMotionWander@@UAEXAAVQDeclarativeParticle@@H@Z @ 580 NONAME ABSENT ; void QDeclarativeParticleMotionWander::advance(class QDeclarativeParticle &, int)
?alert@QDeclarativeWebView@@IAEXABVQString@@@Z @ 581 NONAME ABSENT ; void QDeclarativeWebView::alert(class QString const &)
?alternateBase@QDeclarativeSystemPalette@@QBE?AVQColor@@XZ @ 582 NONAME ; class QColor QDeclarativeSystemPalette::alternateBase(void) const
- ?anchors@QDeclarativeItem@@QAEPAVQDeclarativeAnchors@@XZ @ 583 NONAME ; class QDeclarativeAnchors * QDeclarativeItem::anchors(void)
+ ?anchors@QDeclarativeItem@@QAEPAVQDeclarativeAnchors@@XZ @ 583 NONAME ABSENT ; class QDeclarativeAnchors * QDeclarativeItem::anchors(void)
?angle@QDeclarativeParticles@@QBEMXZ @ 584 NONAME ABSENT ; float QDeclarativeParticles::angle(void) const
?angleChanged@QDeclarativeParticles@@IAEXXZ @ 585 NONAME ABSENT ; void QDeclarativeParticles::angleChanged(void)
?angleDeviation@QDeclarativeParticles@@QBEMXZ @ 586 NONAME ABSENT ; float QDeclarativeParticles::angleDeviation(void) const
@@ -647,7 +647,7 @@ EXPORTS
?buildObject@QDeclarativeCompiler@@AAE_NPAVObject@QDeclarativeParser@@ABUBindingContext@1@@Z @ 646 NONAME ; bool QDeclarativeCompiler::buildObject(class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &)
?buildProperty@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@ABUBindingContext@1@@Z @ 647 NONAME ; bool QDeclarativeCompiler::buildProperty(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &)
?buildPropertyAssignment@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@ABUBindingContext@1@@Z @ 648 NONAME ; bool QDeclarativeCompiler::buildPropertyAssignment(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &)
- ?buildPropertyInNamespace@QDeclarativeCompiler@@AAE_NPAUImportedNamespace@QDeclarativeEnginePrivate@@PAVProperty@QDeclarativeParser@@PAVObject@5@ABUBindingContext@1@@Z @ 649 NONAME ; bool QDeclarativeCompiler::buildPropertyInNamespace(struct QDeclarativeEnginePrivate::ImportedNamespace *, class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &)
+ ?buildPropertyInNamespace@QDeclarativeCompiler@@AAE_NPAUImportedNamespace@QDeclarativeEnginePrivate@@PAVProperty@QDeclarativeParser@@PAVObject@5@ABUBindingContext@1@@Z @ 649 NONAME ABSENT ; bool QDeclarativeCompiler::buildPropertyInNamespace(struct QDeclarativeEnginePrivate::ImportedNamespace *, class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &)
?buildPropertyLiteralAssignment@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@PAVValue@3@ABUBindingContext@1@@Z @ 650 NONAME ; bool QDeclarativeCompiler::buildPropertyLiteralAssignment(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, class QDeclarativeParser::Value *, struct QDeclarativeCompiler::BindingContext const &)
?buildPropertyObjectAssignment@QDeclarativeCompiler@@AAE_NPAVProperty@QDeclarativeParser@@PAVObject@3@PAVValue@3@ABUBindingContext@1@@Z @ 651 NONAME ; bool QDeclarativeCompiler::buildPropertyObjectAssignment(class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, class QDeclarativeParser::Value *, struct QDeclarativeCompiler::BindingContext const &)
?buildScript@QDeclarativeCompiler@@AAE_NPAVObject@QDeclarativeParser@@0@Z @ 652 NONAME ABSENT ; bool QDeclarativeCompiler::buildScript(class QDeclarativeParser::Object *, class QDeclarativeParser::Object *)
@@ -693,7 +693,7 @@ EXPORTS
?classBegin@QDeclarativeDateTimeFormatter@@UAEXXZ @ 692 NONAME ABSENT ; void QDeclarativeDateTimeFormatter::classBegin(void)
?classBegin@QDeclarativeItem@@MAEXXZ @ 693 NONAME ; void QDeclarativeItem::classBegin(void)
?classBegin@QDeclarativeNumberFormatter@@UAEXXZ @ 694 NONAME ABSENT ; void QDeclarativeNumberFormatter::classBegin(void)
- ?classBegin@QDeclarativeParserStatus@@UAEXXZ @ 695 NONAME ; void QDeclarativeParserStatus::classBegin(void)
+ ?classBegin@QDeclarativeParserStatus@@UAEXXZ @ 695 NONAME ABSENT ; void QDeclarativeParserStatus::classBegin(void)
?classBegin@QDeclarativeStateGroup@@UAEXXZ @ 696 NONAME ; void QDeclarativeStateGroup::classBegin(void)
?classBegin@QDeclarativeTimer@@MAEXXZ @ 697 NONAME ; void QDeclarativeTimer::classBegin(void)
?classBegin@QDeclarativeXmlListModel@@UAEXXZ @ 698 NONAME ; void QDeclarativeXmlListModel::classBegin(void)
@@ -754,7 +754,7 @@ EXPORTS
?componentComplete@QDeclarativeItem@@MAEXXZ @ 753 NONAME ; void QDeclarativeItem::componentComplete(void)
?componentComplete@QDeclarativeListView@@MAEXXZ @ 754 NONAME ; void QDeclarativeListView::componentComplete(void)
?componentComplete@QDeclarativeNumberFormatter@@UAEXXZ @ 755 NONAME ABSENT ; void QDeclarativeNumberFormatter::componentComplete(void)
- ?componentComplete@QDeclarativeParserStatus@@UAEXXZ @ 756 NONAME ; void QDeclarativeParserStatus::componentComplete(void)
+ ?componentComplete@QDeclarativeParserStatus@@UAEXXZ @ 756 NONAME ABSENT ; void QDeclarativeParserStatus::componentComplete(void)
?componentComplete@QDeclarativeParticles@@MAEXXZ @ 757 NONAME ABSENT ; void QDeclarativeParticles::componentComplete(void)
?componentComplete@QDeclarativePath@@MAEXXZ @ 758 NONAME ; void QDeclarativePath::componentComplete(void)
?componentComplete@QDeclarativePathView@@MAEXXZ @ 759 NONAME ; void QDeclarativePathView::componentComplete(void)
@@ -1369,7 +1369,7 @@ EXPORTS
?indexOfSignal@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 1368 NONAME ; int QMetaObjectBuilder::indexOfSignal(class QByteArray const &)
?indexOfSlot@QMetaObjectBuilder@@QAEHABVQByteArray@@@Z @ 1369 NONAME ; int QMetaObjectBuilder::indexOfSlot(class QByteArray const &)
?init@QDeclarativeContextPrivate@@QAEXXZ @ 1370 NONAME ABSENT ; void QDeclarativeContextPrivate::init(void)
- ?init@QDeclarativePaintedItem@@AAEXXZ @ 1371 NONAME ; void QDeclarativePaintedItem::init(void)
+ ?init@QDeclarativePaintedItem@@AAEXXZ @ 1371 NONAME ABSENT ; void QDeclarativePaintedItem::init(void)
?init@QDeclarativeWebView@@AAEXXZ @ 1372 NONAME ABSENT ; void QDeclarativeWebView::init(void)
?initialLayout@QDeclarativeWebView@@AAEXXZ @ 1373 NONAME ABSENT ; void QDeclarativeWebView::initialLayout(void)
?initialValue@QDeclarativeOpenMetaObject@@UAE?AVQVariant@@H@Z @ 1374 NONAME ; class QVariant QDeclarativeOpenMetaObject::initialValue(int)
@@ -2214,9 +2214,9 @@ EXPORTS
?resetVerticalCenter@QDeclarativeAnchors@@QAEXXZ @ 2213 NONAME ; void QDeclarativeAnchors::resetVerticalCenter(void)
?resetWidth@QDeclarativeItem@@QAEXXZ @ 2214 NONAME ; void QDeclarativeItem::resetWidth(void)
?resizeEvent@QDeclarativeView@@MAEXPAVQResizeEvent@@@Z @ 2215 NONAME ; void QDeclarativeView::resizeEvent(class QResizeEvent *)
- ?resizeMode@QDeclarativeLoader@@QBE?AW4ResizeMode@1@XZ @ 2216 NONAME ; enum QDeclarativeLoader::ResizeMode QDeclarativeLoader::resizeMode(void) const
+ ?resizeMode@QDeclarativeLoader@@QBE?AW4ResizeMode@1@XZ @ 2216 NONAME ABSENT ; enum QDeclarativeLoader::ResizeMode QDeclarativeLoader::resizeMode(void) const
?resizeMode@QDeclarativeView@@QBE?AW4ResizeMode@1@XZ @ 2217 NONAME ; enum QDeclarativeView::ResizeMode QDeclarativeView::resizeMode(void) const
- ?resizeModeChanged@QDeclarativeLoader@@IAEXXZ @ 2218 NONAME ; void QDeclarativeLoader::resizeModeChanged(void)
+ ?resizeModeChanged@QDeclarativeLoader@@IAEXXZ @ 2218 NONAME ABSENT ; void QDeclarativeLoader::resizeModeChanged(void)
?resolvedUrl@QDeclarativeContext@@QAE?AVQUrl@@ABV2@@Z @ 2219 NONAME ; class QUrl QDeclarativeContext::resolvedUrl(class QUrl const &)
?resources@QDeclarativeItem@@QAE?AU?$QDeclarativeListProperty@VQObject@@@@XZ @ 2220 NONAME ABSENT ; struct QDeclarativeListProperty<class QObject> QDeclarativeItem::resources(void)
?restart@QDeclarativeTimer@@QAEXXZ @ 2221 NONAME ; void QDeclarativeTimer::restart(void)
@@ -2542,7 +2542,7 @@ EXPORTS
?setRepeating@QDeclarativeTimer@@QAEX_N@Z @ 2541 NONAME ; void QDeclarativeTimer::setRepeating(bool)
?setReset@QDeclarativeAnchorChanges@@QAEXABVQString@@@Z @ 2542 NONAME ABSENT ; void QDeclarativeAnchorChanges::setReset(class QString const &)
?setResettable@QMetaPropertyBuilder@@QAEX_N@Z @ 2543 NONAME ; void QMetaPropertyBuilder::setResettable(bool)
- ?setResizeMode@QDeclarativeLoader@@QAEXW4ResizeMode@1@@Z @ 2544 NONAME ; void QDeclarativeLoader::setResizeMode(enum QDeclarativeLoader::ResizeMode)
+ ?setResizeMode@QDeclarativeLoader@@QAEXW4ResizeMode@1@@Z @ 2544 NONAME ABSENT ; void QDeclarativeLoader::setResizeMode(enum QDeclarativeLoader::ResizeMode)
?setResizeMode@QDeclarativeView@@QAEXW4ResizeMode@1@@Z @ 2545 NONAME ; void QDeclarativeView::setResizeMode(enum QDeclarativeView::ResizeMode)
?setRestoreEntryValues@QDeclarativePropertyChanges@@QAEX_N@Z @ 2546 NONAME ; void QDeclarativePropertyChanges::setRestoreEntryValues(bool)
?setReturnType@QMetaMethodBuilder@@QAEXABVQByteArray@@@Z @ 2547 NONAME ; void QMetaMethodBuilder::setReturnType(class QByteArray const &)
@@ -2595,7 +2595,7 @@ EXPORTS
?setStartY@QDeclarativePath@@QAEXM@Z @ 2594 NONAME ; void QDeclarativePath::setStartY(float)
?setState@QDeclarativeDebugQuery@@AAEXW4State@1@@Z @ 2595 NONAME ; void QDeclarativeDebugQuery::setState(enum QDeclarativeDebugQuery::State)
?setState@QDeclarativeDebugWatch@@AAEXW4State@1@@Z @ 2596 NONAME ; void QDeclarativeDebugWatch::setState(enum QDeclarativeDebugWatch::State)
- ?setState@QDeclarativeItem@@QAEXABVQString@@@Z @ 2597 NONAME ; void QDeclarativeItem::setState(class QString const &)
+ ?setState@QDeclarativeItem@@QAEXABVQString@@@Z @ 2597 NONAME ABSENT ; void QDeclarativeItem::setState(class QString const &)
?setState@QDeclarativeStateGroup@@QAEXABVQString@@@Z @ 2598 NONAME ; void QDeclarativeStateGroup::setState(class QString const &)
?setStateGroup@QDeclarativeState@@QAEXPAVQDeclarativeStateGroup@@@Z @ 2599 NONAME ; void QDeclarativeState::setStateGroup(class QDeclarativeStateGroup *)
?setStaticMetacallFunction@QMetaObjectBuilder@@QAEXP6AHW4Call@QMetaObject@@HPAPAX@Z@Z @ 2600 NONAME ; void QMetaObjectBuilder::setStaticMetacallFunction(int (*)(enum QMetaObject::Call, int, void * *))
@@ -2714,7 +2714,7 @@ EXPORTS
?startY@QDeclarativePath@@QBEMXZ @ 2713 NONAME ; float QDeclarativePath::startY(void) const
?state@QDeclarativeDebugQuery@@QBE?AW4State@1@XZ @ 2714 NONAME ; enum QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state(void) const
?state@QDeclarativeDebugWatch@@QBE?AW4State@1@XZ @ 2715 NONAME ; enum QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state(void) const
- ?state@QDeclarativeItem@@QBE?AVQString@@XZ @ 2716 NONAME ; class QString QDeclarativeItem::state(void) const
+ ?state@QDeclarativeItem@@QBE?AVQString@@XZ @ 2716 NONAME ABSENT ; class QString QDeclarativeItem::state(void) const
?state@QDeclarativeStateGroup@@QBE?AVQString@@XZ @ 2717 NONAME ; class QString QDeclarativeStateGroup::state(void) const
?stateChanged@QDeclarativeDebugQuery@@IAEXW4State@1@@Z @ 2718 NONAME ; void QDeclarativeDebugQuery::stateChanged(enum QDeclarativeDebugQuery::State)
?stateChanged@QDeclarativeDebugWatch@@IAEXW4State@1@@Z @ 2719 NONAME ; void QDeclarativeDebugWatch::stateChanged(enum QDeclarativeDebugWatch::State)
@@ -3576,7 +3576,7 @@ EXPORTS
?d_func@QDeclarativeSmoothedAnimation@@ABEPBVQDeclarativeSmoothedAnimationPrivate@@XZ @ 3575 NONAME ; class QDeclarativeSmoothedAnimationPrivate const * QDeclarativeSmoothedAnimation::d_func(void) const
?d_func@QDeclarativeTranslate@@AAEPAVQDeclarativeTranslatePrivate@@XZ @ 3576 NONAME ; class QDeclarativeTranslatePrivate * QDeclarativeTranslate::d_func(void)
?d_func@QDeclarativeTranslate@@ABEPBVQDeclarativeTranslatePrivate@@XZ @ 3577 NONAME ; class QDeclarativeTranslatePrivate const * QDeclarativeTranslate::d_func(void) const
- ?data@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3578 NONAME ; class QDeclarativeListProperty<class QObject> QDeclarativeItem::data(void)
+ ?data@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3578 NONAME ABSENT ; class QDeclarativeListProperty<class QObject> QDeclarativeItem::data(void)
?dataCleared@QDeclarativeXmlListModel@@AAEXXZ @ 3579 NONAME ; void QDeclarativeXmlListModel::dataCleared(void)
?data_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 3580 NONAME ; void QDeclarativeItemPrivate::data_append(class QDeclarativeListProperty<class QObject> *, class QObject *)
?delegateChanged@QDeclarativeGridView@@IAEXXZ @ 3581 NONAME ; void QDeclarativeGridView::delegateChanged(void)
@@ -3707,7 +3707,7 @@ EXPORTS
?request@QDeclarativePixmapCache@@SAPAVQDeclarativePixmapReply@@PAVQDeclarativeEngine@@ABVQUrl@@HH@Z @ 3706 NONAME ; class QDeclarativePixmapReply * QDeclarativePixmapCache::request(class QDeclarativeEngine *, class QUrl const &, int, int)
?resetHeight@QDeclarativeItemPrivate@@UAEXXZ @ 3707 NONAME ; void QDeclarativeItemPrivate::resetHeight(void)
?resetWidth@QDeclarativeItemPrivate@@UAEXXZ @ 3708 NONAME ; void QDeclarativeItemPrivate::resetWidth(void)
- ?resources@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3709 NONAME ; class QDeclarativeListProperty<class QObject> QDeclarativeItem::resources(void)
+ ?resources@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3709 NONAME ABSENT ; class QDeclarativeListProperty<class QObject> QDeclarativeItem::resources(void)
?resources_append@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQObject@@@@PAVQObject@@@Z @ 3710 NONAME ; void QDeclarativeItemPrivate::resources_append(class QDeclarativeListProperty<class QObject> *, class QObject *)
?resources_at@QDeclarativeItemPrivate@@SAPAVQObject@@PAV?$QDeclarativeListProperty@VQObject@@@@H@Z @ 3711 NONAME ; class QObject * QDeclarativeItemPrivate::resources_at(class QDeclarativeListProperty<class QObject> *, int)
?resources_count@QDeclarativeItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQObject@@@@@Z @ 3712 NONAME ; int QDeclarativeItemPrivate::resources_count(class QDeclarativeListProperty<class QObject> *)
@@ -3771,8 +3771,8 @@ EXPORTS
?start@QDeclarativeItemPrivate@@SAXAAVQTime@@@Z @ 3770 NONAME ; void QDeclarativeItemPrivate::start(class QTime &)
?startXChanged@QDeclarativePath@@IAEXXZ @ 3771 NONAME ; void QDeclarativePath::startXChanged(void)
?startYChanged@QDeclarativePath@@IAEXXZ @ 3772 NONAME ; void QDeclarativePath::startYChanged(void)
- ?states@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3773 NONAME ; class QDeclarativeListProperty<class QDeclarativeState> QDeclarativeItem::states(void)
- ?states@QDeclarativeItemPrivate@@QAEPAVQDeclarativeStateGroup@@XZ @ 3774 NONAME ; class QDeclarativeStateGroup * QDeclarativeItemPrivate::states(void)
+ ?states@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3773 NONAME ABSENT ; class QDeclarativeListProperty<class QDeclarativeState> QDeclarativeItem::states(void)
+ ?states@QDeclarativeItemPrivate@@QAEPAVQDeclarativeStateGroup@@XZ @ 3774 NONAME ABSENT ; class QDeclarativeStateGroup * QDeclarativeItemPrivate::states(void)
?statesProperty@QDeclarativeStateGroup@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3775 NONAME ; class QDeclarativeListProperty<class QDeclarativeState> QDeclarativeStateGroup::statesProperty(void)
?stops@QDeclarativeGradient@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeGradientStop@@@@XZ @ 3776 NONAME ; class QDeclarativeListProperty<class QDeclarativeGradientStop> QDeclarativeGradient::stops(void)
?subFocusItemChange@QDeclarativeItemPrivate@@UAEXXZ @ 3777 NONAME ; void QDeclarativeItemPrivate::subFocusItemChange(void)
@@ -3799,7 +3799,7 @@ EXPORTS
?transform_clear@QDeclarativeItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsTransform@@@@@Z @ 3798 NONAME ; void QDeclarativeItemPrivate::transform_clear(class QDeclarativeListProperty<class QGraphicsTransform> *)
?transform_count@QDeclarativeItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQGraphicsTransform@@@@@Z @ 3799 NONAME ; int QDeclarativeItemPrivate::transform_count(class QDeclarativeListProperty<class QGraphicsTransform> *)
?transition@QDeclarativeSmoothedAnimation@@UAEXAAV?$QList@VQDeclarativeAction@@@@AAV?$QList@VQDeclarativeProperty@@@@W4TransitionDirection@QDeclarativeAbstractAnimation@@@Z @ 3800 NONAME ; void QDeclarativeSmoothedAnimation::transition(class QList<class QDeclarativeAction> &, class QList<class QDeclarativeProperty> &, enum QDeclarativeAbstractAnimation::TransitionDirection)
- ?transitions@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3801 NONAME ; class QDeclarativeListProperty<class QDeclarativeTransition> QDeclarativeItem::transitions(void)
+ ?transitions@QDeclarativeItem@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3801 NONAME ABSENT ; class QDeclarativeListProperty<class QDeclarativeTransition> QDeclarativeItem::transitions(void)
?transitionsProperty@QDeclarativeStateGroup@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3802 NONAME ; class QDeclarativeListProperty<class QDeclarativeTransition> QDeclarativeStateGroup::transitionsProperty(void)
?triggeredOnStartChanged@QDeclarativeTimer@@IAEXXZ @ 3803 NONAME ; void QDeclarativeTimer::triggeredOnStartChanged(void)
?type@Variant@QDeclarativeParser@@QBE?AW4Type@12@XZ @ 3804 NONAME ; enum QDeclarativeParser::Variant::Type QDeclarativeParser::Variant::type(void) const
@@ -3920,7 +3920,7 @@ EXPORTS
?execute@QDeclarativeParentChange@@UAEXW4Reason@QDeclarativeActionEvent@@@Z @ 3919 NONAME ; void QDeclarativeParentChange::execute(enum QDeclarativeActionEvent::Reason)
?resetSourceComponent@QDeclarativeLoader@@QAEXXZ @ 3920 NONAME ; void QDeclarativeLoader::resetSourceComponent(void)
?rootIndex@QDeclarativeVisualDataModel@@QBE?AVQVariant@@XZ @ 3921 NONAME ; class QVariant QDeclarativeVisualDataModel::rootIndex(void) const
- ?createObject@QDeclarativeComponent@@IAE?AVQScriptValue@@XZ @ 3922 NONAME ; class QScriptValue QDeclarativeComponent::createObject(void)
+ ?createObject@QDeclarativeComponent@@IAE?AVQScriptValue@@XZ @ 3922 NONAME ABSENT ; class QScriptValue QDeclarativeComponent::createObject(void)
?execute@QDeclarativeStateChangeScript@@UAEXW4Reason@QDeclarativeActionEvent@@@Z @ 3923 NONAME ; void QDeclarativeStateChangeScript::execute(enum QDeclarativeActionEvent::Reason)
?active@QDeclarativeDrag@@QBE_NXZ @ 3924 NONAME ; bool QDeclarativeDrag::active(void) const
?retransformBack@QDeclarativeFlipable@@AAEXXZ @ 3925 NONAME ; void QDeclarativeFlipable::retransformBack(void)
@@ -3955,4 +3955,43 @@ EXPORTS
?parentModelIndex@QDeclarativeVisualDataModel@@QBE?AVQVariant@@XZ @ 3954 NONAME ; class QVariant QDeclarativeVisualDataModel::parentModelIndex(void) const
?usedAnchors@QDeclarativeAnchors@@QBE?AV?$QFlags@W4Anchor@QDeclarativeAnchors@@@@XZ @ 3955 NONAME ; class QFlags<enum QDeclarativeAnchors::Anchor> QDeclarativeAnchors::usedAnchors(void) const
?eventFilter@QDeclarativeView@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 3956 NONAME ; bool QDeclarativeView::eventFilter(class QObject *, class QEvent *)
+ ??0QDeclarativeInfo@@AAE@PAVQDeclarativeInfoPrivate@@@Z @ 3957 NONAME ; QDeclarativeInfo::QDeclarativeInfo(class QDeclarativeInfoPrivate *)
+ ?_states@QDeclarativeItemPrivate@@QAEPAVQDeclarativeStateGroup@@XZ @ 3958 NONAME ; class QDeclarativeStateGroup * QDeclarativeItemPrivate::_states(void)
+ ?baseline@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3959 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline(void) const
+ ?bottom@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3960 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::bottom(void) const
+ ?buildPropertyInNamespace@QDeclarativeCompiler@@AAE_NPAVQDeclarativeImportedNamespace@@PAVProperty@QDeclarativeParser@@PAVObject@4@ABUBindingContext@1@@Z @ 3961 NONAME ; bool QDeclarativeCompiler::buildPropertyInNamespace(class QDeclarativeImportedNamespace *, class QDeclarativeParser::Property *, class QDeclarativeParser::Object *, struct QDeclarativeCompiler::BindingContext const &)
+ ?canceled@QDeclarativeMouseArea@@IAEXXZ @ 3962 NONAME ; void QDeclarativeMouseArea::canceled(void)
+ ?classBegin@QDeclarativeBind@@MAEXXZ @ 3963 NONAME ; void QDeclarativeBind::classBegin(void)
+ ?classBegin@QDeclarativeConnections@@EAEXXZ @ 3964 NONAME ; void QDeclarativeConnections::classBegin(void)
+ ?classBegin@QDeclarativePath@@MAEXXZ @ 3965 NONAME ; void QDeclarativePath::classBegin(void)
+ ?classBegin@QDeclarativeWorkerScript@@MAEXXZ @ 3966 NONAME ; void QDeclarativeWorkerScript::classBegin(void)
+ ?completePending@QDeclarativeVisualDataModel@@UBE_NXZ @ 3967 NONAME ; bool QDeclarativeVisualDataModel::completePending(void) const
+ ?completePending@QDeclarativeVisualItemModel@@UBE_NXZ @ 3968 NONAME ; bool QDeclarativeVisualItemModel::completePending(void) const
+ ?componentFinalized@QDeclarativeBehavior@@AAEXXZ @ 3969 NONAME ; void QDeclarativeBehavior::componentFinalized(void)
+ ?createObject@QDeclarativeComponent@@IAE?AVQScriptValue@@PAVQObject@@@Z @ 3970 NONAME ; class QScriptValue QDeclarativeComponent::createObject(class QObject *)
+ ?data@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3971 NONAME ; class QDeclarativeListProperty<class QObject> QDeclarativeItemPrivate::data(void)
+ ?engine@QDeclarativeWorkerScript@@AAEPAVQDeclarativeWorkerScriptEngine@@XZ @ 3972 NONAME ; class QDeclarativeWorkerScriptEngine * QDeclarativeWorkerScript::engine(void)
+ ?geometryChanged@QDeclarativePaintedItem@@MAEXABVQRectF@@0@Z @ 3973 NONAME ; void QDeclarativePaintedItem::geometryChanged(class QRectF const &, class QRectF const &)
+ ?get@QDeclarativeItemPrivate@@SAPAV1@PAVQDeclarativeItem@@@Z @ 3974 NONAME ; class QDeclarativeItemPrivate * QDeclarativeItemPrivate::get(class QDeclarativeItem *)
+ ?horizontalCenter@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3975 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::horizontalCenter(void) const
+ ?hoverEnabled@QDeclarativeMouseArea@@QBE_NXZ @ 3976 NONAME ; bool QDeclarativeMouseArea::hoverEnabled(void) const
+ ?hoverEnabledChanged@QDeclarativeMouseArea@@IAEXXZ @ 3977 NONAME ; void QDeclarativeMouseArea::hoverEnabledChanged(void)
+ ?ignoreUnknownSignals@QDeclarativeConnections@@QBE_NXZ @ 3978 NONAME ; bool QDeclarativeConnections::ignoreUnknownSignals(void) const
+ ?itemChange@QDeclarativeMouseArea@@MAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 3979 NONAME ; class QVariant QDeclarativeMouseArea::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &)
+ ?itemChange@QDeclarativePaintedItem@@MAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 3980 NONAME ; class QVariant QDeclarativePaintedItem::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &)
+ ?left@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3981 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::left(void) const
+ ?reportConflictingAnchors@QDeclarativeColumn@@MAEXXZ @ 3982 NONAME ; void QDeclarativeColumn::reportConflictingAnchors(void)
+ ?reportConflictingAnchors@QDeclarativeFlow@@MAEXXZ @ 3983 NONAME ; void QDeclarativeFlow::reportConflictingAnchors(void)
+ ?reportConflictingAnchors@QDeclarativeGrid@@MAEXXZ @ 3984 NONAME ; void QDeclarativeGrid::reportConflictingAnchors(void)
+ ?reportConflictingAnchors@QDeclarativeRow@@MAEXXZ @ 3985 NONAME ; void QDeclarativeRow::reportConflictingAnchors(void)
+ ?resources@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQObject@@@@XZ @ 3986 NONAME ; class QDeclarativeListProperty<class QObject> QDeclarativeItemPrivate::resources(void)
+ ?right@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3987 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::right(void) const
+ ?setHoverEnabled@QDeclarativeMouseArea@@QAEX_N@Z @ 3988 NONAME ; void QDeclarativeMouseArea::setHoverEnabled(bool)
+ ?setIgnoreUnknownSignals@QDeclarativeConnections@@QAEX_N@Z @ 3989 NONAME ; void QDeclarativeConnections::setIgnoreUnknownSignals(bool)
+ ?setState@QDeclarativeItemPrivate@@QAEXABVQString@@@Z @ 3990 NONAME ; void QDeclarativeItemPrivate::setState(class QString const &)
+ ?state@QDeclarativeItemPrivate@@QBE?AVQString@@XZ @ 3991 NONAME ; class QString QDeclarativeItemPrivate::state(void) const
+ ?states@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeState@@@@XZ @ 3992 NONAME ; class QDeclarativeListProperty<class QDeclarativeState> QDeclarativeItemPrivate::states(void)
+ ?top@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3993 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::top(void) const
+ ?transitions@QDeclarativeItemPrivate@@QAE?AV?$QDeclarativeListProperty@VQDeclarativeTransition@@@@XZ @ 3994 NONAME ; class QDeclarativeListProperty<class QDeclarativeTransition> QDeclarativeItemPrivate::transitions(void)
+ ?verticalCenter@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 3995 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::verticalCenter(void) const
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index c3a3a08..8ae3b9d 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -2126,8 +2126,8 @@ EXPORTS
?addToGroup@QGraphicsItemGroup@@QAEXPAVQGraphicsItem@@@Z @ 2125 NONAME ; void QGraphicsItemGroup::addToGroup(class QGraphicsItem *)
?addToIndex@QGraphicsItem@@IAEXXZ @ 2126 NONAME ; void QGraphicsItem::addToIndex(void)
?addToPolygon@QBezier@@QBEXPAVQPolygonF@@@Z @ 2127 NONAME ; void QBezier::addToPolygon(class QPolygonF *) const
- ?addToPolygonIterative@QBezier@@QBEXPAVQPolygonF@@@Z @ 2128 NONAME ; void QBezier::addToPolygonIterative(class QPolygonF *) const
- ?addToPolygonMixed@QBezier@@QBEXPAVQPolygonF@@@Z @ 2129 NONAME ; void QBezier::addToPolygonMixed(class QPolygonF *) const
+ ?addToPolygonIterative@QBezier@@QBEXPAVQPolygonF@@@Z @ 2128 NONAME ABSENT ; void QBezier::addToPolygonIterative(class QPolygonF *) const
+ ?addToPolygonMixed@QBezier@@QBEXPAVQPolygonF@@@Z @ 2129 NONAME ABSENT ; void QBezier::addToPolygonMixed(class QPolygonF *) const
?addToolBar@QMainWindow@@QAEPAVQToolBar@@ABVQString@@@Z @ 2130 NONAME ; class QToolBar * QMainWindow::addToolBar(class QString const &)
?addToolBar@QMainWindow@@QAEXPAVQToolBar@@@Z @ 2131 NONAME ; void QMainWindow::addToolBar(class QToolBar *)
?addToolBar@QMainWindow@@QAEXW4ToolBarArea@Qt@@PAVQToolBar@@@Z @ 2132 NONAME ; void QMainWindow::addToolBar(enum Qt::ToolBarArea, class QToolBar *)
@@ -12717,7 +12717,7 @@ EXPORTS
?updateInputMethodSensitivity@QGraphicsViewPrivate@@QAEXXZ @ 12716 NONAME ; void QGraphicsViewPrivate::updateInputMethodSensitivity(void)
?updateLastCenterPoint@QGraphicsViewPrivate@@QAEXXZ @ 12717 NONAME ; void QGraphicsViewPrivate::updateLastCenterPoint(void)
?updateRect@QGraphicsViewPrivate@@QAE_NABVQRect@@@Z @ 12718 NONAME ; bool QGraphicsViewPrivate::updateRect(class QRect const &)
- ?updateRegion@QGraphicsViewPrivate@@QAE_NABVQRegion@@@Z @ 12719 NONAME ; bool QGraphicsViewPrivate::updateRegion(class QRegion const &)
+ ?updateRegion@QGraphicsViewPrivate@@QAE_NABVQRegion@@@Z @ 12719 NONAME ABSENT ; bool QGraphicsViewPrivate::updateRegion(class QRegion const &)
?updateScroll@QGraphicsViewPrivate@@QAEXXZ @ 12720 NONAME ; void QGraphicsViewPrivate::updateScroll(void)
?verticalScroll@QGraphicsViewPrivate@@QBE_JXZ @ 12721 NONAME ; long long QGraphicsViewPrivate::verticalScroll(void) const
?viewportEvent@QAbstractScrollAreaPrivate@@QAE_NPAVQEvent@@@Z @ 12722 NONAME ; bool QAbstractScrollAreaPrivate::viewportEvent(class QEvent *)
@@ -12798,4 +12798,6 @@ EXPORTS
?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 12797 NONAME ; bool QWindowSurface::hasPartialUpdateSupport(void) const
?name@QIcon@@QBE?AVQString@@XZ @ 12798 NONAME ; class QString QIcon::name(void) const
?iconName@QIconEngineV2@@QAE?AVQString@@XZ @ 12799 NONAME ; class QString QIconEngineV2::iconName(void)
+ ?updateRectF@QGraphicsViewPrivate@@QAE_NABVQRectF@@@Z @ 12800 NONAME ; bool QGraphicsViewPrivate::updateRectF(class QRectF const &)
+ ?updateRegion@QGraphicsViewPrivate@@QAE_NABVQRectF@@ABVQTransform@@@Z @ 12801 NONAME ; bool QGraphicsViewPrivate::updateRegion(class QRectF const &, class QTransform const &)
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 92a4020..dc9431b 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3698,4 +3698,6 @@ EXPORTS
_ZN24QAbstractDeclarativeData13parentChangedE @ 3697 NONAME DATA 4
_ZN24QAbstractDeclarativeData9destroyedE @ 3698 NONAME DATA 4
_ZN23QEventDispatcherSymbian12selectThreadEv @ 3699 NONAME
+ _ZN10QByteArray10setRawDataEPKcj @ 3700 NONAME
+ _ZN7QString10setRawDataEPK5QChari @ 3701 NONAME
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index ad12166..e1d8e96 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -111,7 +111,7 @@ EXPORTS
_ZN16QDeclarativeItem11qt_metacallEN11QMetaObject4CallEiPPv @ 110 NONAME
_ZN16QDeclarativeItem11qt_metacastEPKc @ 111 NONAME
_ZN16QDeclarativeItem11resetHeightEv @ 112 NONAME
- _ZN16QDeclarativeItem11transitionsEv @ 113 NONAME
+ _ZN16QDeclarativeItem11transitionsEv @ 113 NONAME ABSENT
_ZN16QDeclarativeItem12childrenRectEv @ 114 NONAME
_ZN16QDeclarativeItem12focusChangedEb @ 115 NONAME
_ZN16QDeclarativeItem12stateChangedERK7QString @ 116 NONAME
@@ -135,17 +135,17 @@ EXPORTS
_ZN16QDeclarativeItem19getStaticMetaObjectEv @ 134 NONAME
_ZN16QDeclarativeItem21baselineOffsetChangedEf @ 135 NONAME
_ZN16QDeclarativeItem22transformOriginChangedENS_15TransformOriginE @ 136 NONAME
- _ZN16QDeclarativeItem4dataEv @ 137 NONAME
+ _ZN16QDeclarativeItem4dataEv @ 137 NONAME ABSENT
_ZN16QDeclarativeItem5eventEP6QEvent @ 138 NONAME
_ZN16QDeclarativeItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 139 NONAME
- _ZN16QDeclarativeItem6statesEv @ 140 NONAME
- _ZN16QDeclarativeItem7anchorsEv @ 141 NONAME
+ _ZN16QDeclarativeItem6statesEv @ 140 NONAME ABSENT
+ _ZN16QDeclarativeItem7anchorsEv @ 141 NONAME ABSENT
_ZN16QDeclarativeItem7setClipEb @ 142 NONAME
_ZN16QDeclarativeItem7setSizeERK6QSizeF @ 143 NONAME
_ZN16QDeclarativeItem8setFocusEb @ 144 NONAME
- _ZN16QDeclarativeItem8setStateERK7QString @ 145 NONAME
+ _ZN16QDeclarativeItem8setStateERK7QString @ 145 NONAME ABSENT
_ZN16QDeclarativeItem8setWidthEf @ 146 NONAME
- _ZN16QDeclarativeItem9resourcesEv @ 147 NONAME
+ _ZN16QDeclarativeItem9resourcesEv @ 147 NONAME ABSENT
_ZN16QDeclarativeItem9setHeightEf @ 148 NONAME
_ZN16QDeclarativeItem9setSmoothEb @ 149 NONAME
_ZN16QDeclarativeItem9transformEv @ 150 NONAME
@@ -361,13 +361,13 @@ EXPORTS
_ZN18QDeclarativeLoader11itemChangedEv @ 360 NONAME
_ZN18QDeclarativeLoader11qt_metacallEN11QMetaObject4CallEiPPv @ 361 NONAME
_ZN18QDeclarativeLoader11qt_metacastEPKc @ 362 NONAME
- _ZN18QDeclarativeLoader13setResizeModeENS_10ResizeModeE @ 363 NONAME
+ _ZN18QDeclarativeLoader13setResizeModeENS_10ResizeModeE @ 363 NONAME ABSENT
_ZN18QDeclarativeLoader13sourceChangedEv @ 364 NONAME
_ZN18QDeclarativeLoader13statusChangedEv @ 365 NONAME
_ZN18QDeclarativeLoader15geometryChangedERK6QRectFS2_ @ 366 NONAME
_ZN18QDeclarativeLoader15progressChangedEv @ 367 NONAME
_ZN18QDeclarativeLoader16staticMetaObjectE @ 368 NONAME DATA 16
- _ZN18QDeclarativeLoader17resizeModeChangedEv @ 369 NONAME
+ _ZN18QDeclarativeLoader17resizeModeChangedEv @ 369 NONAME ABSENT
_ZN18QDeclarativeLoader18setSourceComponentEP21QDeclarativeComponent @ 370 NONAME
_ZN18QDeclarativeLoader19getStaticMetaObjectEv @ 371 NONAME
_ZN18QDeclarativeLoader9setSourceERK4QUrl @ 372 NONAME
@@ -586,7 +586,7 @@ EXPORTS
_ZN20QDeclarativeCompiler22completeComponentBuildEv @ 585 NONAME
_ZN20QDeclarativeCompiler22isAttachedPropertyNameERK10QByteArray @ 586 NONAME
_ZN20QDeclarativeCompiler23buildPropertyAssignmentEPN18QDeclarativeParser8PropertyEPNS0_6ObjectERKNS_14BindingContextE @ 587 NONAME
- _ZN20QDeclarativeCompiler24buildPropertyInNamespaceEPN25QDeclarativeEnginePrivate17ImportedNamespaceEPN18QDeclarativeParser8PropertyEPNS3_6ObjectERKNS_14BindingContextE @ 588 NONAME
+ _ZN20QDeclarativeCompiler24buildPropertyInNamespaceEPN25QDeclarativeEnginePrivate17ImportedNamespaceEPN18QDeclarativeParser8PropertyEPNS3_6ObjectERKNS_14BindingContextE @ 588 NONAME ABSENT
_ZN20QDeclarativeCompiler25buildPropertyOnAssignmentEPN18QDeclarativeParser8PropertyEPNS0_6ObjectES4_PNS0_5ValueERKNS_14BindingContextE @ 589 NONAME
_ZN20QDeclarativeCompiler25buildScriptStringPropertyEPN18QDeclarativeParser8PropertyEPNS0_6ObjectERKNS_14BindingContextE @ 590 NONAME
_ZN20QDeclarativeCompiler26mergeDynamicMetaPropertiesEPN18QDeclarativeParser6ObjectE @ 591 NONAME
@@ -969,7 +969,7 @@ EXPORTS
_ZN21QDeclarativeComponent11beginCreateEP19QDeclarativeContext @ 968 NONAME
_ZN21QDeclarativeComponent11qt_metacallEN11QMetaObject4CallEiPPv @ 969 NONAME
_ZN21QDeclarativeComponent11qt_metacastEPKc @ 970 NONAME
- _ZN21QDeclarativeComponent12createObjectEv @ 971 NONAME
+ _ZN21QDeclarativeComponent12createObjectEv @ 971 NONAME ABSENT
_ZN21QDeclarativeComponent13statusChangedENS_6StatusE @ 972 NONAME
_ZN21QDeclarativeComponent14completeCreateEv @ 973 NONAME
_ZN21QDeclarativeComponent15progressChangedEf @ 974 NONAME
@@ -1493,7 +1493,7 @@ EXPORTS
_ZN23QDeclarativePaintedItem19contentsSizeChangedEv @ 1492 NONAME
_ZN23QDeclarativePaintedItem19getStaticMetaObjectEv @ 1493 NONAME
_ZN23QDeclarativePaintedItem20contentsScaleChangedEv @ 1494 NONAME
- _ZN23QDeclarativePaintedItem4initEv @ 1495 NONAME
+ _ZN23QDeclarativePaintedItem4initEv @ 1495 NONAME ABSENT
_ZN23QDeclarativePaintedItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 1496 NONAME
_ZN23QDeclarativePaintedItemC2EP16QDeclarativeItem @ 1497 NONAME
_ZN23QDeclarativePaintedItemC2ER30QDeclarativePaintedItemPrivateP16QDeclarativeItem @ 1498 NONAME
@@ -1624,9 +1624,9 @@ EXPORTS
_ZN24QDeclarativeParentChangeD0Ev @ 1623 NONAME
_ZN24QDeclarativeParentChangeD1Ev @ 1624 NONAME
_ZN24QDeclarativeParentChangeD2Ev @ 1625 NONAME
- _ZN24QDeclarativeParserStatus10classBeginEv @ 1626 NONAME
- _ZN24QDeclarativeParserStatus17componentCompleteEv @ 1627 NONAME
- _ZN24QDeclarativeParserStatusC1Ev @ 1628 NONAME
+ _ZN24QDeclarativeParserStatus10classBeginEv @ 1626 NONAME ABSENT
+ _ZN24QDeclarativeParserStatus17componentCompleteEv @ 1627 NONAME ABSENT
+ _ZN24QDeclarativeParserStatusC1Ev @ 1628 NONAME ABSENT
_ZN24QDeclarativeParserStatusC2Ev @ 1629 NONAME
_ZN24QDeclarativeParserStatusD0Ev @ 1630 NONAME
_ZN24QDeclarativeParserStatusD1Ev @ 1631 NONAME
@@ -2203,21 +2203,21 @@ EXPORTS
_ZNK16QDeclarativeItem13keepMouseGrabEv @ 2202 NONAME
_ZNK16QDeclarativeItem14baselineOffsetEv @ 2203 NONAME
_ZNK16QDeclarativeItem14implicitHeightEv @ 2204 NONAME
- _ZNK16QDeclarativeItem14verticalCenterEv @ 2205 NONAME
+ _ZNK16QDeclarativeItem14verticalCenterEv @ 2205 NONAME ABSENT
_ZNK16QDeclarativeItem15transformOriginEv @ 2206 NONAME
- _ZNK16QDeclarativeItem16horizontalCenterEv @ 2207 NONAME
+ _ZNK16QDeclarativeItem16horizontalCenterEv @ 2207 NONAME ABSENT
_ZNK16QDeclarativeItem16inputMethodQueryEN2Qt16InputMethodQueryE @ 2208 NONAME
_ZNK16QDeclarativeItem19isComponentCompleteEv @ 2209 NONAME
- _ZNK16QDeclarativeItem3topEv @ 2210 NONAME
+ _ZNK16QDeclarativeItem3topEv @ 2210 NONAME ABSENT
_ZNK16QDeclarativeItem4clipEv @ 2211 NONAME
- _ZNK16QDeclarativeItem4leftEv @ 2212 NONAME
- _ZNK16QDeclarativeItem5rightEv @ 2213 NONAME
- _ZNK16QDeclarativeItem5stateEv @ 2214 NONAME
+ _ZNK16QDeclarativeItem4leftEv @ 2212 NONAME ABSENT
+ _ZNK16QDeclarativeItem5rightEv @ 2213 NONAME ABSENT
+ _ZNK16QDeclarativeItem5stateEv @ 2214 NONAME ABSENT
_ZNK16QDeclarativeItem5widthEv @ 2215 NONAME
- _ZNK16QDeclarativeItem6bottomEv @ 2216 NONAME
+ _ZNK16QDeclarativeItem6bottomEv @ 2216 NONAME ABSENT
_ZNK16QDeclarativeItem6heightEv @ 2217 NONAME
_ZNK16QDeclarativeItem6smoothEv @ 2218 NONAME
- _ZNK16QDeclarativeItem8baselineEv @ 2219 NONAME
+ _ZNK16QDeclarativeItem8baselineEv @ 2219 NONAME ABSENT
_ZNK16QDeclarativeItem8hasFocusEv @ 2220 NONAME
_ZNK16QDeclarativeItem9mapToItemERK12QScriptValueff @ 2221 NONAME
_ZNK16QDeclarativePath10attributesEv @ 2222 NONAME
@@ -2310,7 +2310,7 @@ EXPORTS
_ZNK18QDeclarativeEngine27networkAccessManagerFactoryEv @ 2309 NONAME
_ZNK18QDeclarativeEngine7baseUrlEv @ 2310 NONAME
_ZNK18QDeclarativeLoader10metaObjectEv @ 2311 NONAME
- _ZNK18QDeclarativeLoader10resizeModeEv @ 2312 NONAME
+ _ZNK18QDeclarativeLoader10resizeModeEv @ 2312 NONAME ABSENT
_ZNK18QDeclarativeLoader15sourceComponentEv @ 2313 NONAME
_ZNK18QDeclarativeLoader4itemEv @ 2314 NONAME
_ZNK18QDeclarativeLoader6sourceEv @ 2315 NONAME
@@ -3536,4 +3536,46 @@ EXPORTS
_ZThn8_N25QDeclarativeAnchorChanges7executeEN23QDeclarativeActionEvent6ReasonE @ 3535 NONAME
_ZThn8_N25QDeclarativeAnchorChanges7reverseEN23QDeclarativeActionEvent6ReasonE @ 3536 NONAME
_ZThn8_N29QDeclarativeStateChangeScript7executeEN23QDeclarativeActionEvent6ReasonE @ 3537 NONAME
+ _ZN15QDeclarativeRow24reportConflictingAnchorsEv @ 3538 NONAME
+ _ZN16QDeclarativeBind10classBeginEv @ 3539 NONAME
+ _ZN16QDeclarativeFlow24reportConflictingAnchorsEv @ 3540 NONAME
+ _ZN16QDeclarativeGrid24reportConflictingAnchorsEv @ 3541 NONAME
+ _ZN16QDeclarativePath10classBeginEv @ 3542 NONAME
+ _ZN18QDeclarativeColumn24reportConflictingAnchorsEv @ 3543 NONAME
+ _ZN20QDeclarativeBehavior18componentFinalizedEv @ 3544 NONAME
+ _ZN20QDeclarativeCompiler24buildPropertyInNamespaceEP29QDeclarativeImportedNamespacePN18QDeclarativeParser8PropertyEPNS2_6ObjectERKNS_14BindingContextE @ 3545 NONAME
+ _ZN21QDeclarativeComponent12createObjectEP7QObject @ 3546 NONAME
+ _ZN21QDeclarativeMouseArea10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3547 NONAME
+ _ZN21QDeclarativeMouseArea15setHoverEnabledEb @ 3548 NONAME
+ _ZN21QDeclarativeMouseArea19hoverEnabledChangedEv @ 3549 NONAME
+ _ZN21QDeclarativeMouseArea8canceledEv @ 3550 NONAME
+ _ZN23QDeclarativeConnections10classBeginEv @ 3551 NONAME
+ _ZN23QDeclarativeConnections23setIgnoreUnknownSignalsEb @ 3552 NONAME
+ _ZN23QDeclarativeItemPrivate11transitionsEv @ 3553 NONAME
+ _ZN23QDeclarativeItemPrivate4dataEv @ 3554 NONAME
+ _ZN23QDeclarativeItemPrivate7_statesEv @ 3555 NONAME
+ _ZN23QDeclarativeItemPrivate8setStateERK7QString @ 3556 NONAME
+ _ZN23QDeclarativeItemPrivate9resourcesEv @ 3557 NONAME
+ _ZN23QDeclarativePaintedItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3558 NONAME
+ _ZN23QDeclarativePaintedItem15geometryChangedERK6QRectFS2_ @ 3559 NONAME
+ _ZN24QDeclarativeWorkerScript10classBeginEv @ 3560 NONAME
+ _ZN24QDeclarativeWorkerScript6engineEv @ 3561 NONAME
+ _ZNK21QDeclarativeMouseArea12hoverEnabledEv @ 3562 NONAME
+ _ZNK23QDeclarativeConnections20ignoreUnknownSignalsEv @ 3563 NONAME
+ _ZNK23QDeclarativeItemPrivate14verticalCenterEv @ 3564 NONAME
+ _ZNK23QDeclarativeItemPrivate16horizontalCenterEv @ 3565 NONAME
+ _ZNK23QDeclarativeItemPrivate3topEv @ 3566 NONAME
+ _ZNK23QDeclarativeItemPrivate4leftEv @ 3567 NONAME
+ _ZNK23QDeclarativeItemPrivate5rightEv @ 3568 NONAME
+ _ZNK23QDeclarativeItemPrivate5stateEv @ 3569 NONAME
+ _ZNK23QDeclarativeItemPrivate6bottomEv @ 3570 NONAME
+ _ZNK23QDeclarativeItemPrivate8baselineEv @ 3571 NONAME
+ _ZNK27QDeclarativeVisualDataModel15completePendingEv @ 3572 NONAME
+ _ZNK27QDeclarativeVisualItemModel15completePendingEv @ 3573 NONAME
+ _ZThn8_N16QDeclarativeBind10classBeginEv @ 3574 NONAME
+ _ZThn8_N16QDeclarativePath10classBeginEv @ 3575 NONAME
+ _ZThn8_N21QDeclarativeMouseArea10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3576 NONAME
+ _ZThn8_N23QDeclarativeConnections10classBeginEv @ 3577 NONAME
+ _ZThn8_N23QDeclarativePaintedItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 3578 NONAME
+ _ZThn8_N24QDeclarativeWorkerScript10classBeginEv @ 3579 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b1166c5..02b74ee 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -9901,9 +9901,9 @@ EXPORTS
_ZNK7QBezier10addIfCloseEPff @ 9900 NONAME
_ZNK7QBezier12addToPolygonEP9QPolygonF @ 9901 NONAME
_ZNK7QBezier16bezierOnIntervalEff @ 9902 NONAME
- _ZNK7QBezier17addToPolygonMixedEP9QPolygonF @ 9903 NONAME
+ _ZNK7QBezier17addToPolygonMixedEP9QPolygonF @ 9903 NONAME ABSENT
_ZNK7QBezier17stationaryYPointsERfS0_ @ 9904 NONAME
- _ZNK7QBezier21addToPolygonIterativeEP9QPolygonF @ 9905 NONAME
+ _ZNK7QBezier21addToPolygonIterativeEP9QPolygonF @ 9905 NONAME ABSENT
_ZNK7QBezier5tForYEfff @ 9906 NONAME
_ZNK7QBezier6boundsEv @ 9907 NONAME
_ZNK7QBezier6lengthEf @ 9908 NONAME
@@ -11849,7 +11849,7 @@ EXPORTS
_ZN19QApplicationPrivate15getPixmapCursorEN2Qt11CursorShapeE @ 11848 NONAME
_ZN20QGraphicsViewPrivate10centerViewEN13QGraphicsView14ViewportAnchorE @ 11849 NONAME
_ZN20QGraphicsViewPrivate10updateRectERK5QRect @ 11850 NONAME
- _ZN20QGraphicsViewPrivate12updateRegionERK7QRegion @ 11851 NONAME
+ _ZN20QGraphicsViewPrivate12updateRegionERK7QRegion @ 11851 NONAME ABSENT
_ZN20QGraphicsViewPrivate12updateScrollEv @ 11852 NONAME
_ZN20QGraphicsViewPrivate15storeMouseEventEP11QMouseEvent @ 11853 NONAME
_ZN20QGraphicsViewPrivate18storeDragDropEventEPK27QGraphicsSceneDragDropEvent @ 11854 NONAME
@@ -11998,4 +11998,5 @@ EXPORTS
_ZN14QWindowSurface23setPartialUpdateSupportEb @ 11997 NONAME
_ZNK14QWindowSurface23hasPartialUpdateSupportEv @ 11998 NONAME
_ZNK5QIcon4nameEv @ 11999 NONAME
+ _ZN20QGraphicsViewPrivate12updateRegionERK6QRectFRK10QTransform @ 12000 NONAME
diff --git a/src/src.pro b/src/src.pro
index 796f990..7574796 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -91,7 +91,7 @@ src_declarative.target = sub-declarative
src_xml.depends = src_corelib
src_xmlpatterns.depends = src_corelib src_network
src_dbus.depends = src_corelib src_xml
- src_svg.depends = src_xml src_gui
+ src_svg.depends = src_corelib src_gui
src_script.depends = src_corelib
src_scripttools.depends = src_script src_gui src_network
src_network.depends = src_corelib
@@ -106,14 +106,13 @@ src_declarative.target = sub-declarative
src_multimedia.depends = src_gui
contains(QT_CONFIG, opengl):src_multimedia.depends += src_opengl
src_tools_activeqt.depends = src_tools_idc src_gui
- src_declarative.depends = src_xml src_gui src_script src_network src_svg
+ src_declarative.depends = src_gui src_script src_network
src_plugins.depends = src_gui src_sql src_svg src_multimedia
src_s60installs.depends = $$TOOLS_SUBDIRS $$SRC_SUBDIRS
src_imports.depends = src_gui src_declarative
contains(QT_CONFIG, webkit) {
- src_webkit.depends = src_gui src_sql src_network src_xml
+ src_webkit.depends = src_gui src_sql src_network
contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns
- contains(QT_CONFIG, declarative):src_declarative.depends += src_webkit
src_imports.depends += src_webkit
exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore
}
@@ -122,7 +121,18 @@ src_declarative.target = sub-declarative
src_plugins.depends += src_dbus
src_phonon.depends += src_dbus
}
- contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): src_plugins.depends += src_opengl
+ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
+ src_plugins.depends += src_opengl
+ src_declarative.depends += src_opengl
+ src_webkit.depends += src_opengl
+ }
+ contains(QT_CONFIG, xmlpatterns) {
+ src_declarative.depends += src_xmlpatterns
+ src_webkit.depends += src_xmlpatterns
+ }
+ contains(QT_CONFIG, svg) {
+ src_declarative.depends += src_svg
+ }
}
diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp
index 010965c..400fcc1 100644
--- a/tests/auto/bic/tst_bic.cpp
+++ b/tests/auto/bic/tst_bic.cpp
@@ -191,7 +191,7 @@ void tst_Bic::sizesAndVTables_data()
#elif defined Q_OS_MAC && defined(__i386__)
# define FILESUFFIX "macx-gcc-ia32"
#elif defined Q_OS_MAC && defined(__amd64__)
-# define FILESUFFIX "macx-gcc-amd64";
+# define FILESUFFIX "macx-gcc-amd64"
#elif defined Q_OS_WIN && defined Q_CC_GNU
# define FILESUFFIX "win32-gcc-ia32"
#else
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index 9b3b3d0..4bb3518 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -1,77 +1,80 @@
TEMPLATE = subdirs
+!symbian: {
SUBDIRS += \
examples \
- graphicswidgets \ # Cover
- parserstress \ # Cover
- qmetaobjectbuilder \ # Cover
- qdeclarativeanimations \ # Cover
- qdeclarativebehaviors \ # Cover
- qdeclarativebinding \ # Cover
- qdeclarativecomponent \ # Cover
- qdeclarativeconnection \ # Cover
- qdeclarativecontext \ # Cover
- qdeclarativedebug \ # Cover
- qdeclarativedebugclient \ # Cover
- qdeclarativedebugservice \ # Cover
- qdeclarativedom \ # Cover
- qdeclarativeecmascript \ # Cover
- qdeclarativeengine \ # Cover
- qdeclarativeerror \ # Cover
- qdeclarativefontloader \ # Cover
- qdeclarativeanchors \ # Cover
- qdeclarativeanimatedimage \ # Cover
- qdeclarativeimage \ # Cover
- qdeclarativeborderimage \ # Cover
- qdeclarativeflickable \ # Cover
- qdeclarativeflipable \ # Cover
- qdeclarativefocusscope \ # Cover
- qdeclarativegridview \ # Cover
- qdeclarativeitem \ # Cover
- qdeclarativelistview \ # Cover
- qdeclarativeloader \ # Cover
- qdeclarativelayouts \ # Cover
- qdeclarativemousearea \ # Cover
- qdeclarativeparticles \ # Cover
- qdeclarativepathview \ # Cover
- qdeclarativepositioners \ # Cover
- qdeclarativetext \ # Cover
- qdeclarativetextedit \ # Cover
- qdeclarativetextinput \ # Cover
- qdeclarativeinfo \ # Cover
- qdeclarativeinstruction \ # Cover
- qdeclarativelanguage \ # Cover
- qdeclarativelistreference \ # Cover
- qdeclarativelistmodel \ # Cover
- qdeclarativeproperty \ # Cover
- qdeclarativemetatype \ # Cover
- qdeclarativemoduleplugin \ # Cover
- qdeclarativepixmapcache \ # Cover
- qdeclarativepropertymap \ # Cover
- qdeclarativeqt \ # Cover
- qdeclarativesmoothedanimation \ # Cover
- qdeclarativesmoothedfollow\ # Cover
- qdeclarativespringfollow \ # Cover
- qdeclarativestates \ # Cover
- qdeclarativesystempalette \ # Cover
- qdeclarativetimer \ # Cover
- qdeclarativexmllistmodel \ # Cover
- qpacketprotocol \ # Cover
- qdeclarativerepeater \ # Cover
- qdeclarativeworkerscript \ # Cover
- qdeclarativevaluetypes \ # Cover
- qdeclarativeview \ # Cover
- qdeclarativexmlhttprequest \ # Cover
- qdeclarativeimageprovider \ # Cover
- qdeclarativestyledtext \ # Cover
- qdeclarativesqldatabase \ # Cover
- qdeclarativevisualdatamodel \ # Cover
- qmlvisual # Cover
+ qdeclarativemetatype \
+ qmetaobjectbuilder
+}
+
+SUBDIRS += \
+ parserstress \
+ qdeclarativeanchors \
+ qdeclarativeanimatedimage \
+ qdeclarativeanimations \
+ qdeclarativebehaviors \
+ qdeclarativebinding \
+ qdeclarativeborderimage \
+ qdeclarativecomponent \
+ qdeclarativeconnection \
+ qdeclarativecontext \
+ qdeclarativedebug \
+ qdeclarativedebugclient \
+ qdeclarativedebugservice \
+ qdeclarativedom \
+ qdeclarativeecmascript \
+ qdeclarativeengine \
+ qdeclarativeerror \
+ qdeclarativefontloader \
+ qdeclarativeflickable \
+ qdeclarativeflipable \
+ qdeclarativefocusscope \
+ qdeclarativegridview \
+ qdeclarativeimage \
+ qdeclarativeimageprovider \
+ qdeclarativeinfo \
+ qdeclarativeinstruction \
+ qdeclarativeitem \
+ qdeclarativelanguage \
+ qdeclarativelayoutitem \
+ qdeclarativelistmodel \
+ qdeclarativelistreference \
+ qdeclarativelistview \
+ qdeclarativeloader \
+ qdeclarativemoduleplugin \
+ qdeclarativemousearea \
+ qdeclarativeparticles \
+ qdeclarativepathview \
+ qdeclarativepixmapcache \
+ qdeclarativepositioners \
+ qdeclarativeproperty \
+ qdeclarativepropertymap \
+ qdeclarativeqt \
+ qdeclarativerepeater \
+ qdeclarativesmoothedanimation \
+ qdeclarativesmoothedfollow\
+ qdeclarativespringfollow \
+ qdeclarativesqldatabase \
+ qdeclarativestates \
+ qdeclarativestyledtext \
+ qdeclarativesystempalette \
+ qdeclarativetext \
+ qdeclarativetextedit \
+ qdeclarativetextinput \
+ qdeclarativetimer \
+ qdeclarativevaluetypes \
+ qdeclarativeview \
+ qdeclarativeviewer \
+ qdeclarativevisualdatamodel \
+ qdeclarativeworkerscript \
+ qdeclarativexmlhttprequest \
+ qdeclarativexmllistmodel \
+ qmlvisual \
+ qpacketprotocol
contains(QT_CONFIG, webkit) {
SUBDIRS += \
- qdeclarativewebview # Cover
+ qdeclarativewebview
}
# Tests which should run in Pulse
PULSE_TESTS = $$SUBDIRS
-
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro
index 4c32524..92a16f1 100644
--- a/tests/auto/declarative/examples/examples.pro
+++ b/tests/auto/declarative/examples/examples.pro
@@ -6,7 +6,14 @@ SOURCES += tst_examples.cpp
include(../../../../tools/qml/qml.pri)
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index 16b0cbe..605345e 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -80,22 +80,14 @@ tst_examples::tst_examples()
// Add directories you want excluded here
- excludedDirs << "examples/declarative/extending";
- excludedDirs << "examples/declarative/tutorials/extending";
- excludedDirs << "examples/declarative/plugins";
- excludedDirs << "examples/declarative/proxywidgets";
- excludedDirs << "examples/declarative/gestures";
-
- excludedDirs << "examples/declarative/imageprovider";
- excludedDirs << "demos/declarative/minehunt";
#ifdef QT_NO_WEBKIT
- excludedDirs << "examples/declarative/webview";
+ excludedDirs << "examples/declarative/modelviews/webview";
excludedDirs << "demos/declarative/webbrowser";
#endif
#ifdef QT_NO_XMLPATTERNS
- excludedDirs << "examples/declarative/xmldata";
+ excludedDirs << "examples/declarative/xml/xmldata";
excludedDirs << "demos/declarative/twitter";
excludedDirs << "demos/declarative/flickr";
excludedDirs << "demos/declarative/photoviewer";
@@ -157,11 +149,14 @@ QStringList tst_examples::findQmlFiles(const QDir &d)
QStringList rv;
- QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),
- QDir::Files);
- foreach (const QString &file, files) {
- if (file.at(0).isLower()) {
- rv << d.absoluteFilePath(file);
+ QStringList cppfiles = d.entryList(QStringList() << QLatin1String("*.cpp"), QDir::Files);
+ if (cppfiles.isEmpty()) {
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),
+ QDir::Files);
+ foreach (const QString &file, files) {
+ if (file.at(0).isLower()) {
+ rv << d.absoluteFilePath(file);
+ }
}
}
diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
deleted file mode 100644
index d6cf4de..0000000
--- a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-import Qt 4.7
-import Qt.widgets 4.7
-
-QGraphicsWidget {
- geometry: "20,0,600x400"
- layout: QGraphicsLinearLayout {
- orientation: Qt.Horizontal
- QGraphicsWidget {
- layout: QGraphicsLinearLayout {
- spacing: 10; orientation: Qt.Vertical
- LayoutItem {
- QGraphicsLinearLayout.stretchFactor: 1
- QGraphicsLinearLayout.spacing: 1
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent }
- }
- LayoutItem {
- QGraphicsLinearLayout.stretchFactor: 10
- QGraphicsLinearLayout.spacing: 10
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "blue"; anchors.fill: parent }
- }
- }
- }
- QGraphicsWidget {
- layout: QGraphicsLinearLayout {
- spacing: 10; orientation: Qt.Horizontal; contentsMargin: 10
- LayoutItem {
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "red"; anchors.fill: parent }
- }
- LayoutItem {
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "green"; anchors.fill: parent }
- }
- }
- }
- }
-}
-
diff --git a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro b/tests/auto/declarative/graphicswidgets/graphicswidgets.pro
deleted file mode 100644
index b77b430..0000000
--- a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative gui
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_graphicswidgets.cpp
-
-# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-CONFIG += parallel_test
diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro
index 8830511..a95a855 100644
--- a/tests/auto/declarative/parserstress/parserstress.pro
+++ b/tests/auto/declarative/parserstress/parserstress.pro
@@ -4,7 +4,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_parserstress.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = ..\..\qscriptjstestsuite\tests
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp
index 294f2f7..c86908b 100644
--- a/tests/auto/declarative/parserstress/tst_parserstress.cpp
+++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp
@@ -86,12 +86,15 @@ QStringList tst_parserstress::findJSFiles(const QDir &d)
void tst_parserstress::ecmascript_data()
{
+#ifdef Q_OS_SYMBIAN
+ QDir dir("tests");
+#else
QDir dir(SRCDIR);
dir.cdUp();
dir.cdUp();
dir.cd("qscriptjstestsuite");
dir.cd("tests");
-
+#endif
QStringList files = findJSFiles(dir);
QTest::addColumn<QString>("file");
@@ -129,6 +132,7 @@ void tst_parserstress::ecmascript()
QByteArray qmlData = qml.toUtf8();
QDeclarativeComponent component(&engine);
+
component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml")));
QFileInfo info(file);
diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
index 91973a3..d430c2c 100644
--- a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
+++ b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml
@@ -1,5 +1,4 @@
import Qt 4.7
-import Qt.widgets 4.7
Rectangle {
color: "white"
diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
index a2403f2..452ad55 100644
--- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
+++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro
@@ -3,7 +3,14 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativeanchors.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index dff62c7..e169fa2 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -48,6 +48,7 @@
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativetext_p.h>
#include <QtDeclarative/private/qdeclarativeanchors_p_p.h>
+#include <QtDeclarative/private/qdeclarativeitem_p.h>
Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor)
Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine)
@@ -376,15 +377,16 @@ void tst_qdeclarativeanchors::reset()
anchor.anchorLine = anchorLine;
QDeclarativeItem *item = new QDeclarativeItem;
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
- const QMetaObject *meta = item->anchors()->metaObject();
+ const QMetaObject *meta = itemPrivate->anchors()->metaObject();
QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
- QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor)));
- QCOMPARE(item->anchors()->usedAnchors().testFlag(usedAnchor), true);
+ QVERIFY(p.write(itemPrivate->anchors(), qVariantFromValue(anchor)));
+ QCOMPARE(itemPrivate->anchors()->usedAnchors().testFlag(usedAnchor), true);
- QVERIFY(p.reset(item->anchors()));
- QCOMPARE(item->anchors()->usedAnchors().testFlag(usedAnchor), false);
+ QVERIFY(p.reset(itemPrivate->anchors()));
+ QCOMPARE(itemPrivate->anchors()->usedAnchors().testFlag(usedAnchor), false);
delete item;
delete baseItem;
@@ -410,18 +412,19 @@ void tst_qdeclarativeanchors::resetConvenience()
{
QDeclarativeItem *baseItem = new QDeclarativeItem;
QDeclarativeItem *item = new QDeclarativeItem;
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
//fill
- item->anchors()->setFill(baseItem);
- QVERIFY(item->anchors()->fill() == baseItem);
- item->anchors()->resetFill();
- QVERIFY(item->anchors()->fill() == 0);
+ itemPrivate->anchors()->setFill(baseItem);
+ QVERIFY(itemPrivate->anchors()->fill() == baseItem);
+ itemPrivate->anchors()->resetFill();
+ QVERIFY(itemPrivate->anchors()->fill() == 0);
//centerIn
- item->anchors()->setCenterIn(baseItem);
- QVERIFY(item->anchors()->centerIn() == baseItem);
- item->anchors()->resetCenterIn();
- QVERIFY(item->anchors()->centerIn() == 0);
+ itemPrivate->anchors()->setCenterIn(baseItem);
+ QVERIFY(itemPrivate->anchors()->centerIn() == baseItem);
+ itemPrivate->anchors()->resetCenterIn();
+ QVERIFY(itemPrivate->anchors()->centerIn() == 0);
delete item;
delete baseItem;
@@ -433,12 +436,13 @@ void tst_qdeclarativeanchors::nullItem()
QDeclarativeAnchorLine anchor;
QDeclarativeItem *item = new QDeclarativeItem;
+ QDeclarativeItemPrivate *itemPrivate = QDeclarativeItemPrivate::get(item);
- const QMetaObject *meta = item->anchors()->metaObject();
+ const QMetaObject *meta = itemPrivate->anchors()->metaObject();
QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML Item: Cannot anchor to a null item.");
- QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor)));
+ QVERIFY(p.write(itemPrivate->anchors(), qVariantFromValue(anchor)));
delete item;
}
@@ -486,15 +490,16 @@ void tst_qdeclarativeanchors::fill()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->x(), 0.0 + 10.0);
QCOMPARE(rect->y(), 0.0 + 30.0);
QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
//Alter Offsets (tests QTBUG-6631)
- rect->anchors()->setLeftMargin(20.0);
- rect->anchors()->setRightMargin(0.0);
- rect->anchors()->setBottomMargin(0.0);
- rect->anchors()->setTopMargin(10.0);
+ rectPrivate->anchors()->setLeftMargin(20.0);
+ rectPrivate->anchors()->setRightMargin(0.0);
+ rectPrivate->anchors()->setBottomMargin(0.0);
+ rectPrivate->anchors()->setTopMargin(10.0);
QCOMPARE(rect->x(), 0.0 + 20.0);
QCOMPARE(rect->y(), 0.0 + 10.0);
QCOMPARE(rect->width(), 200.0 - 20.0);
@@ -509,11 +514,12 @@ void tst_qdeclarativeanchors::centerIn()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->x(), 75.0 + 10);
QCOMPARE(rect->y(), 75.0 + 30);
//Alter Offsets (tests QTBUG-6631)
- rect->anchors()->setHorizontalCenterOffset(-20.0);
- rect->anchors()->setVerticalCenterOffset(-10.0);
+ rectPrivate->anchors()->setHorizontalCenterOffset(-20.0);
+ rectPrivate->anchors()->setVerticalCenterOffset(-10.0);
QCOMPARE(rect->x(), 75.0 - 20.0);
QCOMPARE(rect->y(), 75.0 - 10.0);
@@ -526,13 +532,14 @@ void tst_qdeclarativeanchors::margins()
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->x(), 5.0);
QCOMPARE(rect->y(), 6.0);
QCOMPARE(rect->width(), 200.0 - 5.0 - 10.0);
QCOMPARE(rect->height(), 200.0 - 6.0 - 10.0);
- rect->anchors()->setTopMargin(0.0);
- rect->anchors()->setMargins(20.0);
+ rectPrivate->anchors()->setTopMargin(0.0);
+ rectPrivate->anchors()->setMargins(20.0);
QCOMPARE(rect->x(), 5.0);
QCOMPARE(rect->y(), 20.0);
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
index 74f9be0..7213abd 100644
--- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
+++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro
@@ -4,7 +4,14 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
index ce38eeb..f7ed371 100644
--- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
+++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro
@@ -3,7 +3,14 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativeanimations.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index e217e34..ed7e506 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -44,6 +44,7 @@
#include <QtDeclarative/qdeclarativeview.h>
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativeanimation_p.h>
+#include <private/qdeclarativeitem_p.h>
#include <QVariantAnimation>
#include <QEasingCurve>
@@ -324,7 +325,7 @@ void tst_qdeclarativeanimations::badTypes()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QVERIFY(rect);
- rect->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
QTest::qWait(1000 + 50);
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
QVERIFY(myRect);
@@ -366,7 +367,7 @@ void tst_qdeclarativeanimations::mixedTypes()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QVERIFY(rect);
- rect->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
QTest::qWait(500);
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
QVERIFY(myRect);
@@ -382,7 +383,7 @@ void tst_qdeclarativeanimations::mixedTypes()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QVERIFY(rect);
- rect->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
QTest::qWait(500);
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("MyRect");
QVERIFY(myRect);
@@ -468,7 +469,7 @@ void tst_qdeclarativeanimations::propertiesTransition()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QVERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
QVERIFY(myRect);
QTest::qWait(waitDuration);
@@ -483,7 +484,7 @@ void tst_qdeclarativeanimations::propertiesTransition()
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
QVERIFY(myRect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(200));
QCOMPARE(myRect->y(),qreal(100));
QTest::qWait(waitDuration);
@@ -498,7 +499,7 @@ void tst_qdeclarativeanimations::propertiesTransition()
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
QVERIFY(myRect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(200));
QCOMPARE(myRect->y(),qreal(100));
}
@@ -511,7 +512,7 @@ void tst_qdeclarativeanimations::propertiesTransition()
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
QVERIFY(myRect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(100));
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -525,7 +526,7 @@ void tst_qdeclarativeanimations::propertiesTransition()
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
QVERIFY(myRect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(100));
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(200));
@@ -539,7 +540,7 @@ void tst_qdeclarativeanimations::propertiesTransition()
QDeclarativeRectangle *myRect = rect->findChild<QDeclarativeRectangle*>("TheRect");
QVERIFY(myRect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QCOMPARE(myRect->x(),qreal(100));
QTest::qWait(waitDuration);
QTIMED_COMPARE(myRect->x(),qreal(100));
@@ -709,7 +710,7 @@ void tst_qdeclarativeanimations::rotation()
QDeclarativeRectangle *rr3 = rect->findChild<QDeclarativeRectangle*>("rr3");
QDeclarativeRectangle *rr4 = rect->findChild<QDeclarativeRectangle*>("rr4");
- rect->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
QTest::qWait(800);
qreal r1 = rr->rotation();
qreal r2 = rr2->rotation();
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
new file mode 100644
index 0000000..1911cc4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/startup2.qml
@@ -0,0 +1,16 @@
+import Qt 4.7
+
+Rectangle {
+ width: 800;
+ height: 480;
+
+ Text { id:theText; text: "hello world" }
+
+ Rectangle {
+ objectName: "innerRect"
+ color: "red"
+ x: theText.width
+ Behavior on x { NumberAnimation {} }
+ width: 100; height: 100
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
index c2781b8..7137af1 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
+++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro
@@ -3,7 +3,14 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativebehaviors.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index ee9e282..1dc4b53 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -43,8 +43,10 @@
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativetext_p.h>
#include <private/qdeclarativebehavior_p.h>
#include <private/qdeclarativeanimation_p.h>
+#include <private/qdeclarativeitem_p.h>
#include "../../../shared/util.h"
class tst_qdeclarativebehaviors : public QObject
@@ -80,7 +82,7 @@ void tst_qdeclarativebehaviors::simpleBehavior()
QTRY_VERIFY(rect);
QTRY_VERIFY(qobject_cast<QDeclarativeBehavior*>(rect->findChild<QDeclarativeBehavior*>("MyBehavior"))->animation());
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
@@ -128,7 +130,7 @@ void tst_qdeclarativebehaviors::loop()
QTRY_VERIFY(rect);
//don't crash
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
delete rect;
}
@@ -140,7 +142,7 @@ void tst_qdeclarativebehaviors::colorBehavior()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QTRY_VERIFY(rect);
- rect->setState("red");
+ QDeclarativeItemPrivate::get(rect)->setState("red");
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->color() != QColor("red"));
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->color() != QColor("green"));
//i.e. the behavior has been triggered
@@ -155,7 +157,7 @@ void tst_qdeclarativebehaviors::parentBehavior()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QTRY_VERIFY(rect);
- rect->setState("reparented");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
QTRY_VERIFY(rect->findChild<QDeclarativeRectangle*>("MyRect")->parentItem() != rect->findChild<QDeclarativeItem*>("NewParent"));
QTRY_VERIFY(rect->findChild<QDeclarativeRectangle*>("MyRect")->parentItem() == rect->findChild<QDeclarativeItem*>("NewParent"));
@@ -169,7 +171,7 @@ void tst_qdeclarativebehaviors::replaceBinding()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QTRY_VERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
QTRY_VERIFY(innerRect);
QTRY_VERIFY(innerRect->x() > 0);
@@ -181,7 +183,7 @@ void tst_qdeclarativebehaviors::replaceBinding()
rect->setProperty("movedx", 210);
QTRY_COMPARE(innerRect->x(), (qreal)210);
- rect->setState("");
+ QDeclarativeItemPrivate::get(rect)->setState("");
QTRY_VERIFY(innerRect->x() > 10);
QTRY_VERIFY(innerRect->x() < 210); //i.e. the behavior has been triggered
QTRY_COMPARE(innerRect->x(), (qreal)10);
@@ -201,7 +203,7 @@ void tst_qdeclarativebehaviors::group()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QTRY_VERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
//QTest::qWait(200);
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
@@ -216,7 +218,7 @@ void tst_qdeclarativebehaviors::group()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QTRY_VERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
@@ -230,11 +232,11 @@ void tst_qdeclarativebehaviors::emptyBehavior()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/empty.qml"));
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
+ QVERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
- QTRY_COMPARE(x, qreal(200)); //should change immediately
+ QCOMPARE(x, qreal(200)); //should change immediately
delete rect;
}
@@ -244,9 +246,9 @@ void tst_qdeclarativebehaviors::explicitSelection()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/explicit.qml"));
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
+ QVERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() > 0);
QTRY_VERIFY(qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x() < 200);
//i.e. the behavior has been triggered
@@ -259,11 +261,11 @@ void tst_qdeclarativebehaviors::nonSelectingBehavior()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/nonSelecting2.qml"));
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
+ QVERIFY(rect);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
- QTRY_COMPARE(x, qreal(200)); //should change immediately
+ QCOMPARE(x, qreal(200)); //should change immediately
delete rect;
}
@@ -275,10 +277,9 @@ void tst_qdeclarativebehaviors::reassignedAnimation()
QString warning = QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9: QML Behavior: Cannot change the animation assigned to a Behavior.";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
- QTRY_COMPARE(qobject_cast<QDeclarativeNumberAnimation*>(
- qobject_cast<QDeclarativeBehavior*>(
- rect->findChild<QDeclarativeBehavior*>("MyBehavior"))->animation())->duration(), 200);
+ QVERIFY(rect);
+ QCOMPARE(qobject_cast<QDeclarativeNumberAnimation*>(
+ rect->findChild<QDeclarativeBehavior*>("MyBehavior")->animation())->duration(), 200);
delete rect;
}
@@ -288,12 +289,12 @@ void tst_qdeclarativebehaviors::disabled()
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/disabled.qml"));
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
- QTRY_COMPARE(rect->findChild<QDeclarativeBehavior*>("MyBehavior")->enabled(), false);
+ QVERIFY(rect);
+ QCOMPARE(rect->findChild<QDeclarativeBehavior*>("MyBehavior")->enabled(), false);
- rect->setState("moved");
+ QDeclarativeItemPrivate::get(rect)->setState("moved");
qreal x = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"))->x();
- QTRY_COMPARE(x, qreal(200)); //should change immediately
+ QCOMPARE(x, qreal(200)); //should change immediately
delete rect;
}
@@ -307,28 +308,47 @@ void tst_qdeclarativebehaviors::dontStart()
QString warning = c.url().toString() + ":13:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes.";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
+ QVERIFY(rect);
QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim");
- QTRY_VERIFY(myAnim && myAnim->qtAnimation());
- QTRY_VERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
+ QVERIFY(myAnim && myAnim->qtAnimation());
+ QVERIFY(myAnim->qtAnimation()->state() == QAbstractAnimation::Stopped);
delete rect;
}
void tst_qdeclarativebehaviors::startup()
{
- QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup.qml"));
- QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
- QTRY_VERIFY(rect);
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
- QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
- QTRY_VERIFY(innerRect);
+ QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
+ QVERIFY(innerRect);
- QTRY_COMPARE(innerRect->x(), qreal(100)); //should be set immediately
+ QCOMPARE(innerRect->x(), qreal(100)); //should be set immediately
- delete rect;
+ delete rect;
+ }
+
+ {
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/startup2.qml"));
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QDeclarativeRectangle *innerRect = rect->findChild<QDeclarativeRectangle*>("innerRect");
+ QVERIFY(innerRect);
+
+ QDeclarativeText *text = rect->findChild<QDeclarativeText*>();
+ QVERIFY(text);
+
+ QCOMPARE(innerRect->x(), text->width()); //should be set immediately
+
+ delete rect;
+ }
}
QTEST_MAIN(tst_qdeclarativebehaviors)
diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
index 04dd6f5..04535db 100644
--- a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
+++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativebinding.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
index e754923..3aa2197 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
+++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro
@@ -6,7 +6,14 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index e58c798..98c38ad 100644
--- a/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -5,7 +5,11 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativecomponent.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
new file mode 100644
index 0000000..764d5ab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml
@@ -0,0 +1,8 @@
+import Qt 4.7
+
+Item {
+ id: screen
+
+ Connections { target: screen; onNotFooBar1: {} ignoreUnknownSignals: true }
+ Connections { objectName: "connections"; onNotFooBar2: {} ignoreUnknownSignals: true }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
new file mode 100644
index 0000000..09e7812
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml
@@ -0,0 +1,7 @@
+import Qt 4.7
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: null; onNotFooBar: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
new file mode 100644
index 0000000..478503d
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml
@@ -0,0 +1,7 @@
+import Qt 4.7
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; onFooBar: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
new file mode 100644
index 0000000..d4e8d7e
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml
@@ -0,0 +1,7 @@
+import Qt 4.7
+
+Item {
+ id: screen
+
+ Connections { objectName: "connections"; target: screen; onFooBar: {} }
+}
diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
index 959354d..bbf8630 100644
--- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
+++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeconnection.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
index 0efae3b..00e97ca 100644
--- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
+++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp
@@ -59,6 +59,8 @@ private slots:
void connection();
void trimming();
void targetChanged();
+ void unknownSignals_data();
+ void unknownSignals();
private:
QDeclarativeEngine engine;
@@ -156,6 +158,41 @@ void tst_qdeclarativeconnection::targetChanged()
delete item;
}
+void tst_qdeclarativeconnection::unknownSignals_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("basic") << "connection-unknownsignals.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+ QTest::newRow("parent") << "connection-unknownsignals-parent.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\"";
+ QTest::newRow("ignored") << "connection-unknownsignals-ignored.qml" << ""; // should be NO error
+ QTest::newRow("notarget") << "connection-unknownsignals-notarget.qml" << ""; // should be NO error
+}
+
+void tst_qdeclarativeconnection::unknownSignals()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, error);
+
+ QUrl url = QUrl::fromLocalFile(SRCDIR "/data/" + file);
+ if (!error.isEmpty()) {
+ QTest::ignoreMessage(QtWarningMsg, (url.toString() + error).toLatin1());
+ } else {
+ // QTest has no way to insist no message (i.e. fail)
+ }
+
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, url);
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create());
+ QVERIFY(item != 0);
+
+ // check that connection is created (they are all runtime errors)
+ QDeclarativeConnections *connections = item->findChild<QDeclarativeConnections*>("connections");
+ QVERIFY(connections);
+
+ delete item;
+}
+
QTEST_MAIN(tst_qdeclarativeconnection)
#include "tst_qdeclarativeconnection.moc"
diff --git a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
index 5db9a9e..0e1a5b1 100644
--- a/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
+++ b/tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro
@@ -3,7 +3,11 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativecontext.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
index 466c563..9f1e50c 100644
--- a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
+++ b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro
@@ -4,7 +4,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativedom.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
index a951827..6c19566 100644
--- a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
+++ b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
@@ -419,10 +419,8 @@ void tst_qdeclarativedom::loadSyntaxErrors()
void tst_qdeclarativedom::loadRemoteErrors()
{
QByteArray qml = "import Qt 4.7\n"
+ "import \"http://localhost/exampleQmlScript.js\" as Script\n"
"Item {\n"
- " Script {\n"
- " source: \"http://localhost/exampleQmlScript.js\""
- " }\n"
"}";
QDeclarativeDomDocument document;
QVERIFY(false == document.load(&engine, qml));
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/blank.js b/tests/auto/declarative/qdeclarativeecmascript/data/blank.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/blank.js
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
index 72b59ae..2337e44 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
@@ -19,7 +19,7 @@ QtObject {
myObject.deleteOnSet = 1;
- test3 = myObject.value == undefined;
- test4 = obj.value == undefined;
+ test3 = myObject == null
+ test4 = obj == null
}
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
index 3047e9b..7b132e1 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
@@ -11,7 +11,7 @@ MyQmlObject{
function createTwo()
{
var component = Qt.createComponent('dynamicCreation.helper.qml');
- obj.objectProperty = component.createObject();
+ obj.objectProperty = component.createObject(obj);
}
function createThree()
@@ -22,6 +22,6 @@ MyQmlObject{
function dontCrash()
{
var component = Qt.createComponent('file-doesnt-exist.qml');
- obj.objectProperty = component.createObject();
+ obj.objectProperty = component.createObject(obj);
}
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
new file mode 100644
index 0000000..bc2df98
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
@@ -0,0 +1,23 @@
+import Qt 4.7
+
+QtObject {
+ property bool test1: false;
+ property bool test2: false;
+ property bool test3: false;
+ property bool test4: false;
+ property bool test5: false;
+
+
+ property int a: 7
+ property int b: 8
+
+ Component.onCompleted: {
+ var b = 9;
+
+ test1 = (eval("a") == 7);
+ test2 = (eval("b") == 9);
+ test3 = (eval("c") == undefined);
+ test4 = (eval("console") == console);
+ test5 = (eval("Qt") == Qt);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exception.js b/tests/auto/declarative/qdeclarativeecmascript/data/exception.js
new file mode 100644
index 0000000..160bbfa
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/exception.js
@@ -0,0 +1 @@
+throw("Whoops!");
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
new file mode 100644
index 0000000..b435f58
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
@@ -0,0 +1,19 @@
+import Qt 4.7
+
+QtObject {
+ property bool test1: false;
+ property bool test2: false;
+ property bool test3: false;
+
+ Component.onCompleted: {
+ var a = 10;
+
+ var func1 = new Function("a", "return a + 7");
+ var func2 = new Function("a", "return Qt.atob(a)");
+ var func3 = new Function("return a");
+
+ test1 = (func1(4) == 11);
+ test2 = (func2("Hello World!") == Qt.atob("Hello World!"));
+ test3 = (func3() == undefined);
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml
new file mode 100644
index 0000000..09540f1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml
@@ -0,0 +1,5 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property variant a: function myFunction() { return 2; }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
new file mode 100644
index 0000000..948b39c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml
@@ -0,0 +1,13 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ property variant a
+ property bool runTest: false
+ onRunTestChanged: {
+ function myFunction() {
+ console.log("hello world");
+ }
+ a = myFunction;
+ }
+
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.js b/tests/auto/declarative/qdeclarativeecmascript/data/include.js
new file mode 100644
index 0000000..232fd80
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.js
@@ -0,0 +1,8 @@
+var test1 = true
+var test2 = false
+var test3 = false
+
+function go() {
+ Qt.include("js/include2.js");
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
new file mode 100644
index 0000000..18543b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include.qml
@@ -0,0 +1,23 @@
+import Qt 4.7
+import "include.js" as IncludeTest
+
+QtObject {
+ property int test0: 0
+ property bool test1: false
+ property bool test2: false
+ property bool test2_1: false
+ property bool test3: false
+ property bool test3_1: false
+
+ property int testValue: 99
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ test0 = IncludeTest.value
+ test1 = IncludeTest.test1
+ test2 = IncludeTest.test2
+ test2_1 = IncludeTest.test2_1
+ test3 = IncludeTest.test3
+ test3_1 = IncludeTest.test3_1
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js
new file mode 100644
index 0000000..ea19eba
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js
@@ -0,0 +1,11 @@
+function go() {
+ var a = Qt.include("missing.js", function(o) { test2 = o.status == o.NETWORK_ERROR });
+ test1 = a.status == a.NETWORK_ERROR
+
+ var b = Qt.include("blank.js", function(o) { test4 = o.status == o.OK });
+ test3 = b.status == b.OK
+
+ var c = Qt.include("exception.js", function(o) { test6 = o.status == o.EXCEPTION });
+ test5 = c.status == c.EXCEPTION
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
new file mode 100644
index 0000000..a39e821
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml
@@ -0,0 +1,15 @@
+import Qt 4.7
+import "include_callback.js" as IncludeTest
+
+QtObject {
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+ property bool test5: false
+ property bool test6: false
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js
new file mode 100644
index 0000000..e6a4676
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js
@@ -0,0 +1,26 @@
+var myvar = 10;
+
+function go()
+{
+ var a = Qt.include("http://127.0.0.1:8111/remote_file.js",
+ function(o) {
+ test2 = o.status == o.OK
+ test3 = a.status == a.OK
+ test4 = myvar == 13
+
+ done = true;
+ });
+ test1 = a.status == a.LOADING
+
+
+ var b = Qt.include("http://127.0.0.1:8111/exception.js",
+ function(o) {
+ test7 = o.status == o.EXCEPTION
+ test8 = b.status == a.EXCEPTION
+ test9 = b.exception.toString() == "Whoops!";
+ test10 = o.exception.toString() == "Whoops!";
+
+ done2 = true;
+ });
+ test6 = b.status == b.LOADING
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
new file mode 100644
index 0000000..06bd174
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml
@@ -0,0 +1,21 @@
+import Qt 4.7
+import "include_remote.js" as IncludeTest
+
+QtObject {
+ property bool done: false
+ property bool done2: false
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+ property bool test4: false
+ property bool test5: false
+
+ property bool test6: false
+ property bool test7: false
+ property bool test8: false
+ property bool test9: false
+ property bool test10: false
+
+ Component.onCompleted: IncludeTest.go();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js
new file mode 100644
index 0000000..cc90860
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js
@@ -0,0 +1,13 @@
+function go()
+{
+ var a = Qt.include("http://127.0.0.1:8111/missing.js",
+ function(o) {
+ test2 = o.status == o.NETWORK_ERROR
+ test3 = a.status == a.NETWORK_ERROR
+
+ done = true;
+ });
+
+ test1 = a.status == a.LOADING
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
new file mode 100644
index 0000000..8e486b2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+import "include_remote_missing.js" as IncludeTest
+
+QtObject {
+ property bool done: false
+
+ property bool test1: false
+ property bool test2: false
+ property bool test3: false
+
+ Component.onCompleted: IncludeTest.go();
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js
new file mode 100644
index 0000000..a49c07b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js
@@ -0,0 +1,12 @@
+.pragma library
+
+var test1 = true
+var test2 = false
+var test3 = false
+
+var testValue = 99;
+
+function go() {
+ Qt.include("js/include2.js");
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
new file mode 100644
index 0000000..e957018
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml
@@ -0,0 +1,22 @@
+import Qt 4.7
+import "include_shared.js" as IncludeTest
+
+QtObject {
+ property int test0: 0
+ property bool test1: false
+ property bool test2: false
+ property bool test2_1: false
+ property bool test3: false
+ property bool test3_1: false
+
+ Component.onCompleted: {
+ IncludeTest.go();
+ test0 = IncludeTest.value
+ test1 = IncludeTest.test1
+ test2 = IncludeTest.test2
+ test2_1 = IncludeTest.test2_1
+ test3 = IncludeTest.test3
+ test3_1 = IncludeTest.test3_1
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js b/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js
new file mode 100644
index 0000000..2a0c039
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js
@@ -0,0 +1,4 @@
+test2 = true
+var test2_1 = true
+
+Qt.include("include3.js");
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js b/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js
new file mode 100644
index 0000000..84b2770
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js
@@ -0,0 +1,3 @@
+test3 = true
+var test3_1 = true
+var value = testValue
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
new file mode 100644
index 0000000..cb5c4c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml
@@ -0,0 +1,26 @@
+import Qt 4.7
+
+QtObject {
+ property string test: "aaaa"
+ + "bbbb"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc"
+ + "cccc";
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
new file mode 100644
index 0000000..b6d31d5
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml
@@ -0,0 +1,13 @@
+import Qt 4.7
+
+QtObject {
+ id: root
+ property QtObject object: QtObject {
+ id: nested
+ property QtObject nestedObject
+ }
+
+ Component.onCompleted: {
+ nested.nestedObject = root;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js b/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js
new file mode 100644
index 0000000..1b123ae
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js
@@ -0,0 +1,2 @@
+myvar = 13;
+test5 = true;
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
new file mode 100644
index 0000000..a36b4c0
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml
@@ -0,0 +1,14 @@
+import Qt 4.7
+
+QtObject {
+ id: root
+
+ property variant a: 10
+ property int x: 10
+ property int test: a.x
+
+ Component.onCompleted: {
+ a = 11;
+ a = root;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
index eabed26..c907be5 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
+++ b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro
@@ -1,13 +1,18 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative script
+contains(QT_CONFIG,declarative): QT += declarative script network
macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeecmascript.cpp \
- testtypes.cpp
-HEADERS += testtypes.h
+ testtypes.cpp \
+ ../shared/testhttpserver.cpp
+HEADERS += testtypes.h \
+ ../shared/testhttpserver.h
+INCLUDEPATH += ../shared
# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
# LIBS += -lgcov
+DEFINES += SRCDIR=\\\"$$PWD\\\"
+
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 491a736..64e5b3f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -51,6 +51,7 @@
#include <private/qdeclarativeengine_p.h>
#include <private/qdeclarativeglobalscriptclass_p.h>
#include "testtypes.h"
+#include "testhttpserver.h"
/*
This test covers evaluation of ECMAScript expressions and bindings from within
@@ -142,8 +143,15 @@ private slots:
void libraryScriptAssert();
void variantsAssignedUndefined();
void qtbug_9792();
+ void qtcreatorbug_1289();
void noSpuriousWarningsAtShutdown();
void canAssignNullToQObject();
+ void functionAssignment();
+ void eval();
+ void function();
+ void qtbug_10696();
+
+ void include();
void callQtInvokables();
private:
@@ -1100,7 +1108,7 @@ void tst_qdeclarativeecmascript::exceptionClearsOnReeval()
QDeclarativeComponent component(&engine, TEST_FILE("exceptionClearsOnReeval.qml"));
QString url = component.url().toString();
- QString warning = url + ":4: TypeError: Result of expression 'objectProperty.objectProperty' [undefined] is not an object.";
+ QString warning = url + ":4: TypeError: Result of expression 'objectProperty' [null] is not an object.";
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
@@ -1149,6 +1157,7 @@ static void transientErrorsMsgHandler(QtMsgType, const char *)
// Check that transient binding errors are not displayed
void tst_qdeclarativeecmascript::transientErrors()
{
+ {
QDeclarativeComponent component(&engine, TEST_FILE("transientErrors.qml"));
transientErrorsMsgCount = 0;
@@ -1160,6 +1169,22 @@ void tst_qdeclarativeecmascript::transientErrors()
qInstallMsgHandler(old);
QCOMPARE(transientErrorsMsgCount, 0);
+ }
+
+ // One binding erroring multiple times, but then resolving
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("transientErrors.2.qml"));
+
+ transientErrorsMsgCount = 0;
+ QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler);
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ qInstallMsgHandler(old);
+
+ QCOMPARE(transientErrorsMsgCount, 0);
+ }
}
// Check that errors during shutdown are minimized
@@ -2188,6 +2213,27 @@ void tst_qdeclarativeecmascript::qtbug_9792()
delete object;
}
+// Verifies that QDeclarativeGuard<>s used in the vmemetaobject are cleaned correctly
+void tst_qdeclarativeecmascript::qtcreatorbug_1289()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtcreatorbug_1289.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QObject *nested = qvariant_cast<QObject *>(o->property("object"));
+ QVERIFY(nested != 0);
+
+ QVERIFY(qvariant_cast<QObject *>(nested->property("nestedObject")) == o);
+
+ delete nested;
+ nested = qvariant_cast<QObject *>(o->property("object"));
+ QVERIFY(nested == 0);
+
+ // If the bug is present, the next line will crash
+ delete o;
+}
+
// Test that we shut down without stupid warnings
void tst_qdeclarativeecmascript::noSpuriousWarningsAtShutdown()
{
@@ -2252,6 +2298,189 @@ void tst_qdeclarativeecmascript::canAssignNullToQObject()
}
}
+void tst_qdeclarativeecmascript::functionAssignment()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("functionAssignment.1.qml"));
+
+ QString url = component.url().toString();
+ QString warning = url + ":4: Unable to assign a function to a property.";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+
+ QVERIFY(!o->property("a").isValid());
+
+ delete o;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("functionAssignment.2.qml"));
+
+ MyQmlObject *o = qobject_cast<MyQmlObject *>(component.create());
+ QVERIFY(o != 0);
+
+ QVERIFY(!o->property("a").isValid());
+
+ QString url = component.url().toString();
+ QString warning = url + ":10: Error: Cannot assign a function to a property.";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+
+ o->setProperty("runTest", true);
+
+ QVERIFY(!o->property("a").isValid());
+
+ delete o;
+ }
+}
+
+void tst_qdeclarativeecmascript::eval()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("eval.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+
+ delete o;
+}
+
+void tst_qdeclarativeecmascript::function()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("function.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+
+ delete o;
+}
+
+#define TRY_WAIT(expr) \
+ do { \
+ for (int ii = 0; ii < 6; ++ii) { \
+ if ((expr)) break; \
+ QTest::qWait(50); \
+ } \
+ QVERIFY((expr)); \
+ } while (false)
+
+// Test the "Qt.include" method
+void tst_qdeclarativeecmascript::include()
+{
+ // Non-library relative include
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test0").toInt(), 99);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test2_1").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test3_1").toBool(), true);
+
+ delete o;
+ }
+
+ // Library relative include
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include_shared.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test0").toInt(), 99);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test2_1").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test3_1").toBool(), true);
+
+ delete o;
+ }
+
+ // Callback
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("include_callback.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ QCOMPARE(o->property("test6").toBool(), true);
+
+ delete o;
+ }
+
+ // Remote - success
+ {
+ TestHTTPServer server(8111);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("include_remote.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ TRY_WAIT(o->property("done").toBool() == true);
+ TRY_WAIT(o->property("done2").toBool() == true);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+
+ QCOMPARE(o->property("test6").toBool(), true);
+ QCOMPARE(o->property("test7").toBool(), true);
+ QCOMPARE(o->property("test8").toBool(), true);
+ QCOMPARE(o->property("test9").toBool(), true);
+ QCOMPARE(o->property("test10").toBool(), true);
+
+ delete o;
+ }
+
+ // Remote - error
+ {
+ TestHTTPServer server(8111);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QDeclarativeComponent component(&engine, TEST_FILE("include_remote_missing.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ TRY_WAIT(o->property("done").toBool() == true);
+
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+
+ delete o;
+ }
+}
+
+void tst_qdeclarativeecmascript::qtbug_10696()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_10696.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ delete o;
+}
+
QTEST_MAIN(tst_qdeclarativeecmascript)
#include "tst_qdeclarativeecmascript.moc"
diff --git a/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro b/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro
index e0ea2e5..23afd07 100644
--- a/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro
+++ b/tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro
@@ -5,7 +5,11 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeengine.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro b/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro
index 501f32c..fae11f9 100644
--- a/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro
+++ b/tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro
@@ -3,7 +3,11 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativeerror.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
index 07637c9..7a70109 100644
--- a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
+++ b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeflickable.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index 9ce9c49..2c6890e 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -61,6 +61,7 @@ private slots:
void maximumFlickVelocity();
void flickDeceleration();
void pressDelay();
+ void flickableDirection();
private:
QDeclarativeEngine engine;
@@ -224,6 +225,33 @@ void tst_qdeclarativeflickable::pressDelay()
QCOMPARE(spy.count(),1);
}
+void tst_qdeclarativeflickable::flickableDirection()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import Qt 4.7; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(flickableDirectionChanged()));
+
+ QVERIFY(flickable);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::VerticalFlick);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ QCOMPARE(spy.count(),1);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::AutoFlickDirection);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::AutoFlickDirection);
+ QCOMPARE(spy.count(),2);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(spy.count(),3);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(spy.count(),3);
+}
+
QTEST_MAIN(tst_qdeclarativeflickable)
#include "tst_qdeclarativeflickable.moc"
diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
index 9830b55..9b4fbc9 100644
--- a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
+++ b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeflipable.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
index 687c80c..c021fcf 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
+++ b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro
@@ -3,5 +3,12 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativefocusscope.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
index 9a8a3ff..dbe0dcb 100644
--- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
+++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro
@@ -6,7 +6,14 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
index b069260..033e20e 100644
--- a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
+++ b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativegridview.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
index ff365ee..a8b8eca 100644
--- a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
+++ b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro
@@ -6,7 +6,14 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativeimage.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
index 22be991..1b828a5 100644
--- a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
+++ b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro
@@ -9,7 +9,14 @@ SOURCES += tst_qdeclarativeimageprovider.cpp
# LIBS += -lgcov
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
index bb54d6c..c6719c0 100644
--- a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
+++ b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro
@@ -4,7 +4,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeinfo.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro b/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro
index 0daa9e5..350f6c6 100644
--- a/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro
+++ b/tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro
@@ -3,7 +3,11 @@ contains(QT_CONFIG,declarative): QT += declarative script
SOURCES += tst_qdeclarativeinstruction.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml
new file mode 100644
index 0000000..f351b53
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRect.qml
@@ -0,0 +1,27 @@
+import Qt 4.7
+
+Rectangle {
+ width: 400
+ height: 400
+
+ property int childCount: 0;
+
+ Item {
+ objectName: "testItem"
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Repeater {
+ id: repeater
+ model: childCount
+ delegate: Rectangle {
+ x: index*10
+ y: index*20
+ width: 10
+ height: 20
+
+ color: "red"
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml b/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml
new file mode 100644
index 0000000..171536b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/keyspriority.qml
@@ -0,0 +1,9 @@
+import Qt 4.7
+import Test 1.0
+
+KeyTestItem {
+ focus: true
+ Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers)
+ Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; }
+ Keys.priority: keysTestObject.processLast ? Keys.AfterItem : Keys.BeforeItem
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml b/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml
new file mode 100644
index 0000000..a562b8b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/mouseFocus.qml
@@ -0,0 +1,20 @@
+import Qt 4.7
+
+QGraphicsWidget {
+ size: "200x100"
+ focusPolicy: QGraphicsWidget.ClickFocus
+ Item {
+ objectName: "declarativeItem"
+ id: item
+ width: 200
+ height: 100
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ if (!item.focus) {
+ item.focus = true;
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
index e834a4e..f494ef1 100644
--- a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
+++ b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro
@@ -4,7 +4,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeitem.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index d2c328e..ecc813e 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -45,6 +45,7 @@
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeitem.h>
+#include "../../../shared/util.h"
class tst_QDeclarativeItem : public QObject
@@ -54,7 +55,9 @@ public:
tst_QDeclarativeItem();
private slots:
+ void initTestCase();
void keys();
+ void keysProcessingOrder();
void keyNavigation();
void smooth();
void clip();
@@ -63,9 +66,11 @@ private slots:
void propertyChanges();
void transforms();
void transforms_data();
+ void childrenRect();
void childrenProperty();
void resourcesProperty();
+ void mouseFocus();
private:
template<typename T>
@@ -76,8 +81,11 @@ private:
class KeysTestObject : public QObject
{
Q_OBJECT
+
+ Q_PROPERTY(bool processLast READ processLast NOTIFY processLastChanged)
+
public:
- KeysTestObject() : mKey(0), mModifiers(0), mForwardedKey(0) {}
+ KeysTestObject() : mKey(0), mModifiers(0), mForwardedKey(0), mLast(false) {}
void reset() {
mKey = 0;
@@ -86,6 +94,14 @@ public:
mForwardedKey = 0;
}
+ bool processLast() const { return mLast; }
+ void setProcessLast(bool b) {
+ if (b != mLast) {
+ mLast = b;
+ emit processLastChanged();
+ }
+ }
+
public slots:
void keyPress(int key, QString text, int modifiers) {
mKey = key;
@@ -101,20 +117,73 @@ public slots:
mForwardedKey = key;
}
+signals:
+ void processLastChanged();
+
public:
int mKey;
QString mText;
int mModifiers;
int mForwardedKey;
+ bool mLast;
private:
};
+class KeyTestItem : public QDeclarativeItem
+{
+ Q_OBJECT
+public:
+ KeyTestItem(QDeclarativeItem *parent=0) : QDeclarativeItem(parent), mKey(0) {}
+
+protected:
+ void keyPressEvent(QKeyEvent *e) {
+ keyPressPreHandler(e);
+ if (e->isAccepted())
+ return;
+
+ mKey = e->key();
+
+ if (e->key() == Qt::Key_A)
+ e->accept();
+ else
+ e->ignore();
+
+ if (!e->isAccepted())
+ QDeclarativeItem::keyPressEvent(e);
+ }
+
+ void keyReleaseEvent(QKeyEvent *e) {
+ keyReleasePreHandler(e);
+
+ if (e->isAccepted())
+ return;
+
+ if (e->key() == Qt::Key_B)
+ e->accept();
+ else
+ e->ignore();
+
+ if (!e->isAccepted())
+ QDeclarativeItem::keyReleaseEvent(e);
+ }
+
+public:
+ int mKey;
+};
+
+QML_DECLARE_TYPE(KeyTestItem);
+
tst_QDeclarativeItem::tst_QDeclarativeItem()
{
}
+void tst_QDeclarativeItem::initTestCase()
+{
+ qmlRegisterType<KeyTestItem>("Test",1,0,"KeyTestItem");
+}
+
void tst_QDeclarativeItem::keys()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
@@ -211,6 +280,69 @@ void tst_QDeclarativeItem::keys()
QCOMPARE(testObject->mKey, 0);
QVERIFY(!key.isAccepted());
+ canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true));
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_Return));
+ QVERIFY(key.isAccepted());
+
+ delete canvas;
+ delete testObject;
+}
+
+void tst_QDeclarativeItem::keysProcessingOrder()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+
+ KeysTestObject *testObject = new KeysTestObject;
+ canvas->rootContext()->setContextProperty("keysTestObject", testObject);
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keyspriority.qml"));
+ canvas->show();
+ qApp->processEvents();
+
+ KeyTestItem *testItem = qobject_cast<KeyTestItem*>(canvas->rootObject());
+ QVERIFY(testItem);
+
+ QEvent wa(QEvent::WindowActivate);
+ QApplication::sendEvent(canvas, &wa);
+ QFocusEvent fe(QEvent::FocusIn);
+ QApplication::sendEvent(canvas, &fe);
+
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ testObject->setProcessLast(true);
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, 0);
+ QVERIFY(key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_B, Qt::NoModifier, "B", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_B));
+ QCOMPARE(testObject->mText, QLatin1String("B"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
+ key = QKeyEvent(QEvent::KeyRelease, Qt::Key_B, Qt::NoModifier, "B", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, 0);
+ QVERIFY(key.isAccepted());
+
delete canvas;
delete testObject;
}
@@ -465,6 +597,41 @@ void tst_QDeclarativeItem::resourcesProperty()
delete o;
}
+void tst_QDeclarativeItem::mouseFocus()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/mouseFocus.qml"));
+ canvas->show();
+ QVERIFY(canvas->rootObject());
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "declarativeItem");
+ QVERIFY(item);
+ QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
+
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(item->scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(focusSpy.count(), 1);
+ QVERIFY(item->hasFocus());
+
+ // make sure focusable graphics widget underneath does not steal focus
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(item->scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(focusSpy.count(), 1);
+ QVERIFY(item->hasFocus());
+
+ item->setFocus(false);
+ QVERIFY(!item->hasFocus());
+ QCOMPARE(focusSpy.count(), 2);
+ item->setFocus(true);
+ QCOMPARE(focusSpy.count(), 3);
+
+ delete canvas;
+}
+
void tst_QDeclarativeItem::propertyChanges()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
@@ -537,6 +704,33 @@ void tst_QDeclarativeItem::propertyChanges()
delete canvas;
}
+void tst_QDeclarativeItem::childrenRect()
+{
+ QDeclarativeView *canvas = new QDeclarativeView(0);
+ canvas->setFixedSize(240,320);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/childrenRect.qml"));
+ canvas->show();
+
+ QGraphicsObject *o = canvas->rootObject();
+ QDeclarativeItem *item = o->findChild<QDeclarativeItem*>("testItem");
+ QCOMPARE(item->width(), qreal(0));
+ QCOMPARE(item->height(), qreal(0));
+
+ o->setProperty("childCount", 1);
+ QCOMPARE(item->width(), qreal(10));
+ QCOMPARE(item->height(), qreal(20));
+
+ o->setProperty("childCount", 5);
+ QCOMPARE(item->width(), qreal(50));
+ QCOMPARE(item->height(), qreal(100));
+
+ o->setProperty("childCount", 0);
+ QCOMPARE(item->width(), qreal(0));
+ QCOMPARE(item->height(), qreal(0));
+
+ delete o;
+}
+
template<typename T>
T *tst_QDeclarativeItem::findItem(QGraphicsObject *parent, const QString &objectName)
{
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
index 5af3d6e..bac704e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml
@@ -10,5 +10,7 @@ QtObject {
property variant test7: "10x10"
property variant test8: "100,100,100"
property variant test9: String("#FF008800")
+ property variant test10: true
+ property variant test11: false
}
diff --git a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
index 5771469..2b7eb1c 100644
--- a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
+++ b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro
@@ -11,6 +11,13 @@ INCLUDEPATH += ../shared/
HEADERS += ../shared/testhttpserver.h
SOURCES += ../shared/testhttpserver.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"\"\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
index 89f99c8..acbe219 100644
--- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
@@ -99,7 +99,7 @@ private:
int m_value2;
};
-class MyQmlObject : public QObject, public MyInterface, public QDeclarativeParserStatus
+class MyQmlObject : public QObject, public MyInterface
{
Q_OBJECT
Q_PROPERTY(int value READ value WRITE setValue FINAL)
@@ -113,7 +113,7 @@ class MyQmlObject : public QObject, public MyInterface, public QDeclarativeParse
Q_PROPERTY(MyQmlObject *qmlobjectProperty READ qmlobject WRITE setQmlobject)
Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal)
- Q_INTERFACES(MyInterface QDeclarativeParserStatus)
+ Q_INTERFACES(MyInterface)
public:
MyQmlObject() : m_value(-1), m_interface(0), m_qmlobject(0) { qRegisterMetaType<MyCustomVariantType>("MyCustomVariantType"); }
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index ff03005..6b070f5 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -536,6 +536,8 @@ void tst_qdeclarativelanguage::assignLiteralToVariant()
QCOMPARE(object->property("test7").userType(), (int)QVariant::SizeF);
QCOMPARE(object->property("test8").userType(), (int)QVariant::Vector3D);
QCOMPARE(object->property("test9").userType(), (int)QVariant::String);
+ QCOMPARE(object->property("test10").userType(), (int)QVariant::Bool);
+ QCOMPARE(object->property("test11").userType(), (int)QVariant::Bool);
QVERIFY(object->property("test1") == QVariant(1));
QVERIFY(object->property("test2") == QVariant((double)1.7));
@@ -546,6 +548,8 @@ void tst_qdeclarativelanguage::assignLiteralToVariant()
QVERIFY(object->property("test7") == QVariant(QSizeF(10, 10)));
QVERIFY(object->property("test8") == QVariant(QVector3D(100, 100, 100)));
QVERIFY(object->property("test9") == QVariant(QString(QLatin1String("#FF008800"))));
+ QVERIFY(object->property("test10") == QVariant(bool(true)));
+ QVERIFY(object->property("test11") == QVariant(bool(false)));
delete object;
}
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml b/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml
new file mode 100644
index 0000000..ee881a2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelayoutitem/data/layoutItem.qml
@@ -0,0 +1,9 @@
+import Qt 4.7
+
+LayoutItem {//Sized by the layout
+ id: resizable
+ objectName: "resizable"
+ minimumSize: "100x100"
+ maximumSize: "300x300"
+ preferredSize: "200x200"
+}
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
new file mode 100644
index 0000000..79954fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qdeclarativelayoutitem.cpp
+
+# Define SRCDIR equal to test's source directory
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+} \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
new file mode 100644
index 0000000..c0c5abc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp
@@ -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 test suite 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/QtTest>
+#include <qdeclarativecomponent.h>
+#include <qdeclarativeengine.h>
+#include <qdeclarativeitem.h>
+#include <private/qdeclarativelayoutitem_p.h>
+#include <qgraphicsview.h>
+#include <qgraphicsscene.h>
+#include <qgraphicswidget.h>
+#include <qgraphicslinearlayout.h>
+#include "../../../shared/util.h"
+
+class tst_qdeclarativelayoutitem : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qdeclarativelayoutitem();
+
+private slots:
+ void test_resizing();
+};
+
+tst_qdeclarativelayoutitem::tst_qdeclarativelayoutitem()
+{
+}
+
+void tst_qdeclarativelayoutitem::test_resizing()
+{
+ //Create Layout (must be done in C++)
+ QGraphicsView view;
+ QGraphicsScene scene;
+ QGraphicsWidget *widget = new QGraphicsWidget();
+ QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
+ widget->setLayout(layout);
+ scene.addItem(widget);
+ view.setScene(&scene);
+ //Add the QML snippet into the layout
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/layoutItem.qml"));
+ QDeclarativeLayoutItem* obj = static_cast<QDeclarativeLayoutItem*>(c.create());
+ layout->addItem(obj);
+ layout->setContentsMargins(0,0,0,0);
+ widget->setContentsMargins(0,0,0,0);
+ view.show();
+
+ QVERIFY(obj!= 0);
+
+ widget->setGeometry(QRectF(0,0, 400,400));
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 300.0);
+
+ widget->setGeometry(QRectF(0,0, 300,300));
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 300.0);
+
+ widget->setGeometry(QRectF(0,0, 200,200));
+ QCOMPARE(obj->width(), 200.0);
+ QCOMPARE(obj->height(), 200.0);
+
+ widget->setGeometry(QRectF(0,0, 100,100));
+ QCOMPARE(obj->width(), 100.0);
+ QCOMPARE(obj->height(), 100.0);
+
+ widget->setGeometry(QRectF(0,0, 40,40));
+ QCOMPARE(obj->width(), 100.0);
+ QCOMPARE(obj->height(), 100.0);
+
+ widget->setGeometry(QRectF(0,0, 412,112));
+ QCOMPARE(obj->width(), 300.0);
+ QCOMPARE(obj->height(), 112.0);
+}
+
+
+QTEST_MAIN(tst_qdeclarativelayoutitem)
+
+#include "tst_qdeclarativelayoutitem.moc"
diff --git a/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml b/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml
deleted file mode 100644
index 0538738..0000000
--- a/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml
+++ /dev/null
@@ -1,31 +0,0 @@
-import Qt 4.7
-import Qt.widgets 4.7
-
-Item {
- id: resizable
- width:300
- height:300
- QGraphicsWidget {
- x : resizable.x
- y : resizable.y
- width : resizable.width
- height : resizable.height
- layout: QGraphicsLinearLayout {
- spacing: 0
- LayoutItem {
- objectName: "left"
- minimumSize: "100x100"
- maximumSize: "300x300"
- preferredSize: "100x100"
- Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent }
- }
- LayoutItem {
- objectName: "right"
- minimumSize: "100x100"
- maximumSize: "400x400"
- preferredSize: "200x200"
- Rectangle { objectName: "greenRect"; color: "green"; anchors.fill: parent }
- }
- }
- }
-}
diff --git a/tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro b/tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro
deleted file mode 100644
index a2065f4..0000000
--- a/tests/auto/declarative/qdeclarativelayouts/qdeclarativelayouts.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative
-SOURCES += tst_qdeclarativelayouts.cpp
-macx:CONFIG -= app_bundle
-
-# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-CONFIG += parallel_test
-
diff --git a/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp b/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp
deleted file mode 100644
index 412c3b7..0000000
--- a/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite 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/QtTest>
-#include <private/qlistmodelinterface_p.h>
-#include <qdeclarativeview.h>
-#include <private/qdeclarativelayoutitem_p.h>
-#include <qdeclarativeexpression.h>
-#include <QStyle>
-
-class tst_QDeclarativeLayouts : public QObject
-{
- Q_OBJECT
-public:
- tst_QDeclarativeLayouts();
-
-private slots:
- void test_qml();//GraphicsLayout set up in Qml
- void test_cpp();//GraphicsLayout set up in C++
-
-private:
- QDeclarativeView *createView(const QString &filename);
-};
-
-tst_QDeclarativeLayouts::tst_QDeclarativeLayouts()
-{
-}
-
-void tst_QDeclarativeLayouts::test_qml()
-{
- QDeclarativeView *canvas = createView(SRCDIR "/data/layouts.qml");
-
- qApp->processEvents();
- QDeclarativeLayoutItem *left = static_cast<QDeclarativeLayoutItem*>(canvas->rootObject()->findChild<QDeclarativeItem*>("left"));
- QVERIFY(left != 0);
-
- QDeclarativeLayoutItem *right = static_cast<QDeclarativeLayoutItem*>(canvas->rootObject()->findChild<QDeclarativeItem*>("right"));
- QVERIFY(right != 0);
-
- qreal l = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
- qreal r = QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin);
- qreal t = QApplication::style()->pixelMetric(QStyle::PM_LayoutTopMargin);
- qreal b = QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin);
- QVERIFY2(l == r && r == t && t == b, "Test assumes equal margins.");
- qreal gvMargin = l;
-
- QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(canvas->rootObject());
- QVERIFY(rootItem != 0);
-
- //Preferred Size
- rootItem->setWidth(300 + 2*gvMargin);
- rootItem->setHeight(300 + 2*gvMargin);
-
- QCOMPARE(left->x(), gvMargin);
- QCOMPARE(left->y(), gvMargin);
- QCOMPARE(left->width(), 100.0);
- QCOMPARE(left->height(), 300.0);
-
- QCOMPARE(right->x(), 100.0 + gvMargin);
- QCOMPARE(right->y(), 0.0 + gvMargin);
- QCOMPARE(right->width(), 200.0);
- QCOMPARE(right->height(), 300.0);
-
- //Minimum Size
- rootItem->setWidth(10+2*gvMargin);
- rootItem->setHeight(10+2*gvMargin);
-
- QCOMPARE(left->x(), gvMargin);
- QCOMPARE(left->width(), 100.0);
- QCOMPARE(left->height(), 100.0);
-
- QCOMPARE(right->x(), 100.0 + gvMargin);
- QCOMPARE(right->width(), 100.0);
- QCOMPARE(right->height(), 100.0);
-
- //Between preferred and Maximum Size
- /*Note that if set to maximum size (or above) GraphicsLinearLayout behavior
- is to shrink them down to preferred size. So the exact maximum size can't
- be used*/
- rootItem->setWidth(670 + 2*gvMargin);
- rootItem->setHeight(300 + 2*gvMargin);
-
- QCOMPARE(left->x(), gvMargin);
- QCOMPARE(left->width(), 270.0);
- QCOMPARE(left->height(), 300.0);
-
- QCOMPARE(right->x(), 270.0 + gvMargin);
- QCOMPARE(right->width(), 400.0);
- QCOMPARE(right->height(), 300.0);
-
- delete canvas;
-}
-
-void tst_QDeclarativeLayouts::test_cpp()
-{
- //TODO: This test!
-}
-
-QDeclarativeView *tst_QDeclarativeLayouts::createView(const QString &filename)
-{
- QDeclarativeView *canvas = new QDeclarativeView(0);
- canvas->setSource(QUrl::fromLocalFile(filename));
-
- return canvas;
-}
-
-
-QTEST_MAIN(tst_QDeclarativeLayouts)
-
-#include "tst_qdeclarativelayouts.moc"
diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
index 9f1e146..53bb9ec 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
+++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro
@@ -6,7 +6,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativelistmodel.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index ec97461..26a12f0 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -184,8 +184,8 @@ void tst_qdeclarativelistmodel::dynamic_data()
QTest::newRow("count") << "count" << 0 << "";
- QTest::newRow("get1") << "{get(0)}" << 0 << "<Unknown File>: QML ListModel: get: index 0 out of range";
- QTest::newRow("get2") << "{get(-1)}" << 0 << "<Unknown File>: QML ListModel: get: index -1 out of range";
+ QTest::newRow("get1") << "{get(0)}" << 0 << "";
+ QTest::newRow("get2") << "{get(-1)}" << 0 << "";
QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << "";
QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << "";
@@ -196,13 +196,13 @@ void tst_qdeclarativelistmodel::dynamic_data()
QTest::newRow("clear1") << "{append({'foo':456});clear();count}" << 0 << "";
QTest::newRow("clear2") << "{append({'foo':123});append({'foo':456});clear();count}" << 0 << "";
- QTest::newRow("clear3") << "{append({'foo':123});clear();get(0).foo}" << 0 << "<Unknown File>: QML ListModel: get: index 0 out of range";
+ QTest::newRow("clear3") << "{append({'foo':123});clear()}" << 0 << "";
QTest::newRow("remove1") << "{append({'foo':123});remove(0);count}" << 0 << "";
QTest::newRow("remove2a") << "{append({'foo':123});append({'foo':456});remove(0);count}" << 1 << "";
QTest::newRow("remove2b") << "{append({'foo':123});append({'foo':456});remove(0);get(0).foo}" << 456 << "";
QTest::newRow("remove2c") << "{append({'foo':123});append({'foo':456});remove(1);get(0).foo}" << 123 << "";
- QTest::newRow("remove3") << "{append({'foo':123});remove(0);get(0).foo}" << 0 << "<Unknown File>: QML ListModel: get: index 0 out of range";
+ QTest::newRow("remove3") << "{append({'foo':123});remove(0)}" << 0 << "";
QTest::newRow("remove3a") << "{append({'foo':123});remove(-1);count}" << 1 << "<Unknown File>: QML ListModel: remove: index -1 out of range";
QTest::newRow("remove4a") << "{remove(0)}" << 0 << "<Unknown File>: QML ListModel: remove: index 0 out of range";
QTest::newRow("remove4b") << "{append({'foo':123});remove(0);remove(0);count}" << 0 << "<Unknown File>: QML ListModel: remove: index 0 out of range";
@@ -282,7 +282,9 @@ void tst_qdeclarativelistmodel::dynamic()
int actual = e.evaluate().toInt();
if (e.hasError())
qDebug() << e.error(); // errors not expected
- QVERIFY(!e.hasError());
+
+ if (QTest::currentDataTag() != QLatin1String("clear3") && QTest::currentDataTag() != QLatin1String("remove3"))
+ QVERIFY(!e.hasError());
QCOMPARE(actual,result);
}
@@ -326,12 +328,6 @@ void tst_qdeclarativelistmodel::dynamic_worker()
if (QByteArray(QTest::currentDataTag()).startsWith("nested"))
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add nested list values when modifying or after modification from a worker script");
- if (QByteArray(QTest::currentDataTag()).startsWith("nested-append")) {
- int callsToGet = script.count(QLatin1String(";get("));
- for (int i=0; i<callsToGet; i++)
- QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: get: index 0 out of range");
- }
-
QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker",
Q_ARG(QVariant, operations.mid(0, operations.length()-1))));
waitForWorker(item);
diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
index 5d962c0..b406fde 100644
--- a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
+++ b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro
@@ -5,6 +5,13 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativelistview.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 22eb734..ec2afae 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -1432,8 +1432,6 @@ void tst_QDeclarativeListView::QTBUG_9791()
{
QDeclarativeView *canvas = createView();
- QDeclarativeContext *ctxt = canvas->rootContext();
-
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/strictlyenforcerange.qml"));
qApp->processEvents();
diff --git a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
index 9bb0b37..3b851c1 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
@@ -1,5 +1,4 @@
import Qt 4.7
-import Qt.widgets 4.6
QGraphicsWidget {
size: "250x250"
diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml b/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml
index 6aa3d2f..72cd3b9 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml
@@ -1,7 +1,8 @@
import Qt 4.7
-Loader {
- resizeMode: "NoResize"
+Item {
width: 200; height: 80
- source: "Rect120x60.qml"
+ Loader {
+ source: "Rect120x60.qml"
+ }
}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml b/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
index 9322141..0cff506 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml
@@ -1,8 +1,9 @@
import Qt 4.7
-Loader {
- resizeMode: Loader.NoResize
- source: "GraphicsWidget250x250.qml"
+Item {
width: 200
- height: 80
+ height: 80
+ Loader {
+ source: "GraphicsWidget250x250.qml"
+ }
}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
index 0cfb4df..81610ad 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml
@@ -1,7 +1,6 @@
import Qt 4.7
Loader {
- resizeMode: Loader.SizeItemToLoader
width: 200
height: 80
source: "GraphicsWidget250x250.qml"
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
index b588c9d..a801a42 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml
@@ -1,6 +1,5 @@
import Qt 4.7
Loader {
- resizeMode: Loader.SizeLoaderToItem
source: "GraphicsWidget250x250.qml"
}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml
index 93be6f1..77aa8d9 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml
@@ -1,6 +1,5 @@
import Qt 4.7
Loader {
- resizeMode: "SizeLoaderToItem"
source: "Rect120x60.qml"
}
diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml
index 04b46fb..0098927 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml
@@ -1,7 +1,6 @@
import Qt 4.7
Loader {
- resizeMode: "SizeItemToLoader"
width: 200; height: 80
source: "Rect120x60.qml"
}
diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
index 96fea5b..9334928 100644
--- a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
+++ b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro
@@ -7,7 +7,14 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativeloader.cpp \
../shared/testhttpserver.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
index 7cdadb4..59580ea 100644
--- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
+++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -104,13 +104,14 @@ tst_QDeclarativeLoader::tst_QDeclarativeLoader()
void tst_QDeclarativeLoader::url()
{
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import Qt 4.7\nLoader { source: \"Rect120x60.qml\" }"), TEST_FILE(""));
+ component.setData(QByteArray("import Qt 4.7\nLoader { property int did_load: 0; onLoaded: did_load=123; source: \"Rect120x60.qml\" }"), TEST_FILE(""));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
QVERIFY(loader != 0);
QVERIFY(loader->item());
QVERIFY(loader->source() == QUrl::fromLocalFile(SRCDIR "/data/Rect120x60.qml"));
QCOMPARE(loader->progress(), 1.0);
QCOMPARE(loader->status(), QDeclarativeLoader::Ready);
+ QCOMPARE(loader->property("did_load").toInt(), 123);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
delete loader;
@@ -270,7 +271,6 @@ void tst_QDeclarativeLoader::sizeLoaderToItem()
QDeclarativeComponent component(&engine, TEST_FILE("/SizeToItem.qml"));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
QVERIFY(loader != 0);
- QVERIFY(loader->resizeMode() == QDeclarativeLoader::SizeLoaderToItem);
QCOMPARE(loader->width(), 120.0);
QCOMPARE(loader->height(), 60.0);
@@ -282,20 +282,28 @@ void tst_QDeclarativeLoader::sizeLoaderToItem()
QCOMPARE(loader->width(), 150.0);
QCOMPARE(loader->height(), 45.0);
+ // Check explicit width
+ loader->setWidth(200.0);
+ QCOMPARE(loader->width(), 200.0);
+ QCOMPARE(rect->width(), 200.0);
+ rect->setWidth(100.0); // when rect changes ...
+ QCOMPARE(rect->width(), 100.0); // ... it changes
+ QCOMPARE(loader->width(), 200.0); // ... but loader stays the same
+
+ // Check explicit height
+ loader->setHeight(200.0);
+ QCOMPARE(loader->height(), 200.0);
+ QCOMPARE(rect->height(), 200.0);
+ rect->setHeight(100.0); // when rect changes ...
+ QCOMPARE(rect->height(), 100.0); // ... it changes
+ QCOMPARE(loader->height(), 200.0); // ... but loader stays the same
+
// Switch mode
- loader->setResizeMode(QDeclarativeLoader::SizeItemToLoader);
loader->setWidth(180);
loader->setHeight(30);
QCOMPARE(rect->width(), 180.0);
QCOMPARE(rect->height(), 30.0);
- // notify
- QSignalSpy spy(loader, SIGNAL(resizeModeChanged()));
- loader->setResizeMode(QDeclarativeLoader::NoResize);
- QCOMPARE(spy.count(),1);
- loader->setResizeMode(QDeclarativeLoader::NoResize);
- QCOMPARE(spy.count(),1);
-
delete loader;
}
@@ -304,7 +312,6 @@ void tst_QDeclarativeLoader::sizeItemToLoader()
QDeclarativeComponent component(&engine, TEST_FILE("/SizeToLoader.qml"));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
QVERIFY(loader != 0);
- QVERIFY(loader->resizeMode() == QDeclarativeLoader::SizeItemToLoader);
QCOMPARE(loader->width(), 200.0);
QCOMPARE(loader->height(), 80.0);
@@ -320,7 +327,8 @@ void tst_QDeclarativeLoader::sizeItemToLoader()
QCOMPARE(rect->height(), 30.0);
// Switch mode
- loader->setResizeMode(QDeclarativeLoader::SizeLoaderToItem);
+ loader->resetWidth(); // reset explicit size
+ loader->resetHeight();
rect->setWidth(160);
rect->setHeight(45);
QCOMPARE(loader->width(), 160.0);
@@ -332,17 +340,12 @@ void tst_QDeclarativeLoader::sizeItemToLoader()
void tst_QDeclarativeLoader::noResize()
{
QDeclarativeComponent component(&engine, TEST_FILE("/NoResize.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
- QVERIFY(loader != 0);
- QCOMPARE(loader->width(), 200.0);
- QCOMPARE(loader->height(), 80.0);
-
- QDeclarativeItem *rect = qobject_cast<QDeclarativeItem*>(loader->item());
- QVERIFY(rect);
- QCOMPARE(rect->width(), 120.0);
- QCOMPARE(rect->height(), 60.0);
+ QDeclarativeItem* item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item != 0);
+ QCOMPARE(item->width(), 200.0);
+ QCOMPARE(item->height(), 80.0);
- delete loader;
+ delete item;
}
void tst_QDeclarativeLoader::sizeLoaderToGraphicsWidget()
@@ -353,7 +356,6 @@ void tst_QDeclarativeLoader::sizeLoaderToGraphicsWidget()
scene.addItem(loader);
QVERIFY(loader != 0);
- QVERIFY(loader->resizeMode() == QDeclarativeLoader::SizeLoaderToItem);
QCOMPARE(loader->width(), 250.0);
QCOMPARE(loader->height(), 250.0);
@@ -365,7 +367,6 @@ void tst_QDeclarativeLoader::sizeLoaderToGraphicsWidget()
QCOMPARE(loader->height(), 45.0);
// Switch mode
- loader->setResizeMode(QDeclarativeLoader::SizeItemToLoader);
loader->setWidth(180);
loader->setHeight(30);
QCOMPARE(widget->size().width(), 180.0);
@@ -382,7 +383,6 @@ void tst_QDeclarativeLoader::sizeGraphicsWidgetToLoader()
scene.addItem(loader);
QVERIFY(loader != 0);
- QVERIFY(loader->resizeMode() == QDeclarativeLoader::SizeItemToLoader);
QCOMPARE(loader->width(), 200.0);
QCOMPARE(loader->height(), 80.0);
@@ -398,7 +398,8 @@ void tst_QDeclarativeLoader::sizeGraphicsWidgetToLoader()
QCOMPARE(widget->size().height(), 30.0);
// Switch mode
- loader->setResizeMode(QDeclarativeLoader::SizeLoaderToItem);
+ loader->resetWidth(); // reset explicit size
+ loader->resetHeight();
widget->resize(QSizeF(160,45));
QCOMPARE(loader->width(), 160.0);
QCOMPARE(loader->height(), 45.0);
@@ -409,20 +410,15 @@ void tst_QDeclarativeLoader::sizeGraphicsWidgetToLoader()
void tst_QDeclarativeLoader::noResizeGraphicsWidget()
{
QDeclarativeComponent component(&engine, TEST_FILE("/NoResizeGraphicsWidget.qml"));
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
QGraphicsScene scene;
- scene.addItem(loader);
-
- QVERIFY(loader != 0);
- QCOMPARE(loader->width(), 200.0);
- QCOMPARE(loader->height(), 80.0);
+ scene.addItem(item);
- QGraphicsWidget *widget = qobject_cast<QGraphicsWidget*>(loader->item());
- QVERIFY(widget);
- QCOMPARE(widget->size().width(), 250.0);
- QCOMPARE(widget->size().height(), 250.0);
+ QVERIFY(item != 0);
+ QCOMPARE(item->width(), 200.0);
+ QCOMPARE(item->height(), 80.0);
- delete loader;
+ delete item;
}
void tst_QDeclarativeLoader::networkRequestUrl()
@@ -432,7 +428,7 @@ void tst_QDeclarativeLoader::networkRequestUrl()
server.serveDirectory(SRCDIR "/data");
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import Qt 4.7\nLoader { source: \"http://127.0.0.1:14450/Rect120x60.qml\" }"), QUrl::fromLocalFile(SRCDIR "/dummy.qml"));
+ component.setData(QByteArray("import Qt 4.7\nLoader { property int did_load : 0; source: \"http://127.0.0.1:14450/Rect120x60.qml\"; onLoaded: did_load=123 }"), QUrl::fromLocalFile(SRCDIR "/dummy.qml"));
if (component.isError())
qDebug() << component.errors();
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
@@ -442,6 +438,7 @@ void tst_QDeclarativeLoader::networkRequestUrl()
QVERIFY(loader->item());
QCOMPARE(loader->progress(), 1.0);
+ QCOMPARE(loader->property("did_load").toInt(), 123);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1);
delete loader;
@@ -488,7 +485,7 @@ void tst_QDeclarativeLoader::failNetworkRequest()
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: Network error for URL http://127.0.0.1:14450/IDontExist.qml");
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import Qt 4.7\nLoader { source: \"http://127.0.0.1:14450/IDontExist.qml\" }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml"));
+ component.setData(QByteArray("import Qt 4.7\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml"));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
QVERIFY(loader != 0);
@@ -496,6 +493,7 @@ void tst_QDeclarativeLoader::failNetworkRequest()
QVERIFY(loader->item() == 0);
QCOMPARE(loader->progress(), 0.0);
+ QCOMPARE(loader->property("did_load").toInt(), 123);
QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 0);
delete loader;
diff --git a/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro b/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro
index cf3fa65..0d32ab8 100644
--- a/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro
+++ b/tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro
@@ -3,7 +3,11 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativemetatype.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
index 36efe13..76e86c9 100644
--- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
+++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
@@ -88,7 +88,10 @@ QML_DECLARE_TYPE(TestType);
class ParserStatusTestType : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
+ void classBegin(){}
+ void componentComplete(){}
Q_CLASSINFO("DefaultProperty", "foo") // Missing default property
+ Q_INTERFACES(QDeclarativeParserStatus)
};
QML_DECLARE_TYPE(ParserStatusTestType);
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
index fc77225..173a302 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
@@ -4,3 +4,6 @@ SOURCES = plugin.cpp
QT = core declarative
DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+}
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
index d895ed0..29a1009 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro
@@ -2,4 +2,11 @@ load(qttest_p4)
SOURCES = tst_qdeclarativemoduleplugin.cpp
QT += declarative
CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml
new file mode 100644
index 0000000..c01e938
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativemousearea/data/rejectEvent.qml
@@ -0,0 +1,28 @@
+import Qt 4.7
+
+Rectangle {
+ id: root
+ color: "#ffffff"
+ width: 320; height: 240
+ property bool mr1_pressed: false
+ property bool mr1_released: false
+ property bool mr1_canceled: false
+ property bool mr2_pressed: false
+ property bool mr2_released: false
+ property bool mr2_canceled: false
+
+ MouseArea {
+ id: mouseRegion1
+ anchors.fill: parent
+ onPressed: { root.mr1_pressed = true }
+ onReleased: { root.mr1_released = true }
+ onCanceled: { root.mr1_canceled = true }
+ }
+ MouseArea {
+ id: mouseRegion2
+ width: 120; height: 120
+ onPressed: { root.mr2_pressed = true; mouse.accepted = false }
+ onReleased: { root.mr2_released = true }
+ onCanceled: { root.mr2_canceled = true }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
index 48fe025..6f9c98c 100644
--- a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
+++ b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro
@@ -6,7 +6,14 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativemousearea.cpp ../shared/testhttpserver.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
index eb4aa12..ff3bf45 100644
--- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
+++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -56,6 +56,8 @@ private slots:
void updateMouseAreaPosOnClick();
void updateMouseAreaPosOnResize();
void noOnClickedWithPressAndHold();
+ void onMousePressRejected();
+
private:
QDeclarativeView *createView();
};
@@ -320,7 +322,7 @@ void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold()
QTest::qWait(1000);
- QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMousePress);
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
releaseEvent.setScenePos(QPointF(100, 100));
releaseEvent.setButton(Qt::LeftButton);
releaseEvent.setButtons(Qt::LeftButton);
@@ -330,6 +332,48 @@ void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold()
QVERIFY(canvas->rootObject()->property("held").toBool());
}
+void tst_QDeclarativeMouseArea::onMousePressRejected()
+{
+ QDeclarativeView *canvas = createView();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/rejectEvent.qml"));
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->rootObject() != 0);
+
+ QVERIFY(!canvas->rootObject()->property("mr1_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_canceled").toBool());
+
+ QGraphicsScene *scene = canvas->scene();
+ QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
+ pressEvent.setScenePos(QPointF(100, 100));
+ pressEvent.setButton(Qt::LeftButton);
+ pressEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &pressEvent);
+
+ QVERIFY(canvas->rootObject()->property("mr1_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
+ QVERIFY(canvas->rootObject()->property("mr2_pressed").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+ QVERIFY(canvas->rootObject()->property("mr2_canceled").toBool());
+
+ QTest::qWait(200);
+
+ QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease);
+ releaseEvent.setScenePos(QPointF(100, 100));
+ releaseEvent.setButton(Qt::LeftButton);
+ releaseEvent.setButtons(Qt::LeftButton);
+ QApplication::sendEvent(scene, &releaseEvent);
+
+ QVERIFY(canvas->rootObject()->property("mr1_released").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr1_canceled").toBool());
+ QVERIFY(!canvas->rootObject()->property("mr2_released").toBool());
+}
+
QTEST_MAIN(tst_QDeclarativeMouseArea)
#include "tst_qdeclarativemousearea.moc"
diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
index 8a061c3..31172a9 100644
--- a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
+++ b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeparticles.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
new file mode 100644
index 0000000..ce0f0c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdateOnStartChanged.qml
@@ -0,0 +1,38 @@
+import Qt 4.7
+
+Rectangle {
+ width: 800
+ height: 480
+ color: "black"
+ resources: [
+ ListModel {
+ id: appModel
+ ListElement { color: "green" }
+ },
+ Component {
+ id: appDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ color: "green"
+ width: 100
+ height: 100
+ }
+ }
+ ]
+ PathView {
+ id: pathView
+ objectName: "pathView"
+ model: appModel
+ anchors.fill: parent
+
+ transformOrigin: "Top"
+ delegate: appDelegate
+ path: Path {
+ objectName: "path"
+ startX: pathView.width / 2 // startX: 400 <- this works as expected
+ startY: 300
+ PathLine { x: 400; y: 120 }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml
new file mode 100644
index 0000000..082da13
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview_package.qml
@@ -0,0 +1,88 @@
+import Qt 4.7
+
+Item {
+ width: 800; height: 600
+ Component {
+ id: photoDelegate
+ Package {
+ Item { id: pathItem; objectName: "pathItem"; Package.name: 'path'; width: 85; height: 85; scale: pathItem.PathView.scale }
+ Item { id: linearItem; Package.name: 'linear'; width: 85; height: 85 }
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0
+ }
+ state: 'path'
+ states: [
+ State {
+ name: 'path'
+ ParentChange { target: wrapper; parent: pathItem; x: 0; y: 0 }
+ PropertyChanges { target: wrapper; opacity: pathItem.PathView.onPath ? 1.0 : 0 }
+ }
+ ]
+ }
+ }
+ }
+ ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+ VisualDataModel { id: visualModel; model: rssModel; delegate: photoDelegate }
+
+ PathView {
+ id: photoPathView
+ objectName: "photoPathView"
+ width: 800; height: 330; pathItemCount: 4; offset: 1
+ dragMargin: 24
+ preferredHighlightBegin: 0.50
+ preferredHighlightEnd: 0.50
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: visualModel.parts.path
+ }
+
+ PathView {
+ y: 400; width: 800; height: 330; pathItemCount: 8
+
+ path: Path {
+ startX: 0; startY: 40;
+ PathLine { x: 800; y: 40 }
+ }
+
+ model: visualModel.parts.linear
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
index 3c327d5..6bef61c 100644
--- a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
+++ b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativepathview.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 0e3a74d..0e16f66 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -77,6 +77,8 @@ private slots:
void pathChanges();
void componentChanges();
void modelChanges();
+ void pathUpdateOnStartChanged();
+ void package();
private:
@@ -436,7 +438,8 @@ void tst_QDeclarativePathView::pathMoved()
for(int i=0; i<model.count(); i++){
QDeclarativeRectangle *curItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", i);
- QCOMPARE(curItem->pos() + offset, path->pointAt(0.25 + i*0.25));
+ QPointF itemPos(path->pointAt(0.25 + i*0.25));
+ QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y())));
}
pathview->setOffset(0.0);
@@ -477,13 +480,36 @@ void tst_QDeclarativePathView::setCurrentIndex()
QCOMPARE(canvas->rootObject()->property("currentB").toInt(), 0);
pathview->setCurrentIndex(2);
- QTest::qWait(1000);
firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 2);
- QCOMPARE(firstItem->pos() + offset, start);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
QCOMPARE(canvas->rootObject()->property("currentA").toInt(), 2);
QCOMPARE(canvas->rootObject()->property("currentB").toInt(), 2);
+ pathview->decrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 1);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 1);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->decrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 0);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->decrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 3);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 3);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
+ pathview->incrementCurrentIndex();
+ QTRY_COMPARE(pathview->currentIndex(), 0);
+ firstItem = findItem<QDeclarativeRectangle>(pathview, "wrapper", 0);
+ QVERIFY(firstItem);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
delete canvas;
}
@@ -672,6 +698,44 @@ void tst_QDeclarativePathView::modelChanges()
delete canvas;
}
+void tst_QDeclarativePathView::pathUpdateOnStartChanged()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdateOnStartChanged.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
+ QVERIFY(pathView);
+
+ QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path");
+ QVERIFY(path);
+ QCOMPARE(path->startX(), 400.0);
+ QCOMPARE(path->startY(), 300.0);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "wrapper", 0);
+ QVERIFY(item);
+ QCOMPARE(item->x(), path->startX() - item->width() / 2.0);
+ QCOMPARE(item->y(), path->startY() - item->height() / 2.0);
+
+ delete canvas;
+}
+
+void tst_QDeclarativePathView::package()
+{
+ QDeclarativeView *canvas = createView();
+ QVERIFY(canvas);
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview_package.qml"));
+
+ QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("photoPathView");
+ QVERIFY(pathView);
+
+ QDeclarativeItem *item = findItem<QDeclarativeItem>(pathView, "pathItem");
+ QVERIFY(item);
+ QVERIFY(item->scale() != 1.0);
+
+ delete canvas;
+}
+
QDeclarativeView *tst_QDeclarativePathView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
index 4b247fc..99a94bc 100644
--- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
+++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro
@@ -9,7 +9,14 @@ INCLUDEPATH += ../shared/
HEADERS += ../shared/testhttpserver.h
SOURCES += ../shared/testhttpserver.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
# LIBS += -lgcov
diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
index dbe2cbee..2c5b473 100644
--- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
+++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
@@ -4,7 +4,14 @@ SOURCES += tst_qdeclarativepositioners.cpp
macx:CONFIG -= app_bundle
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index b4ac0e1..e639014 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -41,6 +41,7 @@
#include <QtTest/QtTest>
#include <private/qlistmodelinterface_p.h>
#include <qdeclarativeview.h>
+#include <qdeclarativeengine.h>
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativepositioners_p.h>
#include <private/qdeclarativetransition_p.h>
@@ -69,6 +70,7 @@ private slots:
void test_repeater();
void test_flow();
void test_flow_resize();
+ void test_conflictinganchors();
private:
QDeclarativeView *createView(const QString &filename);
};
@@ -100,6 +102,8 @@ void tst_QDeclarativePositioners::test_horizontal()
QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
QCOMPARE(row->width(), 110.0);
QCOMPARE(row->height(), 50.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_horizontal_spacing()
@@ -125,6 +129,8 @@ void tst_QDeclarativePositioners::test_horizontal_spacing()
QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
QCOMPARE(row->width(), 130.0);
QCOMPARE(row->height(), 50.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_horizontal_animated()
@@ -175,6 +181,8 @@ void tst_QDeclarativePositioners::test_horizontal_animated()
QTRY_COMPARE(two->x(), 50.0);
QTRY_COMPARE(three->x(), 100.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_vertical()
@@ -201,6 +209,8 @@ void tst_QDeclarativePositioners::test_vertical()
QVERIFY(column);
QCOMPARE(column->height(), 80.0);
QCOMPARE(column->width(), 50.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_vertical_spacing()
@@ -226,6 +236,8 @@ void tst_QDeclarativePositioners::test_vertical_spacing()
QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
QCOMPARE(column->height(), 100.0);
QCOMPARE(column->width(), 50.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_vertical_animated()
@@ -273,6 +285,7 @@ void tst_QDeclarativePositioners::test_vertical_animated()
QTRY_COMPARE(two->y(), 50.0);
QTRY_COMPARE(three->y(), 100.0);
+ delete canvas;
}
void tst_QDeclarativePositioners::test_grid()
@@ -304,6 +317,8 @@ void tst_QDeclarativePositioners::test_grid()
QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
QCOMPARE(grid->width(), 120.0);
QCOMPARE(grid->height(), 100.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_grid_topToBottom()
@@ -335,6 +350,8 @@ void tst_QDeclarativePositioners::test_grid_topToBottom()
QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 120.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_grid_spacing()
@@ -366,6 +383,8 @@ void tst_QDeclarativePositioners::test_grid_spacing()
QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
QCOMPARE(grid->width(), 128.0);
QCOMPARE(grid->height(), 104.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_grid_animated()
@@ -446,6 +465,7 @@ void tst_QDeclarativePositioners::test_grid_animated()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
+ delete canvas;
}
void tst_QDeclarativePositioners::test_grid_zero_columns()
@@ -477,6 +497,8 @@ void tst_QDeclarativePositioners::test_grid_zero_columns()
QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
QCOMPARE(grid->width(), 170.0);
QCOMPARE(grid->height(), 60.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_propertychanges()
@@ -534,6 +556,8 @@ void tst_QDeclarativePositioners::test_propertychanges()
grid->setRows(2);
QCOMPARE(columnsSpy.count(),2);
QCOMPARE(rowsSpy.count(),2);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_repeater()
@@ -555,6 +579,8 @@ void tst_QDeclarativePositioners::test_repeater()
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 100.0);
QCOMPARE(three->y(), 0.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_flow()
@@ -587,6 +613,8 @@ void tst_QDeclarativePositioners::test_flow()
QVERIFY(flow);
QCOMPARE(flow->width(), 90.0);
QCOMPARE(flow->height(), 120.0);
+
+ delete canvas;
}
void tst_QDeclarativePositioners::test_flow_resize()
@@ -618,6 +646,101 @@ void tst_QDeclarativePositioners::test_flow_resize()
QCOMPARE(four->y(), 50.0);
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 50.0);
+
+ delete canvas;
+}
+
+QString warningMessage;
+
+void interceptWarnings(QtMsgType type, const char *msg)
+{
+ Q_UNUSED( type );
+ warningMessage = msg;
+}
+
+void tst_QDeclarativePositioners::test_conflictinganchors()
+{
+ qInstallMsgHandler(interceptWarnings);
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
+
+ component.setData("import Qt 4.7\nColumn { Item {} }", QUrl::fromLocalFile(""));
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import Qt 4.7\nRow { Item {} }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import Qt 4.7\nGrid { Item {} }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import Qt 4.7\nFlow { Item {} }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+
+ component.setData("import Qt 4.7\nColumn { Item { anchors.top: parent.top } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column"));
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nColumn { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column"));
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nColumn { Item { anchors.left: parent.left } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nRow { Item { anchors.left: parent.left } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row"));
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nRow { Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row"));
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nRow { Item { anchors.top: parent.top } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QVERIFY(warningMessage.isEmpty());
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nGrid { Item { anchors.horizontalCenter: parent.horizontalCenter } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid"));
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nGrid { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid"));
+ warningMessage.clear();
+
+ component.setData("import Qt 4.7\nFlow { Item { anchors.verticalCenter: parent.verticalCenter } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow"));
+
+ component.setData("import Qt 4.7\nFlow { Item { anchors.fill: parent } }", QUrl::fromLocalFile(""));
+ item = qobject_cast<QDeclarativeItem*>(component.create());
+ QVERIFY(item);
+ QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow"));
}
QDeclarativeView *tst_QDeclarativePositioners::createView(const QString &filename)
diff --git a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
index 6910ccc..f37d952 100644
--- a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
+++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro
@@ -4,7 +4,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeproperty.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeqt/data/darker.qml b/tests/auto/declarative/qdeclarativeqt/data/darker.qml
index f6333fe..738095d 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/darker.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/darker.qml
@@ -3,9 +3,10 @@ import Qt 4.7
QtObject {
property variant test1: Qt.darker(Qt.rgba(1, 0.8, 0.3))
property variant test2: Qt.darker()
- property variant test3: Qt.darker(Qt.rgba(1, 0.8, 0.3), 10)
+ property variant test3: Qt.darker(Qt.rgba(1, 0.8, 0.3), 2.8)
property variant test4: Qt.darker("red");
property variant test5: Qt.darker("perfectred"); // Non-existant color
property variant test6: Qt.darker(10);
+ property variant test7: Qt.darker(Qt.rgba(1, 0.8, 0.3), 2.8, 10)
}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml b/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
new file mode 100644
index 0000000..e66c7be
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml
@@ -0,0 +1,6 @@
+import Qt 4.7
+
+QtObject {
+ property variant test1: Qt.fontFamilies(10)
+ property variant test2: Qt.fontFamilies();
+}
diff --git a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
index 6c0053ba..ddaf78d 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml
@@ -3,8 +3,9 @@ import Qt 4.7
QtObject {
property variant test1: Qt.lighter(Qt.rgba(1, 0.8, 0.3))
property variant test2: Qt.lighter()
- property variant test3: Qt.lighter(Qt.rgba(1, 0.8, 0.3), 10)
+ property variant test3: Qt.lighter(Qt.rgba(1, 0.8, 0.3), 1.8)
property variant test4: Qt.lighter("red");
property variant test5: Qt.lighter("perfectred"); // Non-existant color
property variant test6: Qt.lighter(10);
+ property variant test7: Qt.lighter(Qt.rgba(1, 0.8, 0.3), 1.8, 5)
}
diff --git a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
index 10e10a3..b381a9b 100644
--- a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
+++ b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro
@@ -3,7 +3,14 @@ contains(QT_CONFIG,declarative): QT += declarative
SOURCES += tst_qdeclarativeqt.cpp
macx:CONFIG -= app_bundle
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
# QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage
# LIBS += -lgcov
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
index 7cbd8db..5095be8 100644
--- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -42,6 +42,7 @@
#include <qtest.h>
#include <QDebug>
#include <QDeclarativeEngine>
+#include <QFontDatabase>
#include <QFileInfo>
#include <QDeclarativeComponent>
#include <QDesktopServices>
@@ -76,6 +77,7 @@ private slots:
void isQtObject();
void btoa();
void atob();
+ void fontFamilies();
private:
QDeclarativeEngine engine;
@@ -232,7 +234,7 @@ void tst_qdeclarativeqt::lighter()
QDeclarativeComponent component(&engine, TEST_FILE("lighter.qml"));
QString warning1 = component.url().toString() + ":5: Error: Qt.lighter(): Invalid arguments";
- QString warning2 = component.url().toString() + ":6: Error: Qt.lighter(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":10: Error: Qt.lighter(): Invalid arguments";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
@@ -241,7 +243,7 @@ void tst_qdeclarativeqt::lighter()
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter());
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
- QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor::fromRgbF(1, 0.8, 0.3).lighter(180));
QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").lighter());
QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor());
@@ -254,7 +256,7 @@ void tst_qdeclarativeqt::darker()
QDeclarativeComponent component(&engine, TEST_FILE("darker.qml"));
QString warning1 = component.url().toString() + ":5: Error: Qt.darker(): Invalid arguments";
- QString warning2 = component.url().toString() + ":6: Error: Qt.darker(): Invalid arguments";
+ QString warning2 = component.url().toString() + ":10: Error: Qt.darker(): Invalid arguments";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2));
@@ -263,7 +265,7 @@ void tst_qdeclarativeqt::darker()
QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker());
QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor());
- QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor());
+ QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor::fromRgbF(1, 0.8, 0.3).darker(280));
QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").darker());
QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor());
QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor());
@@ -483,6 +485,22 @@ void tst_qdeclarativeqt::atob()
delete object;
}
+void tst_qdeclarativeqt::fontFamilies()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("fontFamilies.qml"));
+
+ QString warning1 = component.url().toString() + ":4: Error: Qt.fontFamilies(): Invalid arguments";
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
+
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QFontDatabase database;
+ QCOMPARE(object->property("test2"), QVariant::fromValue(database.families()));
+
+ delete object;
+}
+
QTEST_MAIN(tst_qdeclarativeqt)
#include "tst_qdeclarativeqt.moc"
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml
index 17c5d8d..e1bd2e2 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml
+++ b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml
@@ -14,7 +14,7 @@ Rectangle {
property int instantiated: 0
Component {
Item{
- Component.onCompleted: {if(index!=model.idx) repeater.errors += 1; repeater.instantiated++}
+ Component.onCompleted: {if(index!=modelData.idx) repeater.errors += 1; repeater.instantiated++}
}
}
}
diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
index abd36e0..51667af 100644
--- a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
+++ b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro
@@ -5,6 +5,13 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativerepeater.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
index 8be7d80..e6b2fdd 100644
--- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
+++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
@@ -185,15 +185,24 @@ void tst_QDeclarativeRepeater::numberModel()
delete canvas;
}
+class MyObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int idx READ idx CONSTANT)
+public:
+ MyObject(int i) : QObject(), m_idx(i) {}
+
+ int idx() const { return m_idx; }
+
+ int m_idx;
+};
+
void tst_QDeclarativeRepeater::objectList()
{
QDeclarativeView *canvas = createView();
-
QObjectList data;
- for(int i=0; i<100; i++){
- data << new QObject();
- data.back()->setProperty("idx", i);
- }
+ for(int i=0; i<100; i++)
+ data << new MyObject(i);
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testData", QVariant::fromValue(data));
diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
index 80b757d..6b98f1e 100644
--- a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
+++ b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativesmoothedanimation.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativesmoothedfollow/qdeclarativesmoothedfollow.pro b/tests/auto/declarative/qdeclarativesmoothedfollow/qdeclarativesmoothedfollow.pro
index 7f737c2..eb7d793 100644
--- a/tests/auto/declarative/qdeclarativesmoothedfollow/qdeclarativesmoothedfollow.pro
+++ b/tests/auto/declarative/qdeclarativesmoothedfollow/qdeclarativesmoothedfollow.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativesmoothedfollow.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativespringfollow/qdeclarativespringfollow.pro b/tests/auto/declarative/qdeclarativespringfollow/qdeclarativespringfollow.pro
index 6f400a3..6ed8924 100644
--- a/tests/auto/declarative/qdeclarativespringfollow/qdeclarativespringfollow.pro
+++ b/tests/auto/declarative/qdeclarativespringfollow/qdeclarativespringfollow.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativespringfollow.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
index 3ff4529..9cdb884 100644
--- a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
+++ b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro
@@ -6,7 +6,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativesqldatabase.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
new file mode 100644
index 0000000..2215ee4
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash2.qml
@@ -0,0 +1,24 @@
+import Qt 4.7
+
+Rectangle {
+ id: myRect
+ width: 400
+ height: 400
+
+ states: [
+ State {
+ name: "state1"
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("Hello World")
+ color: "green"
+ }
+ },
+ State {
+ name: "state2"; extend: "state1"
+ PropertyChanges {
+ target: myRect
+ color: "red"
+ }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
new file mode 100644
index 0000000..a70840c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/unnamedWhen.qml
@@ -0,0 +1,14 @@
+import Qt 4.7
+
+Rectangle {
+ id: theRect
+ property bool triggerState: false
+ property string stateString: ""
+ states: State {
+ when: triggerState
+ PropertyChanges {
+ target: theRect
+ stateString: "inState"
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
index 706d045..6f4ecb3 100644
--- a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
+++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro
@@ -5,6 +5,13 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativestates.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index a016fa7..ea074a4 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -47,6 +47,7 @@
#include <private/qdeclarativetext_p.h>
#include <private/qdeclarativepropertychanges_p.h>
#include <private/qdeclarativestategroup_p.h>
+#include <private/qdeclarativeitem_p.h>
class MyRect : public QDeclarativeRectangle
@@ -86,6 +87,7 @@ private slots:
void basicBinding();
void signalOverride();
void signalOverrideCrash();
+ void signalOverrideCrash2();
void parentChange();
void parentChangeErrors();
void anchorChanges();
@@ -109,6 +111,7 @@ private slots:
void illegalObjectCreation();
void whenOrdering();
void urlResolution();
+ void unnamedWhen();
};
void tst_qdeclarativestates::initTestCase()
@@ -128,63 +131,66 @@ void tst_qdeclarativestates::basicChanges()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
}
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges2.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
}
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges3.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),1);
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->border()->width(),1);
- rect->setState("bordered");
+ rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),2);
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),1);
//### we should be checking that this is an implicit rather than explicit 1 (which currently fails)
- rect->setState("bordered");
+ rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),2);
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->border()->width(),1);
@@ -220,32 +226,33 @@ void tst_qdeclarativestates::basicExtension()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicExtension.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),1);
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->border()->width(),1);
- rect->setState("bordered");
+ rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->border()->width(),2);
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->border()->width(),1);
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),1);
- rect->setState("bordered");
+ rectPrivate->setState("bordered");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->border()->width(),2);
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->border()->width(),1);
}
@@ -253,26 +260,27 @@ void tst_qdeclarativestates::basicExtension()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/fakeExtension.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
}
}
@@ -284,77 +292,80 @@ void tst_qdeclarativestates::basicBinding()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
rect->setProperty("sourceColor", QColor("green"));
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
rect->setProperty("sourceColor", QColor("yellow"));
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("yellow"));
}
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding2.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
rect->setProperty("sourceColor", QColor("green"));
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("green"));
rect->setProperty("sourceColor", QColor("yellow"));
QCOMPARE(rect->color(),QColor("yellow"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("yellow"));
}
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding3.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
rect->setProperty("sourceColor", QColor("green"));
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
rect->setProperty("sourceColor", QColor("red"));
QCOMPARE(rect->color(),QColor("blue"));
rect->setProperty("sourceColor2", QColor("yellow"));
QCOMPARE(rect->color(),QColor("yellow"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
rect->setProperty("sourceColor2", QColor("green"));
QCOMPARE(rect->color(),QColor("red"));
@@ -365,27 +376,28 @@ void tst_qdeclarativestates::basicBinding()
{
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicBinding4.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QVERIFY(rect != 0);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
rect->setProperty("sourceColor", QColor("yellow"));
QCOMPARE(rect->color(),QColor("yellow"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
rect->setProperty("sourceColor", QColor("purple"));
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("purple"));
- rect->setState("green");
+ rectPrivate->setState("green");
QCOMPARE(rect->color(),QColor("green"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
}
}
@@ -403,7 +415,7 @@ void tst_qdeclarativestates::signalOverride()
rect->doSomething();
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("green");
+ QDeclarativeItemPrivate::get(rect)->setState("green");
rect->doSomething();
QCOMPARE(rect->color(),QColor("green"));
}
@@ -418,8 +430,7 @@ void tst_qdeclarativestates::signalOverride()
QCOMPARE(rect->color(),QColor("blue"));
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("extendedRect"));
-
- innerRect->setState("green");
+ QDeclarativeItemPrivate::get(innerRect)->setState("green");
rect->doSomething();
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(innerRect->color(),QColor("green"));
@@ -435,10 +446,25 @@ void tst_qdeclarativestates::signalOverrideCrash()
MyRect *rect = qobject_cast<MyRect*>(rectComponent.create());
QVERIFY(rect != 0);
- rect->setState("overridden");
+ QDeclarativeItemPrivate::get(rect)->setState("overridden");
rect->doSomething();
}
+void tst_qdeclarativestates::signalOverrideCrash2()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash2.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state2");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+
+ delete rect;
+}
+
void tst_qdeclarativestates::parentChange()
{
QDeclarativeEngine engine;
@@ -463,7 +489,7 @@ void tst_qdeclarativestates::parentChange()
QCOMPARE(pChange->parent(), nParent);
- rect->setState("reparented");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(-133));
@@ -474,11 +500,11 @@ void tst_qdeclarativestates::parentChange()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange2.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- rect->setState("reparented");
+ rectPrivate->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(15));
QCOMPARE(innerRect->scale(), qreal(.5));
QCOMPARE(QString("%1").arg(innerRect->x()), QString("%1").arg(-19.9075));
@@ -489,17 +515,17 @@ void tst_qdeclarativestates::parentChange()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange3.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- rect->setState("reparented");
+ rectPrivate->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(-37));
QCOMPARE(innerRect->scale(), qreal(.25));
QCOMPARE(QString("%1").arg(innerRect->x()), QString("%1").arg(-217.305));
QCOMPARE(QString("%1").arg(innerRect->y()), QString("%1").arg(-164.413));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(5));
@@ -521,7 +547,7 @@ void tst_qdeclarativestates::parentChangeErrors()
QVERIFY(innerRect != 0);
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange4.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under non-uniform scale");
- rect->setState("reparented");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(5));
@@ -537,7 +563,7 @@ void tst_qdeclarativestates::parentChangeErrors()
QVERIFY(innerRect != 0);
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange5.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under complex transform");
- rect->setState("reparented");
+ QDeclarativeItemPrivate::get(rect)->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));
QCOMPARE(innerRect->x(), qreal(5));
@@ -552,6 +578,7 @@ void tst_qdeclarativestates::anchorChanges()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
@@ -564,14 +591,14 @@ void tst_qdeclarativestates::anchorChanges()
QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
- rect->setState("right");
+ rectPrivate->setState("right");
QCOMPARE(innerRect->x(), qreal(150));
QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(aChanges->object()->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
- QCOMPARE(aChanges->object()->anchors()->right().item, rect->right().item);
- QCOMPARE(aChanges->object()->anchors()->right().anchorLine, rect->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all)
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(innerRect->x(), qreal(5));
delete rect;
@@ -584,14 +611,15 @@ void tst_qdeclarativestates::anchorChanges2()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
- rect->setState("right");
+ rectPrivate->setState("right");
QCOMPARE(innerRect->x(), qreal(150));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(innerRect->x(), qreal(5));
delete rect;
@@ -604,6 +632,7 @@ void tst_qdeclarativestates::anchorChanges3()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
@@ -622,23 +651,23 @@ void tst_qdeclarativestates::anchorChanges3()
QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
- rect->setState("reanchored");
+ rectPrivate->setState("reanchored");
QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(aChanges->object()->anchors()->left().item, leftGuideline->left().item);
- QCOMPARE(aChanges->object()->anchors()->left().anchorLine, leftGuideline->left().anchorLine);
- QCOMPARE(aChanges->object()->anchors()->right().item, rect->right().item);
- QCOMPARE(aChanges->object()->anchors()->right().anchorLine, rect->right().anchorLine);
- QCOMPARE(aChanges->object()->anchors()->top().item, rect->top().item);
- QCOMPARE(aChanges->object()->anchors()->top().anchorLine, rect->top().anchorLine);
- QCOMPARE(aChanges->object()->anchors()->bottom().item, bottomGuideline->bottom().item);
- QCOMPARE(aChanges->object()->anchors()->bottom().anchorLine, bottomGuideline->bottom().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().item, QDeclarativeItemPrivate::get(leftGuideline)->left().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->left().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().item, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->bottom().anchorLine);
QCOMPARE(innerRect->x(), qreal(10));
QCOMPARE(innerRect->y(), qreal(0));
QCOMPARE(innerRect->width(), qreal(190));
QCOMPARE(innerRect->height(), qreal(150));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(innerRect->x(), qreal(0));
QCOMPARE(innerRect->y(), qreal(10));
QCOMPARE(innerRect->width(), qreal(150));
@@ -672,12 +701,12 @@ void tst_qdeclarativestates::anchorChanges4()
QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
- rect->setState("reanchored");
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
- QCOMPARE(aChanges->object()->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item);
- QCOMPARE(aChanges->object()->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine);
- QCOMPARE(aChanges->object()->anchors()->verticalCenter().item, leftGuideline->verticalCenter().item);
- QCOMPARE(aChanges->object()->anchors()->verticalCenter().anchorLine, leftGuideline->verticalCenter().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QDeclarativeItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().item);
+ QCOMPARE(QDeclarativeItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QDeclarativeItemPrivate::get(leftGuideline)->verticalCenter().anchorLine);
delete rect;
}
@@ -707,7 +736,7 @@ void tst_qdeclarativestates::anchorChanges5()
QDeclarativeAnchorChanges *aChanges = qobject_cast<QDeclarativeAnchorChanges*>(state->operationAt(0));
QVERIFY(aChanges != 0);
- rect->setState("reanchored");
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
QCOMPARE(aChanges->object(), qobject_cast<QDeclarativeItem*>(innerRect));
//QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item);
//QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine);
@@ -726,7 +755,7 @@ void tst_qdeclarativestates::anchorChangesCrash()
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- rect->setState("reanchored");
+ QDeclarativeItemPrivate::get(rect)->setState("reanchored");
delete rect;
}
@@ -739,13 +768,13 @@ void tst_qdeclarativestates::script()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/script.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("blue")); // a script isn't reverted
}
}
@@ -757,13 +786,13 @@ void tst_qdeclarativestates::restoreEntryValues()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/restoreEntryValues.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("blue"));
}
@@ -774,7 +803,7 @@ void tst_qdeclarativestates::explicitChanges()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/explicit.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QDeclarativeListReference list(rect, "states");
QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0));
QVERIFY(state != 0);
@@ -786,18 +815,18 @@ void tst_qdeclarativestates::explicitChanges()
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
rect->setProperty("sourceColor", QColor("green"));
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
rect->setProperty("sourceColor", QColor("yellow"));
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("yellow"));
}
@@ -812,7 +841,7 @@ void tst_qdeclarativestates::propertyErrors()
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"wantsFocus\"");
- rect->setState("blue");
+ QDeclarativeItemPrivate::get(rect)->setState("blue");
}
void tst_qdeclarativestates::incorrectRestoreBug()
@@ -822,22 +851,22 @@ void tst_qdeclarativestates::incorrectRestoreBug()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QCOMPARE(rect->color(),QColor("red"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
// make sure if we change the base state value, we then restore to it correctly
rect->setColor(QColor("green"));
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("green"));
}
@@ -865,12 +894,12 @@ void tst_qdeclarativestates::deletingChange()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/deleting.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
- rect->setState("blue");
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("blue"));
QCOMPARE(rect->radius(),qreal(5));
- rect->setState("");
+ rectPrivate->setState("");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->radius(),qreal(0));
@@ -883,7 +912,7 @@ void tst_qdeclarativestates::deletingChange()
qmlExecuteDeferred(state);
QCOMPARE(state->operationCount(), 1);
- rect->setState("blue");
+ rectPrivate->setState("blue");
QCOMPARE(rect->color(),QColor("red"));
QCOMPARE(rect->radius(),qreal(5));
@@ -928,11 +957,11 @@ void tst_qdeclarativestates::tempState()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/legalTempState.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QTest::ignoreMessage(QtDebugMsg, "entering placed");
QTest::ignoreMessage(QtDebugMsg, "entering idle");
- rect->setState("placed");
- QCOMPARE(rect->state(), QLatin1String("idle"));
+ rectPrivate->setState("placed");
+ QCOMPARE(rectPrivate->state(), QLatin1String("idle"));
}
void tst_qdeclarativestates::illegalTempState()
@@ -942,10 +971,10 @@ void tst_qdeclarativestates::illegalTempState()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/illegalTempState.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.");
- rect->setState("placed");
- QCOMPARE(rect->state(), QLatin1String("placed"));
+ rectPrivate->setState("placed");
+ QCOMPARE(rectPrivate->state(), QLatin1String("placed"));
}
void tst_qdeclarativestates::nonExistantProperty()
@@ -955,10 +984,10 @@ void tst_qdeclarativestates::nonExistantProperty()
QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/nonExistantProp.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
-
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/nonExistantProp.qml") + ":9:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
- rect->setState("blue");
- QCOMPARE(rect->state(), QLatin1String("blue"));
+ rectPrivate->setState("blue");
+ QCOMPARE(rectPrivate->state(), QLatin1String("blue"));
}
void tst_qdeclarativestates::reset()
@@ -974,7 +1003,7 @@ void tst_qdeclarativestates::reset()
QCOMPARE(text->width(), qreal(40.));
QVERIFY(text->width() < text->height());
- rect->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
QVERIFY(text->width() > 41);
QVERIFY(text->width() > text->height());
@@ -1000,19 +1029,20 @@ void tst_qdeclarativestates::whenOrdering()
QDeclarativeComponent c(&engine, SRCDIR "/data/whenOrdering.qml");
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
- QCOMPARE(rect->state(), QLatin1String(""));
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
rect->setProperty("condition2", true);
- QCOMPARE(rect->state(), QLatin1String("state2"));
+ QCOMPARE(rectPrivate->state(), QLatin1String("state2"));
rect->setProperty("condition1", true);
- QCOMPARE(rect->state(), QLatin1String("state1"));
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
rect->setProperty("condition2", false);
- QCOMPARE(rect->state(), QLatin1String("state1"));
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
rect->setProperty("condition2", true);
- QCOMPARE(rect->state(), QLatin1String("state1"));
+ QCOMPARE(rectPrivate->state(), QLatin1String("state1"));
rect->setProperty("condition1", false);
rect->setProperty("condition2", false);
- QCOMPARE(rect->state(), QLatin1String(""));
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
}
void tst_qdeclarativestates::urlResolution()
@@ -1029,13 +1059,32 @@ void tst_qdeclarativestates::urlResolution()
QDeclarativeImage *image3 = rect->findChild<QDeclarativeImage*>("image3");
QVERIFY(myType != 0 && image1 != 0 && image2 != 0 && image3 != 0);
- myType->setState("SetImageState");
+ QDeclarativeItemPrivate::get(myType)->setState("SetImageState");
QUrl resolved = QUrl::fromLocalFile(SRCDIR "/data/Implementation/images/qt-logo.png");
QCOMPARE(image1->source(), resolved);
QCOMPARE(image2->source(), resolved);
QCOMPARE(image3->source(), resolved);
}
+void tst_qdeclarativestates::unnamedWhen()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent c(&engine, SRCDIR "/data/unnamedWhen.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+ QVERIFY(rect != 0);
+ QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect);
+
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+ rect->setProperty("triggerState", true);
+ QCOMPARE(rectPrivate->state(), QLatin1String("anonymousState1"));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String("inState"));
+ rect->setProperty("triggerState", false);
+ QCOMPARE(rectPrivate->state(), QLatin1String(""));
+ QCOMPARE(rect->property("stateString").toString(), QLatin1String(""));
+}
+
QTEST_MAIN(tst_qdeclarativestates)
#include "tst_qdeclarativestates.moc"
diff --git a/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro b/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro
index b2705fa..786bc1b 100644
--- a/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro
+++ b/tests/auto/declarative/qdeclarativesystempalette/qdeclarativesystempalette.pro
@@ -4,5 +4,12 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativesystempalette.cpp
+# Define SRCDIR equal to test's source directory
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
index e70443e..51c7f43 100644
--- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
+++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro
@@ -9,7 +9,14 @@ INCLUDEPATH += ../shared/
HEADERS += ../shared/testhttpserver.h
SOURCES += ../shared/testhttpserver.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml b/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml
new file mode 100644
index 0000000..b39ba5b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextedit/data/geometrySignals.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+
+Item {
+ width: 400; height: 500;
+ property int bindingWidth: text.width
+ property int bindingHeight: text.height
+
+ TextInput {
+ id: text
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
index 2228f11..2adb2b8 100644
--- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
+++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro
@@ -6,4 +6,11 @@ SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp
HEADERS += ../shared/testhttpserver.h
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 3307b7c..c65c883 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -84,7 +84,7 @@ private slots:
void navigation();
void readOnly();
void sendRequestSoftwareInputPanelEvent();
-
+ void geometrySignals();
private:
void simulateKey(QDeclarativeView *, int key);
QDeclarativeView *createView(const QString &filename);
@@ -202,7 +202,7 @@ void tst_qdeclarativetextedit::width()
QFont f;
QFontMetricsF fm(f);
qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width();
- metricWidth = floor(metricWidth);
+ metricWidth = ceil(metricWidth);
QString componentStr = "import Qt 4.7\nTextEdit { text: \"" + standard.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
@@ -219,7 +219,7 @@ void tst_qdeclarativetextedit::width()
document.setHtml(richText.at(i));
document.setDocumentMargin(0);
- int documentWidth = document.idealWidth();
+ int documentWidth = ceil(document.idealWidth());
QString componentStr = "import Qt 4.7\nTextEdit { text: \"" + richText.at(i) + "\" }";
QDeclarativeComponent texteditComponent(&engine);
@@ -793,8 +793,6 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
view.viewport()->setInputContext(&ic);
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
view.style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
- if ((behavior != QStyle::RSIP_OnMouseClick))
- QSKIP("This test need to have a style with RSIP_OnMouseClick", SkipSingle);
QDeclarativeTextEdit edit;
edit.setText("Hello world");
edit.setPos(0, 0);
@@ -806,8 +804,26 @@ void tst_qdeclarativetextedit::sendRequestSoftwareInputPanelEvent()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
QApplication::processEvents();
- QCOMPARE(ic.softwareInputPanelEventReceived, true);
+ if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) {
+ QCOMPARE(ic.softwareInputPanelEventReceived, false);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.softwareInputPanelEventReceived, true);
+ } else if (behavior == QStyle::RSIP_OnMouseClick) {
+ QCOMPARE(ic.softwareInputPanelEventReceived, true);
+ }
+}
+
+void tst_qdeclarativetextedit::geometrySignals()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml");
+ QObject *o = component.create();
+ QVERIFY(o);
+ QCOMPARE(o->property("bindingWidth").toInt(), 400);
+ QCOMPARE(o->property("bindingHeight").toInt(), 500);
+ delete o;
}
+
QTEST_MAIN(tst_qdeclarativetextedit)
#include "tst_qdeclarativetextedit.moc"
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml b/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml
new file mode 100644
index 0000000..a9b50fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetextinput/data/geometrySignals.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+
+Item {
+ width: 400; height: 500;
+ property int bindingWidth: text.width
+ property int bindingHeight: text.height
+
+ TextEdit {
+ id: text
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
index 957e75c..2953567 100644
--- a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
+++ b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro
@@ -5,5 +5,12 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativetextinput.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 83ebe6c..ac80edb 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -76,6 +76,7 @@ private slots:
void focusOutClearSelection();
void echoMode();
+ void geometrySignals();
private:
void simulateKey(QDeclarativeView *, int key);
QDeclarativeView *createView(const QString &filename);
@@ -575,6 +576,14 @@ void tst_qdeclarativetextinput::navigation()
simulateKey(canvas, Qt::Key_Left);
QVERIFY(input->hasFocus() == true);
+ // Up and Down should NOT do Home/End, even on Mac OS X (QTBUG-10438).
+ input->setCursorPosition(2);
+ QCOMPARE(input->cursorPosition(),2);
+ simulateKey(canvas, Qt::Key_Up);
+ QCOMPARE(input->cursorPosition(),2);
+ simulateKey(canvas, Qt::Key_Down);
+ QCOMPARE(input->cursorPosition(),2);
+
delete canvas;
}
@@ -734,8 +743,6 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
view.viewport()->setInputContext(&ic);
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
view.style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
- if ((behavior != QStyle::RSIP_OnMouseClick))
- QSKIP("This test need to have a style with RSIP_OnMouseClick", SkipSingle);
QDeclarativeTextInput input;
input.setText("Hello world");
input.setPos(0, 0);
@@ -747,7 +754,14 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
QApplication::processEvents();
- QCOMPARE(ic.softwareInputPanelEventReceived, true);
+ if (behavior == QStyle::RSIP_OnMouseClickAndAlreadyFocused) {
+ QCOMPARE(ic.softwareInputPanelEventReceived, false);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
+ QApplication::processEvents();
+ QCOMPARE(ic.softwareInputPanelEventReceived, true);
+ } else if (behavior == QStyle::RSIP_OnMouseClick) {
+ QCOMPARE(ic.softwareInputPanelEventReceived, true);
+ }
}
class MyTextInput : public QDeclarativeTextInput
@@ -805,6 +819,16 @@ void tst_qdeclarativetextinput::focusOutClearSelection()
QTRY_COMPARE(input.selectedText(), QLatin1String(""));
}
+void tst_qdeclarativetextinput::geometrySignals()
+{
+ QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml");
+ QObject *o = component.create();
+ QVERIFY(o);
+ QCOMPARE(o->property("bindingWidth").toInt(), 400);
+ QCOMPARE(o->property("bindingHeight").toInt(), 500);
+ delete o;
+}
+
QTEST_MAIN(tst_qdeclarativetextinput)
#include "tst_qdeclarativetextinput.moc"
diff --git a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro
index 42604d8..d95165c 100644
--- a/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro
+++ b/tests/auto/declarative/qdeclarativetimer/qdeclarativetimer.pro
@@ -4,6 +4,10 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativetimer.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml
new file mode 100644
index 0000000..6c4a682
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml
@@ -0,0 +1,22 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_m11: matrix.m11
+ property real v_m12: matrix.m12
+ property real v_m13: matrix.m13
+ property real v_m14: matrix.m14
+ property real v_m21: matrix.m21
+ property real v_m22: matrix.m22
+ property real v_m23: matrix.m23
+ property real v_m24: matrix.m24
+ property real v_m31: matrix.m31
+ property real v_m32: matrix.m32
+ property real v_m33: matrix.m33
+ property real v_m34: matrix.m34
+ property real v_m41: matrix.m41
+ property real v_m42: matrix.m42
+ property real v_m43: matrix.m43
+ property real v_m44: matrix.m44
+ property variant copy: matrix
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml
new file mode 100644
index 0000000..2a9f154
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml
@@ -0,0 +1,21 @@
+import Test 1.0
+
+MyTypeObject {
+ matrix.m11: if (true) 11
+ matrix.m12: if (true) 12
+ matrix.m13: if (true) 13
+ matrix.m14: if (true) 14
+ matrix.m21: if (true) 21
+ matrix.m22: if (true) 22
+ matrix.m23: if (true) 23
+ matrix.m24: if (true) 24
+ matrix.m31: if (true) 31
+ matrix.m32: if (true) 32
+ matrix.m33: if (true) 33
+ matrix.m34: if (true) 34
+ matrix.m41: if (true) 41
+ matrix.m42: if (true) 42
+ matrix.m43: if (true) 43
+ matrix.m44: if (true) 44
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml
new file mode 100644
index 0000000..d1a21dc
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_scalar: quaternion.scalar
+ property real v_x: quaternion.x
+ property real v_y: quaternion.y
+ property real v_z: quaternion.z
+ property variant copy: quaternion
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml
new file mode 100644
index 0000000..0c3e5af
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ quaternion.scalar: if (true) 88.5
+ quaternion.x: if (true) -0.3
+ quaternion.y: if (true) -12.9
+ quaternion.z: if (true) 907.4
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
new file mode 100644
index 0000000..e4715ab
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml
@@ -0,0 +1,14 @@
+import Qt 4.7
+
+QtObject {
+ property int x;
+ property int y;
+ property int z;
+
+ Component.onCompleted: {
+ var vec3 = Qt.vector3d(1, 2, 3);
+ x = vec3.x;
+ y = vec3.y;
+ z = vec3.z;
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml
new file mode 100644
index 0000000..fc315f7
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_x: vector2.x
+ property real v_y: vector2.y
+ property variant copy: vector2
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml
new file mode 100644
index 0000000..f0e35ff
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml
@@ -0,0 +1,7 @@
+import Test 1.0
+
+MyTypeObject {
+ vector2.x: if (true) -0.3
+ vector2.y: if (true) -12.9
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml
new file mode 100644
index 0000000..f9d5d60
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml
@@ -0,0 +1,10 @@
+import Test 1.0
+
+MyTypeObject {
+ property real v_x: vector4.x
+ property real v_y: vector4.y
+ property real v_z: vector4.z
+ property real v_w: vector4.w
+ property variant copy: vector4
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml
new file mode 100644
index 0000000..5486981
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml
@@ -0,0 +1,9 @@
+import Test 1.0
+
+MyTypeObject {
+ vector4.x: if (true) -0.3
+ vector4.y: if (true) -12.9
+ vector4.z: if (true) 907.4
+ vector4.w: if (true) 88.5
+}
+
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
index d9f1c13..02c480c 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
+++ b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro
@@ -7,7 +7,14 @@ HEADERS += testtypes.h
SOURCES += tst_qdeclarativevaluetypes.cpp \
testtypes.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
index 8a9b981..1da9990 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
+++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
@@ -48,7 +48,11 @@
#include <QSizeF>
#include <QRect>
#include <QRectF>
+#include <QVector2D>
#include <QVector3D>
+#include <QVector4D>
+#include <QQuaternion>
+#include <QMatrix4x4>
#include <QFont>
#include <qdeclarative.h>
#include <QDeclarativePropertyValueSource>
@@ -66,7 +70,11 @@ class MyTypeObject : public QObject
Q_PROPERTY(QSize sizereadonly READ size NOTIFY changed)
Q_PROPERTY(QRect rect READ rect WRITE setRect NOTIFY changed)
Q_PROPERTY(QRectF rectf READ rectf WRITE setRectf NOTIFY changed)
+ Q_PROPERTY(QVector2D vector2 READ vector2 WRITE setVector2 NOTIFY changed)
Q_PROPERTY(QVector3D vector READ vector WRITE setVector NOTIFY changed)
+ Q_PROPERTY(QVector4D vector4 READ vector4 WRITE setVector4 NOTIFY changed)
+ Q_PROPERTY(QQuaternion quaternion READ quaternion WRITE setQuaternion NOTIFY changed)
+ Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY changed)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed)
public:
@@ -77,7 +85,11 @@ public:
m_sizef(0.1, 100923.2),
m_rect(2, 3, 109, 102),
m_rectf(103.8, 99.2, 88.1, 77.6),
- m_vector(23.88, 3.1, 4.3)
+ m_vector2(32.88, 1.3),
+ m_vector(23.88, 3.1, 4.3),
+ m_vector4(54.2, 23.88, 3.1, 4.3),
+ m_quaternion(4.3, 54.2, 23.88, 3.1),
+ m_matrix(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
{
m_font.setFamily("Arial");
m_font.setBold(true);
@@ -116,10 +128,26 @@ public:
QRectF rectf() const { return m_rectf; }
void setRectf(const QRectF &v) { m_rectf = v; emit changed(); }
+ QVector2D m_vector2;
+ QVector2D vector2() const { return m_vector2; }
+ void setVector2(const QVector2D &v) { m_vector2 = v; emit changed(); }
+
QVector3D m_vector;
QVector3D vector() const { return m_vector; }
void setVector(const QVector3D &v) { m_vector = v; emit changed(); }
+ QVector4D m_vector4;
+ QVector4D vector4() const { return m_vector4; }
+ void setVector4(const QVector4D &v) { m_vector4 = v; emit changed(); }
+
+ QQuaternion m_quaternion;
+ QQuaternion quaternion() const { return m_quaternion; }
+ void setQuaternion(const QQuaternion &v) { m_quaternion = v; emit changed(); }
+
+ QMatrix4x4 m_matrix;
+ QMatrix4x4 matrix() const { return m_matrix; }
+ void setMatrix(const QMatrix4x4 &v) { m_matrix = v; emit changed(); }
+
QFont m_font;
QFont font() const { return m_font; }
void setFont(const QFont &v) { m_font = v; emit changed(); }
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
index b733b10..95b9baa 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
+++ b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
@@ -62,7 +62,11 @@ private slots:
void sizereadonly();
void rect();
void rectf();
+ void vector2d();
void vector3d();
+ void vector4d();
+ void quaternion();
+ void matrix4x4();
void font();
void bindingAssignment();
@@ -80,6 +84,7 @@ private slots:
void enums();
void conflictingBindings();
void returnValues();
+ void varAssignment();
private:
QDeclarativeEngine engine;
@@ -293,6 +298,31 @@ void tst_qdeclarativevaluetypes::rectf()
}
}
+void tst_qdeclarativevaluetypes::vector2d()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector2d_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)32.88);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)1.3);
+ QCOMPARE(object->property("copy"), QVariant(QVector2D(32.88, 1.3)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector2d_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->vector2(), QVector2D(-0.3, -12.9));
+
+ delete object;
+ }
+}
+
void tst_qdeclarativevaluetypes::vector3d()
{
{
@@ -319,6 +349,106 @@ void tst_qdeclarativevaluetypes::vector3d()
}
}
+void tst_qdeclarativevaluetypes::vector4d()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector4d_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)54.2);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)23.88);
+ QCOMPARE((float)object->property("v_z").toDouble(), (float)3.1);
+ QCOMPARE((float)object->property("v_w").toDouble(), (float)4.3);
+ QCOMPARE(object->property("copy"), QVariant(QVector4D(54.2, 23.88, 3.1, 4.3)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("vector4d_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->vector4(), QVector4D(-0.3, -12.9, 907.4, 88.5));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::quaternion()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("quaternion_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_scalar").toDouble(), (float)4.3);
+ QCOMPARE((float)object->property("v_x").toDouble(), (float)54.2);
+ QCOMPARE((float)object->property("v_y").toDouble(), (float)23.88);
+ QCOMPARE((float)object->property("v_z").toDouble(), (float)3.1);
+ QCOMPARE(object->property("copy"), QVariant(QQuaternion(4.3, 54.2, 23.88, 3.1)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("quaternion_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->quaternion(), QQuaternion(88.5, -0.3, -12.9, 907.4));
+
+ delete object;
+ }
+}
+
+void tst_qdeclarativevaluetypes::matrix4x4()
+{
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("matrix4x4_read.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE((float)object->property("v_m11").toDouble(), (float)1);
+ QCOMPARE((float)object->property("v_m12").toDouble(), (float)2);
+ QCOMPARE((float)object->property("v_m13").toDouble(), (float)3);
+ QCOMPARE((float)object->property("v_m14").toDouble(), (float)4);
+ QCOMPARE((float)object->property("v_m21").toDouble(), (float)5);
+ QCOMPARE((float)object->property("v_m22").toDouble(), (float)6);
+ QCOMPARE((float)object->property("v_m23").toDouble(), (float)7);
+ QCOMPARE((float)object->property("v_m24").toDouble(), (float)8);
+ QCOMPARE((float)object->property("v_m31").toDouble(), (float)9);
+ QCOMPARE((float)object->property("v_m32").toDouble(), (float)10);
+ QCOMPARE((float)object->property("v_m33").toDouble(), (float)11);
+ QCOMPARE((float)object->property("v_m34").toDouble(), (float)12);
+ QCOMPARE((float)object->property("v_m41").toDouble(), (float)13);
+ QCOMPARE((float)object->property("v_m42").toDouble(), (float)14);
+ QCOMPARE((float)object->property("v_m43").toDouble(), (float)15);
+ QCOMPARE((float)object->property("v_m44").toDouble(), (float)16);
+ QCOMPARE(object->property("copy"),
+ QVariant(QMatrix4x4(1, 2, 3, 4,
+ 5, 6, 7, 8,
+ 9, 10, 11, 12,
+ 13, 14, 15, 16)));
+
+ delete object;
+ }
+
+ {
+ QDeclarativeComponent component(&engine, TEST_FILE("matrix4x4_write.qml"));
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->matrix(), QMatrix4x4(11, 12, 13, 14,
+ 21, 22, 23, 24,
+ 31, 32, 33, 34,
+ 41, 42, 43, 44));
+
+ delete object;
+ }
+}
+
void tst_qdeclarativevaluetypes::font()
{
{
@@ -665,7 +795,12 @@ void tst_qdeclarativevaluetypes::cppClasses()
CPP_TEST(QDeclarativeSizeFValueType, QSizeF(-100.7, 18.2));
CPP_TEST(QDeclarativeRectValueType, QRect(13, 39, 10928, 88));
CPP_TEST(QDeclarativeRectFValueType, QRectF(88.2, -90.1, 103.2, 118));
+ CPP_TEST(QDeclarativeVector2DValueType, QVector2D(19.7, 1002));
CPP_TEST(QDeclarativeVector3DValueType, QVector3D(18.2, 19.7, 1002));
+ CPP_TEST(QDeclarativeVector4DValueType, QVector4D(18.2, 19.7, 1002, 54));
+ CPP_TEST(QDeclarativeQuaternionValueType, QQuaternion(18.2, 19.7, 1002, 54));
+ CPP_TEST(QDeclarativeMatrix4x4ValueType,
+ QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
CPP_TEST(QDeclarativeFontValueType, QFont("Helvetica"));
}
@@ -777,6 +912,19 @@ void tst_qdeclarativevaluetypes::returnValues()
delete object;
}
+void tst_qdeclarativevaluetypes::varAssignment()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("varAssignment.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("x").toInt(), 1);
+ QCOMPARE(object->property("y").toInt(), 2);
+ QCOMPARE(object->property("z").toInt(), 3);
+
+ delete object;
+}
+
QTEST_MAIN(tst_qdeclarativevaluetypes)
#include "tst_qdeclarativevaluetypes.moc"
diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
index d6be728..ad54713 100644
--- a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
+++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro
@@ -4,4 +4,11 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeview.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
index 1ed51c1..dd2f46e 100644
--- a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
+++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
@@ -147,7 +147,7 @@ void tst_QDeclarativeView::resizemodedeclarativeitem()
declarativeItem->setHeight(80);
QCOMPARE(canvas->width(), 80);
QCOMPARE(canvas->height(), 100);
- QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(QSize(declarativeItem->width(), declarativeItem->height()), canvas->sizeHint());
QCOMPARE(sceneResizedSpy2.count(), 2);
// size update from view
@@ -230,7 +230,7 @@ void tst_QDeclarativeView::resizemodegraphicswidget()
canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
graphicsWidget->resize(QSizeF(60,80));
QCOMPARE(canvas->size(), QSize(80,100));
- QCOMPARE(canvas->size(), canvas->sizeHint());
+ QCOMPARE(QSize(graphicsWidget->size().width(), graphicsWidget->size().height()), canvas->sizeHint());
QCOMPARE(sceneResizedSpy2.count(), 2);
// size update from view
diff --git a/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
new file mode 100644
index 0000000..687fac6
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeviewer/data/orientation.qml
@@ -0,0 +1,10 @@
+import Qt 4.7
+Rectangle {
+ color: "black"
+ width: (runtime.orientation == Orientation.Landscape) ? 300 : 200
+ height: (runtime.orientation == Orientation.Landscape) ? 200 : 300
+ Text {
+ text: runtime.orientation == Orientation.Landscape ? "Landscape" : "Portrait"
+ color: "white"
+ }
+} \ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
new file mode 100644
index 0000000..9bb6161
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro
@@ -0,0 +1,18 @@
+load(qttest_p4)
+contains(QT_CONFIG,declarative): QT += declarative gui
+macx:CONFIG -= app_bundle
+
+include(../../../../tools/qml/qml.pri)
+
+SOURCES += tst_qdeclarativeviewer.cpp
+
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
+
+CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
new file mode 100644
index 0000000..9429dc9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -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 test suite 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/qdeclarativeengine.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <QtDeclarative/qdeclarativeitem.h>
+#include "qmlruntime.h"
+
+class tst_QDeclarativeViewer : public QObject
+
+{
+ Q_OBJECT
+public:
+ tst_QDeclarativeViewer();
+
+private slots:
+ void orientation();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+tst_QDeclarativeViewer::tst_QDeclarativeViewer()
+{
+}
+
+void tst_QDeclarativeViewer::orientation()
+{
+ QWidget window;
+ QDeclarativeViewer *viewer = new QDeclarativeViewer(&window);
+ QVERIFY(viewer);
+ viewer->open(SRCDIR "/data/orientation.qml");
+ QVERIFY(viewer->view());
+ QVERIFY(viewer->menuBar());
+ QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
+ QVERIFY(rootItem);
+ window.show();
+
+ QCOMPARE(rootItem->width(), 200.0);
+ QCOMPARE(rootItem->height(), 300.0);
+ QCOMPARE(viewer->view()->size(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
+ QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ viewer->toggleOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(rootItem->width(), 300.0);
+ QCOMPARE(rootItem->height(), 200.0);
+ QCOMPARE(viewer->view()->size(), QSize(300, 200));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(300, 200));
+ QCOMPARE(viewer->size(), QSize(300, 200+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+
+ viewer->toggleOrientation();
+ qApp->processEvents();
+
+ QCOMPARE(rootItem->width(), 200.0);
+ QCOMPARE(rootItem->height(), 300.0);
+ QCOMPARE(viewer->view()->size(), QSize(200, 300));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
+ QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), viewer->sizeHint());
+}
+
+QTEST_MAIN(tst_QDeclarativeViewer)
+
+#include "tst_qdeclarativeviewer.moc"
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
new file mode 100644
index 0000000..f5198c9
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
@@ -0,0 +1,16 @@
+import Qt 4.7
+
+ListView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ model: myModel
+ delegate: Component {
+ Rectangle {
+ height: 25
+ width: 100
+ color: model.modelData.color
+ Text { objectName: "name"; text: name }
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
index d76b582..c87171b 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro
@@ -4,8 +4,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativevisualdatamodel.cpp
-# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index 7de15a3..c238ef9 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -44,6 +44,10 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtDeclarative/qdeclarativeexpression.h>
+#include <QtDeclarative/qdeclarativeview.h>
+#include <private/qdeclarativelistview_p.h>
+#include <private/qdeclarativetext_p.h>
#include <private/qdeclarativevisualitemmodel_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include <math.h>
@@ -74,9 +78,50 @@ public:
private slots:
void rootIndex();
+ void objectListModel();
private:
QDeclarativeEngine engine;
+ template<typename T>
+ T *findItem(QGraphicsObject *parent, const QString &objectName, int index);
+};
+
+class DataObject : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged)
+
+public:
+ DataObject(QObject *parent=0) : QObject(parent) {}
+ DataObject(const QString &name, const QString &color, QObject *parent=0)
+ : QObject(parent), m_name(name), m_color(color) { }
+
+
+ QString name() const { return m_name; }
+ void setName(const QString &name) {
+ if (name != m_name) {
+ m_name = name;
+ emit nameChanged();
+ }
+ }
+
+ QString color() const { return m_color; }
+ void setColor(const QString &color) {
+ if (color != m_color) {
+ m_color = color;
+ emit colorChanged();
+ }
+ }
+
+signals:
+ void nameChanged();
+ void colorChanged();
+
+private:
+ QString m_name;
+ QString m_color;
};
tst_qdeclarativevisualdatamodel::tst_qdeclarativevisualdatamodel()
@@ -105,6 +150,60 @@ void tst_qdeclarativevisualdatamodel::rootIndex()
delete obj;
}
+void tst_qdeclarativevisualdatamodel::objectListModel()
+{
+ QDeclarativeView view;
+
+ QList<QObject*> dataList;
+ dataList.append(new DataObject("Item 1", "red"));
+ dataList.append(new DataObject("Item 2", "green"));
+ dataList.append(new DataObject("Item 3", "blue"));
+ dataList.append(new DataObject("Item 4", "yellow"));
+
+ QDeclarativeContext *ctxt = view.rootContext();
+ ctxt->setContextProperty("myModel", QVariant::fromValue(dataList));
+
+ view.setSource(QUrl::fromLocalFile(SRCDIR "/data/objectlist.qml"));
+
+ QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject());
+ QVERIFY(listview != 0);
+
+ QDeclarativeItem *viewport = listview->viewport();
+ QVERIFY(viewport != 0);
+
+ QDeclarativeText *name = findItem<QDeclarativeText>(viewport, "name", 0);
+ QCOMPARE(name->text(), QString("Item 1"));
+
+ dataList[0]->setProperty("name", QLatin1String("Changed"));
+ QCOMPARE(name->text(), QString("Changed"));
+}
+
+template<typename T>
+T *tst_qdeclarativevisualdatamodel::findItem(QGraphicsObject *parent, const QString &objectName, int index)
+{
+ const QMetaObject &mo = T::staticMetaObject;
+ //qDebug() << parent->childItems().count() << "children";
+ for (int i = 0; i < parent->childItems().count(); ++i) {
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(parent->childItems().at(i));
+ if(!item)
+ continue;
+ //qDebug() << "try" << item;
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
+ if (index != -1) {
+ QDeclarativeExpression e(qmlContext(item), "index", item);
+ if (e.evaluate().toInt() == index)
+ return static_cast<T*>(item);
+ } else {
+ return static_cast<T*>(item);
+ }
+ }
+ item = findItem<T>(item, objectName, index);
+ if (item)
+ return static_cast<T*>(item);
+ }
+
+ return 0;
+}
QTEST_MAIN(tst_qdeclarativevisualdatamodel)
diff --git a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro
index 956272f..8caa393 100644
--- a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro
+++ b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro
@@ -6,6 +6,13 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativewebview.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
index 2e3da4d..36b3449 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
+++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro
@@ -5,7 +5,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativeworkerscript.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
index 160300e..b54f670 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro
@@ -8,9 +8,15 @@ HEADERS += ../shared/testhttpserver.h
SOURCES += tst_qdeclarativexmlhttprequest.cpp \
../shared/testhttpserver.cpp
-
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
index 8c5052a..1bf1c58 100644
--- a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
+++ b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro
@@ -8,7 +8,14 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativexmllistmodel.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
index d82c6df..cc9a639 100644
--- a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
@@ -16,7 +16,7 @@ Rectangle {
id: img
source: "pics/qtlogo.png"
x: 60-width/2
- y: 100
+ y: 200-img.height
SequentialAnimation on y {
loops: Animation.Infinite
NumberAnimation {
@@ -24,7 +24,7 @@ Rectangle {
easing.type: "InOutQuad"
}
NumberAnimation {
- to: 100
+ to: 200-img.height
easing.type: "OutBounce"
duration: 2000
}
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.png
new file mode 100644
index 0000000..d8be67b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.png
new file mode 100644
index 0000000..249e0dd
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.png
new file mode 100644
index 0000000..044f823
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.png b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.png
new file mode 100644
index 0000000..d8be67b
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml
new file mode 100644
index 0000000..dc8e2e2
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/data/qtbug10586.qml
@@ -0,0 +1,1151 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 32
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 48
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 64
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 80
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 96
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 112
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 128
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 144
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 160
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 176
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 192
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 208
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 224
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 240
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 256
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 272
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 288
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 304
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 320
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 336
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 352
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 368
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 384
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 400
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 416
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 432
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 448
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 464
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 480
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 496
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 512
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 528
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 544
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 560
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 576
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 592
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 608
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 624
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 640
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 656
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 672
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 688
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 704
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 720
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 736
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 752
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 768
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 784
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 800
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 816
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 832
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 848
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 864
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 880
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 896
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 912
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 928
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 944
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 960
+ image: "qtbug10586.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 992
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1008
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1024
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1040
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1056
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1072
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1088
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1104
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1120
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1136
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1152
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1168
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1184
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1200
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1216
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1232
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1248
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1264
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1280
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1296
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1312
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 174; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1328
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1344
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1360
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1376
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1392
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 170; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1408
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 156; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1424
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 1440
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 130; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 130; y: 204
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 1456
+ hash: "8b7dd0f0a3881f10d76b47cbec4754c3"
+ }
+ Frame {
+ msec: 1472
+ hash: "b6fc4990acb245e015c35261a3c6fd75"
+ }
+ Frame {
+ msec: 1488
+ hash: "849fa4174134804dadc000323141b341"
+ }
+ Frame {
+ msec: 1504
+ hash: "35f2d6405ed7d992bb62eb6e24478492"
+ }
+ Frame {
+ msec: 1520
+ hash: "673ebb4499522c3f27b775dff1dbbe44"
+ }
+ Frame {
+ msec: 1536
+ hash: "96945f5489ffd0dc8ab995c96eb5da43"
+ }
+ Frame {
+ msec: 1552
+ hash: "2e4543754429ac3db831a2432098c063"
+ }
+ Frame {
+ msec: 1568
+ hash: "02253fe8a9fd5009a07265c2c6ffc8e4"
+ }
+ Frame {
+ msec: 1584
+ hash: "200a89949df1e9ef58d005a139857d2c"
+ }
+ Frame {
+ msec: 1600
+ hash: "ceb28be34c7ea8eff5fa00fdea087439"
+ }
+ Frame {
+ msec: 1616
+ hash: "a9ece475c51f126094c5eff4e20f4a19"
+ }
+ Frame {
+ msec: 1632
+ hash: "aa0776f84aef87d6971affdfa2d8dd82"
+ }
+ Frame {
+ msec: 1648
+ hash: "4c74661e1c73fefc9c5154b257239352"
+ }
+ Frame {
+ msec: 1664
+ hash: "c10d23df3a75966aad5016bd8ba8e9d8"
+ }
+ Frame {
+ msec: 1680
+ hash: "41692977d654a55d3b1d037aea9f2c03"
+ }
+ Frame {
+ msec: 1696
+ hash: "2f1835a1de94f962eb5dc781c85b4c32"
+ }
+ Frame {
+ msec: 1712
+ hash: "7cb78e2e5f6d35d456c95f2bd8652eb5"
+ }
+ Frame {
+ msec: 1728
+ hash: "4388aee9b1c8b4fde43634ad08f03557"
+ }
+ Frame {
+ msec: 1744
+ hash: "1cdc71100fd11cb6e60c9ab7e65e95bf"
+ }
+ Frame {
+ msec: 1760
+ hash: "feddbf269adfc8bb1b1a3656b5b5736d"
+ }
+ Frame {
+ msec: 1776
+ hash: "76b39ce0ee9b9b4af8aa0141577b8460"
+ }
+ Frame {
+ msec: 1792
+ hash: "bac963d3df2841ab7a3770a371f3a94d"
+ }
+ Frame {
+ msec: 1808
+ hash: "403007bb6c0782fece1cedbd40994550"
+ }
+ Frame {
+ msec: 1824
+ hash: "72076c743fdd33fab2ac789c7c22973a"
+ }
+ Frame {
+ msec: 1840
+ hash: "662be553c32b0145b3f4fee9bb0d659d"
+ }
+ Frame {
+ msec: 1856
+ hash: "e6b9049949a0ee4ff8a0fcaf5464f479"
+ }
+ Frame {
+ msec: 1872
+ hash: "eb1939458851780b7bb51ee50f0a3bd7"
+ }
+ Frame {
+ msec: 1888
+ hash: "41c8d2686ddb882981a7d3a5c8c69005"
+ }
+ Frame {
+ msec: 1904
+ hash: "7d3b1fc34082a160cbea4409af85fc9c"
+ }
+ Frame {
+ msec: 1920
+ image: "qtbug10586.1.png"
+ }
+ Frame {
+ msec: 1936
+ hash: "17be4a9c3d4d19e93bf1fc3a13a374a2"
+ }
+ Frame {
+ msec: 1952
+ hash: "d449593024a59487eb92195ee6b77a64"
+ }
+ Frame {
+ msec: 1968
+ hash: "c6ccbc2acec8e32f043f2cfb7b7848a9"
+ }
+ Frame {
+ msec: 1984
+ hash: "cef9f8e8cdd5e2d33b86a9a6fb64ecb4"
+ }
+ Frame {
+ msec: 2000
+ hash: "2a8956de5ce417431bdb156144985370"
+ }
+ Frame {
+ msec: 2016
+ hash: "73721425a9c658bd9d40eac3fcbe8e25"
+ }
+ Frame {
+ msec: 2032
+ hash: "9a9cf8eee0bf2f09944a4fb3b1c139d5"
+ }
+ Frame {
+ msec: 2048
+ hash: "3673cdee04343ce679ec2cebadc9f512"
+ }
+ Frame {
+ msec: 2064
+ hash: "eedd62019867e3189f9cf6e2b4149c6d"
+ }
+ Frame {
+ msec: 2080
+ hash: "7a66bc37f5cf917e8b121003af0530b0"
+ }
+ Frame {
+ msec: 2096
+ hash: "401667ed0f38858553de27164e9cadb5"
+ }
+ Frame {
+ msec: 2112
+ hash: "b391699437c4092de3ad1684a35bfd30"
+ }
+ Frame {
+ msec: 2128
+ hash: "109c91215f075292910095a25eaded49"
+ }
+ Frame {
+ msec: 2144
+ hash: "c44d3f6ce1fa1ab324dd9ef394f37f87"
+ }
+ Frame {
+ msec: 2160
+ hash: "299d43cb3dcf7b95af8803df3eb17a46"
+ }
+ Frame {
+ msec: 2176
+ hash: "7ddd97266383d954a008fbe7b95a3169"
+ }
+ Frame {
+ msec: 2192
+ hash: "941f2837ff5145a26df9a0d9f6d20bd9"
+ }
+ Frame {
+ msec: 2208
+ hash: "d99d76cba43f3ae953605d7732d6ce21"
+ }
+ Frame {
+ msec: 2224
+ hash: "929f49416f7ca80d7f5f2be3b13b849e"
+ }
+ Frame {
+ msec: 2240
+ hash: "929f49416f7ca80d7f5f2be3b13b849e"
+ }
+ Frame {
+ msec: 2256
+ hash: "fff9bbf16d1c3f7510ddfc44af616a5e"
+ }
+ Frame {
+ msec: 2272
+ hash: "70b6cdb95ad6723d18c623e1dc79a8db"
+ }
+ Frame {
+ msec: 2288
+ hash: "70b6cdb95ad6723d18c623e1dc79a8db"
+ }
+ Frame {
+ msec: 2304
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2320
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2336
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2352
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2368
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2384
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2400
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2416
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2432
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2448
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2464
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2480
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2496
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2512
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2528
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2544
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2560
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2576
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2592
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2608
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2624
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2640
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2656
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2672
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2688
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2704
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2720
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2736
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Mouse {
+ type: 2
+ button: 1
+ buttons: 1
+ x: 29; y: 239
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2752
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2768
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2784
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2800
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Frame {
+ msec: 2816
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 35; y: 241
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2832
+ hash: "cdb3c12b1b0b6ab269ba7fcf75320f69"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 63; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2848
+ hash: "2732b282b8ac482033694cd04c6f5b7e"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 106; y: 244
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2864
+ hash: "7d253797885f8b304d8fb3ba727a3c5d"
+ }
+ Mouse {
+ type: 5
+ button: 0
+ buttons: 1
+ x: 158; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Mouse {
+ type: 3
+ button: 1
+ buttons: 0
+ x: 158; y: 243
+ modifiers: 0
+ sendToViewport: true
+ }
+ Frame {
+ msec: 2880
+ image: "qtbug10586.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "d85a416e4ddf59dfd0723b0be0e2b418"
+ }
+ Frame {
+ msec: 2912
+ hash: "f1934f6ca6a3c5ac5df3451596b8d8ba"
+ }
+ Frame {
+ msec: 2928
+ hash: "28fc74a76f9eaeeccbd3063dc55a1000"
+ }
+ Frame {
+ msec: 2944
+ hash: "eb8ad8dae734b624664fcf584cda6ba0"
+ }
+ Frame {
+ msec: 2960
+ hash: "a6d0f4aba3e5ae1e003520f45b75d6dd"
+ }
+ Frame {
+ msec: 2976
+ hash: "4e5a4d04dfa5f06292774e6bf4f86508"
+ }
+ Frame {
+ msec: 2992
+ hash: "fc9e16fd8c7379d774a09fe50d4259dc"
+ }
+ Frame {
+ msec: 3008
+ hash: "721ea322d9a5e9d48117336476f568cb"
+ }
+ Frame {
+ msec: 3024
+ hash: "5930448341bce1c50de7acaba1f64ca1"
+ }
+ Frame {
+ msec: 3040
+ hash: "7194bacd56906f83948844224ce6a3e7"
+ }
+ Frame {
+ msec: 3056
+ hash: "fcf11cf70b8ac210d4bb2bc716942053"
+ }
+ Frame {
+ msec: 3072
+ hash: "767d707db4dbb02b6f97153b3822a1d1"
+ }
+ Frame {
+ msec: 3088
+ hash: "f8eb75b97f5233aa82b887aab34a38e3"
+ }
+ Frame {
+ msec: 3104
+ hash: "1d3beb06b39fa1d5cabd31ec4297f59f"
+ }
+ Frame {
+ msec: 3120
+ hash: "cadc775e0764afa7b50c5bab782035dd"
+ }
+ Frame {
+ msec: 3136
+ hash: "385f5a6e80da0d3ddf24539a64f26eb9"
+ }
+ Frame {
+ msec: 3152
+ hash: "34204871a684ea251c9d07fb125436da"
+ }
+ Frame {
+ msec: 3168
+ hash: "bc3e496535e66ff0d1e800092b7c78ca"
+ }
+ Frame {
+ msec: 3184
+ hash: "d6c4ff5bf223361be42c78d6d81248c3"
+ }
+ Frame {
+ msec: 3200
+ hash: "cb09d41612df66a8d099153026adcbf3"
+ }
+ Frame {
+ msec: 3216
+ hash: "f82180b8c0389ddc3623107a049c3366"
+ }
+ Frame {
+ msec: 3232
+ hash: "1b0f65e4599c65b8a603abd8da718d48"
+ }
+ Frame {
+ msec: 3248
+ hash: "897391a8206178356858139b3d1a4ce8"
+ }
+ Frame {
+ msec: 3264
+ hash: "b66d268dc7a42a7b1172b1ff566f4eb8"
+ }
+ Frame {
+ msec: 3280
+ hash: "0fe5d38a253dbd1ebcc67cca7ea86dc7"
+ }
+ Frame {
+ msec: 3296
+ hash: "b788f8a7e1e42f768fd1fe1198ca0344"
+ }
+ Frame {
+ msec: 3312
+ hash: "4f7f8b7f5bb78bb9327b6fa8142ce3a2"
+ }
+ Frame {
+ msec: 3328
+ hash: "30f041278c08174671568a0dfb7cbdf7"
+ }
+ Frame {
+ msec: 3344
+ hash: "6ecd90fc89ab9b6c4813fa6a6e9dffdb"
+ }
+ Frame {
+ msec: 3360
+ hash: "6ecd90fc89ab9b6c4813fa6a6e9dffdb"
+ }
+ Frame {
+ msec: 3376
+ hash: "6d79d9d0ba8da0b5654b39768b25591f"
+ }
+ Frame {
+ msec: 3392
+ hash: "6d79d9d0ba8da0b5654b39768b25591f"
+ }
+ Frame {
+ msec: 3408
+ hash: "6d79d9d0ba8da0b5654b39768b25591f"
+ }
+ Frame {
+ msec: 3424
+ hash: "6d79d9d0ba8da0b5654b39768b25591f"
+ }
+ Frame {
+ msec: 3440
+ hash: "6d79d9d0ba8da0b5654b39768b25591f"
+ }
+ Frame {
+ msec: 3456
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3472
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3488
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3504
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3520
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3536
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3552
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3568
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3584
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3600
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3616
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3632
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3648
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3664
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3680
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3696
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3712
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3728
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3744
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3760
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3776
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3792
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3808
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3824
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3840
+ image: "qtbug10586.3.png"
+ }
+ Frame {
+ msec: 3856
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3872
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3888
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3904
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3920
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3936
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3952
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3968
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 3984
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4000
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4016
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4032
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4048
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4064
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Key {
+ type: 6
+ key: 16777249
+ modifiers: 67108864
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 4080
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4096
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4112
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4128
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4144
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4160
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4176
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+ Frame {
+ msec: 4192
+ hash: "cba9afe3f351e6cd6dc72d7f263401b0"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml b/tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml
new file mode 100644
index 0000000..f1a3ef7
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/animation/qtbug10586/qtbug10586.qml
@@ -0,0 +1,27 @@
+import Qt 4.7
+
+Rectangle {
+ width: 200
+ height: 400
+ Flickable {
+ id: flick
+ anchors.fill: parent
+ contentWidth: 1000; contentHeight: parent.height
+ Rectangle {
+ border.color: "black"
+ border.width: 10
+ width: 1000; height: 1000
+ rotation: 90
+ gradient: Gradient {
+ GradientStop { position: 0; color: "black" }
+ GradientStop { position: 1; color: "white" }
+ }
+ }
+ }
+ Rectangle {
+ color: "red"
+ width: 100; height: 100
+ y: flick.contentX < 10 ? 300 : 0
+ Behavior on y { NumberAnimation {} }
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml
index a0b787f..e223f5e 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml
+++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml
@@ -25,7 +25,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onPressed: blue.color = "lightsteelblue"
- onReleased: blue.color = "steelblue"
+ onCanceled: blue.color = "steelblue"
}
}
Rectangle {
@@ -36,7 +36,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onEntered: { red.color = "darkred"; tooltip.opacity = 1 }
- onExited: { red.color = "red"; tooltip.opacity = 0 }
+ onCanceled: { red.color = "red"; tooltip.opacity = 0 }
}
Rectangle {
id: tooltip
diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.0.png b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.0.png
deleted file mode 100644
index 1f28b9a..0000000
--- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.0.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml
deleted file mode 100644
index f4c4e29..0000000
--- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-import Qt.VisualTest 4.7
-
-VisualTest {
- Frame {
- msec: 0
- }
- Frame {
- msec: 16
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 32
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 48
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 64
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 80
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 96
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 112
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 128
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 144
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 160
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 176
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 192
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 208
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 224
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 240
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 256
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 272
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 288
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
- Frame {
- msec: 304
- hash: "0c70d855adc847fe33d7959ccb98bb8b"
- }
-}
diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.0.png b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.0.png
deleted file mode 100644
index 1f28b9a..0000000
--- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.0.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml
deleted file mode 100644
index 273c2b0..0000000
--- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-import Qt.VisualTest 4.7
-
-VisualTest {
- Frame {
- msec: 0
- }
- Frame {
- msec: 16
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 32
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 48
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 64
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 80
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 96
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 112
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 128
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 144
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 160
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 176
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 192
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 208
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 224
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 240
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 256
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 272
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 288
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
- Frame {
- msec: 304
- hash: "66539e1b1983d95386b0d30d6e969904"
- }
-}
diff --git a/tests/auto/declarative/qmlvisual/qmlvisual.pro b/tests/auto/declarative/qmlvisual/qmlvisual.pro
index a3abbe3..dca9b04 100644
--- a/tests/auto/declarative/qmlvisual/qmlvisual.pro
+++ b/tests/auto/declarative/qmlvisual/qmlvisual.pro
@@ -4,7 +4,34 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qmlvisual.cpp
-DEFINES += QT_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
+symbian: {
+ importFiles.path =
+ importFiles.sources = animation \
+ fillmode \
+ focusscope \
+ ListView \
+ qdeclarativeborderimage \
+ qdeclarativeflickable \
+ qdeclarativeflipable \
+ qdeclarativegridview \
+ qdeclarativemousearea \
+ qdeclarativeparticles \
+ qdeclarativepathview \
+ qdeclarativepositioners \
+ qdeclarativesmoothedanimation \
+ qdeclarativespringfollow \
+ qdeclarativetext \
+ qdeclarativetextedit \
+ qdeclarativetextinput \
+ rect \
+ repeater \
+ selftest_noimages \
+ webview
+ DEPLOYMENT = importFiles
+
+ DEFINES += QT_TEST_SOURCE_DIR=\".\"
+} else {
+ DEFINES += QT_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
+}
CONFIG += parallel_test
-
diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
index 5f25882..4aad29b 100644
--- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
+++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
@@ -82,7 +82,7 @@ QString tst_qmlvisual::viewer()
#if defined(Q_WS_MAC)
qmlruntime = QDir(binaries).absoluteFilePath("qml.app/Contents/MacOS/qml");
-#elif defined(Q_WS_WIN)
+#elif defined(Q_WS_WIN) || defined(Q_WS_S60)
qmlruntime = QDir(binaries).absoluteFilePath("qml.exe");
#else
qmlruntime = QDir(binaries).absoluteFilePath("qml");
@@ -101,9 +101,8 @@ void tst_qmlvisual::visual_data()
files << findQmlFiles(QDir(QT_TEST_SOURCE_DIR));
else {
//these are newly added tests we want to try out in CI (then move to the stable list)
- files << QT_TEST_SOURCE_DIR "/qdeclarativeborderimage/borders.qml";
+ files << QT_TEST_SOURCE_DIR "/animation/qtbug10586/qtbug10586.qml";
files << QT_TEST_SOURCE_DIR "/qdeclarativeborderimage/animated.qml";
- files << QT_TEST_SOURCE_DIR "/qdeclarativeborderimage/animated-smooth.qml";
files << QT_TEST_SOURCE_DIR "/qdeclarativeflipable/test-flipable.qml";
files << QT_TEST_SOURCE_DIR "/qdeclarativepositioners/usingRepeater.qml";
@@ -123,6 +122,8 @@ void tst_qmlvisual::visual_data()
//these reliably fail in CI, for unknown reasons
//files << QT_TEST_SOURCE_DIR "/animation/easing/easing.qml";
//files << QT_TEST_SOURCE_DIR "/animation/pauseAnimation/pauseAnimation-visual.qml";
+ //files << QT_TEST_SOURCE_DIR "/qdeclarativeborderimage/borders.qml";
+ //files << QT_TEST_SOURCE_DIR "/qdeclarativeborderimage/animated-smooth.qml";
//these reliably fail on Linux because of color interpolation (different float rounding)
#if !defined(Q_WS_X11) && !defined(Q_WS_QWS)
diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml b/tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml
index c4a502e..c4a502e 100644
--- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/autosize.qml
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.png b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.qml b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.qml
new file mode 100644
index 0000000..6122138
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data-X11/autosize.qml
@@ -0,0 +1,115 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b2d863e57dee2a297d038e18acc70f92"
+ }
+ Frame {
+ msec: 32
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 48
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 64
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 80
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 96
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 112
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 128
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 144
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 160
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 176
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 192
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 208
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 224
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 240
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 256
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 272
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 288
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 304
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 320
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 336
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 352
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 368
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 384
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 400
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 416
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 432
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.0.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.1.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.2.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.3.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.png b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.png
new file mode 100644
index 0000000..ed87174
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.4.png
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml
new file mode 100644
index 0000000..6122138
--- /dev/null
+++ b/tests/auto/declarative/qmlvisual/webview/autosize/data/autosize.qml
@@ -0,0 +1,115 @@
+import Qt.VisualTest 4.7
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b2d863e57dee2a297d038e18acc70f92"
+ }
+ Frame {
+ msec: 32
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 48
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 64
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 80
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 96
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 112
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 128
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 144
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 160
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 176
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 192
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 208
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 224
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 240
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 256
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 272
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 288
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 304
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 320
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 336
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 352
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 368
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 384
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 400
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 416
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+ Frame {
+ msec: 432
+ hash: "903a4c7e619abba5342c8c827f26a722"
+ }
+}
diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.0.png b/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.0.png
deleted file mode 100644
index 57de710..0000000
--- a/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.0.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml b/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml
deleted file mode 100644
index 9664566..0000000
--- a/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml
+++ /dev/null
@@ -1,363 +0,0 @@
-import Qt.VisualTest 4.7
-
-VisualTest {
- Frame {
- msec: 0
- }
- Frame {
- msec: 16
- hash: "5dc8dca7a73022fbf2116b654b709244"
- }
- Frame {
- msec: 32
- hash: "5dc8dca7a73022fbf2116b654b709244"
- }
- Frame {
- msec: 48
- hash: "34079c4076ab6aadd8b64fcba7d95e15"
- }
- Frame {
- msec: 64
- hash: "5ab5fc62b49e78d0609dcb4be6c9a157"
- }
- Frame {
- msec: 80
- hash: "063cc7438bbffae717648d98006021a8"
- }
- Frame {
- msec: 96
- hash: "c5cd16663e48639cbeade82c3bfa0403"
- }
- Frame {
- msec: 112
- hash: "ea7f8df84ddbad0f683fe97ddb0a0130"
- }
- Frame {
- msec: 128
- hash: "3c353e09bdb3a1e6ff388ad6020f55ea"
- }
- Frame {
- msec: 144
- hash: "5b6de430365d0c9824337011916b0c0b"
- }
- Frame {
- msec: 160
- hash: "48d353ac9e7ee1ce41361d0a2b47e008"
- }
- Frame {
- msec: 176
- hash: "c96e4d02d343ddd78e8d3dd6aa8e0198"
- }
- Frame {
- msec: 192
- hash: "543c63d77ec635b77672ba4c5160a3d4"
- }
- Frame {
- msec: 208
- hash: "2d56ad9c2352e555fef613d625e71151"
- }
- Frame {
- msec: 224
- hash: "18e433c3e3ee64510f875f674791d51c"
- }
- Frame {
- msec: 240
- hash: "56889122c1ddacdd8ebd88310c7410bc"
- }
- Frame {
- msec: 256
- hash: "d51c85458e0109bd5bf9528b741d98d0"
- }
- Frame {
- msec: 272
- hash: "ac54137afc29a3022c6f01df7cdf2fd6"
- }
- Frame {
- msec: 288
- hash: "c7a42b389bae3b729ba9e6cba7f54530"
- }
- Frame {
- msec: 304
- hash: "7583b55841e80891652c3472c658f989"
- }
- Frame {
- msec: 320
- hash: "95a7f8d47c3788261427727f82c9ff59"
- }
- Frame {
- msec: 336
- hash: "a87bad3e2f010680e16cd1e3f5e03e99"
- }
- Frame {
- msec: 352
- hash: "e16bc51653f21819e0eec412b99a069f"
- }
- Frame {
- msec: 368
- hash: "f1e869580ac148ae207141c5f0adc185"
- }
- Frame {
- msec: 384
- hash: "7e496e44363a16d7c62e4258af9ce087"
- }
- Frame {
- msec: 400
- hash: "19e97915c84d3554c66d5a9ad3aa6a3e"
- }
- Frame {
- msec: 416
- hash: "181181b48a1085d1850f18ca9b163549"
- }
- Frame {
- msec: 432
- hash: "4637cb04595a543867bd43b0c1c829ea"
- }
- Frame {
- msec: 448
- hash: "bd0a074fed5507f8556de6110bf56aa4"
- }
- Frame {
- msec: 464
- hash: "9547618923edac6f7f9a3ff324c4f2d8"
- }
- Frame {
- msec: 480
- hash: "a2f90c88eacb7c66878d45e33c2a787d"
- }
- Frame {
- msec: 496
- hash: "d5ffd3e35d0426887c106069310f84d8"
- }
- Frame {
- msec: 512
- hash: "6bc50a5b76e2a2ef0e6bee762abeb330"
- }
- Frame {
- msec: 528
- hash: "d4439933c842ed8432434d272fea2845"
- }
- Frame {
- msec: 544
- hash: "61699e6ec476ac3f090e4f485430421d"
- }
- Frame {
- msec: 560
- hash: "02d7fa9bcd697d2cab364d0a3ca4a0e2"
- }
- Frame {
- msec: 576
- hash: "914178cbf1f6a6822cc40f81823475e4"
- }
- Frame {
- msec: 592
- hash: "280f867ea27891ee764332998567d40d"
- }
- Frame {
- msec: 608
- hash: "ea0d00fe54a172a89c24eac781f7ae6d"
- }
- Frame {
- msec: 624
- hash: "4e910fb507964a710e26f318c62227bf"
- }
- Frame {
- msec: 640
- hash: "b0c3392eb739f270dd21f552ad999c23"
- }
- Frame {
- msec: 656
- hash: "f3698c83b0972bd66a53ad95d4fc301e"
- }
- Frame {
- msec: 672
- hash: "0d303a0d6a9b626943ac93cc6f3fb230"
- }
- Frame {
- msec: 688
- hash: "ba56d49e6f51aa6f1bd2a7500e3538fd"
- }
- Frame {
- msec: 704
- hash: "273ce89d5194168e5bfd1dcefad49be2"
- }
- Frame {
- msec: 720
- hash: "c2beef4fb7996dbccdaff4f54bdc33f1"
- }
- Frame {
- msec: 736
- hash: "1e1aa7d84f27158a8e61bd8698ddbf2a"
- }
- Frame {
- msec: 752
- hash: "24e82479802e710c673133ca0413be66"
- }
- Frame {
- msec: 768
- hash: "b77e935a690bcb396e15b942d772cf1b"
- }
- Frame {
- msec: 784
- hash: "7b729c74df1d15d6b0e8e1fc19c2d710"
- }
- Frame {
- msec: 800
- hash: "fd6cbdca3e481baaf35022dfea76e74c"
- }
- Frame {
- msec: 816
- hash: "c975f6eb592793aa81895ffcb74ca577"
- }
- Frame {
- msec: 832
- hash: "677c4039a650df53b4e885f37b049ab3"
- }
- Frame {
- msec: 848
- hash: "89563aae36552cb1749ec06567e46d9d"
- }
- Frame {
- msec: 864
- hash: "01f57402874de6608cc02937aaf91794"
- }
- Frame {
- msec: 880
- hash: "50c9c4e5eaaadee1ff230975390d34e3"
- }
- Frame {
- msec: 896
- hash: "20b7d277d398afad59afdf9e6b41a57e"
- }
- Frame {
- msec: 912
- hash: "8f9ea938a2375afeba419199de66dd52"
- }
- Frame {
- msec: 928
- hash: "b96745888ba954bcf304c0840a030f93"
- }
- Frame {
- msec: 944
- hash: "f5715e931274011123160f7ad10d6c52"
- }
- Frame {
- msec: 960
- image: "nesting.0.png"
- }
- Frame {
- msec: 976
- hash: "459fe967816c795a177a3926093fae75"
- }
- Frame {
- msec: 992
- hash: "c599a26083068b6db628c8d8416bab60"
- }
- Frame {
- msec: 1008
- hash: "e0aee7d1152c971b1beee9d36542acb7"
- }
- Frame {
- msec: 1024
- hash: "2af0facdf6412f7b06979aae25e4db26"
- }
- Frame {
- msec: 1040
- hash: "f147a92cb1826f95d4fdb7d011ba79b1"
- }
- Frame {
- msec: 1056
- hash: "12a1cb894b0fb8e44152cccacf855c1a"
- }
- Frame {
- msec: 1072
- hash: "c7500cf58b74fef2c3e9820d1de8f843"
- }
- Frame {
- msec: 1088
- hash: "3a031b2206835f8b2dc9837016df6ae6"
- }
- Frame {
- msec: 1104
- hash: "7a4796b419bbc04237764dea0b1d47d5"
- }
- Frame {
- msec: 1120
- hash: "151d350f0064e2faf0bfb9c58bc3e4f2"
- }
- Frame {
- msec: 1136
- hash: "d72c20a97e678908acc1d6c1f8114d9e"
- }
- Frame {
- msec: 1152
- hash: "22da1e645640a3c31b064ff757113197"
- }
- Frame {
- msec: 1168
- hash: "401f0bf370e2ecea5a84276fb72eb1da"
- }
- Frame {
- msec: 1184
- hash: "c6e00d7b0ac14a5c3860b6a29901c915"
- }
- Frame {
- msec: 1200
- hash: "f1f7dc55d7719fcb6e97157c0ca85fc0"
- }
- Frame {
- msec: 1216
- hash: "6a112e1d79c7128c235d093e4f1f9325"
- }
- Frame {
- msec: 1232
- hash: "14a2caf8cdca8d5147261a315059b69d"
- }
- Frame {
- msec: 1248
- hash: "5645243aa3cfd12b0b32442f063bedb2"
- }
- Frame {
- msec: 1264
- hash: "c7f72534a88e33c72a54cb8580534551"
- }
- Frame {
- msec: 1280
- hash: "6cd5e2e8e0128586a682b3c649ae0631"
- }
- Frame {
- msec: 1296
- hash: "67cefb4526b52d40a31811bc0dfaeb6a"
- }
- Frame {
- msec: 1312
- hash: "fbe2a43a27bf490719c8b9e2b094e34f"
- }
- Frame {
- msec: 1328
- hash: "e028aad6f51a47d8189efcf9c5d277ee"
- }
- Frame {
- msec: 1344
- hash: "2b4cc50c37c07289fa6f9309991d36da"
- }
- Frame {
- msec: 1360
- hash: "b67b2244cd0616d07e100d7b3b00bbe2"
- }
- Frame {
- msec: 1376
- hash: "4e4690cffc98c49e91bdb600f1e94c79"
- }
- Frame {
- msec: 1392
- hash: "e5215c727836a5547a170d42363bc5c8"
- }
- Frame {
- msec: 1408
- hash: "26868e91d1794bb3f42d51f508fef613"
- }
- Frame {
- msec: 1424
- hash: "1e5f431b125a66096ac9a4d5a211a2c4"
- }
-}
diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml b/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml
deleted file mode 100644
index c569c9a..0000000
--- a/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml
+++ /dev/null
@@ -1,26 +0,0 @@
-import Qt 4.7
-
-Item {
- property variant period : 250
- property variant color : "black"
- id: root
-
- Item {
- x: root.width/2
- y: root.height/2
- Rectangle {
- radius: width/2
- color: root.color
- x: -width/2
- y: -height/2
- width: root.width*1.5
- height: root.height*1.5
- }
- rotation: NumberAnimation {
- from: 0
- to: 360
- repeat: true
- duration: root.period
- }
- }
-}
diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/nesting.html b/tests/auto/declarative/qmlvisual/webview/embedding/nesting.html
deleted file mode 100644
index 6e81689..0000000
--- a/tests/auto/declarative/qmlvisual/webview/embedding/nesting.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-<head><title>Nesting</title>
-<link rel="icon" sizes="48x48" href="basic.png">
-</head>
-<body bgcolor="green">
-<h1>Nesting</h1>
-This is a test...
-<OBJECT data=egg.qml TYPE=application/x-qt-plugin width=50 height=70 period=2000 color=white></OBJECT>
-... with a spinning QML egg nested in it.
diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml b/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml
deleted file mode 100644
index 9e008de..0000000
--- a/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import Qt 4.7
-import org.webkit 1.0
-
-WebView {
- width: 300
- height: 200
- url: "nesting.html"
- settings.pluginsEnabled: true
-}
diff --git a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
index b8e317e..7d34698 100644
--- a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
+++ b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp
@@ -225,7 +225,7 @@ void tst_QPacketProtocol::read()
void tst_QPacketProtocol::device()
{
QPacketProtocol p(m_client);
- QCOMPARE(p.device(), m_client);
+ QVERIFY(p.device() == m_client);
}
void tst_QPacketProtocol::tst_QPacket_clear()
diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp
index f8ecca3..dfadf48 100644
--- a/tests/auto/gestures/tst_gestures.cpp
+++ b/tests/auto/gestures/tst_gestures.cpp
@@ -50,6 +50,7 @@
#include <qgesturerecognizer.h>
#include <qgraphicsitem.h>
#include <qgraphicsview.h>
+#include <qmainwindow.h>
#include <qdebug.h>
@@ -355,6 +356,7 @@ private slots:
void deleteGestureTargetItem();
void viewportCoordinates();
void partialGesturePropagation();
+ void testQGestureRecognizerCleanup();
};
tst_Gestures::tst_Gestures()
@@ -1949,5 +1951,74 @@ void tst_Gestures::partialGesturePropagation()
QCOMPARE(item4->gestureEventsReceived, 0);
}
+class WinNativePan : public QPanGesture {
+public:
+ WinNativePan() {}
+};
+
+class Pan : public QPanGesture {
+public:
+ Pan() {}
+};
+
+class CustomPan : public QPanGesture {
+public:
+ CustomPan() {}
+};
+
+// Recognizer for active gesture triggers on mouse press
+class PanRecognizer : public QGestureRecognizer {
+public:
+ enum PanType { Platform, Default, Custom };
+
+ PanRecognizer(int id) : m_id(id) {}
+ QGesture *create(QObject *) {
+ switch(m_id) {
+ case Platform: return new WinNativePan();
+ case Default: return new Pan();
+ default: return new CustomPan();
+ }
+ }
+
+ Result recognize(QGesture *, QObject *, QEvent *) { return QGestureRecognizer::Ignore; }
+
+ const int m_id;
+};
+
+void tst_Gestures::testQGestureRecognizerCleanup()
+{
+ // Clean first the current recognizers in QGManager
+ QGestureRecognizer::unregisterRecognizer(Qt::PanGesture);
+
+ // v-- Qt singleton QGManager initialization
+
+ // Mimic QGestureManager: register both default and "platform" recognizers
+ // (this is done in windows when QT_NO_NATIVE_GESTURES is not defined)
+ PanRecognizer *def = new PanRecognizer(PanRecognizer::Default);
+ QGestureRecognizer::registerRecognizer(def);
+ PanRecognizer *plt = new PanRecognizer(PanRecognizer::Platform);
+ QGestureRecognizer::registerRecognizer(plt);
+ qDebug () << "register: default =" << def << "; platform =" << plt;
+
+ // ^-- Qt singleton QGManager initialization
+
+ // Here, application code would start
+
+ // Create QGV (has a QAScrollArea, which uses Qt::PanGesture)
+ QMainWindow *w = new QMainWindow;
+ QGraphicsView *v = new QGraphicsView();
+ w->setCentralWidget(v);
+
+ // Unregister Qt recognizers
+ QGestureRecognizer::unregisterRecognizer(Qt::PanGesture);
+
+ // Register a custom Pan recognizer
+ //QGestureRecognizer::registerRecognizer(new PanRecognizer(PanRecognizer::Custom));
+
+ w->show();
+ QTest::qWaitForWindowShown(w);
+ delete w;
+}
+
QTEST_MAIN(tst_Gestures)
#include "tst_gestures.moc"
diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp
index d04707e..bcc3be4 100644
--- a/tests/auto/languagechange/tst_languagechange.cpp
+++ b/tests/auto/languagechange/tst_languagechange.cpp
@@ -238,8 +238,8 @@ void tst_languageChange::retranslatability()
QString fooName = tmpParentDir + "/foo";
QDir dir;
QCOMPARE(dir.mkpath(tmpDir), true);
-#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86)
- // Just create a new file instead of copying exe, because exe is not there in emulator
+#if defined(Q_OS_SYMBIAN)
+ // Just create a new file instead of copying exe, because there is no read access to /sys/bin
{
QFile fooFile(fooName);
QVERIFY(fooFile.open(QIODevice::WriteOnly | QIODevice::Text));
diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
index a57c56f..2e2577d 100644
--- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
+++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro
@@ -9,3 +9,4 @@ wince*|symbian: {
DEPLOYMENT += testFiles
}
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qabstractsocket/qabstractsocket.pro b/tests/auto/qabstractsocket/qabstractsocket.pro
index 59999af..814a7d2 100644
--- a/tests/auto/qabstractsocket/qabstractsocket.pro
+++ b/tests/auto/qabstractsocket/qabstractsocket.pro
@@ -7,4 +7,5 @@ QT = core network
SOURCES += tst_qabstractsocket.cpp
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qbuffer/tst_qbuffer.cpp b/tests/auto/qbuffer/tst_qbuffer.cpp
index fcef6a3..dd5ca91 100644
--- a/tests/auto/qbuffer/tst_qbuffer.cpp
+++ b/tests/auto/qbuffer/tst_qbuffer.cpp
@@ -76,6 +76,7 @@ private slots:
void atEnd();
void readLineBoundaries();
void writeAfterQByteArrayResize();
+ void read_null();
protected slots:
void readyReadSlot();
@@ -529,5 +530,30 @@ void tst_QBuffer::writeAfterQByteArrayResize()
QCOMPARE(buffer.buffer().size(), 1000);
}
+void tst_QBuffer::read_null()
+{
+ QByteArray buffer;
+ buffer.resize(32000);
+ for (int i = 0; i < buffer.size(); ++i)
+ buffer[i] = char(i & 0xff);
+
+ QBuffer in(&buffer);
+ in.open(QIODevice::ReadOnly);
+
+ QByteArray chunk;
+
+ chunk.resize(16380);
+ in.read(chunk.data(), 16380);
+
+ QCOMPARE(chunk, buffer.mid(0, chunk.size()));
+
+ in.read(chunk.data(), 0);
+
+ chunk.resize(8);
+ in.read(chunk.data(), chunk.size());
+
+ QCOMPARE(chunk, buffer.mid(16380, chunk.size()));
+}
+
QTEST_MAIN(tst_QBuffer)
#include "tst_qbuffer.moc"
diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp
index 90f499d..1da8c5d 100644
--- a/tests/auto/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp
@@ -596,11 +596,11 @@ void tst_QColumnView::clicked()
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, localPoint);
QCOMPARE(clickedSpy.count(), 1);
qApp->processEvents();
-
+
if (sizeof(qreal) != sizeof(double)) {
QSKIP("Skipped due to rounding errors", SkipAll);
}
-
+
for (int i = 0; i < view.createdColumns.count(); ++i) {
QAbstractItemView *column = view.createdColumns.at(i);
if (column && column->selectionModel() && (column->rootIndex() == home))
@@ -961,9 +961,9 @@ void tst_QColumnView::parentCurrentIndex()
QVERIFY(third.isValid());
view.setCurrentIndex(third);
QTest::qWait(ANIMATION_DELAY);
- QCOMPARE(view.createdColumns[0]->currentIndex(), first);
- QCOMPARE(view.createdColumns[1]->currentIndex(), second);
- QCOMPARE(view.createdColumns[2]->currentIndex(), third);
+ QTRY_COMPARE(view.createdColumns[0]->currentIndex(), first);
+ QTRY_COMPARE(view.createdColumns[1]->currentIndex(), second);
+ QTRY_COMPARE(view.createdColumns[2]->currentIndex(), third);
first = model.index(0, 0, QModelIndex());
second = model.index(secondRow, 0, first);
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 6aca996..47c54a5 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -106,6 +106,8 @@ private slots:
void daysTo();
void secsTo_data();
void secsTo();
+ void msecsTo_data();
+ void msecsTo();
void operator_eqeq();
void currentDateTime();
void currentDateTimeUtc();
@@ -910,6 +912,30 @@ void tst_QDateTime::secsTo()
QVERIFY((dt >= result) == (0 >= nsecs));
}
+void tst_QDateTime::msecsTo_data()
+{
+ addMSecs_data();
+}
+
+void tst_QDateTime::msecsTo()
+{
+ QFETCH(QDateTime, dt);
+ QFETCH(int, nsecs);
+ QFETCH(QDateTime, result);
+
+#ifdef Q_OS_IRIX
+ QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
+#endif
+ QCOMPARE(dt.msecsTo(result), qint64(nsecs) * 1000);
+ QCOMPARE(result.msecsTo(dt), -qint64(nsecs) * 1000);
+ QVERIFY((dt == result) == (0 == (qint64(nsecs) * 1000)));
+ QVERIFY((dt != result) == (0 != (qint64(nsecs) * 1000)));
+ QVERIFY((dt < result) == (0 < (qint64(nsecs) * 1000)));
+ QVERIFY((dt <= result) == (0 <= (qint64(nsecs) * 1000)));
+ QVERIFY((dt > result) == (0 > (qint64(nsecs) * 1000)));
+ QVERIFY((dt >= result) == (0 >= (qint64(nsecs) * 1000)));
+}
+
void tst_QDateTime::currentDateTime()
{
#if defined(Q_OS_WINCE)
diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp
index 1bc5b7f..41bbd87 100644
--- a/tests/auto/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp
@@ -613,6 +613,11 @@ void tst_QDirModel::task196768_sorting()
//this task showed that the persistent model indexes got corrupted when sorting
QString path = SRCDIR;
+#ifdef Q_OS_SYMBIAN
+ if(!RProcess().HasCapability(ECapabilityAllFiles))
+ QEXPECT_FAIL("", "QTBUG-9746", Continue);
+#endif
+
QDirModel model;
/* QDirModel has a bug if we show the content of the subdirectory inside a hidden directory
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp
index a734985..2059101 100644
--- a/tests/auto/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp
@@ -96,6 +96,7 @@ private slots:
void task248604_infiniteResize();
void task258459_visibilityChanged();
void taskQTBUG_1665_closableChanged();
+ void taskQTBUG_9758_undockedGeometry();
};
// Testing get/set functions
@@ -653,7 +654,7 @@ void tst_QDockWidget::dockLocationChanged()
QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
Qt::TopDockWidgetArea);
spy.clear();
-
+
dw.setFloating(true);
QTest::qWait(100);
dw.setFloating(false);
@@ -878,6 +879,27 @@ void tst_QDockWidget::taskQTBUG_1665_closableChanged()
QVERIFY(!(dock.windowFlags() & Qt::WindowCloseButtonHint));
}
+void tst_QDockWidget::taskQTBUG_9758_undockedGeometry()
+{
+ QMainWindow window;
+ QDockWidget dock1(&window);
+ QDockWidget dock2(&window);
+ window.addDockWidget(Qt::RightDockWidgetArea, &dock1);
+ window.addDockWidget(Qt::RightDockWidgetArea, &dock2);
+ window.tabifyDockWidget(&dock1, &dock2);
+ dock1.hide();
+ dock2.hide();
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+ dock1.setFloating(true);
+ dock1.show();
+ QTest::qWaitForWindowShown(&dock1);
+
+ QVERIFY(dock1.x() >= 0);
+ QVERIFY(dock1.y() >= 0);
+}
+
+
QTEST_MAIN(tst_QDockWidget)
#include "tst_qdockwidget.moc"
diff --git a/tests/auto/qfile/largefile/tst_largefile.cpp b/tests/auto/qfile/largefile/tst_largefile.cpp
index 041e5f2..60c5f89 100644
--- a/tests/auto/qfile/largefile/tst_largefile.cpp
+++ b/tests/auto/qfile/largefile/tst_largefile.cpp
@@ -523,6 +523,10 @@ void tst_LargeFile::mapFile()
void tst_LargeFile::mapOffsetOverflow()
{
+#if defined(Q_OS_MAC)
+ QSKIP("mmap'ping beyond EOF may succeed; generate bus error on access", SkipAll);
+#endif
+
// Out-of-range mappings should fail, and not silently clip the offset
for (int i = 50; i < 63; ++i) {
uchar *address = 0;
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 38a1ee7..ca7c445 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -529,10 +529,6 @@ void tst_QFiledialog::completer()
#endif
++expected;
}
-#if !defined(Q_OS_WIN)
- if (inputStartsWithRootPath)
- expected++;
-#endif
}
QTest::qWait(1000);
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
index 6bfa8be..eee495f 100644
--- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
@@ -76,6 +76,13 @@
# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
#endif
+#if defined QT_BUILD_INTERNAL
+QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT bool qt_test_isFetchedRoot();
+Q_GUI_EXPORT void qt_test_resetFetchedRoot();
+QT_END_NAMESPACE
+#endif
+
class QNonNativeFileDialog : public QFileDialog
{
Q_OBJECT
@@ -139,7 +146,7 @@ private:
};
tst_QFileDialog2::tst_QFileDialog2()
-{
+{
#if defined(Q_OS_WINCE)
qApp->setAutoMaximizeThreshold(-1);
#endif
@@ -177,19 +184,18 @@ void tst_QFileDialog2::listRoot()
QFileInfoGatherer fileInfoGatherer;
fileInfoGatherer.start();
QTest::qWait(1500);
-
- QFileInfoGatherer::fetchedRoot = false;
+ qt_test_resetFetchedRoot();
QString dir(QDir::currentPath());
QNonNativeFileDialog fd(0, QString(), dir);
fd.show();
- QCOMPARE(QFileInfoGatherer::fetchedRoot,false);
+ QCOMPARE(qt_test_isFetchedRoot(),false);
fd.setDirectory("");
#ifdef Q_OS_WINCE
QTest::qWait(1500);
#else
QTest::qWait(500);
#endif
- QCOMPARE(QFileInfoGatherer::fetchedRoot,true);
+ QCOMPARE(qt_test_isFetchedRoot(),true);
#endif
}
diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro
index c060296..33d479a 100644
--- a/tests/auto/qftp/qftp.pro
+++ b/tests/auto/qftp/qftp.pro
@@ -14,6 +14,7 @@ wince*: {
addFiles.path = .
DEPLOYMENT += addFiles
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
+ TARGET.CAPABILITY = NetworkServices
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 81097be..5a5a821 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -45,6 +45,7 @@
#include <private/qtextcontrol_p.h>
#include <private/qgraphicsitem_p.h>
#include <private/qgraphicsview_p.h>
+#include <private/qgraphicsscene_p.h>
#include <QStyleOptionGraphicsItem>
#include <QAbstractTextDocumentLayout>
#include <QBitmap>
@@ -447,6 +448,7 @@ private slots:
void QT_2649_focusScope();
void sortItemsWhileAdding();
void doNotMarkFullUpdateIfNotInScene();
+ void itemDiesDuringDraggingOperation();
private:
QList<QGraphicsItem *> paintedItems;
@@ -10484,5 +10486,27 @@ void tst_QGraphicsItem::doNotMarkFullUpdateIfNotInScene()
QTRY_COMPARE(item3->painted, 3);
}
+void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QGraphicsRectItem *item = new QGraphicsRectItem(QRectF(0, 0, 100, 100));
+ item->setFlag(QGraphicsItem::ItemIsMovable);
+ item->setAcceptDrops(true);
+ scene.addItem(item);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+ QGraphicsSceneDragDropEvent dragEnter(QEvent::GraphicsSceneDragEnter);
+ dragEnter.setScenePos(item->boundingRect().center());
+ QApplication::sendEvent(&scene, &dragEnter);
+ QGraphicsSceneDragDropEvent event(QEvent::GraphicsSceneDragMove);
+ event.setScenePos(item->boundingRect().center());
+ QApplication::sendEvent(&scene, &event);
+ QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == item);
+ delete item;
+ QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == 0);
+}
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index d5f63d3..6cea834 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -3436,6 +3436,21 @@ void tst_QGraphicsProxyWidget::inputMethod()
qApp->sendEvent(proxy, &event);
QCOMPARE(lineEdit->inputMethodEvents, i);
}
+
+ scene.clear();
+ QGraphicsView view(&scene);
+ QWidget *w = new QWidget;
+ w->setLayout(new QVBoxLayout(w));
+ QLineEdit *lineEdit = new QLineEdit;
+ lineEdit->setEchoMode(QLineEdit::Password);
+ w->layout()->addWidget(lineEdit);
+ lineEdit->setAttribute(Qt::WA_InputMethodEnabled, true);
+ QGraphicsProxyWidget *proxy = scene.addWidget(w);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_VERIFY(!(proxy->flags() & QGraphicsItem::ItemAcceptsInputMethod));
+ lineEdit->setFocus();
+ QVERIFY((proxy->flags() & QGraphicsItem::ItemAcceptsInputMethod));
}
void tst_QGraphicsProxyWidget::clickFocus()
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 1df9a37..b8df7f6 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -218,6 +218,7 @@ private slots:
void update();
void update2_data();
void update2();
+ void update_ancestorClipsChildrenToShape();
void inputMethodSensitivity();
void inputContextReset();
void indirectPainting();
@@ -3758,6 +3759,62 @@ void tst_QGraphicsView::update2()
#endif
}
+void tst_QGraphicsView::update_ancestorClipsChildrenToShape()
+{
+ QGraphicsScene scene(-150, -150, 300, 300);
+
+ /*
+ Add three rects:
+
+ +------------------+
+ | child |
+ | +--------------+ |
+ | | parent | |
+ | | +-----------+ |
+ | | |grandParent| |
+ | | +-----------+ |
+ | +--------------+ |
+ +------------------+
+
+ ... where both the parent and the grand parent clips children to shape.
+ */
+ QApplication::processEvents(); // Get rid of pending update.
+
+ QGraphicsRectItem *grandParent = static_cast<QGraphicsRectItem *>(scene.addRect(0, 0, 50, 50));
+ grandParent->setBrush(Qt::black);
+ grandParent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+
+ QGraphicsRectItem *parent = static_cast<QGraphicsRectItem *>(scene.addRect(-50, -50, 100, 100));
+ parent->setBrush(QColor(0, 0, 255, 125));
+ parent->setParentItem(grandParent);
+ parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+
+ QGraphicsRectItem *child = static_cast<QGraphicsRectItem *>(scene.addRect(-100, -100, 200, 200));
+ child->setBrush(QColor(255, 0, 0, 125));
+ child->setParentItem(parent);
+
+ CustomView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_VERIFY(view.painted);
+
+ view.lastUpdateRegions.clear();
+ view.painted = false;
+
+ // Call child->update() and make sure the updated area is within the ancestors' clip.
+ QRectF expected = child->deviceTransform(view.viewportTransform()).mapRect(child->boundingRect());
+ expected &= grandParent->deviceTransform(view.viewportTransform()).mapRect(grandParent->boundingRect());
+
+ child->update();
+ QTRY_VERIFY(view.painted);
+
+#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions
+ QTRY_VERIFY(view.painted);
+ QCOMPARE(view.lastUpdateRegions.size(), 1);
+ QCOMPARE(view.lastUpdateRegions.at(0), QRegion(expected.toAlignedRect()));
+#endif
+}
+
class FocusItem : public QGraphicsRectItem
{
public:
diff --git a/tests/auto/qhostaddress/qhostaddress.pro b/tests/auto/qhostaddress/qhostaddress.pro
index b208214..7bcbfb0 100644
--- a/tests/auto/qhostaddress/qhostaddress.pro
+++ b/tests/auto/qhostaddress/qhostaddress.pro
@@ -12,3 +12,4 @@ wince*: {
}
}
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qhostinfo/qhostinfo.pro b/tests/auto/qhostinfo/qhostinfo.pro
index 9bfe576..06a4b17 100644
--- a/tests/auto/qhostinfo/qhostinfo.pro
+++ b/tests/auto/qhostinfo/qhostinfo.pro
@@ -10,4 +10,5 @@ wince*: {
win32:LIBS += -lws2_32
}
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro
index 8678a19..23a73c4 100644
--- a/tests/auto/qhttp/qhttp.pro
+++ b/tests/auto/qhttp/qhttp.pro
@@ -21,6 +21,7 @@ wince*: {
addFiles.sources = rfc3252.txt trolltech
addFiles.path = .
DEPLOYMENT = addFiles webFiles cgi
+ TARGET.CAPABILITY = NetworkServices
} else:vxworks*: {
DEFINES += SRCDIR=\\\"\\\"
} else {
diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro
index 0021bc1..d9e2dce 100644
--- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro
+++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro
@@ -4,3 +4,5 @@ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib
requires(contains(QT_CONFIG,private_tests))
QT = core network
+
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro
index 1782b43..36d56c6 100644
--- a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro
+++ b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro
@@ -4,3 +4,4 @@ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib
requires(contains(QT_CONFIG,private_tests))
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qhttpsocketengine/qhttpsocketengine.pro b/tests/auto/qhttpsocketengine/qhttpsocketengine.pro
index f6ad073..d76ebb6 100644
--- a/tests/auto/qhttpsocketengine/qhttpsocketengine.pro
+++ b/tests/auto/qhttpsocketengine/qhttpsocketengine.pro
@@ -8,5 +8,6 @@ MOC_DIR=tmp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 1b4c502..aadee5b 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -114,6 +114,9 @@ private slots:
void readFromFileAfterJunk_data();
void readFromFileAfterJunk();
+ void devicePosition_data();
+ void devicePosition();
+
void setBackgroundColor_data();
void setBackgroundColor();
@@ -1117,7 +1120,7 @@ void tst_QImageReader::readFromFileAfterJunk()
QByteArray imageData = imageFile.readAll();
QVERIFY(!imageData.isNull());
- int iterations = 10;
+ int iterations = 3;
if (format == "ppm" || format == "pbm" || format == "pgm" || format == "svg" || format == "svgz")
iterations = 1;
@@ -1147,6 +1150,64 @@ void tst_QImageReader::readFromFileAfterJunk()
}
}
+void tst_QImageReader::devicePosition_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QByteArray>("format");
+
+ QTest::newRow("pbm") << QString("image.pbm") << QByteArray("pbm");
+ QTest::newRow("pgm") << QString("image.pgm") << QByteArray("pgm");
+ QTest::newRow("ppm-1") << QString("image.ppm") << QByteArray("ppm");
+#ifdef QTEST_HAVE_JPEG
+ QTest::newRow("jpeg-1") << QString("beavis.jpg") << QByteArray("jpeg");
+ QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg");
+ QTest::newRow("jpeg-3") << QString("YCbCr_rgb.jpg") << QByteArray("jpeg");
+#endif
+#if defined QTEST_HAVE_GIF
+ QTest::newRow("gif-1") << QString("earth.gif") << QByteArray("gif");
+#endif
+ QTest::newRow("xbm") << QString("gnus.xbm") << QByteArray("xbm");
+ QTest::newRow("xpm") << QString("marble.xpm") << QByteArray("xpm");
+ QTest::newRow("bmp-1") << QString("colorful.bmp") << QByteArray("bmp");
+ QTest::newRow("bmp-2") << QString("font.bmp") << QByteArray("bmp");
+ QTest::newRow("png") << QString("kollada.png") << QByteArray("png");
+// QTest::newRow("mng-1") << QString("images/ball.mng") << QByteArray("mng");
+// QTest::newRow("mng-2") << QString("images/fire.mng") << QByteArray("mng");
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg");
+ QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz");
+#endif
+}
+
+void tst_QImageReader::devicePosition()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QByteArray, format);
+
+ QImage expected(prefix + fileName);
+ QVERIFY(!expected.isNull());
+
+ QFile imageFile(prefix + fileName);
+ QVERIFY(imageFile.open(QFile::ReadOnly));
+ QByteArray imageData = imageFile.readAll();
+ QVERIFY(!imageData.isNull());
+ int imageDataSize = imageData.size();
+
+ const char *preStr = "prebeef\n";
+ int preLen = qstrlen(preStr);
+ imageData.prepend(preStr);
+ if (format != "svg" && format != "svgz") // Doesn't handle trailing data
+ imageData.append("\npostbeef");
+ QBuffer buf(&imageData);
+ buf.open(QIODevice::ReadOnly);
+ buf.seek(preLen);
+ QImageReader reader(&buf, format);
+ QCOMPARE(expected, reader.read());
+ if (format != "ppm" && format != "gif") // Known not to work
+ QCOMPARE(buf.pos(), qint64(preLen+imageDataSize));
+}
+
+
void tst_QImageReader::description_data()
{
QTest::addColumn<QString>("fileName");
diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro
index e695bf6..716cdce 100644
--- a/tests/auto/qiodevice/qiodevice.pro
+++ b/tests/auto/qiodevice/qiodevice.pro
@@ -14,6 +14,7 @@ wince*: {
addFiles.sources = tst_qiodevice.cpp
addFiles.path = .
DEPLOYMENT += addFiles
+ TARGET.CAPABILITY = NetworkServices
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
contains(QT_CONFIG, qt3support):QT += qt3support
diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro
index 0849453..287e946 100644
--- a/tests/auto/qlocalsocket/qlocalsocket.pro
+++ b/tests/auto/qlocalsocket/qlocalsocket.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = lackey test
!wince*:!symbian*: SUBDIRS += example
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp
index 2de1c52..d4ca064 100644
--- a/tests/auto/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp
@@ -140,6 +140,8 @@ private:
tst_QMessageBox::tst_QMessageBox() : keyToSend(-1)
{
+ int argc = qApp->argc();
+ QT_REQUIRE_VERSION(argc, qApp->argv(), "4.6.2")
}
int tst_QMessageBox::exec(QMessageBox *msgBox, int key)
diff --git a/tests/auto/qnativesocketengine/qnativesocketengine.pro b/tests/auto/qnativesocketengine/qnativesocketengine.pro
index ad40d53..0275d37 100644
--- a/tests/auto/qnativesocketengine/qnativesocketengine.pro
+++ b/tests/auto/qnativesocketengine/qnativesocketengine.pro
@@ -9,4 +9,5 @@ MOC_DIR=tmp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro b/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro
index e2889c1..3ccbffb 100644
--- a/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro
+++ b/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro
@@ -2,4 +2,5 @@ load(qttest_p4)
SOURCES += tst_qnetworkaccessmanager.cpp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro
index 7ed5b07..378deba 100644
--- a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro
+++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro
@@ -2,4 +2,5 @@ load(qttest_p4)
SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp
QT += network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro b/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro
index 8feb95f..885dbf7 100644
--- a/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro
+++ b/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro
@@ -2,3 +2,5 @@ load(qttest_p4)
SOURCES += tst_qnetworkaddressentry.cpp
QT = core network
+
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro b/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro
index b24fe00..77ad347 100644
--- a/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro
+++ b/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro
@@ -2,4 +2,5 @@ load(qttest_p4)
QT += network
SOURCES += tst_qnetworkcachemetadata.cpp
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index ce3acb7..a3cccb2 100644
--- a/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -45,6 +45,13 @@
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
+/*
+ Although this unit test doesn't use QNetworkAccessManager
+ this include is used to ensure that bearer continues to compile against
+ Qt 4.7+ which has a QNetworkConfiguration enabled QNetworkAccessManager
+*/
+#include <QNetworkAccessManager>
+
#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
#include <stdio.h>
#include <iapconf.h>
diff --git a/tests/auto/qnetworkcookie/qnetworkcookie.pro b/tests/auto/qnetworkcookie/qnetworkcookie.pro
index 95d8b6e..2f31138 100644
--- a/tests/auto/qnetworkcookie/qnetworkcookie.pro
+++ b/tests/auto/qnetworkcookie/qnetworkcookie.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
SOURCES += tst_qnetworkcookie.cpp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro
index 3a8e61b..6d75fab 100644
--- a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro
+++ b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
SOURCES += tst_qnetworkcookiejar.cpp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro b/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro
index f47d6d7..3b13087 100644
--- a/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro
+++ b/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro
@@ -2,4 +2,5 @@ load(qttest_p4)
QT += network
SOURCES += tst_qnetworkdiskcache.cpp
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkinterface/qnetworkinterface.pro b/tests/auto/qnetworkinterface/qnetworkinterface.pro
index 26095e9..1c5feee 100644
--- a/tests/auto/qnetworkinterface/qnetworkinterface.pro
+++ b/tests/auto/qnetworkinterface/qnetworkinterface.pro
@@ -3,4 +3,5 @@ SOURCES += tst_qnetworkinterface.cpp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkproxy/qnetworkproxy.pro b/tests/auto/qnetworkproxy/qnetworkproxy.pro
index 8ffc80c..fc0a216 100644
--- a/tests/auto/qnetworkproxy/qnetworkproxy.pro
+++ b/tests/auto/qnetworkproxy/qnetworkproxy.pro
@@ -7,4 +7,5 @@ QT = core network
SOURCES += tst_qnetworkproxy.cpp
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkreply/qnetworkreply.pro b/tests/auto/qnetworkreply/qnetworkreply.pro
index fd8454c..86d3155 100644
--- a/tests/auto/qnetworkreply/qnetworkreply.pro
+++ b/tests/auto/qnetworkreply/qnetworkreply.pro
@@ -4,3 +4,4 @@ SUBDIRS = test
requires(contains(QT_CONFIG,private_tests))
!wince*:SUBDIRS += echo
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworkreply/smb-file.txt b/tests/auto/qnetworkreply/smb-file.txt
new file mode 100644
index 0000000..73c3ac2
--- /dev/null
+++ b/tests/auto/qnetworkreply/smb-file.txt
@@ -0,0 +1 @@
+This is 34 bytes. Do not change... \ No newline at end of file
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index ff79c09..9d942bf 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -522,8 +522,8 @@ public:
active->connectToHost("127.0.0.1", server.serverPort());
#ifndef Q_OS_SYMBIAN
// need more time as working with embedded
- // device and testing from emualtor
- // things tend to get slower
+ // device and testing from emualtor
+ // things tend to get slower
if (!active->waitForConnected(1000))
return false;
@@ -929,7 +929,7 @@ void tst_QNetworkReply::invalidProtocol()
void tst_QNetworkReply::getFromData_data()
{
- QTest::addColumn<QString>("request");
+ QTest::addColumn<QString>("request");
QTest::addColumn<QByteArray>("expected");
QTest::addColumn<QString>("mimeType");
@@ -1025,7 +1025,7 @@ void tst_QNetworkReply::getFromData()
void tst_QNetworkReply::getFromFile()
{
- // create the file:
+ // create the file:
QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX");
file.setAutoRemove(true);
QVERIFY(file.open());
@@ -1073,11 +1073,14 @@ void tst_QNetworkReply::getFromFileSpecial_data()
QTest::newRow("resource") << ":/resource" << "qrc:/resource";
QTest::newRow("search-path") << "srcdir:/rfc3252.txt" << "srcdir:/rfc3252.txt";
QTest::newRow("bigfile-path") << "srcdir:/bigfile" << "srcdir:/bigfile";
+#ifdef Q_OS_WIN
+ QTest::newRow("smb-path") << "srcdir:/smb-file.txt" << "file://" + QtNetworkSettings::winServerName() + "/testshare/test.pri";
+#endif
}
void tst_QNetworkReply::getFromFileSpecial()
{
- QFETCH(QString, fileName);
+ QFETCH(QString, fileName);
QFETCH(QString, url);
// open the resource so we can find out its size
@@ -1107,7 +1110,7 @@ void tst_QNetworkReply::getFromFtp_data()
void tst_QNetworkReply::getFromFtp()
{
- QFETCH(QString, referenceName);
+ QFETCH(QString, referenceName);
QFETCH(QString, url);
QFile reference(referenceName);
@@ -1136,7 +1139,7 @@ void tst_QNetworkReply::getFromHttp_data()
void tst_QNetworkReply::getFromHttp()
{
- QFETCH(QString, referenceName);
+ QFETCH(QString, referenceName);
QFETCH(QString, url);
QFile reference(referenceName);
@@ -3456,8 +3459,8 @@ void tst_QNetworkReply::downloadProgress_data()
QTest::newRow("big") << 4096;
#else
// it can run even with 4096
- // but it takes lot time
- //especially on emulator
+ // but it takes lot time
+ //especially on emulator
QTest::newRow("big") << 1024;
#endif
}
@@ -3646,7 +3649,7 @@ void tst_QNetworkReply::receiveCookiesFromHttp_data()
void tst_QNetworkReply::receiveCookiesFromHttp()
{
- QFETCH(QString, cookieString);
+ QFETCH(QString, cookieString);
QByteArray data = cookieString.toLatin1() + '\n';
QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/set-cookie.cgi");
diff --git a/tests/auto/qnetworkrequest/qnetworkrequest.pro b/tests/auto/qnetworkrequest/qnetworkrequest.pro
index f576ba2..f96fd3b 100644
--- a/tests/auto/qnetworkrequest/qnetworkrequest.pro
+++ b/tests/auto/qnetworkrequest/qnetworkrequest.pro
@@ -2,3 +2,4 @@ load(qttest_p4)
SOURCES += tst_qnetworkrequest.cpp
QT = core network
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworksession/lackey/main.cpp b/tests/auto/qnetworksession/lackey/main.cpp
index 8759b52..ec2fad9 100644
--- a/tests/auto/qnetworksession/lackey/main.cpp
+++ b/tests/auto/qnetworksession/lackey/main.cpp
@@ -47,6 +47,8 @@
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
+#include <QEventLoop>
+#include <QTimer>
#include <QDebug>
QT_USE_NAMESPACE
@@ -60,15 +62,14 @@ int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
- // Cannot read/write to processes on WinCE or Symbian.
- // Easiest alternative is to use sockets for IPC.
-
- QLocalSocket oopSocket;
-
- oopSocket.connectToServer("tst_qnetworksession");
- oopSocket.waitForConnected(-1);
-
+ // Update configurations so that everything is up to date for this process too.
+ // Event loop is used to wait for awhile.
QNetworkConfigurationManager manager;
+ manager.updateConfigurations();
+ QEventLoop iIgnoreEventLoop;
+ QTimer::singleShot(3000, &iIgnoreEventLoop, SLOT(quit()));
+ iIgnoreEventLoop.exec();
+
QList<QNetworkConfiguration> discovered =
manager.allConfigurations(QNetworkConfiguration::Discovered);
@@ -82,6 +83,13 @@ int main(int argc, char** argv)
return NO_DISCOVERED_CONFIGURATIONS_ERROR;
}
+ // Cannot read/write to processes on WinCE or Symbian.
+ // Easiest alternative is to use sockets for IPC.
+ QLocalSocket oopSocket;
+
+ oopSocket.connectToServer("tst_qnetworksession");
+ oopSocket.waitForConnected(-1);
+
qDebug() << "Lackey started";
QNetworkSession *session = 0;
diff --git a/tests/auto/qnetworksession/qnetworksession.pro b/tests/auto/qnetworksession/qnetworksession.pro
index a85925b..34761e5 100644
--- a/tests/auto/qnetworksession/qnetworksession.pro
+++ b/tests/auto/qnetworksession/qnetworksession.pro
@@ -1,2 +1,3 @@
TEMPLATE = subdirs
SUBDIRS = lackey test
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index 23cdc6a..934a50e 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -100,6 +100,7 @@ private slots:
private:
QNetworkConfigurationManager manager;
+ QMap<QString, bool> testsToRun;
int inProcessSessionManagementCount;
@@ -117,6 +118,7 @@ private:
bool openSession(QNetworkSession *session);
bool closeSession(QNetworkSession *session, bool lastSessionOnConfiguration = true);
void updateConfigurations();
+void printConfigurations();
QNetworkConfiguration suitableConfiguration(QString bearerType, QNetworkConfiguration::Type configType);
void tst_QNetworkSession::initTestCase()
@@ -125,7 +127,19 @@ void tst_QNetworkSession::initTestCase()
qRegisterMetaType<QNetworkSession::SessionError>("QNetworkSession::SessionError");
qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration");
qRegisterMetaType<QNetworkConfiguration::Type>("QNetworkConfiguration::Type");
-
+
+ // If you wish to skip tests, set value as false. This is often very convinient because tests are so lengthy.
+ // Better way still would be to make this readable from a file.
+ testsToRun["robustnessBombing"] = true;
+ testsToRun["outOfProcessSession"] = true;
+ testsToRun["invalidSession"] = true;
+ testsToRun["repeatedOpenClose"] = true;
+ testsToRun["roamingErrorCodes"] = true;
+ testsToRun["sessionStop"] = true;
+ testsToRun["sessionProperties"] = true;
+ testsToRun["userChoiceSession"] = true;
+ testsToRun["sessionOpenCloseStop"] = true;
+
#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
@@ -238,6 +252,10 @@ void tst_QNetworkSession::cleanupTestCase()
// Robustness test for calling interfaces in nonsense order / with nonsense parameters
void tst_QNetworkSession::robustnessBombing()
{
+ if (!testsToRun["robustnessBombing"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
+
QNetworkConfigurationManager mgr;
QNetworkSession testSession(mgr.defaultConfiguration());
// Should not reset even session is not opened
@@ -245,15 +263,14 @@ void tst_QNetworkSession::robustnessBombing()
testSession.accept();
testSession.ignore();
testSession.reject();
- quint64 temp;
- temp = testSession.bytesWritten();
- temp = testSession.bytesReceived();
- temp = testSession.activeTime();
}
void tst_QNetworkSession::invalidSession()
-{
+{
+ if (!testsToRun["invalidSession"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
// 1. Verify that session created with invalid configuration remains in invalid state
QNetworkSession session(QNetworkConfiguration(), 0);
QVERIFY(!session.isOpen());
@@ -270,11 +287,24 @@ void tst_QNetworkSession::invalidSession()
QVERIFY(error == QNetworkSession::InvalidConfigurationError);
QVERIFY(session.error() == QNetworkSession::InvalidConfigurationError);
QVERIFY(session.state() == QNetworkSession::Invalid);
-
+
#ifdef QNETWORKSESSION_MANUAL_TESTS
+
+ QNetworkConfiguration invalidatedConfig = suitableConfiguration("WLAN",QNetworkConfiguration::InternetAccessPoint);
+ if (invalidatedConfig.isValid()) {
+ // 3. Verify that invalidating a session after its successfully configured works
+ QNetworkSession invalidatedSession(invalidatedConfig);
+ qDebug() << "Delete the WLAN IAP from phone now (waiting 60 seconds): " << invalidatedConfig.name();
+ QTest::qWait(60000);
+ QVERIFY(!invalidatedConfig.isValid());
+ QVERIFY(invalidatedSession.state() == QNetworkSession::Invalid);
+ qDebug() << "Add the WLAN IAP back (waiting 60 seconds): " << invalidatedConfig.name();
+ QTest::qWait(60000);
+ }
+
QNetworkConfiguration definedConfig = suitableConfiguration("WLAN",QNetworkConfiguration::InternetAccessPoint);
if (definedConfig.isValid()) {
- // 3. Verify that opening a session with defined configuration emits error and enters notavailable-state
+ // 4. Verify that opening a session with defined configuration emits error and enters notavailable-state
// TODO these timer waits should be changed to waiting appropriate signals, now these wait excessively
qDebug() << "Shutdown WLAN IAP (waiting 60 seconds): " << definedConfig.name();
QTest::qWait(60000);
@@ -283,43 +313,27 @@ void tst_QNetworkSession::invalidSession()
QNetworkSession definedSession(definedConfig);
QSignalSpy errorSpy(&definedSession, SIGNAL(error(QNetworkSession::SessionError)));
QNetworkSession::SessionError sessionError;
+ updateConfigurations();
definedSession.open();
+#ifdef Q_OS_SYMBIAN
+ // On symbian, the connection opening is tried even with defined state.
+ qDebug("Waiting for 10 seconds to all signals to propagate.");
+ QTest::qWait(10000);
+#endif
+ updateConfigurations();
QVERIFY(definedConfig.isValid()); // Session remains valid
QVERIFY(definedSession.state() == QNetworkSession::NotAvailable); // State is not available because WLAN is not in coverage
QVERIFY(!errorSpy.isEmpty()); // Session tells with error about invalidated configuration
sessionError = qvariant_cast<QNetworkSession::SessionError> (errorSpy.first().at(0));
- qDebug() << "Error code is: " << sessionError;
QVERIFY(sessionError == QNetworkSession::InvalidConfigurationError);
-
qDebug() << "Turn the WLAN IAP back on (waiting 60 seconds): " << definedConfig.name();
QTest::qWait(60000);
- updateConfigurations();
-
+ updateConfigurations();
QVERIFY(definedConfig.state() == QNetworkConfiguration::Discovered);
}
-
- QNetworkConfiguration invalidatedConfig = suitableConfiguration("WLAN",QNetworkConfiguration::InternetAccessPoint);
- if (invalidatedConfig.isValid()) {
- // 4. Verify that invalidating a session after its successfully configured works
- QNetworkSession invalidatedSession(invalidatedConfig);
- QSignalSpy errorSpy(&invalidatedSession, SIGNAL(error(QNetworkSession::SessionError)));
- QNetworkSession::SessionError sessionError;
-
- qDebug() << "Delete the WLAN IAP from phone now (waiting 60 seconds): " << invalidatedConfig.name();
- QTest::qWait(60000);
-
- invalidatedSession.open();
- QVERIFY(!invalidatedConfig.isValid());
- QVERIFY(invalidatedSession.state() == QNetworkSession::Invalid);
- QVERIFY(!errorSpy.isEmpty());
-
- sessionError = qvariant_cast<QNetworkSession::SessionError> (errorSpy.first().at(0));
- QVERIFY(sessionError == QNetworkSession::InvalidConfigurationError);
- qDebug() << "Add the WLAN IAP back (waiting 60 seconds): " << invalidatedConfig.name();
- QTest::qWait(60000);
- }
+
#endif
}
@@ -337,12 +351,12 @@ void tst_QNetworkSession::sessionProperties_data()
void tst_QNetworkSession::sessionProperties()
{
+ if (!testsToRun["sessionProperties"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
QFETCH(QNetworkConfiguration, configuration);
-
QNetworkSession session(configuration);
-
QVERIFY(session.configuration() == configuration);
-
QStringList validBearerNames = QStringList() << QLatin1String("Unknown")
<< QLatin1String("Ethernet")
<< QLatin1String("WLAN")
@@ -356,9 +370,6 @@ void tst_QNetworkSession::sessionProperties()
if (!configuration.isValid()) {
QVERIFY(configuration.bearerName().isEmpty());
} else {
- qDebug() << "Type:" << configuration.type()
- << "Bearer:" << configuration.bearerName();
-
switch (configuration.type())
{
case QNetworkConfiguration::ServiceNetwork:
@@ -374,9 +385,7 @@ void tst_QNetworkSession::sessionProperties()
// QNetworkSession::interface() should return an invalid interface unless
// session is in the connected state.
- qDebug() << "Session state:" << session.state();
#ifndef QT_NO_NETWORKINTERFACE
- qDebug() << "Session iface:" << session.interface().isValid() << session.interface().name();
#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
// On Symbian emulator, the support for data bearers is limited
QCOMPARE(session.state() == QNetworkSession::Connected, session.interface().isValid());
@@ -420,7 +429,12 @@ void tst_QNetworkSession::repeatedOpenClose_data() {
}
// Tests repeated-open close.
-void tst_QNetworkSession::repeatedOpenClose() {
+void tst_QNetworkSession::repeatedOpenClose()
+{
+ if (!testsToRun["repeatedOpenClose"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
+
QFETCH(QString, bearerType);
QFETCH(QNetworkConfiguration::Type, configurationType);
QFETCH(int, repeatTimes);
@@ -436,13 +450,20 @@ void tst_QNetworkSession::repeatedOpenClose() {
!closeSession(&permanentSession)) {
QSKIP("Unable to open/close session, skipping this round of repeated open-close test.", SkipSingle);
}
- for (int i = repeatTimes; i > 0; i--) {
+ for (int i = 0; i < repeatTimes; i++) {
+ qDebug() << "Opening, loop number " << i;
QVERIFY(openSession(&permanentSession));
+ qDebug() << "Closing, loop number, then waiting 5 seconds: " << i;
QVERIFY(closeSession(&permanentSession));
+ QTest::qWait(5000);
}
}
-void tst_QNetworkSession::roamingErrorCodes() {
+void tst_QNetworkSession::roamingErrorCodes()
+{
+ if (!testsToRun["roamingErrorCodes"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
#ifndef Q_OS_SYMBIAN
QSKIP("Roaming supported on Symbian.", SkipAll);
#else
@@ -466,41 +487,11 @@ void tst_QNetworkSession::roamingErrorCodes() {
adminIapSession.stop(); // requires NetworkControl capabilities
QTRY_VERIFY(!errorSpy.isEmpty()); // wait for error signals
QNetworkSession::SessionError error = qvariant_cast<QNetworkSession::SessionError>(errorSpy.first().at(0));
+ QTest::qWait(2000); // Wait for a moment to all platform signals to propagate
QVERIFY(error == QNetworkSession::SessionAbortedError);
QVERIFY(iapSession.state() == QNetworkSession::Disconnected);
QVERIFY(adminIapSession.state() == QNetworkSession::Disconnected);
#endif // Q_OS_SYMBIAN
-
-#ifdef QNETWORKSESSION_MANUAL_TESTS
- // Check for roaming error.
- // Case requires that you have controllable WLAN in Internet SNAP (only).
- QNetworkConfiguration snapConfig = suitableConfiguration("bearer_not_relevant_with_snaps", QNetworkConfiguration::ServiceNetwork);
- if (!snapConfig.isValid()) {
- QSKIP("No SNAP accessible, skipping test.", SkipAll);
- }
- QNetworkSession snapSession(snapConfig);
- QVERIFY(openSession(&snapSession));
- QSignalSpy errorSpySnap(&snapSession, SIGNAL(error(QNetworkSession::SessionError)));
- qDebug("Disconnect the WLAN now");
- QTRY_VERIFY(!errorSpySnap.isEmpty()); // wait for error signals
- QVERIFY(errorSpySnap.count() == 1);
- error = qvariant_cast<QNetworkSession::SessionError>(errorSpySnap.first().at(0));
- qDebug() << "Error received when turning off wlan on SNAP: " << error;
- QVERIFY(error == QNetworkSession::RoamingError);
-
- qDebug("Connect the WLAN now");
- QTest::qWait(60000); // Wait for WLAN to get up
- QNetworkConfiguration wlanIapConfig2 = suitableConfiguration("WLAN", QNetworkConfiguration::InternetAccessPoint);
- QNetworkSession iapSession2(wlanIapConfig2);
- QVERIFY(openSession(&iapSession2));
- QSignalSpy errorSpy2(&iapSession2, SIGNAL(error(QNetworkSession::SessionError)));
- qDebug("Disconnect the WLAN now");
- QTRY_VERIFY(!errorSpy2.isEmpty()); // wait for error signals
- QVERIFY(errorSpy2.count() == 1);
- error = qvariant_cast<QNetworkSession::SessionError>(errorSpy2.first().at(0));
- QVERIFY(error == QNetworkSession::SessionAbortedError);
- QVERIFY(iapSession2.state() == QNetworkSession::Disconnected);
-#endif
}
@@ -515,6 +506,9 @@ void tst_QNetworkSession::sessionStop_data() {
void tst_QNetworkSession::sessionStop()
{
+ if (!testsToRun["sessionStop"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
#ifndef Q_OS_SYMBIAN
QSKIP("Testcase contains mainly Symbian specific checks, because it is only platform to really support interface (IAP-level) Stop.", SkipAll);
#endif
@@ -522,6 +516,9 @@ void tst_QNetworkSession::sessionStop()
QFETCH(QNetworkConfiguration::Type, configurationType);
int configWaitdelayInMs = 2000;
+
+ updateConfigurations();
+ printConfigurations();
QNetworkConfiguration config = suitableConfiguration(bearerType, configurationType);
if (!config.isValid()) {
@@ -539,6 +536,9 @@ void tst_QNetworkSession::sessionStop()
QSignalSpy closedSessionStateChangedSpy(&closedSession, SIGNAL(stateChanged(QNetworkSession::State)));
QSignalSpy closedErrorSpy(&closedSession, SIGNAL(error(QNetworkSession::SessionError)));
+ QSignalSpy openedSessionClosedSpy(&openedSession, SIGNAL(closed()));
+ QSignalSpy openedSessionStateChangedSpy(&openedSession, SIGNAL(stateChanged(QNetworkSession::State)));
+
QSignalSpy innocentSessionClosedSpy(&innocentSession, SIGNAL(closed()));
QSignalSpy innocentSessionStateChangedSpy(&innocentSession, SIGNAL(stateChanged(QNetworkSession::State)));
QSignalSpy innocentErrorSpy(&innocentSession, SIGNAL(error(QNetworkSession::SessionError)));
@@ -554,10 +554,18 @@ void tst_QNetworkSession::sessionStop()
closedSessionClosedSpy.clear();
closedSessionStateChangedSpy.clear();
closedErrorSpy.clear();
+ openedSessionStateChangedSpy.clear();
+ openedSessionClosedSpy.clear();
+
openedSession.stop();
- QVERIFY(openedSession.state() == QNetworkSession::Disconnected);
+ qDebug("Waiting for %d ms to get all configurationChange signals from platform.", configWaitdelayInMs);
QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
+
+ // First to closing, then to disconnected
+ QVERIFY(openedSessionStateChangedSpy.count() == 2);
+ QVERIFY(!openedSessionClosedSpy.isEmpty());
+ QVERIFY(openedSession.state() == QNetworkSession::Disconnected);
QVERIFY(config.state() != QNetworkConfiguration::Active);
// 2. Verify that stopping a session based on non-connected configuration does nothing
@@ -583,18 +591,20 @@ void tst_QNetworkSession::sessionStop()
// 3. Check that stopping a opened session affects also other opened session based on the same configuration.
if (config.type() == QNetworkConfiguration::InternetAccessPoint) {
qDebug("----------3. Check that stopping a opened session affects also other opened session based on the same configuration.");
+
QVERIFY(openSession(&openedSession));
QVERIFY(openSession(&innocentSession));
-
+
configChangeSpy.clear();
innocentSessionClosedSpy.clear();
innocentSessionStateChangedSpy.clear();
innocentErrorSpy.clear();
-
+
openedSession.stop();
qDebug("Waiting for %d ms to get all configurationChange signals from platform.", configWaitdelayInMs);
QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
-
+ QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
+
QVERIFY(!innocentSessionClosedSpy.isEmpty());
QVERIFY(!innocentSessionStateChangedSpy.isEmpty());
QVERIFY(!innocentErrorSpy.isEmpty());
@@ -614,14 +624,19 @@ void tst_QNetworkSession::sessionStop()
if (config.type() == QNetworkConfiguration::ServiceNetwork) {
qDebug("----------4. Skip for SNAP configuration.");
} else if (config.type() == QNetworkConfiguration::InternetAccessPoint) {
- qDebug("----------4. Check that stopping a non-opened session stops the other session based on the same configuration");
- QVERIFY(openSession(&innocentSession));
+ qDebug("----------4. Check that stopping a non-opened session stops the other session based on the same configuration");
+ qDebug("----------4.1 Opening innocent session");
+ QVERIFY(openSession(&innocentSession));
qDebug("Waiting for %d ms after open to make sure all platform indications are propagated", configWaitdelayInMs);
QTest::qWait(configWaitdelayInMs);
+ qDebug("----------4.2 Calling closedSession.stop()");
closedSession.stop();
qDebug("Waiting for %d ms to get all configurationChange signals from platform..", configWaitdelayInMs);
QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
+ QTest::qWait(configWaitdelayInMs);
+ QTest::qWait(configWaitdelayInMs);
+
QVERIFY(!innocentSessionClosedSpy.isEmpty());
QVERIFY(!innocentSessionStateChangedSpy.isEmpty());
QVERIFY(!innocentErrorSpy.isEmpty());
@@ -653,6 +668,9 @@ void tst_QNetworkSession::userChoiceSession_data()
void tst_QNetworkSession::userChoiceSession()
{
+ if (!testsToRun["userChoiceSession"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
QFETCH(QNetworkConfiguration, configuration);
QVERIFY(configuration.type() == QNetworkConfiguration::UserChoice);
@@ -682,7 +700,20 @@ void tst_QNetworkSession::userChoiceSession()
session.open();
+#if defined(Q_OS_SYMBIAN)
+ // Opening & closing multiple connections in a row sometimes
+ // results hanging of connection opening on Symbian devices
+ // => If first open fails, wait a moment and try again.
+ if (!session.waitForOpened()) {
+ qDebug("**** Session open Timeout - Wait 5 seconds and try once again ****");
+ session.close();
+ QTest::qWait(5000); // Wait a while before trying to open session again
+ session.open();
+ session.waitForOpened();
+ }
+#else
session.waitForOpened();
+#endif
if (session.isOpen())
QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty());
@@ -786,6 +817,9 @@ void tst_QNetworkSession::sessionOpenCloseStop_data()
void tst_QNetworkSession::sessionOpenCloseStop()
{
+ if (!testsToRun["sessionOpenCloseStop"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
QFETCH(QNetworkConfiguration, configuration);
QFETCH(bool, forceSessionStop);
@@ -818,7 +852,20 @@ void tst_QNetworkSession::sessionOpenCloseStop()
session.open();
+#if defined(Q_OS_SYMBIAN)
+ // Opening & closing multiple connections in a row sometimes
+ // results hanging of connection opening on Symbian devices
+ // => If first open fails, wait a moment and try again.
+ if (!session.waitForOpened()) {
+ qDebug("**** Session open Timeout - Wait 5 seconds and try once again ****");
+ session.close();
+ QTest::qWait(5000); // Wait a while before trying to open session again
+ session.open();
+ session.waitForOpened();
+ }
+#else
session.waitForOpened();
+#endif
if (session.isOpen())
QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty());
@@ -894,26 +941,30 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QVERIFY(session.error() == QNetworkSession::UnknownSessionError);
session2.open();
-
+
QTRY_VERIFY(!sessionOpenedSpy2.isEmpty() || !errorSpy2.isEmpty());
+ if (errorSpy2.isEmpty()) {
+ QVERIFY(session2.isOpen());
+ QVERIFY(session2.state() == QNetworkSession::Connected);
+ }
QVERIFY(session.isOpen());
- QVERIFY(session2.isOpen());
QVERIFY(session.state() == QNetworkSession::Connected);
- QVERIFY(session2.state() == QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
#if !(defined(Q_OS_SYMBIAN) && defined(__WINS__))
// On Symbian emulator, the support for data bearers is limited
QVERIFY(session.interface().isValid());
#endif
- QCOMPARE(session.interface().hardwareAddress(), session2.interface().hardwareAddress());
- QCOMPARE(session.interface().index(), session2.interface().index());
+ if (errorSpy2.isEmpty()) {
+ QCOMPARE(session.interface().hardwareAddress(), session2.interface().hardwareAddress());
+ QCOMPARE(session.interface().index(), session2.interface().index());
+ }
#endif
}
sessionOpenedSpy2.clear();
- if (forceSessionStop) {
+ if (forceSessionStop && session2.isOpen()) {
// Test forcing the second session to stop the interface.
QNetworkSession::State previousState = session.state();
#ifdef Q_CC_NOKIAX86
@@ -922,15 +973,17 @@ void tst_QNetworkSession::sessionOpenCloseStop()
#else
bool expectStateChange = previousState != QNetworkSession::Disconnected;
#endif
-
session2.stop();
+ // QNetworkSession::stop() must result either closed() signal
+ // or error() signal
QTRY_VERIFY(!sessionClosedSpy2.isEmpty() || !errorSpy2.isEmpty());
-
QVERIFY(!session2.isOpen());
if (!errorSpy2.isEmpty()) {
- QVERIFY(!errorSpy.isEmpty());
+ // QNetworkSession::stop() resulted error() signal for session2
+ // => also session should emit error() signal
+ QTRY_VERIFY(!errorSpy.isEmpty());
// check for SessionAbortedError
QNetworkSession::SessionError error =
@@ -950,9 +1003,12 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QVERIFY(errorSpy.isEmpty());
QVERIFY(errorSpy2.isEmpty());
-
+
+ // Wait for Disconnected state
+ QTRY_NOOP(session2.state() == QNetworkSession::Disconnected);
+
if (expectStateChange)
- QTRY_VERIFY(stateChangedSpy2.count() >= 2 || !errorSpy2.isEmpty());
+ QTRY_VERIFY(stateChangedSpy2.count() >= 1 || !errorSpy2.isEmpty());
if (!errorSpy2.isEmpty()) {
QVERIFY(session2.state() == previousState);
@@ -996,16 +1052,29 @@ void tst_QNetworkSession::sessionOpenCloseStop()
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
QVERIFY(state == QNetworkSession::Disconnected);
+
+ QTRY_VERIFY(session.state() == QNetworkSession::Roaming ||
+ session.state() == QNetworkSession::Connected ||
+ session.state() == QNetworkSession::Disconnected);
+
QTRY_VERIFY(stateChangedSpy.count() > 0);
- state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(0).at(0));
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 1).at(0));
+
if (state == QNetworkSession::Roaming) {
- QTRY_VERIFY(!errorSpy.isEmpty() || stateChangedSpy.count() > 1);
- if (stateChangedSpy.count() > 1 &&
- qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(1).at(0)) ==
- QNetworkSession::Connected) {
- roamedSuccessfully = true;
+ QTRY_VERIFY(session.state() == QNetworkSession::Connected);
+ QTRY_VERIFY(session2.state() == QNetworkSession::Connected);
+ roamedSuccessfully = true;
+ } else if (state == QNetworkSession::Disconnected) {
+ QTRY_VERIFY(!errorSpy.isEmpty());
+ QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
+ } else if (state == QNetworkSession::Connected) {
+ QTRY_VERIFY(errorSpy.isEmpty());
+ if (stateChangedSpy.count() > 1) {
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 2).at(0));
+ QVERIFY(state == QNetworkSession::Roaming);
}
- }
+ roamedSuccessfully = true;
+ }
if (roamedSuccessfully) {
QString configId = session.sessionProperty("ActiveConfiguration").toString();
@@ -1013,37 +1082,36 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession session3(config);
QSignalSpy errorSpy3(&session3, SIGNAL(error(QNetworkSession::SessionError)));
QSignalSpy sessionOpenedSpy3(&session3, SIGNAL(opened()));
-
session3.open();
- session3.waitForOpened();
-
+ session3.waitForOpened();
if (session.isOpen())
QVERIFY(!sessionOpenedSpy3.isEmpty() || !errorSpy3.isEmpty());
-
session.stop();
-
QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
- QTRY_VERIFY(session3.state() == QNetworkSession::Disconnected);
}
#ifndef Q_CC_NOKIAX86
if (!roamedSuccessfully)
QVERIFY(!errorSpy.isEmpty());
#endif
} else {
- QCOMPARE(stateChangedSpy2.count(), 2);
-
- QNetworkSession::State state =
- qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Closing);
-
- state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QTest::qWait(2000); // Wait awhile to get all signals from platform
+
+ if (stateChangedSpy2.count() == 2) {
+ QNetworkSession::State state =
+ qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+ QVERIFY(state == QNetworkSession::Closing);
+ state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
+ QVERIFY(state == QNetworkSession::Disconnected);
+ } else { // Assume .count() == 1
+ QCOMPARE(stateChangedSpy2.count(), 1);
+ QNetworkSession::State state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+ // Symbian version dependant.
+ QVERIFY(state == QNetworkSession::Disconnected);
+ }
}
QTRY_VERIFY(!sessionClosedSpy.isEmpty());
-
QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
- QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
}
QVERIFY(errorSpy2.isEmpty());
@@ -1062,7 +1130,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QVERIFY(!session.isOpen());
#endif
QVERIFY(!session2.isOpen());
- } else {
+ } else if (session2.isOpen()) {
// Test closing the second session.
{
int stateChangedCountBeforeClose = stateChangedSpy2.count();
@@ -1161,11 +1229,15 @@ QDebug operator<<(QDebug debug, const QList<QNetworkConfiguration> &list)
// at Discovered -state.
void tst_QNetworkSession::outOfProcessSession()
{
- qDebug() << "START";
-
+ if (!testsToRun["outOfProcessSession"]) {
+ QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+ }
#if defined(Q_OS_SYMBIAN) && defined(__WINS__)
QSKIP("Symbian emulator does not support two [QR]PRocesses linking a dll (QtBearer.dll) with global writeable static data.", SkipAll);
#endif
+ updateConfigurations();
+ QTest::qWait(2000);
+
QNetworkConfigurationManager manager;
// Create a QNetworkConfigurationManager to detect configuration changes made in Lackey. This
// is actually the essence of this testcase - to check that platform mediates/reflects changes
@@ -1182,16 +1254,15 @@ void tst_QNetworkSession::outOfProcessSession()
QLocalServer::removeServer("tst_qnetworksession");
oopServer.listen("tst_qnetworksession");
- qDebug() << "starting lackey";
QProcess lackey;
lackey.start("lackey/lackey");
qDebug() << lackey.error() << lackey.errorString();
QVERIFY(lackey.waitForStarted());
- qDebug() << "waiting for connection";
+
QVERIFY(oopServer.waitForNewConnection(-1));
QLocalSocket *oopSocket = oopServer.nextPendingConnection();
- qDebug() << "got connection";
+
do {
QByteArray output;
@@ -1258,7 +1329,6 @@ void tst_QNetworkSession::outOfProcessSession()
default:
QSKIP("Lackey failed", SkipAll);
}
- qDebug("STOP");
}
// A convinience / helper function for testcases. Return the first matching configuration.
@@ -1269,6 +1339,7 @@ QNetworkConfiguration suitableConfiguration(QString bearerType, QNetworkConfigur
// Refresh configurations and derive configurations matching given parameters.
QNetworkConfigurationManager mgr;
QSignalSpy updateSpy(&mgr, SIGNAL(updateCompleted()));
+
mgr.updateConfigurations();
QTRY_NOOP(updateSpy.count() == 1);
if (updateSpy.count() != 1) {
@@ -1277,8 +1348,7 @@ QNetworkConfiguration suitableConfiguration(QString bearerType, QNetworkConfigur
}
QList<QNetworkConfiguration> discoveredConfigs = mgr.allConfigurations(QNetworkConfiguration::Discovered);
foreach(QNetworkConfiguration config, discoveredConfigs) {
- if ((config.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
- // qDebug() << "Dumping config because is active: " << config.name();
+ if ((config.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
discoveredConfigs.removeOne(config);
} else if (config.type() != configType) {
// qDebug() << "Dumping config because type (IAP/SNAP) mismatches: " << config.name();
@@ -1315,9 +1385,23 @@ void updateConfigurations()
QTRY_NOOP(updateSpy.count() == 1);
}
+// A convinience-function: updates and prints all available confiurations and their states
+void printConfigurations()
+{
+ QNetworkConfigurationManager manager;
+ QList<QNetworkConfiguration> allConfigs =
+ manager.allConfigurations();
+ qDebug("tst_QNetworkSession::printConfigurations QNetworkConfigurationManager gives following configurations: ");
+ foreach(QNetworkConfiguration config, allConfigs) {
+ qDebug() << "Name of the configuration: " << config.name();
+ qDebug() << "State of the configuration: " << config.state();
+ }
+}
+
// A convinience function for test-cases: opens the given configuration and return
// true if it was done gracefully.
bool openSession(QNetworkSession *session) {
+ bool result = true;
QNetworkConfigurationManager mgr;
QSignalSpy openedSpy(session, SIGNAL(opened()));
QSignalSpy stateChangeSpy(session, SIGNAL(stateChanged(QNetworkSession::State)));
@@ -1327,43 +1411,57 @@ bool openSession(QNetworkSession *session) {
// active by some other session
QNetworkConfiguration::StateFlags configInitState = session->configuration().state();
QNetworkSession::State sessionInitState = session->state();
+ qDebug() << "tst_QNetworkSession::openSession() name of the configuration to be opened: " << session->configuration().name();
+ qDebug() << "tst_QNetworkSession::openSession() state of the configuration to be opened: " << session->configuration().state();
+ qDebug() << "tst_QNetworkSession::openSession() state of the session to be opened: " << session->state();
if (session->isOpen() ||
!session->sessionProperty("ActiveConfiguration").toString().isEmpty()) {
qDebug("tst_QNetworkSession::openSession() failure: session was already open / active.");
- return false;
+ result = false;
} else {
session->open();
session->waitForOpened(120000); // Bringing interfaces up and down may take time at platform
}
+ QTest::qWait(5000); // Wait a moment to ensure all signals are propagated
// Check that connection opening went by the book. Add checks here if more strictness needed.
if (!session->isOpen()) {
qDebug("tst_QNetworkSession::openSession() failure: QNetworkSession::open() failed.");
- return false;
+ result = false;
}
if (openedSpy.count() != 1) {
qDebug("tst_QNetworkSession::openSession() failure: QNetworkSession::opened() - signal not received.");
- return false;
+ result = false;
}
if (!errorSpy.isEmpty()) {
qDebug("tst_QNetworkSession::openSession() failure: QNetworkSession::error() - signal was detected.");
- return false;
+ result = false;
}
if (sessionInitState != QNetworkSession::Connected &&
stateChangeSpy.isEmpty()) {
qDebug("tst_QNetworkSession::openSession() failure: QNetworkSession::stateChanged() - signals not detected.");
- return false;
+ result = false;
}
if (configInitState != QNetworkConfiguration::Active &&
configChangeSpy.isEmpty()) {
qDebug("tst_QNetworkSession::openSession() failure: QNetworkConfigurationManager::configurationChanged() - signals not detected.");
- return false;
+ result = false;
}
if (session->configuration().state() != QNetworkConfiguration::Active) {
qDebug("tst_QNetworkSession::openSession() failure: session's configuration is not in 'Active' -state.");
- return false;
+ qDebug() << "tst_QNetworkSession::openSession() state is: " << session->configuration().state();
+ result = false;
+ }
+ if (result == false) {
+ qDebug() << "tst_QNetworkSession::openSession() opening session failed.";
+ } else {
+ qDebug() << "tst_QNetworkSession::openSession() opening session succeeded.";
}
- return true;
+ qDebug() << "tst_QNetworkSession::openSession() name of the configuration is: " << session->configuration().name();
+ qDebug() << "tst_QNetworkSession::openSession() configuration state is: " << session->configuration().state();
+ qDebug() << "tst_QNetworkSession::openSession() session state is: " << session->state();
+
+ return result;
}
// Helper function for closing opened session. Performs checks that
@@ -1376,6 +1474,11 @@ bool closeSession(QNetworkSession *session, bool lastSessionOnConfiguration) {
qDebug("tst_QNetworkSession::closeSession() failure: NULL session given");
return false;
}
+
+ qDebug() << "tst_QNetworkSession::closeSession() name of the configuration to be closed: " << session->configuration().name();
+ qDebug() << "tst_QNetworkSession::closeSession() state of the configuration to be closed: " << session->configuration().state();
+ qDebug() << "tst_QNetworkSession::closeSession() state of the session to be closed: " << session->state();
+
if (session->state() != QNetworkSession::Connected ||
!session->isOpen()) {
qDebug("tst_QNetworkSession::closeSession() failure: session is not opened.");
@@ -1387,38 +1490,48 @@ bool closeSession(QNetworkSession *session, bool lastSessionOnConfiguration) {
QSignalSpy sessionErrorSpy(session, SIGNAL(error(QNetworkSession::SessionError)));
QSignalSpy configChangeSpy(&mgr, SIGNAL(configurationChanged(QNetworkConfiguration)));
+ bool result = true;
session->close();
+ QTest::qWait(5000); // Wait a moment so that all signals are propagated
if (!sessionErrorSpy.isEmpty()) {
qDebug("tst_QNetworkSession::closeSession() failure: QNetworkSession::error() received.");
- return false;
+ result = false;
}
if (sessionClosedSpy.count() != 1) {
qDebug("tst_QNetworkSession::closeSession() failure: QNetworkSession::closed() signal not received.");
- return false;
+ result = false;
}
if (lastSessionOnConfiguration &&
sessionStateChangedSpy.isEmpty()) {
qDebug("tst_QNetworkSession::closeSession() failure: QNetworkSession::stateChanged() signals not received.");
- return false;
+ result = false;
}
if (lastSessionOnConfiguration &&
session->state() != QNetworkSession::Disconnected) {
qDebug("tst_QNetworkSession::closeSession() failure: QNetworkSession is not in Disconnected -state");
- return false;
+ result = false;
}
QTRY_NOOP(!configChangeSpy.isEmpty());
if (lastSessionOnConfiguration &&
configChangeSpy.isEmpty()) {
qDebug("tst_QNetworkSession::closeSession() failure: QNetworkConfigurationManager::configurationChanged() - signal not detected.");
- return false;
+ result = false;
}
if (lastSessionOnConfiguration &&
session->configuration().state() == QNetworkConfiguration::Active) {
qDebug("tst_QNetworkSession::closeSession() failure: session's configuration is still in active state.");
- return false;
+ result = false;
}
- return true;
+ if (result == false) {
+ qDebug() << "tst_QNetworkSession::closeSession() closing session failed.";
+ } else {
+ qDebug() << "tst_QNetworkSession::closeSession() closing session succeeded.";
+ }
+ qDebug() << "tst_QNetworkSession::closeSession() name of the configuration is: " << session->configuration().name();
+ qDebug() << "tst_QNetworkSession::closeSession() configuration state is: " << session->configuration().state();
+ qDebug() << "tst_QNetworkSession::closeSession() session state is: " << session->state();
+ return result;
}
void tst_QNetworkSession::sessionAutoClose_data()
diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
index f8951f5..70f2ac3 100644
--- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#define Q_TEST_QPIXMAPCACHE
#include <QtTest/QtTest>
@@ -152,6 +153,7 @@ void tst_QPixmapCache::setCacheLimit()
p1 = new QPixmap(2, 3);
key = QPixmapCache::insert(*p1);
QVERIFY(QPixmapCache::find(key, p1) != 0);
+ p1->detach(); // dectach so that the cache thinks no-one is using it.
QPixmapCache::setCacheLimit(0);
QVERIFY(QPixmapCache::find(key, p1) == 0);
QPixmapCache::setCacheLimit(1000);
@@ -169,6 +171,8 @@ void tst_QPixmapCache::setCacheLimit()
key = QPixmapCache::insert(*p1);
QVERIFY(QPixmapCache::find(key, &p2) != 0);
//we flush the cache
+ p1->detach();
+ p2.detach();
QPixmapCache::setCacheLimit(0);
QPixmapCache::setCacheLimit(1000);
QPixmapCache::Key key2 = QPixmapCache::insert(*p1);
@@ -180,21 +184,25 @@ void tst_QPixmapCache::setCacheLimit()
delete p1;
//Here we simulate the flushing when the app is idle
- /*QPixmapCache::clear();
+ QPixmapCache::clear();
QPixmapCache::setCacheLimit(originalCacheLimit);
p1 = new QPixmap(300, 300);
key = QPixmapCache::insert(*p1);
+ p1->detach();
QCOMPARE(getPrivate(key)->key, 1);
key2 = QPixmapCache::insert(*p1);
+ p1->detach();
key2 = QPixmapCache::insert(*p1);
+ p1->detach();
QPixmapCache::Key key3 = QPixmapCache::insert(*p1);
- QTest::qWait(32000);
+ p1->detach();
+ QPixmapCache::flushDetachedPixmaps();
key2 = QPixmapCache::insert(*p1);
QCOMPARE(getPrivate(key2)->key, 1);
//This old key is not valid anymore after the flush
QCOMPARE(getPrivate(key)->isValid, false);
QVERIFY(QPixmapCache::find(key, &p2) == 0);
- delete p1;*/
+ delete p1;
}
void tst_QPixmapCache::find()
@@ -225,12 +233,14 @@ void tst_QPixmapCache::find()
QPixmapCache::clear();
QPixmapCache::setCacheLimit(128);
- key = QPixmapCache::insert(p1);
+ QPixmap p4(10,10);
+ key = QPixmapCache::insert(p4);
+ p4.detach();
- //The int part of the API
+ QPixmap p5(10,10);
QList<QPixmapCache::Key> keys;
for (int i = 0; i < 4000; ++i)
- QPixmapCache::insert(p1);
+ QPixmapCache::insert(p5);
//at that time the first key has been erase because no more place in the cache
QVERIFY(QPixmapCache::find(key, &p1) == 0);
@@ -257,8 +267,10 @@ void tst_QPixmapCache::insert()
QPixmapCache::insert("0", p1);
// ditto
- for (int j = 0; j < numberOfKeys; ++j)
- QPixmapCache::insert(QString::number(j), p1);
+ for (int j = 0; j < numberOfKeys; ++j) {
+ QPixmap p3(10, 10);
+ QPixmapCache::insert(QString::number(j), p3);
+ }
int num = 0;
for (int k = 0; k < numberOfKeys; ++k) {
@@ -286,8 +298,10 @@ void tst_QPixmapCache::insert()
//The int part of the API
// make sure it doesn't explode
QList<QPixmapCache::Key> keys;
- for (int i = 0; i < numberOfKeys; ++i)
- keys.append(QPixmapCache::insert(p1));
+ for (int i = 0; i < numberOfKeys; ++i) {
+ QPixmap p3(10,10);
+ keys.append(QPixmapCache::insert(p3));
+ }
num = 0;
for (int k = 0; k < numberOfKeys; ++k) {
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index 49bddb2..8b79533 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -110,6 +110,7 @@ private slots:
void testCurrentPage();
void taskQTBUG4497_reusePrinterOnDifferentFiles();
+ void testPdfTitle();
private:
};
@@ -417,7 +418,7 @@ void tst_QPrinter::testMargins()
printer.setFullPage(fullpage);
printer.setPageSize((QPrinter::PageSize)pagesize);
if (withPainter)
- painter = new QPainter(&printer);
+ painter = new QPainter(&printer);
#ifdef QT3_SUPPORT
Q3PaintDeviceMetrics metrics(&printer);
@@ -1028,5 +1029,30 @@ void tst_QPrinter::testCurrentPage()
}
+void tst_QPrinter::testPdfTitle()
+{
+ // Check the document name is represented correctly in produced pdf
+ {
+ QPainter painter;
+ QPrinter printer;
+ // This string is just the UTF-8 encoding of the string: \()f &oslash; hiragana o
+ const char title[]={0x5c, 0x28, 0x29, 0x66, 0xc3, 0xb8, 0xe3, 0x81, 0x8a, 0x00};
+ printer.setOutputFileName("file.pdf");
+ printer.setDocName(QString::fromUtf8(title));
+ painter.begin(&printer);
+ painter.end();
+ }
+ QFile file("file.pdf");
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ // The we expect the title to appear in the PDF as:
+ // ASCII('\title (') UTF16(\\\(\)f &oslash; hiragana o) ASCII(')').
+ // which has the following binary representation
+ const char expected[] = {
+ 0x2f, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x28, 0xfe,
+ 0xff, 0x00, 0x5c, 0x5c, 0x00, 0x5c, 0x28, 0x00, 0x5c,
+ 0x29, 0x00, 0x66, 0x00, 0xf8, 0x30, 0x4a, 0x29};
+ QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
+}
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 849b8b2..ea527de 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -133,6 +133,7 @@ private slots:
void twoAnimations();
void deletedInUpdateCurrentTime();
void totalDuration();
+ void zeroLoopCount();
};
tst_QPropertyAnimation::tst_QPropertyAnimation()
@@ -1214,6 +1215,29 @@ void tst_QPropertyAnimation::totalDuration()
QCOMPARE(anim.totalDuration(), 0);
}
+void tst_QPropertyAnimation::zeroLoopCount()
+{
+ DummyPropertyAnimation* anim;
+ anim = new DummyPropertyAnimation;
+ anim->setStartValue(0);
+ anim->setDuration(20);
+ anim->setLoopCount(0);
+
+ QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QSignalSpy finishedSpy(anim, SIGNAL(finished()));
+
+ QCOMPARE(anim->state(), QAnimationGroup::Stopped);
+ QCOMPARE(anim->currentValue().toInt(), 0);
+ QCOMPARE(runningSpy.count(), 0);
+ QCOMPARE(finishedSpy.count(), 0);
+
+ anim->start();
+
+ QCOMPARE(anim->state(), QAnimationGroup::Stopped);
+ QCOMPARE(anim->currentValue().toInt(), 0);
+ QCOMPARE(runningSpy.count(), 0);
+ QCOMPARE(finishedSpy.count(), 0);
+}
QTEST_MAIN(tst_QPropertyAnimation)
#include "tst_qpropertyanimation.moc"
diff --git a/tests/auto/qsocketnotifier/qsocketnotifier.pro b/tests/auto/qsocketnotifier/qsocketnotifier.pro
index ec924c1..c43c96a 100644
--- a/tests/auto/qsocketnotifier/qsocketnotifier.pro
+++ b/tests/auto/qsocketnotifier/qsocketnotifier.pro
@@ -6,5 +6,6 @@ requires(contains(QT_CONFIG,private_tests))
include(../qnativesocketengine/qsocketengine.pri)
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
index 4a32852..cd5e6e7 100644
--- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
+++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro
@@ -11,6 +11,7 @@ QT = core network
# Symbian toolchain does not support correct include semantics
symbian:INCPATH+=..\..\..\include\QtNetwork\private
+symbian: TARGET.CAPABILITY = NetworkServices
requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 2339b21..992c95e 100644
--- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -138,6 +138,7 @@ private slots:
void taskQTBUG_6205_doubleProxySelectionSetSourceModel();
void taskQTBUG_7537_appearsAndSort();
void taskQTBUG_7716_unnecessaryDynamicSorting();
+ void taskQTBUG_10287_unnecessaryMapCreation();
void testMultipleProxiesWithSelection();
@@ -3038,5 +3039,65 @@ void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection()
}
+class Model10287 : public QStandardItemModel
+{
+ Q_OBJECT
+
+public:
+ Model10287(QObject *parent = 0)
+ : QStandardItemModel(0, 1, parent)
+ {
+ parentItem = new QStandardItem("parent");
+ parentItem->setData(false, Qt::UserRole);
+ appendRow(parentItem);
+
+ childItem = new QStandardItem("child");
+ childItem->setData(true, Qt::UserRole);
+ parentItem->appendRow(childItem);
+
+ childItem2 = new QStandardItem("child2");
+ childItem2->setData(true, Qt::UserRole);
+ parentItem->appendRow(childItem2);
+ }
+
+ void removeChild()
+ {
+ childItem2->setData(false, Qt::UserRole);
+ parentItem->removeRow(0);
+ }
+
+private:
+ QStandardItem *parentItem, *childItem, *childItem2;
+};
+
+class Proxy10287 : public QSortFilterProxyModel
+{
+ Q_OBJECT
+
+public:
+ Proxy10287(QAbstractItemModel *model, QObject *parent = 0)
+ : QSortFilterProxyModel(parent)
+ {
+ setSourceModel(model);
+ setDynamicSortFilter(true);
+ }
+
+protected:
+ virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
+ {
+ // Filter based on UserRole in model
+ QModelIndex i = sourceModel()->index(source_row, 0, source_parent);
+ return i.data(Qt::UserRole).toBool();
+ }
+};
+
+void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation()
+{
+ Model10287 m;
+ Proxy10287 p(&m);
+ m.removeChild();
+ // No assert failure, it passes.
+}
+
QTEST_MAIN(tst_QSortFilterProxyModel)
#include "tst_qsortfilterproxymodel.moc"
diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro
index b237f2e..d7671ea 100644
--- a/tests/auto/qsslcertificate/qsslcertificate.pro
+++ b/tests/auto/qsslcertificate/qsslcertificate.pro
@@ -24,4 +24,5 @@ wince*: {
DEFINES += SRCDIR=\\\".\\\"
} else:!symbian {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
+ TARGET.CAPABILITY = NetworkServices
}
diff --git a/tests/auto/qsslcipher/qsslcipher.pro b/tests/auto/qsslcipher/qsslcipher.pro
index 6eae588..78fd387 100644
--- a/tests/auto/qsslcipher/qsslcipher.pro
+++ b/tests/auto/qsslcipher/qsslcipher.pro
@@ -14,4 +14,5 @@ win32 {
}
}
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qsslerror/qsslerror.pro b/tests/auto/qsslerror/qsslerror.pro
index ee5872b..5b907fb 100644
--- a/tests/auto/qsslerror/qsslerror.pro
+++ b/tests/auto/qsslerror/qsslerror.pro
@@ -14,4 +14,5 @@ win32 {
}
}
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro
index 32138f8..e3eeef9 100644
--- a/tests/auto/qsslkey/qsslkey.pro
+++ b/tests/auto/qsslkey/qsslkey.pro
@@ -24,4 +24,5 @@ wince*: {
DEFINES += SRCDIR=\\\".\\\"
} else:!symbian {
DEFINES+= SRCDIR=\\\"$$PWD\\\"
+ TARGET.CAPABILITY = NetworkServices
}
diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro
index 541b2d9..3557fc8 100644
--- a/tests/auto/qsslsocket/qsslsocket.pro
+++ b/tests/auto/qsslsocket/qsslsocket.pro
@@ -24,7 +24,7 @@ wince* {
} else:symbian {
DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
TARGET.EPOCHEAPSIZE="0x100 0x1000000"
- TARGET.CAPABILITY="ALL -TCB"
+ TARGET.CAPABILITY=NetworkServices
certFiles.sources = certs ssl.tar.gz
certFiles.path = .
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index e0512a9..e370309 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -98,6 +98,7 @@ private slots:
void complexWidgetFocus();
void task188195_baseBackground();
void task232085_spinBoxLineEditBg();
+ void changeStyleInChangeEvent();
//at the end because it mess with the style.
void widgetStyle();
@@ -1256,7 +1257,7 @@ void tst_QStyleSheetStyle::proxyStyle()
QStyleOptionViewItemV4 opt;
opt.initFrom(w);
opt.features |= QStyleOptionViewItemV2::HasCheckIndicator;
- QVERIFY(pb5->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator,
+ QVERIFY(pb5->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator,
&opt, pb5).width() == 3);
delete w;
delete proxy;
@@ -1579,6 +1580,34 @@ void tst_QStyleSheetStyle::task232085_spinBoxLineEditBg()
.toLocal8Bit().constData());
}
+class ChangeEventWidget : public QWidget
+{ public:
+ void changeEvent(QEvent * event)
+ {
+ if(event->type() == QEvent::StyleChange) {
+ static bool recurse = false;
+ if (!recurse) {
+ recurse = true;
+ QStyle *style = new QMotifStyle;
+ style->setParent(this);
+ setStyle(style);
+ recurse = false;
+ }
+ }
+ QWidget::changeEvent(event);
+ }
+};
+
+void tst_QStyleSheetStyle::changeStyleInChangeEvent()
+{ //must not crash;
+ ChangeEventWidget wid;
+ wid.ensurePolished();
+ wid.setStyleSheet(" /* */ ");
+ wid.ensurePolished();
+ wid.setStyleSheet(" /* ** */ ");
+ wid.ensurePolished();
+}
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"
diff --git a/tests/auto/qtcpserver/qtcpserver.pro b/tests/auto/qtcpserver/qtcpserver.pro
index fe5ea37..a3744a2 100644
--- a/tests/auto/qtcpserver/qtcpserver.pro
+++ b/tests/auto/qtcpserver/qtcpserver.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = test crashingServer
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro
index 3d4eba3..370a695 100644
--- a/tests/auto/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/qtcpsocket/qtcpsocket.pro
@@ -6,3 +6,4 @@ wince*|symbian*|vxworks* : SUBDIRS = test
requires(contains(QT_CONFIG,private_tests))
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index cd512a1..31cae40 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -144,6 +144,7 @@ private slots:
void blockingIMAP();
void nonBlockingIMAP();
void hostNotFound();
+ void timeoutConnect_data();
void timeoutConnect();
void delayedClose();
void partialRead();
@@ -544,19 +545,36 @@ void tst_QTcpSocket::hostNotFound()
}
//----------------------------------------------------------------------------------
+void tst_QTcpSocket::timeoutConnect_data()
+{
+ QTest::addColumn<QString>("address");
+ QTest::newRow("host") << QtNetworkSettings::serverName();
+ QTest::newRow("ip") << QtNetworkSettings::serverIP().toString();
+}
void tst_QTcpSocket::timeoutConnect()
{
+ QFETCH(QString, address);
QTcpSocket *socket = newSocket();
- // Outgoing port 53 is firewalled in the Oslo office.
- socket->connectToHost("cisco.com", 53);
+ QElapsedTimer timer;
+ timer.start();
+
+ // Port 1357 is configured to drop packets on the test server
+ socket->connectToHost(address, 1357);
+ QVERIFY(timer.elapsed() < 50);
QVERIFY(!socket->waitForConnected(200));
QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
QCOMPARE(int(socket->error()), int(QTcpSocket::SocketTimeoutError));
- socket->connectToHost("cisco.com", 53);
- QTest::qSleep(50);
+ timer.start();
+ socket->connectToHost(address, 1357);
+ QVERIFY(timer.elapsed() < 50);
+ QTimer::singleShot(50, &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(5);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(socket->state() == QTcpSocket::ConnectingState
+ || socket->state() == QTcpSocket::HostLookupState);
socket->abort();
QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
QCOMPARE(socket->openMode(), QIODevice::NotOpen);
diff --git a/tests/auto/qudpsocket/qudpsocket.pro b/tests/auto/qudpsocket/qudpsocket.pro
index 4ef8a40..8fd3545 100644
--- a/tests/auto/qudpsocket/qudpsocket.pro
+++ b/tests/auto/qudpsocket/qudpsocket.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = test clientserver
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qurl/qurl.pro b/tests/auto/qurl/qurl.pro
index 72c93bc..018bb38 100644
--- a/tests/auto/qurl/qurl.pro
+++ b/tests/auto/qurl/qurl.pro
@@ -1,3 +1,4 @@
load(qttest_p4)
SOURCES += tst_qurl.cpp
QT = core
+symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 76e20b9..5d47aed 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9514,6 +9514,8 @@ void tst_QWidget::destroyBackingStore()
w.update();
QApplication::processEvents();
QCOMPARE(w.numPaintEvents, 2);
+#else
+ QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll);
#endif
}
@@ -9992,6 +9994,7 @@ void tst_QWidget::focusProxyAndInputMethods()
delete toplevel;
}
+#ifdef QT_BUILD_INTERNAL
class scrollWidgetWBS : public QWidget
{
public:
@@ -10011,9 +10014,11 @@ public:
}
}
};
+#endif
void tst_QWidget::scrollWithoutBackingStore()
{
+#ifdef QT_BUILD_INTERNAL
scrollWidgetWBS scrollable;
scrollable.resize(100,100);
QLabel child(QString("@"),&scrollable);
@@ -10027,6 +10032,9 @@ void tst_QWidget::scrollWithoutBackingStore()
QCOMPARE(child.pos(),QPoint(25,25));
scrollable.enableBackingStore();
QCOMPARE(child.pos(),QPoint(25,25));
+#else
+ QSKIP("Test case relies on developer build (AUTOTEST_EXPORT)", SkipAll);
+#endif
}
void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy()
diff --git a/tests/auto/qwidgetaction/tst_qwidgetaction.cpp b/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
index 5dfcd43..53dc4b5 100644
--- a/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
+++ b/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
@@ -51,6 +51,8 @@
#include <qmainwindow.h>
#include <qmenubar.h>
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -190,8 +192,8 @@ void tst_QWidgetAction::visibilityUpdate()
QVERIFY(action->isVisible());
action->setVisible(false);
- QTest::qWait(100); //the call to hide is delayed by the toolbar layout
- QVERIFY(!combo->isVisible());
+ qApp->processEvents(); //the call to hide is delayed by the toolbar layout
+ QTRY_VERIFY(!combo->isVisible());
delete action;
// action also deletes combo
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index be0d708..6fd9b93 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -857,7 +857,7 @@ void tst_QXmlQuery::bindVariableXSLTSuccess() const
stylesheet.bindVariable(QLatin1String("paramSelectWithTypeIntBoundWithBindVariableRequired"),
QVariant(QLatin1String("param5")));
- stylesheet.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl"))));
+ stylesheet.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl"))));
QVERIFY(stylesheet.isValid());
@@ -1798,11 +1798,11 @@ void tst_QXmlQuery::setFocusQUrl() const
{
QXmlQuery query(QXmlQuery::XSLT20);
- const TestURIResolver resolver(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ const TestURIResolver resolver(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
query.setUriResolver(&resolver);
QVERIFY(query.setFocus(QUrl(QLatin1String("arbitraryURI"))));
- query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl"))));
+ query.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl"))));
QVERIFY(query.isValid());
QBuffer result;
@@ -2997,7 +2997,7 @@ void tst_QXmlQuery::setInitialTemplateNameQXmlName() const
QCOMPARE(query.initialTemplateName(), name);
- query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl"))));
+ query.setQuery(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl"))));
QVERIFY(query.isValid());
QBuffer result;
@@ -3059,7 +3059,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
/* Ensure fn:doc() picks up the right QNetworkAccessManager. */
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
- QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml"))));
+ QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml"))));
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3075,7 +3075,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
/* Ensure setQuery() is using the right network manager. */
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
- QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq"))));
+ QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq"))));
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3135,7 +3135,7 @@ void tst_QXmlQuery::multipleDocsAndFocus() const
query.setQuery(QLatin1String("string(doc('") +
inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")) +
QLatin1String("'))"));
- query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
query.setQuery(QLatin1String("string(.)"));
QStringList result;
@@ -3159,11 +3159,11 @@ void tst_QXmlQuery::multipleEvaluationsWithDifferentFocus() const
QXmlQuery query;
QStringList result;
- query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
query.setQuery(QLatin1String("string(.)"));
QVERIFY(query.evaluateTo(&result));
- query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+ query.setFocus(QUrl(inputFileAsURI(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
QVERIFY(query.evaluateTo(&result));
}
diff --git a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp
index 64120c7..ec63858 100644
--- a/tests/auto/xmlpatternsxqts/tst_suitetest.cpp
+++ b/tests/auto/xmlpatternsxqts/tst_suitetest.cpp
@@ -89,10 +89,17 @@ void tst_SuiteTest::runTestSuite() const
TestSuite::SuiteType suiteType;
switch (m_suiteType) {
- case XQuerySuite: suiteType = TestSuite::XQuerySuite;
- case XsltSuite: suiteType = TestSuite::XsltSuite;
- case XsdSuite: suiteType = TestSuite::XsdSuite;
- default: break;
+ case XQuerySuite:
+ suiteType = TestSuite::XQuerySuite;
+ break;
+ case XsltSuite:
+ suiteType = TestSuite::XsltSuite;
+ break;
+ case XsdSuite:
+ suiteType = TestSuite::XsdSuite;
+ break;
+ default:
+ break;
}
TestSuite *const ts = TestSuite::openCatalog(catalogPath, errMsg, true, suiteType);
diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro
index 5ceaf34..268541f 100644
--- a/tests/benchmarks/declarative/binding/binding.pro
+++ b/tests/benchmarks/declarative/binding/binding.pro
@@ -8,11 +8,11 @@ SOURCES += tst_binding.cpp testtypes.cpp
HEADERS += testtypes.h
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-symbian* {
- data.sources = data/*
- data.path = data
- DEPLOYMENT = data
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-
diff --git a/tests/benchmarks/declarative/compilation/compilation.pro b/tests/benchmarks/declarative/compilation/compilation.pro
new file mode 100644
index 0000000..32f4aba
--- /dev/null
+++ b/tests/benchmarks/declarative/compilation/compilation.pro
@@ -0,0 +1,11 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_compilation
+QT += declarative
+macx:CONFIG -= app_bundle
+
+CONFIG += release
+
+SOURCES += tst_compilation.cpp
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/benchmarks/declarative/compilation/data/BoomBlock.qml b/tests/benchmarks/declarative/compilation/data/BoomBlock.qml
new file mode 100644
index 0000000..47f43c2
--- /dev/null
+++ b/tests/benchmarks/declarative/compilation/data/BoomBlock.qml
@@ -0,0 +1,65 @@
+import Qt 4.7
+import Qt.labs.particles 1.0
+
+Item {
+ id: block
+ property bool dying: false
+ property bool spawned: false
+ property int type: 0
+ property int targetX: 0
+ property int targetY: 0
+
+ SpringFollow on x { enabled: spawned; to: targetX; spring: 2; damping: 0.2 }
+ SpringFollow on y { to: targetY; 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/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp b/tests/benchmarks/declarative/compilation/tst_compilation.cpp
index f1a71d5..5694d5b 100644
--- a/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp
+++ b/tests/benchmarks/declarative/compilation/tst_compilation.cpp
@@ -38,37 +38,53 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
#include <QFile>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativecomponent.h>
-#include <QtGui/qgraphicswidget.h>
-class tst_graphicswidgets : public QObject
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Application private dir is default serach path for files, so SRCDIR can be set to empty
+#define SRCDIR ""
+#endif
+class tst_compilation : public QObject
{
Q_OBJECT
public:
- tst_graphicswidgets();
+ tst_compilation();
private slots:
- void widgets();
+ void boomblock();
+
+private:
+ QDeclarativeEngine engine;
};
-tst_graphicswidgets::tst_graphicswidgets()
+tst_compilation::tst_compilation()
{
}
-void tst_graphicswidgets::widgets()
+inline QUrl TEST_FILE(const QString &filename)
{
- QDeclarativeEngine engine;
- QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/graphicswidgets.qml"));
- QGraphicsWidget *obj = qobject_cast<QGraphicsWidget*>(c.create());
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+void tst_compilation::boomblock()
+{
+ QFile f(SRCDIR + QLatin1String("/data/BoomBlock.qml"));
+ QVERIFY(f.open(QIODevice::ReadOnly));
+ QByteArray data = f.readAll();
- QVERIFY(obj != 0);
- delete obj;
+ QBENCHMARK {
+ QDeclarativeComponent c(&engine);
+ c.setData(data, QUrl());
+// QVERIFY(c.isReady());
+ }
}
-QTEST_MAIN(tst_graphicswidgets)
+QTEST_MAIN(tst_compilation)
-#include "tst_graphicswidgets.moc"
+#include "tst_compilation.moc"
diff --git a/tests/benchmarks/declarative/creation/creation.pro b/tests/benchmarks/declarative/creation/creation.pro
index 3e0caf6..08ad772 100644
--- a/tests/benchmarks/declarative/creation/creation.pro
+++ b/tests/benchmarks/declarative/creation/creation.pro
@@ -6,10 +6,11 @@ macx:CONFIG -= app_bundle
SOURCES += tst_creation.cpp
-symbian* {
- data.sources = data/*
- data.path = data
- DEPLOYMENT += addFiles
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
-} \ No newline at end of file
+}
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp
index 6f00473..6e9197b 100644
--- a/tests/benchmarks/declarative/creation/tst_creation.cpp
+++ b/tests/benchmarks/declarative/creation/tst_creation.cpp
@@ -50,12 +50,6 @@
#include <QDeclarativeContext>
#include <private/qobject_p.h>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR ""
-#endif
-
class tst_creation : public QObject
{
Q_OBJECT
@@ -203,7 +197,7 @@ void tst_creation::qobject_10tree_cpp()
void tst_creation::qobject_qmltype()
{
- QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/QtObject", 4, 6);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/QtObject", 4, 7);
QBENCHMARK {
QObject *obj = t->create();
@@ -347,7 +341,7 @@ void tst_creation::elements_data()
void tst_creation::elements()
{
QFETCH(QByteArray, type);
- QDeclarativeType *t = QDeclarativeMetaType::qmlType(type, 4, 6);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(type, 4, 7);
if (!t || !t->isCreatable())
QSKIP("Non-creatable type", SkipSingle);
diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro
index a7d426c..262247a 100644
--- a/tests/benchmarks/declarative/declarative.pro
+++ b/tests/benchmarks/declarative/declarative.pro
@@ -1,8 +1,11 @@
TEMPLATE = subdirs
+!symbian: {
+ SUBDIRS += painting
+}
+
SUBDIRS += \
binding \
creation \
- painting \
pointers \
qdeclarativecomponent \
qdeclarativeimage \
diff --git a/tests/benchmarks/declarative/painting/painting.pro b/tests/benchmarks/declarative/painting/painting.pro
index 2f98e8b..a228ea7 100644
--- a/tests/benchmarks/declarative/painting/painting.pro
+++ b/tests/benchmarks/declarative/painting/painting.pro
@@ -11,3 +11,4 @@ INCLUDEPATH += .
SOURCES += paintbenchmark.cpp
QT += opengl
CONFIG += console
+macx:CONFIG -= app_bundle
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index 30ef235..670e425 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -8,15 +8,11 @@ SOURCES += tst_qdeclarativecomponent.cpp testtypes.cpp
HEADERS += testtypes.h
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
-symbian* {
- data.sources = data/*
- data.path = data
- samegame.sources = data/samegame/*
- samegame.path = data/samegame
- samegame_pics.sources = data/samegame/pics/*
- samegame_pics.path = data/samegame/pics
- DEPLOYMENT += data samegame samegame_pics
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
}
-
diff --git a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro
index bbe4e8d..fb5779a 100644
--- a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro
+++ b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro
@@ -7,10 +7,12 @@ CONFIG += release
SOURCES += tst_qdeclarativeimage.cpp
-symbian* {
- data.sources = image.png
- data.path = .
- DEPLOYMENT += data
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = image.png
+ importFiles.path =
+ DEPLOYMENT = importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
+
diff --git a/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index 4bba022..e979f20 100644
--- a/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -44,12 +44,6 @@
#include <QDeclarativeComponent>
#include <private/qdeclarativeimage_p.h>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR ""
-#endif
-
class tst_qmlgraphicsimage : public QObject
{
Q_OBJECT
@@ -68,7 +62,7 @@ private:
void tst_qmlgraphicsimage::qmlgraphicsimage()
{
int x = 0;
- QUrl url("image.png");
+ QUrl url(SRCDIR "/image.png");
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
@@ -80,7 +74,7 @@ void tst_qmlgraphicsimage::qmlgraphicsimage()
void tst_qmlgraphicsimage::qmlgraphicsimage_file()
{
int x = 0;
- QUrl url("image.png");
+ QUrl url(SRCDIR "/image.png");
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
@@ -93,7 +87,7 @@ void tst_qmlgraphicsimage::qmlgraphicsimage_file()
void tst_qmlgraphicsimage::qmlgraphicsimage_url()
{
int x = 0;
- QUrl url("image.png");
+ QUrl url(SRCDIR "/image.png");
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
index 79fdd26..55dfafe 100644
--- a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
+++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
@@ -7,4 +7,11 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativemetaproperty.cpp
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/benchmarks/declarative/script/data/slot_complex_js.js b/tests/benchmarks/declarative/script/data/slot_complex_js.js
new file mode 100644
index 0000000..64a1f65
--- /dev/null
+++ b/tests/benchmarks/declarative/script/data/slot_complex_js.js
@@ -0,0 +1,8 @@
+function myCustomFunction(n) {
+ var a = 1;
+ while (n > 0) {
+ a = a * n;
+ n--;
+ }
+ return a;
+}
diff --git a/tests/benchmarks/declarative/script/data/slot_complex_js.qml b/tests/benchmarks/declarative/script/data/slot_complex_js.qml
index ed4f78b..7bda48b 100644
--- a/tests/benchmarks/declarative/script/data/slot_complex_js.qml
+++ b/tests/benchmarks/declarative/script/data/slot_complex_js.qml
@@ -1,18 +1,8 @@
import Qt.test 1.0
+import "slot_complex_js.js" as Logic
TestObject {
- Script {
- function myCustomFunction(n) {
- var a = 1;
- while (n > 0) {
- a = a * n;
- n--;
- }
- return a;
- }
- }
-
- onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(10); } }
+ onMySignal: { for (var ii = 0; ii < 10000; ++ii) { Logic.myCustomFunction(10); } }
}
diff --git a/tests/benchmarks/declarative/script/data/slot_simple_js.js b/tests/benchmarks/declarative/script/data/slot_simple_js.js
new file mode 100644
index 0000000..d6e6060
--- /dev/null
+++ b/tests/benchmarks/declarative/script/data/slot_simple_js.js
@@ -0,0 +1,3 @@
+function myCustomFunction() {
+ return 0;
+}
diff --git a/tests/benchmarks/declarative/script/data/slot_simple_js.qml b/tests/benchmarks/declarative/script/data/slot_simple_js.qml
index a88265c..7ea3177 100644
--- a/tests/benchmarks/declarative/script/data/slot_simple_js.qml
+++ b/tests/benchmarks/declarative/script/data/slot_simple_js.qml
@@ -1,13 +1,7 @@
import Qt.test 1.0
+import "slot_simple_js.js" as Logic
TestObject {
-
- Script {
- function myCustomFunction() {
- return 0;
- }
- }
-
- onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(); } }
+ onMySignal: { for (var ii = 0; ii < 10000; ++ii) { Logic.myCustomFunction(); } }
}
diff --git a/tests/benchmarks/declarative/script/script.pro b/tests/benchmarks/declarative/script/script.pro
index 6255acc..91db871 100644
--- a/tests/benchmarks/declarative/script/script.pro
+++ b/tests/benchmarks/declarative/script/script.pro
@@ -7,10 +7,11 @@ CONFIG += release
SOURCES += tst_script.cpp
-symbian* {
- data.sources = data/*
- data.path = data
- DEPLOYMENT += data
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/benchmarks/declarative/script/tst_script.cpp b/tests/benchmarks/declarative/script/tst_script.cpp
index 8ea6dcd..6dc7ed6 100644
--- a/tests/benchmarks/declarative/script/tst_script.cpp
+++ b/tests/benchmarks/declarative/script/tst_script.cpp
@@ -48,12 +48,6 @@
#include <QScriptEngine>
#include <QScriptValue>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default serach path for files, so SRCDIR can be set to empty
-#define SRCDIR "."
-#endif
-
class tst_script : public QObject
{
Q_OBJECT
diff --git a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
index 9ffbefb..8e9de4a 100644
--- a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
@@ -43,6 +43,7 @@
#include <QPixmap>
#include <QBitmap>
#include <QPainter>
+#include <private/qpixmap_raster_p.h>
class tst_QPixmap : public QObject
{
@@ -67,6 +68,31 @@ Q_DECLARE_METATYPE(QImage::Format)
Q_DECLARE_METATYPE(Qt::AspectRatioMode)
Q_DECLARE_METATYPE(Qt::TransformationMode)
+QPixmap rasterPixmap(int width, int height)
+{
+ QPixmapData *data =
+ new QRasterPixmapData(QPixmapData::PixmapType);
+
+ data->resize(width, height);
+
+ return QPixmap(data);
+}
+
+QPixmap rasterPixmap(const QSize &size)
+{
+ return rasterPixmap(size.width(), size.height());
+}
+
+QPixmap rasterPixmap(const QImage &image)
+{
+ QPixmapData *data =
+ new QRasterPixmapData(QPixmapData::PixmapType);
+
+ data->fromImage(image, Qt::AutoColor);
+
+ return QPixmap(data);
+}
+
tst_QPixmap::tst_QPixmap()
{
}
@@ -90,7 +116,7 @@ void tst_QPixmap::fill()
QFETCH(int, height);
const QColor color = opaque ? QColor(255, 0, 0) : QColor(255, 0, 0, 200);
- QPixmap pixmap(width, height);
+ QPixmap pixmap = rasterPixmap(width, height);
QBENCHMARK {
pixmap.fill(color);
@@ -126,8 +152,8 @@ void tst_QPixmap::scaled()
QFETCH(Qt::AspectRatioMode, ratioMode);
QFETCH(Qt::TransformationMode, transformMode);
- QPixmap opaque(size);
- QPixmap transparent(size);
+ QPixmap opaque = rasterPixmap(size);
+ QPixmap transparent = rasterPixmap(size);
opaque.fill(QColor(255, 0, 0));
transparent.fill(QColor(255, 0, 0, 200));
@@ -180,8 +206,8 @@ void tst_QPixmap::transformed()
QFETCH(QTransform, transform);
QFETCH(Qt::TransformationMode, transformMode);
- QPixmap opaque(size);
- QPixmap transparent(size);
+ QPixmap opaque = rasterPixmap(size);
+ QPixmap transparent = rasterPixmap(size);
opaque.fill(QColor(255, 0, 0));
transparent.fill(QColor(255, 0, 0, 200));
@@ -209,7 +235,7 @@ void tst_QPixmap::mask()
{
QFETCH(QSize, size);
- QPixmap src(size);
+ QPixmap src = rasterPixmap(size);
src.fill(Qt::transparent);
{
QPainter p(&src);
diff --git a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
index 8c30be4..7015bd1 100644
--- a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
@@ -159,12 +159,17 @@ void tst_QWidget::update_data()
QTest::newRow("10x10x1 opaque") << 10 << 10 << 1 << true;
QTest::newRow("10x10x10 opaque") << 10 << 10 << 10 << true;
QTest::newRow("10x10x100 opaque") << 10 << 10 << 100 << true;
+#ifndef Q_OS_SYMBIAN
+ //These test cases cause stack overflow in QWidgetPrivate::paintSiblingsRecursive
+ //see http://bugreports.qt.nokia.com/browse/QTBUG-8512
+ //Symbian threads have a hard limit of 80kB user stack
QTest::newRow("25x25x1 transparent ") << 25 << 25 << 1 << false;
QTest::newRow("25x25x10 transparent") << 25 << 25 << 10 << false;
QTest::newRow("25x25x100 transparent") << 25 << 25 << 100 << false;
QTest::newRow("25x25x1 opaque") << 25 << 25 << 1 << true;
QTest::newRow("25x25x10 opaque") << 25 << 25 << 10 << true;
QTest::newRow("25x25x100 opaque") << 25 << 25 << 100 << true;
+#endif
}
void tst_QWidget::update()
diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
index d570bb3..318b671 100644
--- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
@@ -50,6 +50,8 @@
#define M_PI 3.14159265358979323846
#endif
+#include <private/qpixmap_raster_p.h>
+
Q_DECLARE_METATYPE(QLine)
Q_DECLARE_METATYPE(QRect)
Q_DECLARE_METATYPE(QSize)
@@ -125,6 +127,32 @@ struct PrimitiveSet {
};
+QPixmap rasterPixmap(int width, int height)
+{
+ QPixmapData *data =
+ new QRasterPixmapData(QPixmapData::PixmapType);
+
+ data->resize(width, height);
+
+ return QPixmap(data);
+}
+
+QPixmap rasterPixmap(const QSize &size)
+{
+ return rasterPixmap(size.width(), size.height());
+}
+
+QPixmap rasterPixmap(const QImage &image)
+{
+ QPixmapData *data =
+ new QRasterPixmapData(QPixmapData::PixmapType);
+
+ data->fromImage(image, Qt::AutoColor);
+
+ return QPixmap(data);
+}
+
+
class tst_QPainter : public QObject
{
Q_OBJECT
@@ -222,7 +250,8 @@ private:
QPaintDevice *surface()
{
- return new QPixmap(1024, 1024);
+ m_pixmap = rasterPixmap(1024, 1024);
+ return &m_pixmap;
}
@@ -233,6 +262,7 @@ private:
PrimitiveSet m_primitives_100;
PrimitiveSet m_primitives_1000;
+ QPixmap m_pixmap;
QPaintDevice *m_surface;
QPainter m_painter;
@@ -490,7 +520,7 @@ void tst_QPainter::setupBrushes()
void tst_QPainter::beginAndEnd()
{
- QPixmap pixmap(100, 100);
+ QPixmap pixmap = rasterPixmap(100, 100);
QBENCHMARK {
QPainter p;
@@ -505,10 +535,11 @@ void tst_QPainter::drawLine()
QFETCH(QPen, pen);
const int offset = 5;
- QPixmap pixmapUnclipped(qMin(line.x1(), line.x2())
- + 2*offset + qAbs(line.dx()),
- qMin(line.y1(), line.y2())
- + 2*offset + qAbs(line.dy()));
+ QPixmap pixmapUnclipped =
+ rasterPixmap(qMin(line.x1(), line.x2())
+ + 2*offset + qAbs(line.dx()),
+ qMin(line.y1(), line.y2())
+ + 2*offset + qAbs(line.dy()));
pixmapUnclipped.fill(Qt::white);
QPainter p(&pixmapUnclipped);
@@ -535,10 +566,11 @@ void tst_QPainter::drawLine_clipped()
QFETCH(QPen, pen);
const int offset = 5;
- QPixmap pixmapClipped(qMin(line.x1(), line.x2())
- + 2*offset + qAbs(line.dx()),
- qMin(line.y1(), line.y2())
- + 2*offset + qAbs(line.dy()));
+ QPixmap pixmapClipped
+ = rasterPixmap(qMin(line.x1(), line.x2())
+ + 2*offset + qAbs(line.dx()),
+ qMin(line.y1(), line.y2())
+ + 2*offset + qAbs(line.dy()));
const QRect clip = QRect(line.p1(), line.p2()).normalized();
@@ -569,10 +601,11 @@ void tst_QPainter::drawLine_antialiased_clipped()
QFETCH(QPen, pen);
const int offset = 5;
- QPixmap pixmapClipped(qMin(line.x1(), line.x2())
- + 2*offset + qAbs(line.dx()),
- qMin(line.y1(), line.y2())
- + 2*offset + qAbs(line.dy()));
+ QPixmap pixmapClipped
+ = rasterPixmap(qMin(line.x1(), line.x2())
+ + 2*offset + qAbs(line.dx()),
+ qMin(line.y1(), line.y2())
+ + 2*offset + qAbs(line.dy()));
const QRect clip = QRect(line.p1(), line.p2()).normalized();
@@ -696,8 +729,8 @@ void tst_QPainter::drawPixmap()
QImage sourceImage = createImage(type, size).convertToFormat(sourceFormat);
QImage targetImage(size, targetFormat);
- QPixmap sourcePixmap = QPixmap::fromImage(sourceImage);
- QPixmap targetPixmap = QPixmap::fromImage(targetImage);
+ QPixmap sourcePixmap = rasterPixmap(sourceImage);
+ QPixmap targetPixmap = rasterPixmap(targetImage);
QPainter p(&targetPixmap);
@@ -759,10 +792,10 @@ void tst_QPainter::compositionModes()
QFETCH(QSize, size);
QFETCH(QColor, color);
- QPixmap src(size);
+ QPixmap src = rasterPixmap(size);
src.fill(color);
- QPixmap dest(size);
+ QPixmap dest = rasterPixmap(size);
if (mode < QPainter::RasterOp_SourceOrDestination)
color.setAlpha(127); // porter-duff needs an alpha channel
dest.fill(color);
@@ -844,11 +877,11 @@ void tst_QPainter::drawTiledPixmap()
QFETCH(QColor, color);
QFETCH(QPainter::RenderHint, renderHint);
- QPixmap src(srcSize);
+ QPixmap src = rasterPixmap(srcSize);
src.fill(color);
const QRect dstRect = transform.mapRect(QRect(QPoint(), dstSize));
- QPixmap dst(dstRect.right() + 5, dstRect.bottom() + 5);
+ QPixmap dst = rasterPixmap(dstRect.right() + 5, dstRect.bottom() + 5);
QPainter p(&dst);
p.setTransform(transform);
p.setRenderHint(renderHint);
@@ -1411,7 +1444,7 @@ void tst_QPainter::drawBorderPixmapRoundedRect()
rp.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, rectImage.width()-(pw+1), rectImage.height()-(pw+1)), radius, radius);
else
rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
- QPixmap rectPixmap = QPixmap::fromImage(rectImage);
+ QPixmap rectPixmap = rasterPixmap(rectImage);
//setup surface
QImage surface(100, 100, QImage::Format_RGB16);
@@ -1466,7 +1499,7 @@ void tst_QPainter::drawScaledBorderPixmapRoundedRect()
else
rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
- QPixmap rectPixmap = QPixmap::fromImage(rectImage);
+ QPixmap rectPixmap = rasterPixmap(rectImage);
//setup surface
QImage surface(400, 400, QImage::Format_RGB16);
@@ -1522,7 +1555,7 @@ void tst_QPainter::drawTransformedBorderPixmapRoundedRect()
else
rp.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, rectImage.width()-pw, rectImage.height()-pw), radius, radius);
- QPixmap rectPixmap = QPixmap::fromImage(rectImage);
+ QPixmap rectPixmap = rasterPixmap(rectImage);
//setup surface
QImage surface(400, 400, QImage::Format_RGB16);
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index 19246a2..bf60dd1 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -300,8 +300,12 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
SessionTab::~SessionTab()
{
+ // Need to be nulled, because modal dialogs may return after destruction of this object and
+ // use already released resources.
delete m_NetworkSession;
+ m_NetworkSession = NULL;
delete m_http;
+ m_http = NULL;
}
void SessionTab::on_createQHttpButton_clicked()
@@ -551,10 +555,16 @@ void SessionTab::done(bool error)
msgBox.setText(QString("HTTP request finished successfully.\nReceived ")+QString::number(result.length())+QString(" bytes."));
}
msgBox.exec();
-
- sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+
- QString(" / ")+
- QString::number(m_NetworkSession->bytesReceived()));
+ // Check if the networksession still exists - it may have gone after returning from
+ // the modal dialog (in the case that app has been closed, and deleting QHttp will
+ // trigger the done() invokation).
+ if (m_NetworkSession) {
+ sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+
+ QString(" / ")+
+ QString::number(m_NetworkSession->bytesReceived()));
+ } else {
+ sentRecDataLineEdit->setText("Data amounts not available.");
+ }
}
// End of file
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index 2359479..131fb85 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -565,6 +565,7 @@ void CentralWidget::connectSignals()
SIGNAL(highlighted(QString)));
connect(viewer, SIGNAL(sourceChanged(QUrl)), this,
SLOT(setTabTitle(QUrl)));
+ connect(viewer, SIGNAL(printRequested()), this, SLOT(print()));
}
}
diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp
index e0347c8..8afa1df 100644
--- a/tools/assistant/tools/assistant/contentwindow.cpp
+++ b/tools/assistant/tools/assistant/contentwindow.cpp
@@ -133,11 +133,13 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e)
if (m_contentWidget && o == m_contentWidget->viewport()
&& e->type() == QEvent::MouseButtonRelease) {
QMouseEvent *me = static_cast<QMouseEvent*>(e);
- QModelIndex index = m_contentWidget->indexAt(me->pos());
- QItemSelectionModel *sm = m_contentWidget->selectionModel();
+ const QModelIndex &index = m_contentWidget->indexAt(me->pos());
+ if (!index.isValid())
+ return QWidget::eventFilter(o, e);
- Qt::MouseButtons button = me->button();
- if (index.isValid() && (sm && sm->isSelected(index))) {
+ const Qt::MouseButtons button = me->button();
+ QItemSelectionModel *sm = m_contentWidget->selectionModel();
+ if (sm->isSelected(index)) {
if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier))
|| (button == Qt::MidButton)) {
QHelpContentModel *contentModel =
@@ -189,9 +191,11 @@ void ContentWindow::itemClicked(const QModelIndex &index)
qobject_cast<QHelpContentModel*>(m_contentWidget->model());
if (contentModel) {
- QHelpContentItem *itm = contentModel->contentItemAt(index);
- if (itm)
- emit linkActivated(itm->url());
+ if (QHelpContentItem *itm = contentModel->contentItemAt(index)) {
+ const QUrl &url = itm->url();
+ if (url != CentralWidget::instance()->currentSource())
+ emit linkActivated(url);
+ }
}
}
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index adaa45b..244d091 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -269,6 +269,7 @@ HelpViewer::HelpViewer(CentralWidget *parent, qreal zoom)
SIGNAL(highlighted(QString)));
connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool)));
+ connect(page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested()));
setFont(viewerFont());
setTextSizeMultiplier(zoom == 0.0 ? 1.0 : zoom);
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.h b/tools/assistant/tools/assistant/helpviewer_qwv.h
index a2c0389..2577828 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.h
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.h
@@ -100,6 +100,7 @@ Q_SIGNALS:
void backwardAvailable(bool enabled);
void highlighted(const QString &);
void sourceChanged(const QUrl &);
+ void printRequested();
protected:
virtual void wheelEvent(QWheelEvent *);
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index b66fc6a..bb65e66 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2356,7 +2356,7 @@ void Configure::generateBuildKey()
+ buildSymbianKey + "\"\n"
"#else\n"
// Debug builds
- "# if (defined(_DEBUG) || defined(DEBUG))\n"
+ "# if (!QT_NO_DEBUG)\n"
"# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
+ build64Key.arg("debug") + "\"\n"
"# else\n"
@@ -3430,7 +3430,7 @@ void Configure::displayConfig()
cout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
cout << "library names through OPENSSL_LIBS." << endl;
cout << "For example:" << endl;
- cout << " configure -openssl-linked OPENSSL_LIBS='-lssleay32 -llibeay32'" << endl;
+ cout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
}
if( dictionary[ "ZLIB_FORCED" ] == "yes" ) {
QString which_zlib = "supplied";
diff --git a/tools/designer/src/designer/qdesigner_actions.cpp b/tools/designer/src/designer/qdesigner_actions.cpp
index a593a76..86b6214 100644
--- a/tools/designer/src/designer/qdesigner_actions.cpp
+++ b/tools/designer/src/designer/qdesigner_actions.cpp
@@ -347,6 +347,7 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench)
connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(editWidgetsSlot()));
m_editWidgetsAction->setChecked(true);
m_editWidgetsAction->setEnabled(false);
+ m_editWidgetsAction->setProperty(QDesignerActions::defaultToolbarPropertyName, true);
m_toolActions->addAction(m_editWidgetsAction);
connect(formWindowManager, SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)),
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index a0cd560..5495e34 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -599,7 +599,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
generateAnnotatedList(relative, marker, nonCompatClasses);
}
else if (atom->string() == "classes") {
- generateCompactList(relative, marker, nonCompatClasses);
+ generateCompactList(relative, marker, nonCompatClasses, true);
}
else if (atom->string().contains("classesbymodule")) {
QString arg = atom->string().trimmed();
@@ -647,10 +647,10 @@ int HtmlGenerator::generateAtom(const Atom *atom,
generateClassHierarchy(relative, marker, nonCompatClasses);
}
else if (atom->string() == "compatclasses") {
- generateCompactList(relative, marker, compatClasses);
+ generateCompactList(relative, marker, compatClasses, false);
}
else if (atom->string() == "obsoleteclasses") {
- generateCompactList(relative, marker, obsoleteClasses);
+ generateCompactList(relative, marker, obsoleteClasses, false);
}
else if (atom->string() == "functionindex") {
generateFunctionIndex(relative, marker);
@@ -659,10 +659,10 @@ int HtmlGenerator::generateAtom(const Atom *atom,
generateLegaleseList(relative, marker);
}
else if (atom->string() == "mainclasses") {
- generateCompactList(relative, marker, mainClasses);
+ generateCompactList(relative, marker, mainClasses, true);
}
else if (atom->string() == "services") {
- generateCompactList(relative, marker, serviceClasses);
+ generateCompactList(relative, marker, serviceClasses, false);
}
else if (atom->string() == "overviews") {
generateOverviewList(relative, marker);
@@ -802,9 +802,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
<< "\"></a>\n";
out() << "<h3>" << protectEnc((*s).name) << "</h3>\n";
if (idx == Class)
- generateCompactList(0, marker, ncmap.value(), QString("Q"));
+ generateCompactList(0, marker, ncmap.value(), false, QString("Q"));
else if (idx == QmlClass)
- generateCompactList(0, marker, nqcmap.value(), QString("Q"));
+ generateCompactList(0, marker, nqcmap.value(), false, QString("Q"));
else if (idx == MemberFunction) {
ParentMaps parentmaps;
ParentMaps::iterator pmap;
@@ -830,7 +830,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << "</a>" << ":</p>\n";
generateSection(nlist, 0, marker, CodeMarker::Summary);
- out() << "<br />";
+ out() << "<br/>";
++pmap;
}
}
@@ -876,7 +876,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << "</div>";
break;
case Atom::LineBreak:
- out() << "<br />";
+ out() << "<br/>";
break;
case Atom::Link:
{
@@ -912,8 +912,14 @@ int HtmlGenerator::generateAtom(const Atom *atom,
else if (atom->string() == ATOM_LIST_VALUE) {
threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom);
if (threeColumnEnumValueTable) {
- out() << "<table class=\"valuelist\">"
- << "<tr><th>Constant</th>"
+ out() << "<table class=\"valuelist\">";
+ // << "<tr>"
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd\">";
+ else
+ out() << "<tr class=\"even\">";
+
+ out() << "<tr><th>Constant</th>"
<< "<th>Value</th>"
<< "<th>Description</th></tr>\n";
}
@@ -926,7 +932,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << "<ol type=";
if (atom->string() == ATOM_LIST_UPPERALPHA) {
out() << "\"A\"";
- }
+ } /* why type? */
else if (atom->string() == ATOM_LIST_LOWERALPHA) {
out() << "\"a\"";
}
@@ -956,7 +962,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << "<tr><td class=\"topAlign\"><tt>"
<< protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),
relative)))
- << "</tt></td><td class=\"centerAlign topAlign\">";
+ << "</tt></td><td class=\" topAlign\">";
QString itemValue;
if (relative->type() == Node::Enum) {
@@ -1093,13 +1099,13 @@ int HtmlGenerator::generateAtom(const Atom *atom,
}
if (!atom->string().isEmpty()) {
if (atom->string().contains("%"))
- out() << "<table class=\"generic centerAlign\" width=\"" << atom->string() << "\">\n ";
+ out() << "<table class=\"generic\">\n "; // width=\"" << atom->string() << "\">\n ";
else {
- out() << "<table class=\"generic centerAlign\">\n";
+ out() << "<table class=\"generic\">\n";
}
}
else {
- out() << "<table class=\"generic centerAlign\">\n";
+ out() << "<table class=\"generic\">\n";
}
numTableRows = 0;
break;
@@ -1143,7 +1149,10 @@ int HtmlGenerator::generateAtom(const Atom *atom,
out() << " colspan=\"" << spans.at(0) << "\"";
if (spans.at(1) != "1")
out() << " rowspan=\"" << spans.at(1) << "\"";
+ if (inTableHeader)
out() << ">";
+ else
+ out() << "><p>";
}
if (matchAhead(atom, Atom::ParaLeft))
skipAhead = 1;
@@ -1153,7 +1162,7 @@ int HtmlGenerator::generateAtom(const Atom *atom,
if (inTableHeader)
out() << "</th>";
else
- out() << "</td>";
+ out() << "</p></td>";
if (matchAhead(atom, Atom::ParaLeft))
skipAhead = 1;
break;
@@ -1243,6 +1252,8 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")"
<< Atom(Atom::LineBreak);
+#if 0
+ // No longer used because the modeule name is a breadcrumb.
QString fixedModule = inner->moduleName();
if (fixedModule == "Qt3SupportLight")
fixedModule = "Qt3Support";
@@ -1263,6 +1274,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
subtitleText << "]";
}
}
+#endif
generateHeader(title, inner, marker);
sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
@@ -1585,7 +1597,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
NodeList::ConstIterator m = (*s).members.begin();
while (m != (*s).members.end()) {
generateDetailedQmlMember(*m, fake, marker);
- out() << "<br />\n";
+ out() << "<br/>\n";
fakeSection.keywords += qMakePair((*m)->name(),
linkForNode(*m,0));
++m;
@@ -1739,6 +1751,9 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
}
}
else if (node->subType() == Node::QmlClass) {
+ out() << " <li><a href=\"qdeclarativeelements.html\">QML Elements</a></li>";
+ out() << " <li><a href=\"" << fn->name() << "\">" << title
+ << "</a></li>";
}
else if (node->subType() == Node::Example) {
out() << " <li><a href=\"examples.html\">All Examples</a></li>";
@@ -1788,27 +1803,14 @@ void HtmlGenerator::generateHeader(const QString& title,
//out() << " <title>Qt Reference Documentation</title>";
out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n";
- out() << " <!--[if IE]>\n";
- out() << " <meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
- out() << " <meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
- out() << " <![endif]-->\n";
- out() << " <!--[if lt IE 7]>\n";
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
- out() << " <![endif]-->\n";
- out() << " <!--[if IE 7]>\n";
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
- out() << " <![endif]-->\n";
- out() << " <!--[if IE 8]>\n";
- out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
- out() << " <![endif]-->\n";
out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
out() << "</head>\n";
if (offlineDocs)
- out() << "<body class=\"offline\">\n";
+ out() << "<body class=\"offline\" onload=\"CheckEmptyAndLoadList();\">\n";
else
- out() << "<body class=\"\">\n";
+ out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
#ifdef GENERATE_MAC_REFS
if (mainPage)
@@ -1831,18 +1833,16 @@ void HtmlGenerator::generateTitle(const QString& title,
CodeMarker *marker)
{
if (!title.isEmpty())
- out() << "<h1 class=\"title\">" << protectEnc(title);
+ out() << "<h1 class=\"title\">" << protectEnc(title) << "</h1>\n";
if (!subTitle.isEmpty()) {
- out() << "<br />";
- if (subTitleSize == SmallSubTitle)
- out() << "<span class=\"small-subtitle\">";
+ out() << "<span";
+ if (subTitleSize == SmallSubTitle)
+ out() << " class=\"small-subtitle\">";
else
- out() << "<span class=\"subtitle\">";
+ out() << " class=\"subtitle\">";
generateText(subTitle, relative, marker);
out() << "</span>\n";
}
- if (!title.isEmpty())
- out() << "</h1>\n";
}
void HtmlGenerator::generateFooter(const Node *node)
@@ -1851,9 +1851,10 @@ void HtmlGenerator::generateFooter(const Node *node)
out() << "<p>\n" << navigationLinks << "</p>\n";
out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version())
- << QString(address).replace("\\" + COMMAND_VERSION, myTree->version())
- << "</body>\n"
- "</html>\n";
+ << QString(address).replace("\\" + COMMAND_VERSION, myTree->version());
+ out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ out() << "</body>\n";
+ out() << "</html>\n";
}
void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
@@ -1874,7 +1875,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker)
{
if (!inner->includes().isEmpty()) {
- out() << "<pre clas=\"highlightedCode\">"
+ out() << "<pre class=\"highlightedCode\">"
<< trimmedTrailing(highlightedCode(indent(codeIndent,
marker->markedUpIncludes(inner->includes())),
marker,inner))
@@ -2278,22 +2279,22 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
out() << "<tr class=\"odd topAlign\">";
else
out() << "<tr class=\"even topAlign\">";
- out() << "<th>";
+ out() << "<td><p>";
generateFullName(node, relative, marker);
- out() << "</th>";
+ out() << "</p></td>";
if (!(node->type() == Node::Fake)) {
Text brief = node->doc().trimmedBriefText(name);
if (!brief.isEmpty()) {
- out() << "<td>";
+ out() << "<td><p>";
generateText(brief, node, marker);
- out() << "</td>";
+ out() << "</p></td>";
}
}
else {
- out() << "<td>";
+ out() << "<td><p>";
out() << protectEnc(node->doc().briefText().toString());
- out() << "</td>";
+ out() << "</p></td>";
}
out() << "</tr>\n";
}
@@ -2312,10 +2313,11 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
void HtmlGenerator::generateCompactList(const Node *relative,
CodeMarker *marker,
const NodeMap &classMap,
+ bool includeAlphabet,
QString commonPrefix)
{
const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_'
- const int NumColumns = 3; // number of columns in the result
+ const int NumColumns = 2; // number of columns in the result
if (classMap.isEmpty())
return;
@@ -2384,6 +2386,7 @@ void HtmlGenerator::generateCompactList(const Node *relative,
*/
NodeMap paragraph[NumParagraphs+1];
QString paragraphName[NumParagraphs+1];
+ QSet<char> usedParagraphNames;
NodeMap::ConstIterator c = classMap.begin();
while (c != classMap.end()) {
@@ -2407,6 +2410,7 @@ void HtmlGenerator::generateCompactList(const Node *relative,
}
paragraphName[paragraphNo] = key[0].toUpper();
+ usedParagraphNames.insert(key[0].toLower().cell());
paragraph[paragraphNo].insert(key, c.value());
++c;
}
@@ -2426,15 +2430,15 @@ void HtmlGenerator::generateCompactList(const Node *relative,
for (j = 0; j < NumParagraphs; j++) // j = 0..36
paragraphOffset[j + 1] = paragraphOffset[j] + paragraph[j].count();
- int firstOffset[NumColumns + 1]; // 4 + 1
- int currentOffset[NumColumns]; // 4
- int currentParagraphNo[NumColumns]; // 4
- int currentOffsetInParagraph[NumColumns]; // 4
+ int firstOffset[NumColumns + 1];
+ int currentOffset[NumColumns];
+ int currentParagraphNo[NumColumns];
+ int currentOffsetInParagraph[NumColumns];
int numRows = (classMap.count() + NumColumns - 1) / NumColumns;
int curParagNo = 0;
- for (i = 0; i < NumColumns; i++) { // i = 0..3
+ for (i = 0; i < NumColumns; i++) {
firstOffset[i] = qMin(i * numRows, classMap.size());
currentOffset[i] = firstOffset[i];
@@ -2450,13 +2454,29 @@ void HtmlGenerator::generateCompactList(const Node *relative,
}
firstOffset[NumColumns] = classMap.count();
+ if (includeAlphabet) {
+ out() << "<p class=\"centerAlign functionIndex\"><b>";
+ for (int i = 0; i < 26; i++) {
+ QChar ch('a' + i);
+ if (usedParagraphNames.contains(char('a' + i)))
+ out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
+ }
+ out() << "</b></p>\n";
+ }
+
out() << "<table class=\"generic\">\n";
for (k = 0; k < numRows; k++) {
- out() << "<tr>\n";
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd topAlign\">";
+ else
+ out() << "<tr class=\"even topAlign\">";
+ //break;
+
+// out() << "<tr>\n";
for (i = 0; i < NumColumns; i++) {
if (currentOffset[i] >= firstOffset[i + 1]) {
// this column is finished
- out() << "<td>\n</td>\n";
+ out() << "<td>\n</td>\n"; // check why?
}
else {
while ((currentParagraphNo[i] < NumParagraphs) &&
@@ -2471,16 +2491,20 @@ void HtmlGenerator::generateCompactList(const Node *relative,
currentParagraphNo[i] = NumParagraphs - 1;
}
#endif
- out() << "<td class=\"rightAlign\">";
+ out() << "<th class=\"rightAlign alphaChar\"><p>";
if (currentOffsetInParagraph[i] == 0) {
// start a new paragraph
+ if (includeAlphabet) {
+ QChar c = paragraphName[currentParagraphNo[i]][0].toLower();
+ out() << QString("<a name=\"%1\"></a>").arg(c);
+ }
out() << "<b>"
<< paragraphName[currentParagraphNo[i]]
- << "&nbsp;</b>";
+ << "</b>";
}
- out() << "</td>\n";
+ out() << "</p></th>\n";
- out() << "<td>";
+ out() << "<td><p>";
if ((currentParagraphNo[i] < NumParagraphs) &&
!paragraphName[currentParagraphNo[i]].isEmpty()) {
NodeMap::Iterator it;
@@ -2506,7 +2530,7 @@ void HtmlGenerator::generateCompactList(const Node *relative,
out() << ")";
}
}
- out() << "</td>\n";
+ out() << "</p></td>\n";
currentOffset[i]++;
currentOffsetInParagraph[i]++;
@@ -2646,7 +2670,7 @@ void HtmlGenerator::generateQmlItem(const Node *node,
if (summary)
marked.replace("@name>", "b>");
- marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
+ marked.replace("<@extra>", "<tt>");
marked.replace("</@extra>", "</tt>");
if (summary) {
@@ -2812,14 +2836,14 @@ void HtmlGenerator::generateSection(const NodeList& nl,
else {
if (twoColumn && i == (int) (nl.count() + 1) / 2)
out() << "</ul></td><td class=\"topAlign\"><ul>\n";
- out() << "<li><div class=\"fn\">";
+ out() << "<li class=\"fn\">";
}
generateSynopsis(*m, relative, marker, style, name_alignment);
if (name_alignment)
out() << "</td></tr>\n";
else
- out() << "</div></li>\n";
+ out() << "</li>\n";
i++;
++m;
}
@@ -2873,14 +2897,14 @@ void HtmlGenerator::generateSectionList(const Section& section,
else {
if (twoColumn && i == (int) (section.members.count() + 1) / 2)
out() << "</ul></td><td class=\"topAlign\"><ul>\n";
- out() << "<li><div class=\"fn\">";
+ out() << "<li class=\"fn\">";
}
generateSynopsis(*m, relative, marker, style, name_alignment);
if (name_alignment)
out() << "</td></tr>\n";
else
- out() << "</div></li>\n";
+ out() << "</li>\n";
i++;
++m;
}
@@ -2908,9 +2932,9 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section,
QList<QPair<ClassNode *, int> >::ConstIterator p = section.inherited.begin();
while (p != section.inherited.end()) {
if (nameAlignment)
- out() << "<li><div bar=\"2\" class=\"fn\"></div>";
+ out() << "<li class=\"fn\">";
else
- out() << "<li><div class=\"fn\"></div>";
+ out() << "<li class=\"fn\">";
out() << (*p).second << " ";
if ((*p).second == 1) {
out() << section.singularMember;
@@ -2955,7 +2979,7 @@ void HtmlGenerator::generateSynopsis(const Node *node,
extraRegExp.setMinimal(true);
marked.replace(extraRegExp, "");
} else {
- marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
+ marked.replace("<@extra>", "<tt>");
marked.replace("</@extra>", "</tt>");
}
@@ -3151,8 +3175,13 @@ void HtmlGenerator::generateSectionList(const Section& section,
twoColumn = (section.members.count() >= 5);
}
if (twoColumn)
- out() << "<table class=\"generic\">\n"
- << "<tr><td class=\"topAlign\">";
+ out() << "<table class=\"generic\">\n";
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd topAlign\">";
+ else
+ out() << "<tr class=\"even topAlign\">";
+
+// << "<tr><td class=\"topAlign\">";
out() << "<ul>\n";
int i = 0;
@@ -3166,7 +3195,7 @@ void HtmlGenerator::generateSectionList(const Section& section,
if (twoColumn && i == (int) (section.members.count() + 1) / 2)
out() << "</ul></td><td class=\"topAlign\"><ul>\n";
- out() << "<li><div class=\"fn\"></div>";
+ out() << "<li class=\"fn\">";
if (style == CodeMarker::Accessors)
out() << "<b>";
generateSynopsis(*m, relative, marker, style);
@@ -3194,7 +3223,7 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section,
{
QList<QPair<ClassNode *, int> >::ConstIterator p = section.inherited.begin();
while (p != section.inherited.end()) {
- out() << "<li><div bar=\"2\" class=\"fn\"></div>";
+ out() << "<li class=\"fn\">";
out() << (*p).second << " ";
if ((*p).second == 1) {
out() << section.singularMember;
@@ -3234,7 +3263,7 @@ void HtmlGenerator::generateSynopsis(const Node *node,
extraRegExp.setMinimal(true);
marked.replace(extraRegExp, "");
} else {
- marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
+ marked.replace("<@extra>", "<tt>");
marked.replace("</@extra>", "</tt>");
}
@@ -3764,7 +3793,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
out() << "<h3 class=\"flags\">";
out() << "<a name=\"" + refForNode(node) + "\"></a>";
generateSynopsis(enume, relative, marker, CodeMarker::Detailed);
- out() << "<br />";
+ out() << "<br/>";
generateSynopsis(enume->flagsType(),
relative,
marker,
@@ -4359,8 +4388,12 @@ void HtmlGenerator::generateQmlSummary(const Section& section,
twoColumn = (count >= 5);
}
if (twoColumn)
- out() << "<table class=\"qmlsummary\">\n"
- << "<tr><td class=\"topAlign\">";
+ out() << "<table class=\"qmlsummary\">\n";
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd topAlign\">";
+ else
+ out() << "<tr class=\"even topAlign\">";
+ // << "<tr><td class=\"topAlign\">";
out() << "<ul>\n";
int row = 0;
@@ -4368,7 +4401,7 @@ void HtmlGenerator::generateQmlSummary(const Section& section,
while (m != section.members.end()) {
if (twoColumn && row == (int) (count + 1) / 2)
out() << "</ul></td><td class=\"topAlign\"><ul>\n";
- out() << "<li><div class=\"fn\"></div>";
+ out() << "<li class=\"fn\">";
generateQmlItem(*m,relative,marker,true);
out() << "</li>\n";
row++;
@@ -4402,22 +4435,21 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
while (p != qpgn->childNodes().end()) {
if ((*p)->type() == Node::QmlProperty) {
qpn = static_cast<const QmlPropertyNode*>(*p);
- out() << "<tr><td>";
+
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd\">";
+ else
+ out() << "<tr class=\"even\">";
+
+ out() << "<td><p>";
+ //out() << "<tr><td>"; // old
out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
if (!qpn->isWritable())
- out() << "<span class=\"qmlreadonly\">read-only&nbsp;</span>";
+ out() << "<span class=\"qmlreadonly\">read-only</span>";
if (qpgn->isDefault())
- out() << "<span class=\"qmldefault\">default&nbsp;</span>";
+ out() << "<span class=\"qmldefault\">default</span>";
generateQmlItem(qpn, relative, marker, false);
out() << "</td></tr>";
- if (qpgn->isDefault()) {
- out() << "</table>"
- << "</div></div>"
- << "<div class=\"qmlitem\">"
- << "<div class=\"qmlproto\">"
- << "<table class=\"qmlname\">"
- << "<tr><td>default</td></tr>";
- }
}
++p;
}
@@ -4428,11 +4460,16 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
const FunctionNode* qsn = static_cast<const FunctionNode*>(node);
out() << "<div class=\"qmlproto\">";
out() << "<table class=\"qmlname\">";
- out() << "<tr><td>";
+ //out() << "<tr>";
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd\">";
+ else
+ out() << "<tr class=\"even\">";
+ out() << "<td><p>";
out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
//generateQmlItem(qsn,relative,marker,false);
- out() << "</td></tr>";
+ out() << "</p></td></tr>";
out() << "</table>";
out() << "</div>";
}
@@ -4440,10 +4477,15 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
const FunctionNode* qmn = static_cast<const FunctionNode*>(node);
out() << "<div class=\"qmlproto\">";
out() << "<table class=\"qmlname\">";
- out() << "<tr><td>";
+ //out() << "<tr>";
+ if (++numTableRows % 2 == 1)
+ out() << "<tr class=\"odd\">";
+ else
+ out() << "<tr class=\"even\">";
+ out() << "<td><p>";
out() << "<a name=\"" + refForNode(qmn) + "\"></a>";
generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false);
- out() << "</td></tr>";
+ out() << "</p></td></tr>";
out() << "</table>";
out() << "</div>";
}
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index d80cbdb..e060257 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -173,6 +173,7 @@ class HtmlGenerator : public PageGenerator
void generateCompactList(const Node *relative,
CodeMarker *marker,
const NodeMap &classMap,
+ bool includeAlphabet,
QString commonPrefix = QString());
void generateFunctionIndex(const Node *relative, CodeMarker *marker);
void generateLegaleseList(const Node *relative, CodeMarker *marker);
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index a2bd948..4ba3a32 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1289,7 +1289,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
const ClassNode* cn)
: FakeNode(parent, name, QmlClass), cnode(cn)
{
- setTitle((qmlOnly ? "" : "QML ") + name + " Element Reference");
+ setTitle((qmlOnly ? "" : "QML ") + name + " Element");
}
/*!
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 1deefce..112b1b2 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -16,45 +16,28 @@ qhp.Assistant.file = assistant.qhp
qhp.Assistant.namespace = com.trolltech.assistant.470
qhp.Assistant.virtualFolder = qdoc
qhp.Assistant.indexTitle = Qt Assistant Manual
-qhp.Assistant.extraFiles = images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
+qhp.Assistant.extraFiles = images/bg_l.png \
images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
+ images/bullet_sq.png \
images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
images/feedbackground.png \
- images/form_bg.png \
images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
style/style.css
+
qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant
qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index 513801a..d4da292 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -16,45 +16,28 @@ qhp.Designer.file = designer.qhp
qhp.Designer.namespace = com.trolltech.designer.470
qhp.Designer.virtualFolder = qdoc
qhp.Designer.indexTitle = Qt Designer Manual
-qhp.Designer.extraFiles = images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
+qhp.Designer.extraFiles = images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
- images/content_bg.png \
images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
+
qhp.Designer.filterAttributes = qt 4.7.0 tools designer
qhp.Designer.customFilters.Designer.name = Qt Designer Manual
qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index a3f4f00..7420b4f 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -16,45 +16,28 @@ qhp.Linguist.file = linguist.qhp
qhp.Linguist.namespace = com.trolltech.linguist.470
qhp.Linguist.virtualFolder = qdoc
qhp.Linguist.indexTitle = Qt Linguist Manual
-qhp.Linguist.extraFiles = images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
+qhp.Linguist.extraFiles = images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
- images/content_bg.png \
images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
+
qhp.Linguist.filterAttributes = qt 4.7.0 tools linguist
qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual
qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist
diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf
index 22db23e..e7a1dbc 100644
--- a/tools/qdoc3/test/macros.qdocconf
+++ b/tools/qdoc3/test/macros.qdocconf
@@ -18,6 +18,7 @@ macro.ouml.HTML = "&ouml;"
macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
+macro.QQL = "\\e{Qt QML Launcher}"
macro.param = "\\e"
macro.raisedaster.HTML = "<sup>*</sup>"
macro.rarrow.HTML = "&rarr;"
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index 80050e3..8015f57 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -27,45 +27,27 @@ qhp.Qml.indexTitle = Qml Reference
# Files not referenced in any qdoc file
# See also extraimages.HTML
-qhp.Qml.extraFiles = images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+qhp.Qml.extraFiles = images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
qhp.Qml.filterAttributes = qt 4.6.0 qtrefdoc
qhp.Qml.customFilters.Qt.name = Qt 4.6.0
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index f38a2a4..49d088e 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -16,45 +16,28 @@ qhp.qmake.file = qmake.qhp
qhp.qmake.namespace = com.trolltech.qmake.470
qhp.qmake.virtualFolder = qdoc
qhp.qmake.indexTitle = QMake Manual
-qhp.qmake.extraFiles = images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+qhp.qmake.extraFiles = images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
+
qhp.qmake.filterAttributes = qt 4.7.0 tools qmake
qhp.qmake.customFilters.qmake.name = qmake Manual
qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 0694748..f0c2535 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -22,45 +22,27 @@ qhp.Qt.indexTitle = Qt Reference Documentation
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
index 5a3d726..a00d5a1 100644
--- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
@@ -30,45 +30,27 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
language = Cpp
diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf
index 0426f4d..f3291df 100644
--- a/tools/qdoc3/test/qt-defines.qdocconf
+++ b/tools/qdoc3/test/qt-defines.qdocconf
@@ -20,37 +20,20 @@ codeindent = 1
# See also qhp.Qt.extraFiles
extraimages.HTML = qt-logo \
trolltech-logo \
- api_examples.png \
- bg_ll.png \
- bg_ul_blank.png \
+ bg_l.png \
+ bg_l_blank.png \
+ bg_r.png \
+ box_bg.png \
+ breadcrumb.png \
bullet_gt.png \
- horBar.png \
- qt_ref_doc.png \
- api_lookup.png \
- bg_ll_blank.png \
- bg_ur.png \
+ bullet_dn.png \
bullet_sq.png \
- bullet_dn.png \
- bullet_up.png \
+ bullet_up.png \
+ feedbackground.png \
+ horBar.png \
+ page.png \
page_bg.png \
- qt_tools.png \
- api_topics.png \
- bg_lr.png \
- bg_ur_blank.png \
- content_bg.png \
- print.png \
- sep.png \
- bg_l.png \
- bg_r.png \
- box_bg.png \
- feedbackground.png \
- qt_guide.png \
sprites-combined.png \
- bg_l_blank.png \
- bg_ul.png \
- breadcrumb.png \
- form_bg.png \
- qt_icon.png \
taskmenuextension-example.png \
coloreditorfactoryimage.png \
dynamiclayouts-example.png \
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 85a29c2..9af2f92 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -31,55 +31,55 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <div class=\"searchlabel\">\n" \
" Search index:</div>\n" \
" <div class=\"search\">\n" \
- " <form id=\"qtdocsearch\" action=\"#\">\n" \
+ " <form id=\"qtdocsearch\" action=\"\">\n" \
" <fieldset>\n" \
- " <input type=\"text\" name=\"searchstring\" id=\"searchstring\" value=\"\" onkeyup=\"doSearch(this.value);\" />\n" \
+ " <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \
" </fieldset>\n" \
" </form>\n" \
" </div>\n" \
" <div class=\"box first bottombar\" id=\"lookup\">\n" \
- " <h2>\n" \
+ " <h2><span></span>\n" \
" API Lookup</h2>\n" \
- " <div class=\"list\">\n" \
- " <ul>\n" \
- " <li><a href=\"modules.html\">All modules</a></li>\n" \
- " <li><a href=\"classes.html\">All classes</a></li>\n" \
- " <li><a href=\"functions.html\">All functions</a></li>\n" \
- " <li><a href=\"namespaces.html\">All namespaces</a></li>\n" \
- " <li><a href=\"platform-specific.html\">Platform specifics</a></li>\n" \
- " </ul>\n" \
+ " <div id=\"list001\" class=\"list\">\n" \
+ " <ul id=\"ul001\" >\n" \
+ " <li class=\"defaultLink\"><a href=\"classes.html\">Class index</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"functions.html\">Function index</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"modules.html\">Modules</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"namespaces.html\">Namespaces</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"qtglobal.html\">Global stuff</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"qdeclarativeelements.html\">QML elements</a></li>\n" \
+ " </ul> \n" \
" </div>\n" \
- " <div class=\"live\">\n" \
+ " <div id=\"live001\" class=\"live\">\n" \
" </div>\n" \
" </div>\n" \
" <div class=\"box bottombar\" id=\"topics\">\n" \
- " <h2>\n" \
- " API Topics</h2>\n" \
- " <div class=\"list\">\n" \
- " <ul>\n" \
- " <li><a href=\"object.html\">QObject model</a></li>\n" \
- " <li><a href=\"eventsandfilters.html\">Events, signals &amp; slots</a></li>\n" \
- " <li><a href=\"paintsystem.html\">Graphics &amp; Paint system</a></li>\n" \
- " <li><a href=\"declarativeui.html\">Qt Quick</a></li>\n" \
- " <li><a href=\"widgets-and-layouts.html\">Widget style &amp; layout</a></li>\n" \
- " </ul>\n" \
+ " <h2><span></span>\n" \
+ " Qt Topics</h2>\n" \
+ " <div id=\"list002\" class=\"list\">\n" \
+ " <ul id=\"ul002\" >\n" \
+ " <li class=\"defaultLink\"><a href=\"qt-basic-concepts.html\">Basic Qt architecture</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"declarativeui.html\">Device UI's &amp; Qt Quick</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"qt-gui-concepts.html\">Desktop UI components</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li>\n" \
+ " </ul> \n" \
" </div>\n" \
- " <div class=\"live\">\n" \
+ " <div id=\"live002\" class=\"live\">\n" \
" </div>\n" \
" </div>\n" \
" <div class=\"box\" id=\"examples\">\n" \
- " <h2>\n" \
- " API Examples</h2>\n" \
- " <div class=\"list\">\n" \
- " <ul>\n" \
- " <li><a href=\"examples.html\">All examples</a></li>\n" \
- " <li><a href=\"tutorials.html\">All tutorials</a></li>\n" \
- " <li><a href=\"examples.html\">Qt Quick examples</a></li>\n" \
- " <li><a href=\"examples.html\">Desktop examples</a></li>\n" \
- " <li><a href=\"examples.html\">Device examples</a></li>\n" \
- " </ul>\n" \
+ " <h2><span></span>\n" \
+ " Examples</h2>\n" \
+ " <div id=\"list003\" class=\"list\">\n" \
+ " <ul id=\"ul003\">\n" \
+ " <li class=\"defaultLink\"><a href=\"all-examples.html\">Examples</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"tutorials.html\">Tutorials</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \
+ " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li>\n" \
+ " </ul> \n" \
" </div>\n" \
- " <div class=\"live\">\n" \
+ " <div id=\"live003\" class=\"live\">\n" \
" </div>\n" \
" </div>\n" \
" </div>\n" \
@@ -98,20 +98,21 @@ HTML.postpostheader = " </ul>\n" \
" <li id=\"medA\" class=\"t_button active\">A</li>\n" \
" <li id=\"bigA\" class=\"t_button\">A</li>\n" \
" <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \
- " <img src=\"images/sep.png\" alt=\"\" /><img id=\"printIcon\" src=\"images/print.png\" alt=\"Print this page\" /></a></li>\n" \
+ " <span>Print</span></a></li>\n" \
" </ul>\n" \
" </div>\n" \
" </div>\n" \
" <div class=\"content\">\n"
-HTML.footer = " </div>\n" \
- " <div class=\"feedback t_button\" onclick=\"\$(\'#feedbackBox\').show();\$(\'#blurpage\').show()\">\n" \
+HTML.footer = " <!-- /div -->\n" \
+ " <div class=\"feedback t_button\" onclick=\"\$(\'.bd\').hide();\$(\'.hd\').hide();\$(\'.footer\').hide();\$(\'#feedbackBox\').show();\$(\'#blurpage\').show()\">\n" \
" [+] Documentation Feedback</div>\n" \
" </div>\n" \
" </div>\n" \
" <div class=\"ft\">\n" \
" <span></span>\n" \
" </div>\n" \
+ " </div> \n" \
" <div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
@@ -123,17 +124,18 @@ HTML.footer = " </div>\n" \
" </div>\n" \
" <div id=\"feedbackBox\">\n" \
" <div id=\"feedcloseX\">\n" \
- " <a href=\"#\" onclick=\"\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\">X</a>\n" \
+ " <a href=\"#\" onclick=\"\$(\'.bd\').show();\$(\'.hd\').show();\$(\'.footer\').show();\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\">X</a>\n" \
" </div>\n" \
- " <form action=\"#\">\n" \
- " <textarea id=\"feedbox\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea>\n" \
- " <input id=\"feedsubmit\" type=\"submit\" onclick=\"\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\"\n" \
- " name=\"feedback\" />\n" \
+ " <form id=\"feedform\" action=\"feedback.php\" method=\"get\">\n" \
+ " <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea></p>\n" \
+ " <input id=\"page\" name=\"pageVal\" value=\"\$(\'title\').html();\" style=\"display:none;\">\n" \
+ " <p><input id=\"feedsubmit\" type=\"submit\" onclick=\"\$(\'.bd\').show();\$(\'.hd\').show();\$(\'.footer\').show();\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\"\n" \
+ " name=\"feedback\" /></p>\n" \
" </form>\n" \
" </div>\n" \
" <div id=\"blurpage\">\n" \
" </div>\n" \
- "<script type=\"text/javascript\">\n" \
+ "<!-- <script type=\"text/javascript\">\n" \
" var _gaq = _gaq || [];\n" \
" _gaq.push([\'_setAccount\', \'UA-4457116-5\']);\n" \
" _gaq.push([\'_trackPageview\']);\n" \
@@ -142,4 +144,4 @@ HTML.footer = " </div>\n" \
" ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\n" \
" var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);\n" \
" })();\n" \
- "</script>\n"
+ "</script> -->\n"
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index 69ab4e1..2f6983a 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -26,45 +26,27 @@ qhp.Qt.indexRoot =
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
+ images/bg_l.png \
+ images/bg_l_blank.png \
images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
scripts/functions.js \
scripts/jquery.js \
- style/style.css
+ style/style.css
qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc
qhp.Qt.customFilters.Qt.name = Qt 4.7.0
diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf
index a5a65d8..9275b5c 100644
--- a/tools/qdoc3/test/qt_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt_zh_CN.qdocconf
@@ -32,45 +32,27 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0
# Files not referenced in any qdoc file (last four are needed by qtdemo)
# See also extraimages.HTML
qhp.Qt.extraFiles = index.html \
- images/api_examples.png \
- images/api_lookup.png \
- images/api_topics.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ll.png \
- images/bg_l.png \
- images/bg_lr.png \
- images/bg_r.png \
- images/bg_ul_blank.png \
- images/bg_ul.png \
- images/bg_ur_blank.png \
- images/bg_ur.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_dn.png \
- images/bullet_gt.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/coloreditorfactoryimage.png \
- images/content_bg.png \
- images/dynamiclayouts-example.png \
- images/feedbackground.png \
- images/form_bg.png \
- images/horBar.png \
- images/page_bg.png \
- images/print.png \
- images/qt_guide.png \
- images/qt_icon.png \
- images/qt-logo.png \
- images/qt_ref_doc.png \
- images/qt_tools.png \
- images/sep.png \
- images/sprites-combined.png \
- images/stylesheet-coffee-plastique.png \
- images/taskmenuextension-example.png \
- scripts/functions.js \
- scripts/jquery.js \
- style/style.css
+ images/bg_l.png \
+ images/bg_l_blank.png \
+ images/bg_r.png \
+ images/box_bg.png \
+ images/breadcrumb.png \
+ images/bullet_gt.png \
+ images/bullet_dn.png \
+ images/bullet_sq.png \
+ images/bullet_up.png \
+ images/feedbackground.png \
+ images/horBar.png \
+ images/page.png \
+ images/page_bg.png \
+ images/sprites-combined.png \
+ images/stylesheet-coffee-plastique.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ scripts/functions.js \
+ scripts/jquery.js \
+ style/style.css
language = Cpp
diff --git a/tools/qdoc3/test/style/style.css b/tools/qdoc3/test/style/style.css
index 1ed49fa..9c290f5 100644
--- a/tools/qdoc3/test/style/style.css
+++ b/tools/qdoc3/test/style/style.css
@@ -58,6 +58,19 @@
{
vertical-align: baseline;
}
+ .heading
+ {
+ font: normal 600 16px/1.0 Arial;
+ padding-bottom: 15px;
+ }
+ .subtitle
+ {
+ font-size: 13px;
+ }
+ .small-subtitle
+ {
+ font-size: 13px;
+ }
legend
{
color: #000000;
@@ -73,7 +86,6 @@
{
font-size: 100%;
}
- /* Page style */
html
{
background-color: #e5e5e5;
@@ -92,6 +104,11 @@
{
font-style: italic;
}
+ a
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
.header, .footer, .wrapper
{
min-width: 600px;
@@ -106,23 +123,19 @@
{
padding-left: 216px;
height: 15px;
- background: url(../images/bg_ul.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 0;
overflow: hidden;
}
.offline .wrapper .hd
{
- background: url(../images/bg_ul_blank.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -15px;
}
.wrapper .hd span
{
height: 15px;
display: block;
- background: url(../images/bg_ur.png) no-repeat 100% 0;
overflow: hidden;
- }
- .offline .wrapper .hd span
- {
- /* background: url(../images/bg_ur_blank.png) no-repeat 100% 0; */
+ background: url(../images/page.png) no-repeat 100% -30px;
}
.wrapper .bd
{
@@ -137,18 +150,18 @@
{
padding-left: 216px;
height: 15px;
- background: url(../images/bg_ll.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -75px;
overflow: hidden;
}
.offline .wrapper .ft
{
- background: url(../images/bg_ll_blank.png) no-repeat 0 0;
+ background: url(../images/page.png) no-repeat 0 -90px;
}
.wrapper .ft span
{
height: 15px;
display: block;
- background: url(../images/bg_lr.png) no-repeat 100% 0;
+ background: url(../images/page.png) no-repeat 100% -60px;
overflow: hidden;
}
.header, .footer
@@ -182,186 +195,9 @@
width: 302px;
height: 22px;
text-indent: -999em;
- background: url(../images/header.png) no-repeat 0 0;
- }
- /* header elements */
- #nav-topright
- {
- height: 70px;
- }
-
- #nav-topright ul
- {
- list-style-type: none;
- float: right;
- width: 370px;
- margin-top: 11px;
- }
-
- #nav-topright li
- {
- display: inline-block;
- margin-right: 20px;
- float: left;
- }
-
- #nav-topright li.nav-topright-last
- {
- margin-right: 0;
- }
-
- #nav-topright li a
- {
- background: transparent url(../images/sprites-combined.png) no-repeat;
- height: 18px;
- display: block;
- overflow: hidden;
- text-indent: -9999px;
- }
-
- #nav-topright li.nav-topright-home a
- {
- width: 65px;
- background-position: -2px -91px;
- }
-
- #nav-topright li.nav-topright-home a:hover
- {
- background-position: -2px -117px;
- }
-
-
- #nav-topright li.nav-topright-dev a
- {
- width: 30px;
- background-position: -76px -91px;
- }
-
- #nav-topright li.nav-topright-dev a:hover
- {
- background-position: -76px -117px;
- }
-
-
- #nav-topright li.nav-topright-labs a
- {
- width: 40px;
- background-position: -114px -91px;
- }
-
- #nav-topright li.nav-topright-labs a:hover
- {
- background-position: -114px -117px;
- }
-
- #nav-topright li.nav-topright-doc a
- {
- width: 32px;
- background-position: -162px -91px;
- }
-
- #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
- {
- background-position: -162px -117px;
- }
-
- #nav-topright li.nav-topright-blog a
- {
- width: 40px;
- background-position: -203px -91px;
- }
-
- #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
- {
- background-position: -203px -117px;
- }
-
- #nav-topright li.nav-topright-shop a
- {
- width: 40px;
- background-position: -252px -91px;
- }
-
- #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
- {
- background-position: -252px -117px;
- }
-
- #nav-logo
- {
- background: transparent url( "../images/sprites-combined.png" ) no-repeat 0 -225px;
- left: -3px;
- position: absolute;
- width: 75px;
- height: 75px;
- top: 13px;
- }
- #nav-logo a
- {
- width: 75px;
- height: 75px;
- display: block;
- text-indent: -9999px;
- overflow: hidden;
- }
- /* Clearing */
- .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
- /* ^ Clearing */
-
-
-
- .shortCut-topleft-inactive
- {
- padding-left: 3px;
- background: transparent url( "../images/sprites-combined.png" ) no-repeat 0px -58px;
- height: 20px;
- width: 93px;
- }
- .shortCut-topleft-inactive span
- {
- font-variant: normal;
- }
- #shortCut
- {
- padding-top: 10px;
- font-weight: bolder;
- color: #b0adab;
- }
- #shortCut ul
- {
- list-style-type: none;
- float: left;
- width: 347px;
- margin-left: 100px;
- }
- #shortCut li
- {
- display: inline-block;
- margin-right: 25px;
- float: left;
- white-space: nowrap;
- }
- #shortCut li a
- {
- color: #b0adab;
- text-decoration: none;
- }
- #shortCut li a:hover
- {
- color: #44a51c;
- text-decoration: none;
+ background: url(../images/sprites-combined.png) no-repeat -78px -235px;
}
- /* end of header elements */
-
- /* menu element */
.sidebar
{
float: left;
@@ -369,32 +205,32 @@
width: 200px;
font-size: 11px;
}
- .sidebar a
- {
- color: #00732f;
- text-decoration: none;
- }
- .offline .sidebar, .offline .feedback
+
+ .offline .sidebar, .offline .feedback, .offline .t_button
{
display: none;
}
+
.sidebar .searchlabel
{
padding: 0 0 2px 17px;
font: normal bold 11px/1.2 Verdana;
}
+
.sidebar .search
{
padding: 0 15px 0 16px;
}
+
.sidebar .search form
{
- width: 167px;
- height: 21px;
- padding: 2px 0 0 5px;
- background: url(../images/form_bg.png) no-repeat 0 0;
+ background: url(../images/sprites-combined.png) no-repeat -6px -348px;
+ height:21px;
+ padding:2px 0 0 5px;
+ width:167px;
}
- .sidebar .search form fieldset input#searchstring
+
+ .sidebar .search form input#pageType
{
width: 158px;
height: 19px;
@@ -403,32 +239,62 @@
outline: none;
font: 13px/1.2 Verdana;
}
+
.sidebar .box
{
padding: 17px 15px 5px 16px;
}
+
.sidebar .box .first
{
background-image: none;
}
+
.sidebar .box h2
{
font: normal 18px/1.2 Arial;
- padding: 15px 0 0 40px;
+ padding: 0;
min-height: 32px;
}
+ .sidebar .box h2 span
+ {
+ overflow: hidden;
+ display: inline-block;
+ }
.sidebar .box#lookup h2
{
- background: url(../images/api_lookup.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #lookup.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -6px -311px;
+ width: 27px;
+ height: 35px;
+ margin-right: 13px;
}
.sidebar .box#topics h2
{
- background: url(../images/api_topics.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #topics.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -94px -311px;
+ width: 27px;
+ height: 32px;
+ margin-right: 13px;
}
.sidebar .box#examples h2
{
- background: url(../images/api_examples.png) no-repeat 0 0;
+ background-image: none;
+ }
+ .sidebar #examples.box h2 span
+ {
+ background: url(../images/sprites-combined.png) no-repeat -48px -311px;
+ width: 30px;
+ height: 31px;
+ margin-right: 9px;
}
+
.sidebar .box .list
{
display: block;
@@ -443,6 +309,9 @@
{
text-decoration: underline;
}
+ .sidebar .box ul
+ {
+ }
.sidebar .box ul li
{
padding-left: 12px;
@@ -453,23 +322,20 @@
{
background: url(../images/box_bg.png) repeat-x 0 bottom;
}
- /* content elements */
.wrap
{
- overflow: hidden;
+ margin: 0 5px 0 208px;
+ overflow: visible;
}
.offline .wrap
{
margin: 0 5px 0 5px;
}
- /* tool bar */
.wrap .toolbar
{
background-color: #fafafa;
border-bottom: 1px solid #d1d1d1;
- height: 20px;
- margin-left: 3px;
- margin-right: 5px;
+ height: 20px;
position: relative;
}
.wrap .toolbar .toolblock
@@ -487,7 +353,7 @@
{
padding: 0 0 10px 21px;
right: 5px;
- vertical-align: top;
+ vertical-align: middle;
overflow: hidden;
}
.wrap .toolbar .toolbuttons .active
@@ -507,32 +373,56 @@
font-weight: bold;
color: #B0ADAB;
}
- #smallA
+
+ .toolbuttons #print
+ {
+ border-left: 1px solid #c5c4c4;
+ margin-top: 0;
+ padding-left: 7px;
+ text-indent: 0;
+ }
+ .toolbuttons #print a
+ {
+ width: 16px;
+ height: 16px;
+ }
+
+ .toolbuttons #print a span
+ {
+ width: 16px;
+ height: 16px;
+ text-indent: -999em;
+ display: block;
+ overflow: hidden;
+ background: url(../images/sprites-combined.png) no-repeat -137px -311px;
+ }
+
+ .toolbuttons #smallA
{
font-size: 10pt;
}
- #medA
+ .toolbuttons #medA
{
font-size: 12pt;
}
- #bigA
+ .toolbuttons #bigA
{
font-size: 14pt;
+ margin-right: 7px;
}
+
#smallA:hover, #medA:hover, #bigA:hover
{
color: #00732F;
}
- #print
+
+ .offline .wrap .breadcrumb
{
- font-size: 14pt;
- line-height: 20pt;
}
- #printIcon
+
+ .wrap .breadcrumb ul
{
- margin-left: 5px;
}
- /* bread crumbs */
.wrap .breadcrumb ul li
{
float: left;
@@ -545,6 +435,10 @@
{
font-weight: normal;
}
+ .wrap .breadcrumb ul li a
+ {
+ color: #363534;
+ }
.wrap .breadcrumb ul li.first
{
background-image: none;
@@ -554,29 +448,29 @@
.wrap .content
{
padding: 30px;
- position: relative;
}
- /* text elements */
- .heading
+
+ .wrap .content li
{
- font: normal 600 16px/1.0 Arial;
- padding-bottom: 15px;
+ padding-left: 12px;
+ background: url(../images/bullet_sq.png) no-repeat 0 5px;
+ font: normal 400 10pt/1 Verdana;
+ color: #44a51c;
+ margin-bottom: 10px;
}
-
- .subtitle
+ .content li:hover
{
- font-size: 13px;
+ text-decoration: underline;
}
- .small-subtitle
+ .offline .wrap .content
{
- font-size: 13px;
+ padding-top: 15px;
}
-
+
.wrap .content h1
{
font: 600 18px/1.2 Arial;
- padding-bottom: 15px;
}
.wrap .content h2
{
@@ -588,26 +482,13 @@
}
.wrap .content p
{
- line-height:20px;
- padding:10px 5px 10px 5px;
+ line-height: 20px;
+ padding: 10px 5px 10px 5px;
}
.wrap .content ul
{
padding-left: 25px;
}
- .wrap .content li
- {
- padding-left: 12px;
- background: url(../images/bullet_sq.png) no-repeat 0 5px;
- font: normal 400 10pt/1 Verdana;
- margin-bottom: 10px;
- line-height: 14px;
- }
- a
- {
- color: #00732F;
- text-decoration: none;
- }
a:hover
{
color: #4c0033;
@@ -618,10 +499,6 @@
color: #4c0033;
text-decoration: none;
}
- .offline .wrap .content
- {
- padding-top: 15px;
- }
.footer
{
min-height: 100px;
@@ -629,11 +506,15 @@
font: normal 9px/1 Verdana;
text-align: center;
padding-top: 40px;
+ background-color: #E6E7E8;
+ margin: 0;
}
.feedback
{
- float: right;
- padding-right: 10px;
+ float: none;
+ position: absolute;
+ right: 15px;
+ bottom: 10px;
font: normal 8px/1 Verdana;
color: #B0ADAB;
}
@@ -644,37 +525,223 @@
color: #00732F;
text-decoration: underline;
}
+ .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+ #nav-topright
+ {
+ height: 70px;
+ }
+
+ #nav-topright ul
+ {
+ list-style-type: none;
+ float: right;
+ width: 370px;
+ margin-top: 11px;
+ }
+
+ #nav-topright li
+ {
+ display: inline-block;
+ margin-right: 20px;
+ float: left;
+ }
+
+ #nav-topright li.nav-topright-last
+ {
+ margin-right: 0;
+ }
+
+ #nav-topright li a
+ {
+ background: transparent url(../images/sprites-combined.png) no-repeat;
+ height: 18px;
+ display: block;
+ overflow: hidden;
+ text-indent: -9999px;
+ }
+
+ #nav-topright li.nav-topright-home a
+ {
+ width: 65px;
+ background-position: -2px -91px;
+ }
+
+ #nav-topright li.nav-topright-home a:hover
+ {
+ background-position: -2px -117px;
+ }
+
+
+ #nav-topright li.nav-topright-dev a
+ {
+ width: 30px;
+ background-position: -76px -91px;
+ }
+
+ #nav-topright li.nav-topright-dev a:hover
+ {
+ background-position: -76px -117px;
+ }
+
+
+ #nav-topright li.nav-topright-labs a
+ {
+ width: 40px;
+ background-position: -114px -91px;
+ }
+
+ #nav-topright li.nav-topright-labs a:hover
+ {
+ background-position: -114px -117px;
+ }
+
+ #nav-topright li.nav-topright-doc a
+ {
+ width: 32px;
+ background-position: -162px -91px;
+ }
+
+ #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
+ {
+ background-position: -162px -117px;
+ }
+
+ #nav-topright li.nav-topright-blog a
+ {
+ width: 40px;
+ background-position: -203px -91px;
+ }
+
+ #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
+ {
+ background-position: -203px -117px;
+ }
+
+ #nav-topright li.nav-topright-shop a
+ {
+ width: 40px;
+ background-position: -252px -91px;
+ }
+
+ #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
+ {
+ background-position: -252px -117px;
+ }
+
+ #nav-logo
+ {
+ background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
+ left: -3px;
+ position: absolute;
+ width: 75px;
+ height: 75px;
+ top: 13px;
+ }
+ #nav-logo a
+ {
+ width: 75px;
+ height: 75px;
+ display: block;
+ text-indent: -9999px;
+ overflow: hidden;
+ }
+
+
+ .shortCut-topleft-inactive
+ {
+ padding-left: 3px;
+ background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
+ height: 20px;
+ width: 47px;
+ }
+ .shortCut-topleft-inactive span
+ {
+ font-variant: normal;
+ }
+ #shortCut
+ {
+ padding-top: 10px;
+ font-weight: bolder;
+ color: #b0adab;
+ }
+ #shortCut ul
+ {
+ list-style-type: none;
+ float: left;
+ width: 347px;
+ margin-left: 100px;
+ }
+ #shortCut li
+ {
+ display: inline-block;
+ margin-right: 25px;
+ float: left;
+ white-space: nowrap;
+ }
+ #shortCut li a
+ {
+ color: #b0adab;
+ }
+ #shortCut li a:hover
+ {
+ color: #44a51c;
+ }
+
hr
{
- background-color: #e0e0e0;
+ background-color: #E6E6E6;
+ border: 1px solid #E6E6E6;
height: 1px;
width: 100%;
text-align: left;
margin: 15px 0px 15px 0px;
}
-
+
.content .alignedsummary
{
margin: 15px;
}
- /* tables */
+ pre
+ {
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
+ overflow-x: auto;
+ }
table, pre
{
-moz-border-radius: 7px 7px 7px 7px;
background-color: #F6F6F6;
border: 1px solid #E6E6E6;
border-collapse: separate;
- font-size: 11px;
- min-width: 395px;
+ font-size: 11px;
+ /*min-width: 395px;*/
margin-bottom: 25px;
+ display: inline-block;
+ }
+ thead
+ {
+ margin-top: 5px;
+ }
+ th
+ {
+ padding: 3px 15px 3px 15px;
+ }
+ td
+ {
+ padding: 3px 15px 3px 20px;
}
- thead{margin-top: 5px;}
- th{ padding: 3px 15px 3px 15px;}
- td{padding: 3px 15px 3px 20px;}
table tr.odd
{
border-left: 1px solid #E6E6E6;
- background-color: #F6F6F6;
+ background-color: #F6F6F6;
color: #66666E;
}
table tr.even
@@ -685,12 +752,13 @@
}
table tr.odd:hover
{
- background-color: #E6E6E6;
+ background-color: #E6E6E6;
}
table tr.even:hover
{
background-color: #E6E6E6;
}
+
span.comment
{
color: #8B0000;
@@ -700,15 +768,7 @@
{
color: #254117;
}
- pre
- {
- -moz-border-radius:7px 7px 7px 7px;
- background-color:#F6F6F6;
- border:1px solid #DDDDDD;
- margin:0 20px 10px 10px;
- padding:20px 15px 20px 20px;
- overflow-x:auto;
- }
+
.qmltype
{
text-align: center;
@@ -719,13 +779,28 @@
float: right;
color: #254117;
}
+
+ .qmldefault
+ {
+ float: right;
+ color: red;
+ }
+
+ .qmldoc
+ {
+ }
+
+ *.qmlitem p
+ {
+ }
+
#feedbackBox
{
- display:none;
- -moz-border-radius:7px 7px 7px 7px;
- border:1px solid #DDDDDD;
- position:fixed;
- top:100px;
+ display: none;
+ -moz-border-radius: 7px 7px 7px 7px;
+ border: 1px solid #DDDDDD;
+ position: fixed;
+ top: 100px;
left: 33%;
height: 190px;
width: 400px;
@@ -735,27 +810,27 @@
}
#feedcloseX a
{
- display:inline;
+ display: inline;
padding: 5px 5px 0 0;
- margin-bottom:3px;
+ margin-bottom: 3px;
color: #363534;
- font-weight:600;
+ font-weight: 600;
float: right;
text-decoration: none;
}
+
#feedbox
- /* here */
{
- display:inline;
+ display: inline;
width: 370px;
height: 120px;
- margin:0px 25px 10px 15px;
+ margin: 0px 25px 10px 15px;
}
#feedsubmit
{
- display:inline;
- float:right;
- margin:4px 32px 0 0;
+ display: inline;
+ float: right;
+ margin: 4px 32px 0 0;
}
#blurpage
{
@@ -771,141 +846,172 @@
}
.toc
{
- float: right;
- -moz-border-radius:7px 7px 7px 7px;
- background-color:#F6F6F6;
- border:1px solid #DDDDDD;
- margin:0 20px 10px 10px;
- padding:20px 15px 20px 20px;
+ float: right;
+ -moz-border-radius: 7px 7px 7px 7px;
+ background-color: #F6F6F6;
+ border: 1px solid #DDDDDD;
+ margin: 0 20px 10px 10px;
+ padding: 20px 15px 20px 20px;
height: auto;
width: 200px;
}
- .toc ul
+ .toc h3
{
- float: left;
- padding: 15px;
-
+ font: 600 12px/1.2 Arial;
+ }
+
+ .wrap .content .toc ul
+ {
+ padding-left: 0px;
+ }
+
+
+ .wrap .content .toc .level2
+ {
+ margin-left: 15px;
}
-
.content .toc li
{
- font: normal 12px/1.2 Verdana;
+ font: normal 10px/1.2 Verdana;
background: url(../images/bullet_dn.png) no-repeat 0 5px;
}
- .relpage
+ .relpage
{
-moz-border-radius: 7px 7px 7px 7px;
border: 1px solid #DDDDDD;
padding: 25px 25px;
- clear:both;
+ clear: both;
}
.relpage ul
{
float: none;
padding: 15px;
}
- .content .relpage li
+ .content .relpage li
{
font: normal 11px/1.2 Verdana;
}
- /* edit */
h3.fn, span.fn
{
background-color: #F6F6F6;
border-width: 1px;
border-style: solid;
border-color: #E6E6E6;
- font-weight: bold;
- /* padding: 6px 0px 6px 10px;*/
- /* margin: 42px 0px 0px 0px;*/
+ font-weight: bold;
}
- /* edit */
- .indexbox
- {
- width: 100%;
- }
- .content .indexboxcont li
- {
- font: normal 600 13px/1 Verdana;
- }
- /* .indexbox a
- {
- color: #00732f;
- text-decoration: none;
- }*/
- .indexbox a:hover, .indexbox a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
- .indexbox a:visited
+ /* start index box */
+ .indexbox
{
- color: #00732f;
- text-decoration: none;
+ width: 100%;
+ display:inline-block;
}
.indexboxcont
{
display: block;
+ /* overflow: hidden;*/
}
.indexboxbar
{
- background: transparent url( "../images/horBar.png" ) repeat-x left bottom;
+ background: transparent url(../images/horBar.png ) repeat-x left bottom;
margin-bottom: 25px;
+ /* background-image: none;
+ border-bottom: 1px solid #e2e2e2;*/
}
.indexboxcont .section
{
- display: inline-block;
+ display: inline-block;
width: 49%;
*width:42%;
_width:42%;
padding:0 2% 0 1%;
vertical-align:top;
+
}
.indexboxcont .indexIcon
- {
+ {
width: 11%;
*width:18%;
_width:18%;
overflow:hidden;
+
}
.indexboxcont .section p
- {
+ {
padding-top: 20px;
padding-bottom: 20px;
}
-
.indexboxcont .sectionlist
{
display: inline-block;
width: 33%;
- margin-right: -2px;
- vertical-align: top;
padding: 0;
}
- .tricol
- {
-
- }
.indexboxcont .sectionlist ul
{
- padding-left: 15px;
margin-bottom: 20px;
}
-/*
+
.indexboxcont .sectionlist ul li
{
line-height: 12px;
}
-*/
+
+ .content .indexboxcont li
+ {
+ font: normal 600 13px/1 Verdana;
+ }
+
+ .indexbox a:hover, .indexbox a:visited:hover
+ {
+ color: #4c0033;
+ text-decoration: underline;
+ }
+
+ .indexbox a:visited
+ {
+ color: #00732f;
+ text-decoration: none;
+ }
+
+ .indexboxcont:after
+ {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+ }
+
+ .indexbox .indexIcon span
+ {
+ display: block;
+ }
+
+ .indexbox.guide .indexIcon span
+ {
+ width: 96px;
+ height: 137px;
+ background: url(../images/sprites-combined.png) no-repeat -5px -376px;
+ padding: 0;
+ }
+
+ .indexbox.tools .indexIcon span
+ {
+ width: 115px;
+ height: 137px;
+ background: url(../images/sprites-combined.png) no-repeat -111px -376px;
+ padding: 0;
+ }
+
.lastcol
{
display: inline-block;
@@ -916,12 +1022,9 @@
.tricol .lastcol
{
- margin-left:-6px;
+ margin-left: -6px;
}
-
- /*.toc ul*/
-
- /* end page elements */
+ /* end indexbox */
}
/* end of screen media */
@@ -929,7 +1032,7 @@
@media print
{
- .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
+ input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
{
display: none;
background: none;
diff --git a/tools/qml/Info_mac.plist b/tools/qml/Info_mac.plist
index ce4ebe3..80ca6a3 100644
--- a/tools/qml/Info_mac.plist
+++ b/tools/qml/Info_mac.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.1">
<dict>
+ <key>CFBundleIconFile</key>
+ <string>@ICON@</string>
<key>CFBundleIdentifier</key>
<string>com.nokia.qt.qml</string>
<key>CFBundlePackageType</key>
diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml
index 0912f58..c3a2cc0 100644
--- a/tools/qml/content/Browser.qml
+++ b/tools/qml/content/Browser.qml
@@ -12,12 +12,12 @@ Rectangle {
FolderListModel {
id: folders1
nameFilters: [ "*.qml" ]
- folder: qmlViewerFolder
+ folder: qmlLauncherFolder
}
FolderListModel {
id: folders2
nameFilters: [ "*.qml" ]
- folder: qmlViewerFolder
+ folder: qmlLauncherFolder
}
SystemPalette { id: palette }
@@ -62,7 +62,7 @@ Rectangle {
if (folders.isFolder(index)) {
down(filePath);
} else {
- qmlViewer.launch(filePath);
+ qmlLauncher.launch(filePath);
}
}
width: root.width
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp
index 9eca4a6..3ae2b5e 100644
--- a/tools/qml/loggerwidget.cpp
+++ b/tools/qml/loggerwidget.cpp
@@ -42,29 +42,141 @@
#include "loggerwidget.h"
#include <qglobal.h>
#include <QDebug>
+#include <QSettings>
+#include <QActionGroup>
+#include <QMenu>
QT_BEGIN_NAMESPACE
LoggerWidget::LoggerWidget(QWidget *parent) :
QPlainTextEdit(parent),
- m_keepClosed(false)
+ m_visibilityOrigin(SettingsOrigin)
{
setAttribute(Qt::WA_QuitOnClose, false);
- setWindowTitle(tr("Logger"));
+ setWindowTitle(tr("Warnings"));
+
+ readSettings();
+ setupPreferencesMenu();
}
void LoggerWidget::append(const QString &msg)
{
appendPlainText(msg);
- if (!m_keepClosed && !isVisible())
+ if (!isVisible() && (defaultVisibility() == AutoShowWarnings))
setVisible(true);
}
+LoggerWidget::Visibility LoggerWidget::defaultVisibility() const
+{
+ return m_visibility;
+}
+
+void LoggerWidget::setDefaultVisibility(LoggerWidget::Visibility visibility)
+{
+ if (m_visibility == visibility)
+ return;
+
+ m_visibility = visibility;
+ m_visibilityOrigin = CommandLineOrigin;
+
+ m_preferencesMenu->setEnabled(m_visibilityOrigin == SettingsOrigin);
+}
+
+QMenu *LoggerWidget::preferencesMenu()
+{
+ return m_preferencesMenu;
+}
+
+QAction *LoggerWidget::showAction()
+{
+ return m_showWidgetAction;
+}
+
+void LoggerWidget::readSettings()
+{
+ QSettings settings;
+ QString warningsPreferences = settings.value("warnings", "hide").toString();
+ if (warningsPreferences == "show") {
+ m_visibility = ShowWarnings;
+ } else if (warningsPreferences == "hide") {
+ m_visibility = HideWarnings;
+ } else {
+ m_visibility = AutoShowWarnings;
+ }
+}
+
+void LoggerWidget::saveSettings()
+{
+ if (m_visibilityOrigin != SettingsOrigin)
+ return;
+
+ QString value = "autoShow";
+ if (defaultVisibility() == ShowWarnings) {
+ value = "show";
+ } else if (defaultVisibility() == HideWarnings) {
+ value = "hide";
+ }
+
+ QSettings settings;
+ settings.setValue("warnings", value);
+}
+
+void LoggerWidget::warningsPreferenceChanged(QAction *action)
+{
+ Visibility newSetting = static_cast<Visibility>(action->data().toInt());
+ m_visibility = newSetting;
+ saveSettings();
+}
+
+void LoggerWidget::showEvent(QShowEvent *event)
+{
+ QWidget::showEvent(event);
+ emit opened();
+}
+
void LoggerWidget::closeEvent(QCloseEvent *event)
{
- m_keepClosed = true;
QWidget::closeEvent(event);
+ emit closed();
+}
+
+void LoggerWidget::setupPreferencesMenu()
+{
+ m_preferencesMenu = new QMenu(tr("Warnings"));
+ QActionGroup *warnings = new QActionGroup(m_preferencesMenu);
+ warnings->setExclusive(true);
+
+ connect(warnings, SIGNAL(triggered(QAction*)), this, SLOT(warningsPreferenceChanged(QAction*)));
+
+ QAction *showWarningsPreference = new QAction(tr("Show by default"), m_preferencesMenu);
+ showWarningsPreference->setCheckable(true);
+ showWarningsPreference->setData(LoggerWidget::ShowWarnings);
+ warnings->addAction(showWarningsPreference);
+ m_preferencesMenu->addAction(showWarningsPreference);
+
+ QAction *hideWarningsPreference = new QAction(tr("Hide by default"), m_preferencesMenu);
+ hideWarningsPreference->setCheckable(true);
+ hideWarningsPreference->setData(LoggerWidget::HideWarnings);
+ warnings->addAction(hideWarningsPreference);
+ m_preferencesMenu->addAction(hideWarningsPreference);
+
+ QAction *autoWarningsPreference = new QAction(tr("Show for first warning"), m_preferencesMenu);
+ autoWarningsPreference->setCheckable(true);
+ autoWarningsPreference->setData(LoggerWidget::AutoShowWarnings);
+ warnings->addAction(autoWarningsPreference);
+ m_preferencesMenu->addAction(autoWarningsPreference);
+
+ switch (defaultVisibility()) {
+ case LoggerWidget::ShowWarnings:
+ showWarningsPreference->setChecked(true);
+ break;
+ case LoggerWidget::HideWarnings:
+ hideWarningsPreference->setChecked(true);
+ break;
+ default:
+ autoWarningsPreference->setChecked(true);
+ }
}
QT_END_NAMESPACE
diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h
index 5c4a701..fd20c41 100644
--- a/tools/qml/loggerwidget.h
+++ b/tools/qml/loggerwidget.h
@@ -50,14 +50,44 @@ class LoggerWidget : public QPlainTextEdit {
Q_OBJECT
public:
LoggerWidget(QWidget *parent=0);
+
+ enum Visibility { ShowWarnings, HideWarnings, AutoShowWarnings };
+
+ Visibility defaultVisibility() const;
+ void setDefaultVisibility(Visibility visibility);
+
+ QMenu *preferencesMenu();
+ QAction *showAction();
+
public slots:
void append(const QString &msg);
+
+private slots:
+ void warningsPreferenceChanged(QAction *action);
+ void readSettings();
+ void saveSettings();
+
protected:
+ void showEvent(QShowEvent *event);
void closeEvent(QCloseEvent *event);
+
+signals:
+ void opened();
+ void closed();
+
private:
- bool m_keepClosed;
+ void setupPreferencesMenu();
+
+ QMenu *m_preferencesMenu;
+ QAction *m_showWidgetAction;
+
+ enum ConfigOrigin { CommandLineOrigin, SettingsOrigin };
+ ConfigOrigin m_visibilityOrigin;
+ Visibility m_visibility;
};
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(LoggerWidget::Visibility)
+
#endif // LOGGERWIDGET_H
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 9ccc3d2..380f5cc 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -54,7 +54,7 @@
QT_USE_NAMESPACE
-QtMsgHandler systemMsgOutput;
+QtMsgHandler systemMsgOutput = 0;
#if defined (Q_OS_SYMBIAN)
#include <unistd.h>
@@ -86,7 +86,7 @@ QString warnings;
void showWarnings()
{
if (!warnings.isEmpty()) {
- QMessageBox::warning(0, QApplication::tr("Qt Declarative UI Runtime"), warnings);
+ QMessageBox::warning(0, QApplication::tr("Qt QML Launcher"), warnings);
}
}
@@ -118,14 +118,11 @@ void usage()
qWarning(" -frameless ............................... run with no window frame");
qWarning(" -maximized................................ run maximized");
qWarning(" -fullscreen............................... run fullscreen");
- qWarning(" -stayontop................................ keep viewer window on top");
- qWarning(" -skin <qvfbskindir> ...................... run with a skin window frame");
- qWarning(" \"list\" for a list of built-ins");
- qWarning(" -resizeview .............................. resize the view, not the skin");
+ qWarning(" -stayontop................................ keep launcher window on top");
qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content");
qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view");
qWarning(" -qmlbrowser .............................. use a QML-based file browser");
- qWarning(" -nolog ................................... do not show log window");
+ qWarning(" -warnings [show|hide]..................... show warnings in a separate log window");
qWarning(" -recordfile <output> ..................... set video recording file");
qWarning(" - ImageMagick 'convert' for GIF)");
qWarning(" - png file for raw frames");
@@ -160,14 +157,16 @@ void scriptOptsUsage()
qWarning(" testerror ................................ test 'error' property of root item on playback");
qWarning(" snapshot ................................. file being recorded is static,");
qWarning(" only one frame will be recorded or tested");
- qWarning(" exitoncomplete ........................... cleanly exit the viewer on script completion");
- qWarning(" exitonfailure ............................ immediately exit the viewer on script failure");
- qWarning(" saveonexit ............................... save recording on viewer exit");
+ qWarning(" exitoncomplete ........................... cleanly exit the launcher on script completion");
+ qWarning(" exitonfailure ............................ immediately exit the launcher on script failure");
+ qWarning(" saveonexit ............................... save recording on launcher exit");
qWarning(" ");
qWarning(" One of record, play or both must be specified.");
exit(1);
}
+enum WarningsConfig { ShowWarnings, HideWarnings, DefaultWarnings };
+
int main(int argc, char ** argv)
{
#if defined (Q_OS_SYMBIAN)
@@ -198,7 +197,7 @@ int main(int argc, char ** argv)
#endif
QApplication app(argc, argv);
- app.setApplicationName("QtQmlRuntime");
+ app.setApplicationName("QtQmlLauncher");
app.setOrganizationName("Nokia");
app.setOrganizationDomain("nokia.com");
@@ -207,7 +206,6 @@ int main(int argc, char ** argv)
QDeclarativeFolderListModel::registerTypes();
bool frameless = false;
- bool resizeview = false;
QString fileName;
double fps = 0;
int autorecord_from = 0;
@@ -217,7 +215,6 @@ int main(int argc, char ** argv)
QStringList recordargs;
QStringList imports;
QStringList plugins;
- QString skin;
QString script;
QString scriptopts;
bool runScript = false;
@@ -229,7 +226,9 @@ int main(int argc, char ** argv)
bool stayOnTop = false;
bool maximized = false;
bool useNativeFileBrowser = true;
- bool showLogWidget = true;
+ bool experimentalGestures = false;
+
+ WarningsConfig warningsConfig = DefaultWarnings;
bool sizeToView = true;
#if defined(Q_OS_SYMBIAN)
@@ -248,11 +247,6 @@ int main(int argc, char ** argv)
fullScreen = true;
} else if (arg == "-stayontop") {
stayOnTop = true;
- } else if (arg == "-skin") {
- if (lastArg) usage();
- skin = QString(argv[++i]);
- } else if (arg == "-resizeview") {
- resizeview = true;
} else if (arg == "-netcache") {
if (lastArg) usage();
cache = QString(argv[++i]).toInt();
@@ -281,7 +275,7 @@ int main(int argc, char ** argv)
if (lastArg) usage();
app.setStartDragDistance(QString(argv[++i]).toInt());
} else if (arg == QLatin1String("-v") || arg == QLatin1String("-version")) {
- qWarning("Qt Qml Runtime version %s", QT_VERSION_STR);
+ qWarning("Qt QML Launcher version %s", QT_VERSION_STR);
exit(0);
} else if (arg == "-translation") {
if (lastArg) usage();
@@ -290,8 +284,16 @@ int main(int argc, char ** argv)
useGL = true;
} else if (arg == "-qmlbrowser") {
useNativeFileBrowser = false;
- } else if (arg == "-nolog") {
- showLogWidget = false;
+ } else if (arg == "-warnings") {
+ if (lastArg) usage();
+ QString warningsStr = QString(argv[++i]);
+ if (warningsStr == QLatin1String("show")) {
+ warningsConfig = ShowWarnings;
+ } else if (warningsStr == QLatin1String("hide")) {
+ warningsConfig = HideWarnings;
+ } else {
+ usage();
+ }
} else if (arg == "-I" || arg == "-L") {
if (arg == "-L")
qWarning("-L option provided for compatibility only, use -I instead");
@@ -323,6 +325,8 @@ int main(int argc, char ** argv)
sizeToView = false;
} else if (arg == "-sizerootobjecttoview") {
sizeToView = true;
+ } else if (arg == "-experimentalgestures") {
+ experimentalGestures = true;
} else if (arg[0] != '-') {
fileName = arg;
} else if (1 || arg == "-help") {
@@ -340,13 +344,6 @@ int main(int argc, char ** argv)
if (stayOnTop)
wflags |= Qt::WindowStaysOnTopHint;
-#if !defined(Q_OS_SYMBIAN)
- LoggerWidget loggerWidget(0);
- if (showLogWidget) {
- logger = &loggerWidget;
- }
-#endif
-
QDeclarativeViewer *viewer = new QDeclarativeViewer(0, wflags);
if (!scriptopts.isEmpty()) {
QStringList options =
@@ -389,6 +386,19 @@ int main(int argc, char ** argv)
usage();
}
+#if !defined(Q_OS_SYMBIAN)
+ logger = viewer->warningsWidget();
+ if (warningsConfig == ShowWarnings) {
+ logger.data()->setDefaultVisibility(LoggerWidget::ShowWarnings);
+ logger.data()->show();
+ } else if (warningsConfig == HideWarnings){
+ logger.data()->setDefaultVisibility(LoggerWidget::HideWarnings);
+ }
+#endif
+
+ if (experimentalGestures)
+ viewer->enableExperimentalGestures();
+
foreach (QString lib, imports)
viewer->addLibraryPath(lib);
@@ -398,21 +408,10 @@ int main(int argc, char ** argv)
viewer->setNetworkCacheSize(cache);
viewer->setRecordFile(recordfile);
viewer->setSizeToView(sizeToView);
- if (resizeview)
- viewer->setScaleView();
if (fps>0)
viewer->setRecordRate(fps);
if (autorecord_to)
viewer->setAutoRecord(autorecord_from,autorecord_to);
- if (!skin.isEmpty()) {
- if (skin == "list") {
- foreach (QString s, viewer->builtinSkins())
- qWarning() << qPrintable(s);
- exit(0);
- } else {
- viewer->setSkin(skin);
- }
- }
if (devkeys)
viewer->setDeviceKeys(true);
viewer->setRecordDither(dither);
diff --git a/tools/qml/qdeclarativefolderlistmodel.cpp b/tools/qml/qdeclarativefolderlistmodel.cpp
index 5a9d88b..7ac25d6 100644
--- a/tools/qml/qdeclarativefolderlistmodel.cpp
+++ b/tools/qml/qdeclarativefolderlistmodel.cpp
@@ -256,6 +256,10 @@ void QDeclarativeFolderListModel::setNameFilters(const QStringList &filters)
d->model.setNameFilters(d->nameFilters);
}
+void QDeclarativeFolderListModel::classBegin()
+{
+}
+
void QDeclarativeFolderListModel::componentComplete()
{
if (!d->folder.isValid() || !QDir().exists(d->folder.toLocalFile()))
@@ -340,7 +344,6 @@ void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, i
void QDeclarativeFolderListModel::dataChanged(const QModelIndex &start, const QModelIndex &end)
{
- qDebug() << "data changed";
if (start.parent() == d->folderIndex)
emit itemsChanged(start.row(), end.row() - start.row() + 1, roles());
}
diff --git a/tools/qml/qdeclarativefolderlistmodel.h b/tools/qml/qdeclarativefolderlistmodel.h
index 57b7fe5..1ecc784 100644
--- a/tools/qml/qdeclarativefolderlistmodel.h
+++ b/tools/qml/qdeclarativefolderlistmodel.h
@@ -87,6 +87,7 @@ public:
QStringList nameFilters() const;
void setNameFilters(const QStringList &filters);
+ virtual void classBegin();
virtual void componentComplete();
Q_INVOKABLE bool isFolder(int index) const;
diff --git a/tools/qml/qml.icns b/tools/qml/qml.icns
new file mode 100644
index 0000000..c760516
--- /dev/null
+++ b/tools/qml/qml.icns
Binary files differ
diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
index d343c76..a2058c7 100644
--- a/tools/qml/qml.pri
+++ b/tools/qml/qml.pri
@@ -24,7 +24,11 @@ maemo5 {
} else {
SOURCES += $$PWD/deviceorientation.cpp
}
+
+symbian {
+ INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
+ LIBS += -lesock -lcommdb -lconnmon -linsock
+}
+
FORMS = $$PWD/recopts.ui \
$$PWD/proxysettings.ui
-
-include(../shared/deviceskin/deviceskin.pri)
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index b33d48b..6129639 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -32,12 +32,11 @@ wince* {
symbian {
TARGET.UID3 = 0x20021317
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
- INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
- LIBS += -lesock -lcommdb -lconnmon -linsock
TARGET.CAPABILITY = NetworkServices ReadUserData
}
mac {
QMAKE_INFO_PLIST=Info_mac.plist
- TARGET=Qml
+ TARGET="QML Launcher"
+ ICON=qml.icns
}
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 008f163..9700090 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -53,7 +53,6 @@
#include "qdeclarative.h"
#include <private/qabstractanimation_p.h>
#include <QAbstractAnimation>
-#include "deviceskin.h"
#include <QSettings>
#include <QXmlStreamReader>
@@ -66,6 +65,7 @@
#include <QDeclarativeComponent>
#include <QWidget>
#include <QApplication>
+#include <QTranslator>
#include <QDir>
#include <QTextBrowser>
#include <QFile>
@@ -167,89 +167,6 @@ private:
QWidget *refWidget;
};
-
-class PreviewDeviceSkin : public DeviceSkin
-{
- Q_OBJECT
-public:
- explicit PreviewDeviceSkin(const DeviceSkinParameters &parameters, QWidget *parent);
-
- void setPreview(QWidget *formWidget);
- void setPreviewAndScale(QWidget *formWidget);
-
- void setScreenSize(const QSize& size)
- {
- QMatrix fit;
- fit = fit.scale(qreal(size.width())/m_screenSize.width(),
- qreal(size.height())/m_screenSize.height());
- setTransform(fit);
- QApplication::syncX();
- }
-
- QSize standardScreenSize() const { return m_screenSize; }
-
- QMenu* menu;
-
-private slots:
- void slotSkinKeyPressEvent(int code, const QString& text, bool autorep);
- void slotSkinKeyReleaseEvent(int code, const QString& text, bool autorep);
- void slotPopupMenu();
-
-private:
- const QSize m_screenSize;
-};
-
-
-PreviewDeviceSkin::PreviewDeviceSkin(const DeviceSkinParameters &parameters, QWidget *parent) :
- DeviceSkin(parameters, parent),
- m_screenSize(parameters.screenSize())
-{
- menu = new QMenu(this);
- connect(this, SIGNAL(skinKeyPressEvent(int,QString,bool)),
- this, SLOT(slotSkinKeyPressEvent(int,QString,bool)));
- connect(this, SIGNAL(skinKeyReleaseEvent(int,QString,bool)),
- this, SLOT(slotSkinKeyReleaseEvent(int,QString,bool)));
- connect(this, SIGNAL(popupMenu()), this, SLOT(slotPopupMenu()));
-}
-
-void PreviewDeviceSkin::setPreview(QWidget *formWidget)
-{
- formWidget->setFixedSize(m_screenSize);
- formWidget->setParent(this, Qt::SubWindow);
- formWidget->setAutoFillBackground(true);
- setView(formWidget);
-}
-
-void PreviewDeviceSkin::setPreviewAndScale(QWidget *formWidget)
-{
- setScreenSize(formWidget->sizeHint());
- formWidget->setParent(this, Qt::SubWindow);
- formWidget->setAutoFillBackground(true);
- setView(formWidget);
-}
-
-void PreviewDeviceSkin::slotSkinKeyPressEvent(int code, const QString& text, bool autorep)
-{
- if (QWidget *focusWidget = QApplication::focusWidget()) {
- QKeyEvent e(QEvent::KeyPress,code,0,text,autorep);
- QApplication::sendEvent(focusWidget, &e);
- }
-
-}
-
-void PreviewDeviceSkin::slotSkinKeyReleaseEvent(int code, const QString& text, bool autorep)
-{
- if (QWidget *focusWidget = QApplication::focusWidget()) {
- QKeyEvent e(QEvent::KeyRelease,code,0,text,autorep);
- QApplication::sendEvent(focusWidget, &e);
- }
-}
-
-void PreviewDeviceSkin::slotPopupMenu()
-{
- menu->exec(QCursor::pos());
-}
-
static struct { const char *name, *args; } ffmpegprofiles[] = {
{"Maximum Quality", "-sameq"},
{"High Quality", "-qmax 2"},
@@ -433,7 +350,7 @@ QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
setupProxy(manager);
if (cacheSize > 0) {
QNetworkDiskCache *cache = new QNetworkDiskCache;
- cache->setCacheDirectory(QDir::tempPath()+QLatin1String("/qml-duiviewer-network-cache"));
+ cache->setCacheDirectory(QDir::tempPath()+QLatin1String("/qml-launcher-network-cache"));
cache->setMaximumCacheSize(cacheSize);
manager->setCache(cache);
} else {
@@ -461,15 +378,19 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
#else
: QWidget(parent, flags)
#endif
- , frame_stream(0), scaleSkin(true), mb(0)
+ , loggerWindow(new LoggerWidget())
+ , frame_stream(0), mb(0)
, portraitOrientation(0), landscapeOrientation(0)
- , m_scriptOptions(0), tester(0), useQmlFileBrowser(true)
+ , showWarningsWindow(0)
+ , m_scriptOptions(0)
+ , tester(0)
+ , useQmlFileBrowser(true)
+ , translator(0)
{
QDeclarativeViewer::registerTypes();
- setWindowTitle(tr("Qt Qml Runtime"));
+ setWindowTitle(tr("Qt QML Launcher"));
devicemode = false;
- skin = 0;
canvas = 0;
record_autotime = 0;
record_rate = 50;
@@ -495,6 +416,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
}
canvas = new QDeclarativeView(this);
+
canvas->setAttribute(Qt::WA_OpaquePaintEvent);
canvas->setAttribute(Qt::WA_NoSystemBackground);
@@ -504,6 +426,9 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
QObject::connect(canvas, SIGNAL(statusChanged(QDeclarativeView::Status)), this, SLOT(statusChanged()));
QObject::connect(canvas->engine(), SIGNAL(quit()), QCoreApplication::instance (), SLOT(quit()));
+ QObject::connect(warningsWidget(), SIGNAL(opened()), this, SLOT(warningsWidgetOpened()));
+ QObject::connect(warningsWidget(), SIGNAL(closed()), this, SLOT(warningsWidgetClosed()));
+
if (!(flags & Qt::FramelessWindowHint)) {
createMenu(menuBar(),0);
setPortrait();
@@ -526,6 +451,8 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
connect(&autoStartTimer, SIGNAL(triggered()), this, SLOT(autoStartRecording()));
connect(&autoStopTimer, SIGNAL(triggered()), this, SLOT(autoStopRecording()));
connect(&recordTimer, SIGNAL(triggered()), this, SLOT(recordFrame()));
+ connect(DeviceOrientation::instance(), SIGNAL(orientationChanged()),
+ this, SLOT(orientationChanged()), Qt::QueuedConnection);
autoStartTimer.setRunning(false);
autoStopTimer.setRunning(false);
recordTimer.setRunning(false);
@@ -534,10 +461,21 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
QDeclarativeViewer::~QDeclarativeViewer()
{
+ delete loggerWindow;
canvas->engine()->setNetworkAccessManagerFactory(0);
delete namFactory;
}
+void QDeclarativeViewer::enableExperimentalGestures()
+{
+ canvas->viewport()->grabGesture(Qt::TapGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::TapAndHoldGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::PanGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::PinchGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->grabGesture(Qt::SwipeGesture,Qt::DontStartGestureOnChildren|Qt::ReceivePartialGestures|Qt::IgnoredGesturesPropagateToParent);
+ canvas->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
+}
+
int QDeclarativeViewer::menuBarHeight() const
{
if (!(windowFlags() & Qt::FramelessWindowHint))
@@ -563,6 +501,11 @@ QDeclarativeView *QDeclarativeViewer::view() const
return canvas;
}
+LoggerWidget *QDeclarativeViewer::warningsWidget() const
+{
+ return loggerWindow;
+}
+
void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
{
QObject *parent = flatmenu ? (QObject*)flatmenu : (QObject*)menu;
@@ -614,53 +557,17 @@ void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
connect(slowAction, SIGNAL(triggered(bool)), this, SLOT(setSlowMode(bool)));
debugMenu->addAction(slowAction);
- if (flatmenu) flatmenu->addSeparator();
+ showWarningsWindow = new QAction(tr("Show Warnings"), parent);
+ showWarningsWindow->setCheckable((true));
+ showWarningsWindow->setChecked(loggerWindow->isVisible());
+ connect(showWarningsWindow, SIGNAL(triggered(bool)), this, SLOT(showWarnings(bool)));
- QMenu *skinMenu = flatmenu ? flatmenu->addMenu(tr("&Skin")) : menu->addMenu(tr("&Skin"));
-
- QActionGroup *skinActions;
- QAction *skinAction;
-
- skinActions = new QActionGroup(parent);
- skinAction = new QAction(tr("Scale skin"), parent);
- skinAction->setCheckable(true);
- skinAction->setChecked(scaleSkin);
- skinActions->addAction(skinAction);
- skinMenu->addAction(skinAction);
- connect(skinAction, SIGNAL(triggered()), this, SLOT(setScaleSkin()));
- skinAction = new QAction(tr("Resize view"), parent);
- skinAction->setCheckable(true);
- skinAction->setChecked(!scaleSkin);
- skinActions->addAction(skinAction);
- skinMenu->addAction(skinAction);
- connect(skinAction, SIGNAL(triggered()), this, SLOT(setScaleView()));
- skinMenu->addSeparator();
-
- skinActions = new QActionGroup(parent);
- QSignalMapper *mapper = new QSignalMapper(parent);
- skinAction = new QAction(tr("None"), parent);
- skinAction->setCheckable(true);
- if (currentSkin.isEmpty())
- skinAction->setChecked(true);
- skinActions->addAction(skinAction);
- skinMenu->addAction(skinAction);
- mapper->setMapping(skinAction, "");
- connect(skinAction, SIGNAL(triggered()), mapper, SLOT(map()));
- skinMenu->addSeparator();
-
- foreach (QString name, builtinSkins()) {
- skinAction = new QAction(name, parent);
- skinActions->addAction(skinAction);
- skinMenu->addAction(skinAction);
- skinAction->setCheckable(true);
- if (":skin/"+name+".skin" == currentSkin)
- skinAction->setChecked(true);
- mapper->setMapping(skinAction, name);
- connect(skinAction, SIGNAL(triggered()), mapper, SLOT(map()));
- }
- connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setSkin(QString)));
+#if !defined(Q_OS_SYMBIAN)
+ debugMenu->addAction(showWarningsWindow);
+#endif
if (flatmenu) flatmenu->addSeparator();
+
#endif // Q_OS_SYMBIAN
QMenu *settingsMenu = flatmenu ? flatmenu : menu->addMenu(tr("S&ettings"));
@@ -670,6 +577,8 @@ void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
#if !defined(Q_OS_SYMBIAN)
if (!flatmenu)
settingsMenu->addAction(recordOptions);
+
+ settingsMenu->addMenu(loggerWindow->preferencesMenu());
#else
QAction *fullscreenAction = new QAction(tr("Full Screen"), parent);
fullscreenAction->setCheckable(true);
@@ -677,7 +586,10 @@ void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
settingsMenu->addAction(fullscreenAction);
#endif
+ if (flatmenu) flatmenu->addSeparator();
+
QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
+
QActionGroup *orientation = new QActionGroup(parent);
QAction *toggleOrientation = new QAction(tr("&Toggle Orientation"), parent);
@@ -756,30 +668,20 @@ void QDeclarativeViewer::toggleFullScreen()
showFullScreen();
}
-void QDeclarativeViewer::setScaleSkin()
+void QDeclarativeViewer::showWarnings(bool show)
{
- if (scaleSkin)
- return;
- scaleSkin = true;
- if (skin) {
- canvas->resize(initialSize);
- canvas->setFixedSize(initialSize);
- canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject);
- updateSizeHints();
- }
+ loggerWindow->setVisible(show);
}
-void QDeclarativeViewer::setScaleView()
+void QDeclarativeViewer::warningsWidgetOpened()
{
- if (!scaleSkin)
- return;
- scaleSkin = false;
- if (skin) {
- canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
- updateSizeHints();
- }
+ showWarningsWindow->setChecked(true);
}
+void QDeclarativeViewer::warningsWidgetClosed()
+{
+ showWarningsWindow->setChecked(false);
+}
void QDeclarativeViewer::takeSnapShot()
{
@@ -924,10 +826,8 @@ void QDeclarativeViewer::statusChanged()
if (canvas->status() == QDeclarativeView::Ready) {
initialSize = canvas->sizeHint();
if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
- QSize newWindowSize = initialSize;
- newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
updateSizeHints();
- resize(newWindowSize);
+ resize(QSize(initialSize.width(), initialSize.height()+menuBarHeight()));
}
}
}
@@ -937,6 +837,46 @@ void QDeclarativeViewer::launch(const QString& file_or_url)
QMetaObject::invokeMethod(this, "open", Qt::QueuedConnection, Q_ARG(QString, file_or_url));
}
+void QDeclarativeViewer::loadTranslationFile(const QString& directory)
+{
+ if (!translator) {
+ translator = new QTranslator(this);
+ QApplication::installTranslator(translator);
+ }
+
+ translator->load(QLatin1String("qml_" )+QLocale::system().name(), directory + QLatin1String("/i18n"));
+}
+
+void QDeclarativeViewer::loadDummyDataFiles(const QString& directory)
+{
+ QDir dir(directory+"/dummydata", "*.qml");
+ QStringList list = dir.entryList();
+ for (int i = 0; i < list.size(); ++i) {
+ QString qml = list.at(i);
+ QFile f(dir.filePath(qml));
+ f.open(QIODevice::ReadOnly);
+ QByteArray data = f.readAll();
+ QDeclarativeComponent comp(canvas->engine());
+ comp.setData(data, QUrl());
+ QObject *dummyData = comp.create();
+
+ if(comp.isError()) {
+ QList<QDeclarativeError> errors = comp.errors();
+ foreach (const QDeclarativeError &error, errors) {
+ qWarning() << error;
+ }
+ if (tester) tester->executefailure();
+ }
+
+ if (dummyData) {
+ qWarning() << "Loaded dummy data:" << dir.filePath(qml);
+ qml.truncate(qml.length()-4);
+ canvas->rootContext()->setContextProperty(qml, dummyData);
+ dummyData->setParent(this);
+ }
+ }
+}
+
bool QDeclarativeViewer::open(const QString& file_or_url)
{
currentFileOrUrl = file_or_url;
@@ -947,7 +887,7 @@ bool QDeclarativeViewer::open(const QString& file_or_url)
url = QUrl::fromLocalFile(fi.absoluteFilePath());
else
url = QUrl(file_or_url);
- setWindowTitle(tr("%1 - Qt Qml Runtime").arg(file_or_url));
+ setWindowTitle(tr("%1 - Qt QML Launcher").arg(file_or_url));
if (!m_script.isEmpty())
tester = new QDeclarativeTester(m_script, m_scriptOptions, canvas);
@@ -955,50 +895,26 @@ bool QDeclarativeViewer::open(const QString& file_or_url)
delete canvas->rootObject();
canvas->engine()->clearComponentCache();
QDeclarativeContext *ctxt = canvas->rootContext();
- ctxt->setContextProperty("qmlViewer", this);
+ ctxt->setContextProperty("qmlLauncher", this);
#ifdef Q_OS_SYMBIAN
- ctxt->setContextProperty("qmlViewerFolder", "E:\\"); // Documents on your S60 phone
+ ctxt->setContextProperty("qmlLauncherFolder", "E:\\"); // Documents on your S60 phone
#else
- ctxt->setContextProperty("qmlViewerFolder", QDir::currentPath());
+ ctxt->setContextProperty("qmlLauncherFolder", QDir::currentPath());
#endif
ctxt->setContextProperty("runtime", Runtime::instance());
QString fileName = url.toLocalFile();
if (!fileName.isEmpty()) {
- QFileInfo fi(fileName);
if (fi.exists()) {
if (fi.suffix().toLower() != QLatin1String("qml")) {
qWarning() << "qml cannot open non-QML file" << fileName;
return false;
}
- QDir dir(fi.path()+"/dummydata", "*.qml");
- QStringList list = dir.entryList();
- for (int i = 0; i < list.size(); ++i) {
- QString qml = list.at(i);
- QFile f(dir.filePath(qml));
- f.open(QIODevice::ReadOnly);
- QByteArray data = f.readAll();
- QDeclarativeComponent comp(canvas->engine());
- comp.setData(data, QUrl());
- QObject *dummyData = comp.create();
-
- if(comp.isError()) {
- QList<QDeclarativeError> errors = comp.errors();
- foreach (const QDeclarativeError &error, errors) {
- qWarning() << error;
- }
- if (tester) tester->executefailure();
- }
-
- if (dummyData) {
- qWarning() << "Loaded dummy data:" << dir.filePath(qml);
- qml.truncate(qml.length()-4);
- ctxt->setContextProperty(qml, dummyData);
- dummyData->setParent(this);
- }
- }
+ QFileInfo fi(fileName);
+ loadTranslationFile(fi.path());
+ loadDummyDataFiles(fi.path());
} else {
qWarning() << "qml cannot find file:" << fileName;
return false;
@@ -1020,83 +936,6 @@ void QDeclarativeViewer::startNetwork()
#endif
}
-QStringList QDeclarativeViewer::builtinSkins() const
-{
- QDir dir(":/skins/","*.skin");
- const QFileInfoList l = dir.entryInfoList();
- QStringList r;
- for (QFileInfoList::const_iterator it = l.begin(); it != l.end(); ++it) {
- r += (*it).baseName();
- }
- return r;
-}
-
-void QDeclarativeViewer::setSkin(const QString& skinDirOrName)
-{
- QString skinDirectory = skinDirOrName;
-
- if (!QDir(skinDirOrName).exists() && QDir(":/skins/"+skinDirOrName+".skin").exists())
- skinDirectory = ":/skins/"+skinDirOrName+".skin";
-
- if (currentSkin == skinDirectory)
- return;
-
- currentSkin = skinDirectory;
-
- // XXX QWidget::setMask does not handle changes well, and we may
- // XXX have been signalled from an item in a menu we're replacing,
- // XXX hence some rather convoluted resetting here...
-
- QString err;
- if (skin) {
- skin->hide();
- skin->deleteLater();
- }
-
- DeviceSkinParameters parameters;
- if (!skinDirectory.isEmpty() && parameters.read(skinDirectory,DeviceSkinParameters::ReadAll,&err)) {
- layout()->setEnabled(false);
- if (mb)
- mb->hide();
- if (!err.isEmpty())
- qWarning() << err;
- skin = new PreviewDeviceSkin(parameters,this);
- if (scaleSkin)
- skin->setPreviewAndScale(canvas);
- else
- skin->setPreview(canvas);
- createMenu(0,skin->menu);
- if (scaleSkin) {
- canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject);
- }
- updateSizeHints();
- skin->show();
- } else if (skin) {
- skin = 0;
- clearMask();
- if ((windowFlags() & Qt::FramelessWindowHint)) {
- menuBar()->clear();
- createMenu(menuBar(),0);
- }
- canvas->setParent(this, Qt::SubWindow);
- setParent(0,windowFlags()); // recreate
- mb->show();
- canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView);
- updateSizeHints();
-
- layout()->setEnabled(true);
- if (!scaleSkin) {
- canvas->resize(initialSize);
- canvas->setFixedSize(initialSize);
- }
- QSize newWindowSize = canvas->size();
- newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
- resize(newWindowSize);
- show();
- }
- canvas->show();
-}
-
void QDeclarativeViewer::setAutoRecord(int from, int to)
{
if (from==0) from=1; // ensure resized
@@ -1365,6 +1204,19 @@ void QDeclarativeViewer::recordFrame()
}
}
+void QDeclarativeViewer::orientationChanged()
+{
+ if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) {
+ if (canvas->rootObject()) {
+ QSizeF rootObjectSize = canvas->rootObject()->boundingRect().size();
+ QSize newSize(rootObjectSize.width(), rootObjectSize.height()+menuBarHeight());
+ if (size() != newSize) {
+ resize(newSize);
+ }
+ }
+ }
+}
+
void QDeclarativeViewer::setDeviceKeys(bool on)
{
devicemode = on;
@@ -1412,24 +1264,16 @@ void QDeclarativeViewer::updateSizeHints()
{
if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) {
QSize newWindowSize = canvas->sizeHint();
- if (!skin)
- newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
+ newWindowSize.setHeight(newWindowSize.height()+menuBarHeight());
if (!isFullScreen() && !isMaximized()) {
resize(newWindowSize);
setFixedSize(newWindowSize);
- if (skin && scaleSkin) {
- skin->setScreenSize(newWindowSize);
- }
}
} else { // QDeclarativeView::SizeRootObjectToView
canvas->setMinimumSize(QSize(0,0));
canvas->setMaximumSize(QSize(16777215,16777215));
setMinimumSize(QSize(0,0));
setMaximumSize(QSize(16777215,16777215));
- if (skin && !scaleSkin) {
- canvas->setFixedSize(skin->standardScreenSize());
- skin->setScreenSize(skin->standardScreenSize());
- }
}
updateGeometry();
}
diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h
index 2a0a07d..0416b32 100644
--- a/tools/qml/qmlruntime.h
+++ b/tools/qml/qmlruntime.h
@@ -48,6 +48,8 @@
#include <QTime>
#include <QList>
+#include "loggerwidget.h"
+
QT_BEGIN_NAMESPACE
class QDeclarativeView;
@@ -59,6 +61,7 @@ class QDeclarativeTester;
class QNetworkReply;
class QNetworkCookieJar;
class NetworkAccessManagerFactory;
+class QTranslator;
class QDeclarativeViewer
#if defined(Q_OS_SYMBIAN)
@@ -102,11 +105,13 @@ public:
void setUseNativeFileBrowser(bool);
void updateSizeHints();
void setSizeToView(bool sizeToView);
- QStringList builtinSkins() const;
QMenuBar *menuBar() const;
QDeclarativeView *view() const;
+ LoggerWidget *warningsWidget() const;
+
+ void enableExperimentalGestures();
public slots:
void sceneResized(QSize size);
@@ -117,10 +122,9 @@ public slots:
void toggleRecording();
void toggleRecordingWithSelection();
void ffmpegFinished(int code);
- void setSkin(const QString& skinDirectory);
void showProxySettings ();
void proxySettingsChanged ();
- void setScaleView();
+ void toggleOrientation();
void statusChanged();
void setSlowMode(bool);
void launch(const QString &);
@@ -128,7 +132,6 @@ public slots:
protected:
virtual void keyPressEvent(QKeyEvent *);
virtual bool event(QEvent *);
-
void createMenu(QMenuBar *menu, QMenu *flatmenu);
private slots:
@@ -137,19 +140,21 @@ private slots:
void recordFrame();
void chooseRecordingOptions();
void pickRecordingFile();
- void setScaleSkin();
void setPortrait();
void setLandscape();
- void toggleOrientation();
void startNetwork();
void toggleFullScreen();
+ void orientationChanged();
+
+ void showWarnings(bool show);
+ void warningsWidgetOpened();
+ void warningsWidgetClosed();
private:
QString getVideoFileName();
int menuBarHeight() const;
- PreviewDeviceSkin *skin;
- QSize skinscreensize;
+ LoggerWidget *loggerWindow;
QDeclarativeView *canvas;
QSize initialSize;
QString currentFileOrUrl;
@@ -182,16 +187,22 @@ private:
QAction *portraitOrientation;
QAction *landscapeOrientation;
+ QAction *showWarningsWindow;
+
QString m_script;
ScriptOptions m_scriptOptions;
QDeclarativeTester *tester;
QNetworkReply *wgtreply;
QString wgtdir;
-
NetworkAccessManagerFactory *namFactory;
bool useQmlFileBrowser;
+
+ QTranslator *translator;
+ void loadTranslationFile(const QString& directory);
+
+ void loadDummyDataFiles(const QString& directory);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeViewer::ScriptOptions)
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index 37e4548..885d029 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -102,6 +102,10 @@ int main(int argc, char *argv[])
else if (arg == "--sis" || arg == "-s") {
CHECK_PARAMETER_EXISTS
sisFile = it.next();
+ if (!QFileInfo(sisFile).exists()) {
+ errstream << "Sis file (" << sisFile << ") doesn't exist" << endl;
+ return 1;
+ }
}
else if (arg == "--download" || arg == "-d") {
CHECK_PARAMETER_EXISTS
diff --git a/tools/runonphone/symbianutils/launcher.cpp b/tools/runonphone/symbianutils/launcher.cpp
index fa509e7..ecb067e 100644
--- a/tools/runonphone/symbianutils/launcher.cpp
+++ b/tools/runonphone/symbianutils/launcher.cpp
@@ -365,8 +365,22 @@ void Launcher::handleResult(const TrkResult &result)
QByteArray prefix = "READ BUF: ";
QByteArray str = result.toString().toUtf8();
if (result.isDebugOutput) { // handle application output
- logMessage("APPLICATION OUTPUT: " + result.data);
- emit applicationOutputReceived(result.data);
+ QString msg;
+ if (result.multiplex == MuxTextTrace) {
+ if (result.data.length() > 8) {
+ quint64 timestamp = extractInt64(result.data) & 0x0FFFFFFFFFFFFFFFULL;
+ quint64 secs = timestamp / 1000000000;
+ quint64 ns = timestamp % 1000000000;
+ msg = QString("[%1.%2] %3").arg(secs).arg(ns).arg(QString(result.data.mid(8)));
+ logMessage("TEXT TRACE: " + msg);
+ }
+ } else {
+ logMessage("APPLICATION OUTPUT: " + result.data);
+ msg = result.data;
+ }
+ msg.replace("\r\n", "\n");
+ if(!msg.endsWith('\n')) msg.append('\n');
+ emit applicationOutputReceived(msg);
return;
}
switch (result.code) {
diff --git a/tools/runonphone/symbianutils/trkutils.cpp b/tools/runonphone/symbianutils/trkutils.cpp
index 9b43c96..60e391e 100644
--- a/tools/runonphone/symbianutils/trkutils.cpp
+++ b/tools/runonphone/symbianutils/trkutils.cpp
@@ -276,14 +276,13 @@ QByteArray frameMessage(byte command, byte token, const QByteArray &data, bool s
/* returns 0 if array doesn't represent a result,
otherwise returns the length of the result data */
-ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame)
+ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame, ushort& mux)
{
if (serialFrame) {
// Serial protocol with length info
if (buffer.length() < 4)
return 0;
- if (buffer.at(0) != 0x01 || byte(buffer.at(1)) != 0x90)
- return 0;
+ mux = extractShort(buffer.data());
const ushort len = extractShort(buffer.data() + 2);
return (buffer.size() >= len + 4) ? len : ushort(0);
}
@@ -292,6 +291,7 @@ ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame)
const int firstDelimiterPos = buffer.indexOf(delimiter);
// Regular message delimited by 0x7e..0x7e
if (firstDelimiterPos == 0) {
+ mux = MuxTrk;
const int endPos = buffer.indexOf(delimiter, firstDelimiterPos + 1);
return endPos != -1 ? endPos + 1 - firstDelimiterPos : 0;
}
@@ -304,7 +304,7 @@ bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *result, QByt
result->clear();
if(rawData)
rawData->clear();
- const ushort len = isValidTrkResult(*buffer, serialFrame);
+ const ushort len = isValidTrkResult(*buffer, serialFrame, result->multiplex);
if (!len)
return false;
// handle receiving application output, which is not a regular command
@@ -312,7 +312,6 @@ bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *result, QByt
if (buffer->at(delimiterPos) != 0x7e) {
result->isDebugOutput = true;
result->data = buffer->mid(delimiterPos, len);
- result->data.replace("\r\n", "\n");
*buffer->remove(0, delimiterPos + len);
return true;
}
@@ -353,6 +352,19 @@ SYMBIANUTILS_EXPORT uint extractInt(const char *data)
return res;
}
+SYMBIANUTILS_EXPORT quint64 extractInt64(const char *data)
+{
+ quint64 res = byte(data[0]);
+ res <<= 8; res += byte(data[1]);
+ res <<= 8; res += byte(data[2]);
+ res <<= 8; res += byte(data[3]);
+ res <<= 8; res += byte(data[4]);
+ res <<= 8; res += byte(data[5]);
+ res <<= 8; res += byte(data[6]);
+ res <<= 8; res += byte(data[7]);
+ return res;
+}
+
SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba)
{
QString res;
diff --git a/tools/runonphone/symbianutils/trkutils.h b/tools/runonphone/symbianutils/trkutils.h
index 553fc7d..e571028 100644
--- a/tools/runonphone/symbianutils/trkutils.h
+++ b/tools/runonphone/symbianutils/trkutils.h
@@ -135,9 +135,16 @@ enum Command {
TrkDSPositionFile = 0xd4
};
+enum SerialMultiplexor {
+ MuxRaw = 0,
+ MuxTextTrace = 0x0102,
+ MuxTrk = 0x0190
+};
+
inline byte extractByte(const char *data) { return *data; }
SYMBIANUTILS_EXPORT ushort extractShort(const char *data);
SYMBIANUTILS_EXPORT uint extractInt(const char *data);
+SYMBIANUTILS_EXPORT quint64 extractInt64(const char *data);
SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba);
@@ -217,6 +224,7 @@ struct SYMBIANUTILS_EXPORT TrkResult
int errorCode() const;
QString errorString() const;
+ ushort multiplex;
byte code;
byte token;
QByteArray data;