aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-28 15:24:18 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-05-28 15:35:03 +0200
commitba0899542cf03a685335bf4e02edfb377bade224 (patch)
tree554213486fd3420745da3821c3e4502e4c15830f
parent6f411ef9d460d6a4f73a455b6eec9afc2f52d305 (diff)
parent43484528552cb2ba3dc1dabfcce22ed40bf4f8db (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/quick/doc/src/appdevguide/porting.qdoc sync.profile Change-Id: Iec5516c596c3eca60a3e6ceb1d45f2a7a1595c12
-rw-r--r--dist/changes-5.1.09
-rw-r--r--examples/qml/doc/src/qml-extending.qdoc (renamed from examples/quick/doc/src/qml-extending.qdoc)36
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/app.qml (renamed from examples/quick/tutorials/extending/chapter1-basics/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro (renamed from examples/quick/tutorials/extending/chapter1-basics/chapter1-basics.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/main.cpp (renamed from examples/quick/tutorials/extending/chapter1-basics/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter1-basics/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/piechart.h (renamed from examples/quick/tutorials/extending/chapter1-basics/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/app.qml (renamed from examples/quick/tutorials/extending/chapter2-methods/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro (renamed from examples/quick/tutorials/extending/chapter2-methods/chapter2-methods.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/main.cpp (renamed from examples/quick/tutorials/extending/chapter2-methods/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter2-methods/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/piechart.h (renamed from examples/quick/tutorials/extending/chapter2-methods/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/app.qml (renamed from examples/quick/tutorials/extending/chapter3-bindings/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro (renamed from examples/quick/tutorials/extending/chapter3-bindings/chapter3-bindings.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/main.cpp (renamed from examples/quick/tutorials/extending/chapter3-bindings/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter3-bindings/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/piechart.h (renamed from examples/quick/tutorials/extending/chapter3-bindings/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h (renamed from examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/app.qml (renamed from examples/quick/tutorials/extending/chapter5-listproperties/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro (renamed from examples/quick/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/main.cpp (renamed from examples/quick/tutorials/extending/chapter5-listproperties/main.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter5-listproperties/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/piechart.h (renamed from examples/quick/tutorials/extending/chapter5-listproperties/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp (renamed from examples/quick/tutorials/extending/chapter5-listproperties/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h (renamed from examples/quick/tutorials/extending/chapter5-listproperties/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir (renamed from examples/quick/tutorials/extending/chapter6-plugins/Charts/qmldir)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/app.qml (renamed from examples/quick/tutorials/extending/chapter6-plugins/app.qml)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro (renamed from examples/quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp (renamed from examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h (renamed from examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp (renamed from examples/quick/tutorials/extending/chapter6-plugins/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/piechart.h (renamed from examples/quick/tutorials/extending/chapter6-plugins/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp (renamed from examples/quick/tutorials/extending/chapter6-plugins/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/pieslice.h (renamed from examples/quick/tutorials/extending/chapter6-plugins/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/extending.pro (renamed from examples/quick/tutorials/extending/extending.pro)0
-rw-r--r--examples/quick/accessibility/doc/src/accessibility.qdoc4
-rw-r--r--examples/quick/animation/doc/src/animation.qdoc20
-rw-r--r--examples/quick/canvas/doc/src/canvas.qdoc10
-rw-r--r--examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml5
-rw-r--r--examples/quick/customitems/maskedmousearea/maskedmousearea.cpp4
-rw-r--r--examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png (renamed from examples/quick/demos/calqlatr/doc/images/qml-calqlatr-demo-small.png)bin37120 -> 37120 bytes
-rw-r--r--examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc10
-rw-r--r--examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.pngbin0 -> 26067 bytes
-rw-r--r--examples/quick/demos/clocks/doc/src/clocks.qdoc35
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.pngbin0 -> 73390 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.pngbin0 -> 61303 bytes
-rw-r--r--examples/quick/demos/maroon/doc/src/maroon.qdoc36
-rw-r--r--examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png (renamed from examples/quick/demos/photosurface/doc/images/qml-photosurface-example-small.png)bin47271 -> 47271 bytes
-rw-r--r--examples/quick/demos/photosurface/doc/src/photosurface.qdoc8
-rw-r--r--examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.pngbin0 -> 73662 bytes
-rw-r--r--examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc35
-rw-r--r--examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.pngbin0 -> 43372 bytes
-rw-r--r--examples/quick/demos/rssnews/doc/src/rssnews.qdoc35
-rw-r--r--examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.pngbin0 -> 100713 bytes
-rw-r--r--examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.pngbin0 -> 134892 bytes
-rw-r--r--examples/quick/demos/samegame/doc/src/samegame.qdoc36
-rw-r--r--examples/quick/demos/stocqt/content/CheckBox.qml21
-rw-r--r--examples/quick/demos/stocqt/content/StockSettings.qml3
-rw-r--r--examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.pngbin0 -> 24592 bytes
-rw-r--r--examples/quick/demos/stocqt/doc/src/stocqt.qdoc35
-rw-r--r--examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.pngbin0 -> 18531 bytes
-rw-r--r--examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.pngbin0 -> 90622 bytes
-rw-r--r--examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc36
-rw-r--r--examples/quick/dialogs/ColorDialogs.qml38
-rw-r--r--examples/quick/dialogs/FileDialogs.qml77
-rw-r--r--examples/quick/dialogs/dialogs.pro17
-rw-r--r--examples/quick/dialogs/dialogs.qml (renamed from examples/quick/window/window/Window.qml)25
-rw-r--r--examples/quick/dialogs/dialogs.qrc7
-rw-r--r--examples/quick/dialogs/main.cpp (renamed from src/qml/doc/snippets/qml/qtbinding/resources/main.qml)11
-rw-r--r--examples/quick/draganddrop/doc/src/draganddrop.qdoc10
-rw-r--r--examples/quick/imageelements/doc/src/imageelements.qdoc10
-rw-r--r--examples/quick/mousearea/doc/src/mousearea.qdoc4
-rw-r--r--examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc14
-rw-r--r--examples/quick/particles/affectors/doc/src/affectors.qdoc34
-rw-r--r--examples/quick/particles/customparticle/doc/src/customparticle.qdoc10
-rw-r--r--examples/quick/particles/emitters/doc/src/emitters.qdoc12
-rw-r--r--examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc14
-rw-r--r--examples/quick/particles/system/doc/src/system.qdoc10
-rw-r--r--examples/quick/positioners/doc/src/positioners.qdoc8
-rw-r--r--examples/quick/quick.pro1
-rw-r--r--examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc2
-rw-r--r--examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc2
-rw-r--r--examples/quick/scenegraph/textureinthread/error.qml (renamed from src/quick/doc/snippets/qml/usecases/MyText.qml)11
-rw-r--r--examples/quick/scenegraph/textureinthread/main.cpp12
-rw-r--r--examples/quick/scenegraph/textureinthread/textureinthread.pro6
-rw-r--r--examples/quick/scenegraph/textureinthread/textureinthread.qrc3
-rw-r--r--examples/quick/shadereffects/doc/src/shadereffects.qdoc10
-rw-r--r--examples/quick/shared/TabSet.qml (renamed from examples/quick/window/screen/screenInfo.qml)85
-rw-r--r--examples/quick/shared/images/qt-logo.pngbin0 -> 13923 bytes
-rw-r--r--examples/quick/shared/images/tab.pngbin0 -> 507 bytes
-rw-r--r--examples/quick/shared/qmldir1
-rw-r--r--examples/quick/shared/shared.h2
-rw-r--r--examples/quick/shared/shared.qrc4
-rw-r--r--examples/quick/text/doc/src/text.qdoc18
-rw-r--r--examples/quick/textureprovider/etcprovider.cpp6
-rw-r--r--examples/quick/threading/doc/src/threading.qdoc10
-rw-r--r--examples/quick/touchinteraction/doc/src/touchinteraction.qdoc10
-rw-r--r--examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc20
-rw-r--r--examples/quick/views/doc/src/views.qdoc30
-rw-r--r--examples/quick/window/ScreenInfo.qml (renamed from examples/quick/window/window/twowindows.qml)92
-rw-r--r--examples/quick/window/Splash.qml74
-rw-r--r--examples/quick/window/doc/images/qml-window-example.pngbin0 -> 9863 bytes
-rw-r--r--examples/quick/window/doc/src/window.qdoc71
-rw-r--r--examples/quick/window/main.cpp (renamed from examples/quick/window/window/window.cpp)2
-rw-r--r--examples/quick/window/resources/icon.icnsbin0 -> 59662 bytes
-rw-r--r--examples/quick/window/resources/icon.icobin0 -> 11825 bytes
-rw-r--r--examples/quick/window/resources/icon.svg208
-rw-r--r--examples/quick/window/resources/icon64.pngbin0 -> 3004 bytes
-rw-r--r--examples/quick/window/resources/window.rc32
-rw-r--r--examples/quick/window/window.pro18
-rw-r--r--examples/quick/window/window.qml180
-rw-r--r--examples/quick/window/window.qrc7
-rw-r--r--examples/quick/window/window/nogui.qml50
-rw-r--r--examples/quick/window/window/standalone.qml128
-rw-r--r--examples/quick/window/window/window.pro13
-rw-r--r--examples/quick/window/window/window.qrc5
-rw-r--r--qtdeclarative.pro1
-rw-r--r--src/imports/dialogs/plugin.cpp29
-rw-r--r--src/imports/dialogs/qquickplatformcolordialog.cpp2
-rw-r--r--src/imports/dialogs/qquickplatformfiledialog.cpp2
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp22
-rw-r--r--src/imports/localstorage/plugin.cpp2
-rw-r--r--src/imports/qtquick2/plugins.qmltypes625
-rw-r--r--src/imports/window/plugins.qmltypes22
-rw-r--r--src/particles/qquickmaskextruder.cpp2
-rw-r--r--src/particles/qquickparticleemitter.cpp6
-rw-r--r--src/qml/debugger/qqmldebugserver.cpp3
-rw-r--r--src/qml/debugger/qqmlprofilerservice.cpp137
-rw-r--r--src/qml/debugger/qqmlprofilerservice_p.h98
-rw-r--r--src/qml/doc/qtqml.qdocconf2
-rw-r--r--src/qml/doc/snippets/delegatemodel/visualdatagroup.qml (renamed from src/quick/doc/snippets/qml/visualdatagroup.qml)0
-rw-r--r--src/qml/doc/snippets/delegatemodel/visualdatamodel.qml (renamed from src/quick/doc/snippets/qml/visualdatamodel.qml)0
-rw-r--r--src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/main.cpp (renamed from src/quick/doc/snippets/qml/visualdatamodel_rootindex/main.cpp)0
-rw-r--r--src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/view.qml (renamed from src/quick/doc/snippets/qml/visualdatamodel_rootindex/view.qml)0
-rw-r--r--src/qml/doc/snippets/qml/qtbinding/resources/main.cpp57
-rw-r--r--src/qml/doc/snippets/qml/qtbinding/resources/resources.pro4
-rw-r--r--src/qml/doc/src/cppclasses/topic.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/contextproperties.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/data.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/extending-tutorial.qdoc96
-rw-r--r--src/qml/doc/src/javascript/dynamicobjectcreation.qdoc18
-rw-r--r--src/qml/doc/src/javascript/imports.qdoc6
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc14
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/topic.qdoc4
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc8
-rw-r--r--src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc7
-rw-r--r--src/qml/doc/src/qmllanguageref/qmlreference.qdoc19
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/signals.qdoc2
-rw-r--r--src/qml/doc/src/qmltypereference.qdoc10
-rw-r--r--src/qml/doc/src/qtqml.qdoc2
-rw-r--r--src/qml/doc/src/whatsnew.qdoc2
-rw-r--r--src/qml/qml/qml.pri2
-rw-r--r--src/qml/qml/qqml.h18
-rw-r--r--src/qml/qml/qqmlabstracturlinterceptor.cpp91
-rw-r--r--src/qml/qml/qqmlabstracturlinterceptor_p.h66
-rw-r--r--src/qml/qml/qqmlapplicationengine.cpp3
-rw-r--r--src/qml/qml/qqmlcompileddata.cpp1
-rw-r--r--src/qml/qml/qqmlcompiler.cpp5
-rw-r--r--src/qml/qml/qqmlcomponent.cpp7
-rw-r--r--src/qml/qml/qqmlcontext.cpp16
-rw-r--r--src/qml/qml/qqmldata_p.h9
-rw-r--r--src/qml/qml/qqmlengine.cpp97
-rw-r--r--src/qml/qml/qqmlengine.h4
-rw-r--r--src/qml/qml/qqmlengine_p.h5
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp28
-rw-r--r--src/qml/qml/qqmlimport.cpp8
-rw-r--r--src/qml/qml/qqmlimport_p.h2
-rw-r--r--src/qml/qml/qqmlinfo.cpp24
-rw-r--r--src/qml/qml/qqmlinfo.h19
-rw-r--r--src/qml/qml/qqmlinstruction.cpp2
-rw-r--r--src/qml/qml/qqmllocale.cpp4
-rw-r--r--src/qml/qml/qqmlmetatype.cpp46
-rw-r--r--src/qml/qml/qqmlmetatype_p.h2
-rw-r--r--src/qml/qml/qqmlprivate.h2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp31
-rw-r--r--src/qml/qml/qqmltypeloader_p.h11
-rw-r--r--src/qml/qml/qqmlvme.cpp28
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp9
-rw-r--r--src/qml/qml/v8/qjsengine.cpp4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp22
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp45
-rw-r--r--src/qml/types/qqmlinstantiator.cpp10
-rw-r--r--src/qml/types/qqmlinstantiator_p_p.h9
-rw-r--r--src/quick/doc/images/qml-extending-types.pngbin738 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-animation.pngbin474 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-integratingjs.pngbin679 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-layouts-anchors.pngbin946 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-layouts-direct.pngbin344 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-layouts-positioners.pngbin471 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-styling-text.pngbin29158 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-styling.pngbin6330 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-text.pngbin41485 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-userinput.pngbin6713 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-visual-opacity.pngbin211 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-visual-rectangles.pngbin770 -> 0 bytes
-rw-r--r--src/quick/doc/images/qml-uses-visual-transforms.pngbin671 -> 0 bytes
-rw-r--r--src/quick/doc/qtquick.qdocconf2
-rw-r--r--src/quick/doc/snippets/qml/codingconventions/dotproperties.qml68
-rw-r--r--src/quick/doc/snippets/qml/codingconventions/javascript-imports.qml47
-rw-r--r--src/quick/doc/snippets/qml/codingconventions/javascript.qml73
-rw-r--r--src/quick/doc/snippets/qml/codingconventions/lists.qml62
-rw-r--r--src/quick/doc/snippets/qml/codingconventions/myscript.js9
-rw-r--r--src/quick/doc/snippets/qml/codingconventions/photo.qml85
-rw-r--r--src/quick/doc/snippets/qml/colors.qml (renamed from src/qml/doc/snippets/qml/colors.qml)2
-rw-r--r--src/quick/doc/snippets/qml/usecases/Button.qml86
-rw-r--r--src/quick/doc/snippets/qml/usecases/animations.qml187
-rw-r--r--src/quick/doc/snippets/qml/usecases/integratingjs-inline.qml79
-rw-r--r--src/quick/doc/snippets/qml/usecases/integratingjs.qml71
-rw-r--r--src/quick/doc/snippets/qml/usecases/layouts.qml142
-rw-r--r--src/quick/doc/snippets/qml/usecases/myscript.js46
-rw-r--r--src/quick/doc/snippets/qml/usecases/styling.qml65
-rw-r--r--src/quick/doc/snippets/qml/usecases/text.qml105
-rw-r--r--src/quick/doc/snippets/qml/usecases/userinput-keys.qml71
-rw-r--r--src/quick/doc/snippets/qml/usecases/visual-opacity.qml83
-rw-r--r--src/quick/doc/snippets/qml/usecases/visual-rects.qml78
-rw-r--r--src/quick/doc/snippets/qml/usecases/visual-transforms.qml72
-rw-r--r--src/quick/doc/snippets/qml/usecases/visual.qml66
-rw-r--r--src/quick/doc/snippets/qml/xmlrole.qml (renamed from src/qml/doc/snippets/qml/xmlrole.qml)0
-rw-r--r--src/quick/doc/src/advtutorial.qdoc58
-rw-r--r--src/quick/doc/src/appdevguide/applicationdevelopers.qdoc145
-rw-r--r--src/quick/doc/src/appdevguide/codingconventions.qdoc106
-rw-r--r--src/quick/doc/src/appdevguide/debugging.qdoc158
-rw-r--r--src/quick/doc/src/appdevguide/deployment.qdoc212
-rw-r--r--src/quick/doc/src/appdevguide/glossary.qdoc193
-rw-r--r--src/quick/doc/src/appdevguide/internationalization.qdoc280
-rw-r--r--src/quick/doc/src/appdevguide/performance.qdoc1147
-rw-r--r--src/quick/doc/src/appdevguide/porting.qdoc258
-rw-r--r--src/quick/doc/src/appdevguide/qmlscene.qdoc146
-rw-r--r--src/quick/doc/src/appdevguide/qtquicktest.qdoc131
-rw-r--r--src/quick/doc/src/appdevguide/quickstart/basics.qdoc118
-rw-r--r--src/quick/doc/src/appdevguide/quickstart/essentials.qdoc184
-rw-r--r--src/quick/doc/src/appdevguide/usecases/animations.qdoc73
-rw-r--r--src/quick/doc/src/appdevguide/usecases/integratingjs.qdoc70
-rw-r--r--src/quick/doc/src/appdevguide/usecases/layouts.qdoc79
-rw-r--r--src/quick/doc/src/appdevguide/usecases/styling.qdoc63
-rw-r--r--src/quick/doc/src/appdevguide/usecases/text.qdoc58
-rw-r--r--src/quick/doc/src/appdevguide/usecases/userinput.qdoc83
-rw-r--r--src/quick/doc/src/appdevguide/usecases/visual.qdoc85
-rw-r--r--src/quick/doc/src/concepts/effects/sprites.qdoc1
-rw-r--r--src/quick/doc/src/concepts/input/focus.qdoc1
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc24
-rw-r--r--src/quick/doc/src/concepts/positioning/layouts.qdoc1
-rw-r--r--src/quick/doc/src/concepts/positioning/righttoleft.qdoc3
-rw-r--r--src/quick/doc/src/dynamicview-tutorial.qdoc48
-rw-r--r--src/quick/doc/src/examples.qdoc5
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc20
-rw-r--r--src/quick/doc/src/qtquick.qdoc4
-rw-r--r--src/quick/doc/src/whatsnew.qdoc30
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp105
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp199
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp1
-rw-r--r--src/quick/items/qquickdrag.cpp10
-rw-r--r--src/quick/items/qquickdroparea.cpp2
-rw-r--r--src/quick/items/qquickflickable.cpp16
-rw-r--r--src/quick/items/qquickitem.cpp120
-rw-r--r--src/quick/items/qquickitem.h2
-rw-r--r--src/quick/items/qquickitem_p.h7
-rw-r--r--src/quick/items/qquickitemsmodule.cpp1
-rw-r--r--src/quick/items/qquickitemview.cpp6
-rw-r--r--src/quick/items/qquicklistview.cpp4
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp28
-rw-r--r--src/quick/items/qquickmultipointtoucharea_p.h4
-rw-r--r--src/quick/items/qquickpincharea.cpp28
-rw-r--r--src/quick/items/qquickpincharea_p.h4
-rw-r--r--src/quick/items/qquickpositioners.cpp38
-rw-r--r--src/quick/items/qquickrectangle.cpp2
-rw-r--r--src/quick/items/qquickrepeater.cpp11
-rw-r--r--src/quick/items/qquickscreen.cpp2
-rw-r--r--src/quick/items/qquickscreen_p.h3
-rw-r--r--src/quick/items/qquicktext.cpp1
-rw-r--r--src/quick/items/qquicktextcontrol.cpp24
-rw-r--r--src/quick/items/qquicktextcontrol_p_p.h1
-rw-r--r--src/quick/items/qquicktextedit.cpp111
-rw-r--r--src/quick/items/qquicktextedit_p_p.h3
-rw-r--r--src/quick/items/qquicktextnode_p.h1
-rw-r--r--src/quick/items/qquickwindow.cpp82
-rw-r--r--src/quick/items/qquickwindow.h3
-rw-r--r--src/quick/items/qquickwindow_p.h17
-rw-r--r--src/quick/quick.pro7
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp18
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.cpp1
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.h1
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp6
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp52
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp21
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp19
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.cpp2
-rw-r--r--src/quick/scenegraph/qsgdefaultimagenode_p.h2
-rw-r--r--src/quick/scenegraph/qsgdefaultrectanglenode_p.h2
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp39
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h12
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp36
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp77
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp45
-rw-r--r--src/quick/scenegraph/util/qsgflatcolormaterial.cpp10
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp58
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.cpp6
-rw-r--r--src/quick/util/qquickanimation.cpp4
-rw-r--r--src/quick/util/qquickimageprovider.cpp6
-rw-r--r--src/quick/util/qquickpath.cpp2
-rw-r--r--src/quick/util/qquickpixmapcache.cpp24
-rw-r--r--sync.profile7
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/data/TestImage_2x2.pngbin0 -> 158 bytes
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/data/pixmapCacheTest.qml13
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/data/scenegraphTest.qml18
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro3
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp147
-rw-r--r--tests/auto/qml/debugger/shared/debugutil.cpp8
-rw-r--r--tests/auto/qml/debugger/shared/debugutil_p.h3
-rw-r--r--tests/auto/qml/qml.pro4
-rw-r--r--tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp4
-rw-r--r--tests/auto/qml/qqmlcomponent/data/createWindow.qml29
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp10
-rw-r--r--tests/auto/qml/qqmlecmascript/data/MyDeferredComponent.qml10
-rw-r--r--tests/auto/qml/qqmlecmascript/data/MyDeferredComponent2.qml3
-rw-r--r--tests/auto/qml/qqmlecmascript/data/deferredPropertiesInComponents.qml15
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp32
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml6
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml11
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml12
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml11
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml11
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/intercepted.js1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml6
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml5
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js1
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml11
-rw-r--r--tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml11
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp96
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp1
-rw-r--r--tests/auto/qmldevtools/compile/compile.pro7
-rw-r--r--tests/auto/qmltest/fontloader/tst_fontloader.qml27
-rw-r--r--tests/auto/qmltest/listmodel/tst_listmodel.qml12
-rw-r--r--tests/auto/qmltest/listview/data/asynclistviewloader.qml (renamed from src/quick/doc/snippets/qml/usecases/styling-text.qml)54
-rw-r--r--tests/auto/qmltest/listview/data/asyncloadercurrentindex.qml (renamed from src/qml/doc/snippets/qml/folderlistmodel.qml)35
-rw-r--r--tests/auto/qmltest/listview/tst_listview.qml95
-rw-r--r--tests/auto/qmltest/qmltest.pro1
-rw-r--r--tests/auto/qmltest/textedit/tst_textedit.qml7
-rw-r--r--tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp6
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab6.qml144
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab7.qml36
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab8.qml36
-rw-r--r--tests/auto/quick/qquickitem2/data/resourcesProperty.qml23
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp255
-rw-r--r--tests/auto/quick/qquickwindow/data/active.qml29
-rw-r--r--tests/auto/quick/qquickwindow/data/ucantclosethis.qml32
-rw-r--r--tests/auto/quick/qquickwindow/qquickwindow.pro1
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp73
-rw-r--r--tests/manual/qmltypememory/README3
-rw-r--r--tests/manual/qmltypememory/TestPlugin/plugin.cpp (renamed from src/quick/doc/snippets/qml/usecases/userinput.qml)47
-rw-r--r--tests/manual/qmltypememory/TestPlugin/plugin.pro7
-rw-r--r--tests/manual/qmltypememory/TestPlugin/qmldir2
-rw-r--r--tests/manual/qmltypememory/TestType.qml43
-rw-r--r--tests/manual/qmltypememory/main.cpp56
-rw-r--r--tests/manual/qmltypememory/main.qml54
-rw-r--r--tests/manual/qmltypememory/qmldir2
-rw-r--r--tests/manual/qmltypememory/qmltypememory.pro8
-rw-r--r--tests/manual/qmltypememory/testdriver.cpp105
-rw-r--r--tests/manual/qmltypememory/testdriver.h65
-rw-r--r--tools/qmlplugindump/qmlplugindump.pro9
-rw-r--r--tools/qmlscene/main.cpp6
-rw-r--r--tools/tools.pro11
379 files changed, 5352 insertions, 6663 deletions
diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0
index 4333c4a8dd..50bdc2f9f8 100644
--- a/dist/changes-5.1.0
+++ b/dist/changes-5.1.0
@@ -35,10 +35,19 @@ Third party components
- A Window declared nested inside another Item or Window automatically
becomes transient for (centered upon) its parent's window, if x and y
were not explicitly specified
+ - The resources property of Item is now its own property independent
+ of QObject. It no longer returns all QObject children, or explicitly
+ sets QObject parent. The resources property now behaves as documented.
+ - As part of a fix for QTBUG-30555, ListView and GridView properties, such
+ as count, which are based off of the data model will no longer update
+ immediately if queried. Updates are batched to happen once per frame (or
+ when properties are being set).
****************************************************************************
* Library *
****************************************************************************
+ - QTBUG-30837: The Flickable type no longer fixes up the content area on
+ startup to move it inside the viewport.
****************************************************************************
diff --git a/examples/quick/doc/src/qml-extending.qdoc b/examples/qml/doc/src/qml-extending.qdoc
index ee2dd06623..7dbd147cc1 100644
--- a/examples/quick/doc/src/qml-extending.qdoc
+++ b/examples/qml/doc/src/qml-extending.qdoc
@@ -34,7 +34,7 @@
The Adding Types Example shows how to add a new object type, \c Person, to QML.
The \c Person type can be used from QML like this:
-\snippet qml/referenceexamples/adding/example.qml 0
+\snippet referenceexamples/adding/example.qml 0
\section1 Declare the Person class
@@ -43,11 +43,11 @@ 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
type, the C++ class can be named differently, or appear in a namespace.
-\snippet qml/referenceexamples/adding/person.h 0
+\snippet referenceexamples/adding/person.h 0
\section1 Define the Person class
-\snippet qml/referenceexamples/adding/person.cpp 0
+\snippet referenceexamples/adding/person.cpp 0
The Person class implementation is quite basic. The property accessors simply
return members of the object instance.
@@ -78,33 +78,33 @@ properties in QML. This example adds a BirthdayParty type 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 qml/referenceexamples/properties/example.qml 0
+\snippet referenceexamples/properties/example.qml 0
\section1 Declare the BirthdayParty
The BirthdayParty class is declared like this:
-\snippet qml/referenceexamples/properties/birthdayparty.h 0
-\snippet qml/referenceexamples/properties/birthdayparty.h 1
-\snippet qml/referenceexamples/properties/birthdayparty.h 2
-\snippet qml/referenceexamples/properties/birthdayparty.h 3
+\snippet referenceexamples/properties/birthdayparty.h 0
+\snippet referenceexamples/properties/birthdayparty.h 1
+\snippet referenceexamples/properties/birthdayparty.h 2
+\snippet referenceexamples/properties/birthdayparty.h 3
The class contains a member to store the celebrant object, and also a
QList<Person *> member.
In QML, the type of a list properties - and the guests property is a list of
-people - are all of type QDeclarativeListProperty<T>. QDeclarativeListProperty is simple value
+people - are all of type QQmlListProperty<T>. QQmlListProperty is simple value
type that contains a set of function pointers. QML calls these function
pointers whenever it needs to read from, write to or otherwise interact with
the list. In addition to concrete lists like the people list used in this
-example, the use of QDeclarativeListProperty allows for "virtual lists" and other advanced
+example, the use of QQmlListProperty allows for "virtual lists" and other advanced
scenarios.
\section2 Define the BirthdayParty
The implementation of BirthdayParty property accessors is straight forward.
-\snippet qml/referenceexamples/properties/birthdayparty.cpp 0
+\snippet referenceexamples/properties/birthdayparty.cpp 0
\section1 Running the example
@@ -128,11 +128,11 @@ The Inheritance and Coercion Example shows how to use base classes to assign
types of more than one type to a property. It specializes the Person type
developed in the previous examples into two types - a \c Boy and a \c Girl.
-\snippet qml/referenceexamples/coercion/example.qml 0
+\snippet referenceexamples/coercion/example.qml 0
\section1 Declare Boy and Girl
-\snippet qml/referenceexamples/coercion/person.h 0
+\snippet 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
@@ -147,7 +147,7 @@ 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 qml/referenceexamples/coercion/main.cpp 0
+\snippet 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
@@ -157,7 +157,7 @@ and other types can be coerced to it.
The implementation of Boy and Girl are trivial.
-\snippet qml/referenceexamples/coercion/person.cpp 1
+\snippet 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.
@@ -167,7 +167,7 @@ and their QML name with the QML engine.
The BirthdayParty type has not changed since the previous example. The
celebrant and guests property still use the People type.
-\snippet qml/referenceexamples/coercion/birthdayparty.h 0
+\snippet 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
@@ -194,14 +194,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 qml/referenceexamples/default/example.qml 0
+\snippet 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 qml/referenceexamples/default/birthdayparty.h 0
+\snippet 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 type the guest
diff --git a/examples/quick/tutorials/extending/chapter1-basics/app.qml b/examples/qml/tutorials/extending/chapter1-basics/app.qml
index d2f03daf83..d2f03daf83 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/app.qml
+++ b/examples/qml/tutorials/extending/chapter1-basics/app.qml
diff --git a/examples/quick/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
index 8ed66f8b66..8ed66f8b66 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/chapter1-basics.pro
+++ b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
diff --git a/examples/quick/tutorials/extending/chapter1-basics/main.cpp b/examples/qml/tutorials/extending/chapter1-basics/main.cpp
index d30628fd5a..d30628fd5a 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/main.cpp
+++ b/examples/qml/tutorials/extending/chapter1-basics/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter1-basics/piechart.cpp b/examples/qml/tutorials/extending/chapter1-basics/piechart.cpp
index fa005781d8..fa005781d8 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter1-basics/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter1-basics/piechart.h b/examples/qml/tutorials/extending/chapter1-basics/piechart.h
index a6272453ce..a6272453ce 100644
--- a/examples/quick/tutorials/extending/chapter1-basics/piechart.h
+++ b/examples/qml/tutorials/extending/chapter1-basics/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter2-methods/app.qml b/examples/qml/tutorials/extending/chapter2-methods/app.qml
index 06ecb3a09d..06ecb3a09d 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/app.qml
+++ b/examples/qml/tutorials/extending/chapter2-methods/app.qml
diff --git a/examples/quick/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
index 8ed66f8b66..8ed66f8b66 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/chapter2-methods.pro
+++ b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
diff --git a/examples/quick/tutorials/extending/chapter2-methods/main.cpp b/examples/qml/tutorials/extending/chapter2-methods/main.cpp
index d30628fd5a..d30628fd5a 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/main.cpp
+++ b/examples/qml/tutorials/extending/chapter2-methods/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter2-methods/piechart.cpp b/examples/qml/tutorials/extending/chapter2-methods/piechart.cpp
index ddcb1b3efd..ddcb1b3efd 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter2-methods/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter2-methods/piechart.h b/examples/qml/tutorials/extending/chapter2-methods/piechart.h
index 86750197d2..86750197d2 100644
--- a/examples/quick/tutorials/extending/chapter2-methods/piechart.h
+++ b/examples/qml/tutorials/extending/chapter2-methods/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/app.qml b/examples/qml/tutorials/extending/chapter3-bindings/app.qml
index afb9e25c51..afb9e25c51 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/app.qml
+++ b/examples/qml/tutorials/extending/chapter3-bindings/app.qml
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
index 8ed66f8b66..8ed66f8b66 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
+++ b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/main.cpp b/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
index d30628fd5a..d30628fd5a 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/main.cpp
+++ b/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/piechart.cpp b/examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp
index a63035033f..a63035033f 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter3-bindings/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter3-bindings/piechart.h b/examples/qml/tutorials/extending/chapter3-bindings/piechart.h
index 25e82d66cc..25e82d66cc 100644
--- a/examples/quick/tutorials/extending/chapter3-bindings/piechart.h
+++ b/examples/qml/tutorials/extending/chapter3-bindings/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml
index 441b7f9b82..441b7f9b82 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/app.qml
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/app.qml
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
index 23eb222ea3..23eb222ea3 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
index 5b6e1cf451..5b6e1cf451 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
index c1e2996e83..c1e2996e83 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h
index 9f0ea47eb9..9f0ea47eb9 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
index 2afe82048f..2afe82048f 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
diff --git a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
index 4eef9bb6d1..4eef9bb6d1 100644
--- a/examples/quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/app.qml b/examples/qml/tutorials/extending/chapter5-listproperties/app.qml
index a57d1b833f..a57d1b833f 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/app.qml
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/app.qml
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
index 23eb222ea3..23eb222ea3 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/main.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
index f8826f6c31..f8826f6c31 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/main.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp
index 9fb61d9cd8..9fb61d9cd8 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.h b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.h
index 55488f4900..55488f4900 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/piechart.h
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp
index 52b409aa22..52b409aa22 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.cpp
diff --git a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.h b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h
index f324179481..f324179481 100644
--- a/examples/quick/tutorials/extending/chapter5-listproperties/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/pieslice.h
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/Charts/qmldir b/examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir
index d9e8471b3c..d9e8471b3c 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/Charts/qmldir
+++ b/examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/app.qml b/examples/qml/tutorials/extending/chapter6-plugins/app.qml
index 417fc6651a..417fc6651a 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/app.qml
+++ b/examples/qml/tutorials/extending/chapter6-plugins/app.qml
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
index 6bf44b4d15..6bf44b4d15 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp
index fea4c1aa85..fea4c1aa85 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h
index d768306967..d768306967 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/chartsplugin.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/piechart.cpp b/examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp
index 295bb8961d..295bb8961d 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/piechart.h b/examples/qml/tutorials/extending/chapter6-plugins/piechart.h
index b37bcdd411..b37bcdd411 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/piechart.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/piechart.h
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.cpp b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp
index 52b409aa22..52b409aa22 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp
diff --git a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.h b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.h
index 0b488b4835..0b488b4835 100644
--- a/examples/quick/tutorials/extending/chapter6-plugins/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/pieslice.h
diff --git a/examples/quick/tutorials/extending/extending.pro b/examples/qml/tutorials/extending/extending.pro
index 967473fda0..967473fda0 100644
--- a/examples/quick/tutorials/extending/extending.pro
+++ b/examples/qml/tutorials/extending/extending.pro
diff --git a/examples/quick/accessibility/doc/src/accessibility.qdoc b/examples/quick/accessibility/doc/src/accessibility.qdoc
index a637383324..0281ffff4e 100644
--- a/examples/quick/accessibility/doc/src/accessibility.qdoc
+++ b/examples/quick/accessibility/doc/src/accessibility.qdoc
@@ -33,8 +33,8 @@
Types in this example are augmented with meta-data for accessiblity systems.
For example, the button identifies itself and its functionality to the accessibility system:
- \snippet quick/accessibility/content/Button.qml button
+ \snippet accessibility/content/Button.qml button
As do Text types inside the example:
- \snippet quick/accessibility/accessibility.qml text
+ \snippet accessibility/accessibility.qml text
*/
diff --git a/examples/quick/animation/doc/src/animation.qdoc b/examples/quick/animation/doc/src/animation.qdoc
index 064717835d..734b1af118 100644
--- a/examples/quick/animation/doc/src/animation.qdoc
+++ b/examples/quick/animation/doc/src/animation.qdoc
@@ -36,37 +36,37 @@
a small QML file emphasizing a particular type or feature.
ColorAnimation demonstrates using a color animation to fade a sky from day to night.
- \snippet quick/animation/basics/color-animation.qml 0
+ \snippet animation/basics/color-animation.qml 0
PropertyAnimation demonstrates using a number animation to bounce a circle up and down.
- \snippet quick/animation/basics/property-animation.qml 0
+ \snippet animation/basics/property-animation.qml 0
Behaviors demonstrates using behaviors to animate moving a rectangle to whereever you click.
- \snippet quick/animation/behaviors/behavior-example.qml 0
+ \snippet animation/behaviors/behavior-example.qml 0
Wiggly Text demonstrates using more complex behaviors to animate and wiggle some text around as you drag it.
It does this by assigning a complex binding to each letter:
- \snippet quick/animation/behaviors/wigglytext.qml 0
+ \snippet animation/behaviors/wigglytext.qml 0
Then, it uses behaviors to animate the movement on each letter:
- \snippet quick/animation/behaviors/wigglytext.qml 1
+ \snippet animation/behaviors/wigglytext.qml 1
Tv Tennis demonstrates using more complex behaviors to get paddles following a ball for an infinite game.
Again a binding which depends on other values is applied to the position and a behavior provided the animation.
- \snippet quick/animation/behaviors/tvtennis.qml 0
+ \snippet animation/behaviors/tvtennis.qml 0
Easing Curves shows off all the easing curves available in Qt Quick animations.
States demonstrates how the properties of an item can vary between states.
It defines several states:
- \snippet quick/animation/states/states.qml 0
+ \snippet animation/states/states.qml 0
Note that there is also the implicit 'base state' from properties set directly on objects.
Transitions takes the States example and animates the property changes by setting transitions:
- \snippet quick/animation/states/transitions.qml 0
+ \snippet animation/states/transitions.qml 0
PathAnimation animates an image along a beizer curve using a PathAnimation.
- \snippet quick/animation/pathanimation/pathanimation.qml 0
+ \snippet animation/pathanimation/pathanimation.qml 0
PathInterpolator animates an image along the same beizer curve, using a PathInterpolator instead.
- \snippet quick/animation/pathinterpolator/pathinterpolator.qml 0
+ \snippet animation/pathinterpolator/pathinterpolator.qml 0
*/
diff --git a/examples/quick/canvas/doc/src/canvas.qdoc b/examples/quick/canvas/doc/src/canvas.qdoc
index 638d25d83f..f3eb78e1d1 100644
--- a/examples/quick/canvas/doc/src/canvas.qdoc
+++ b/examples/quick/canvas/doc/src/canvas.qdoc
@@ -36,12 +36,12 @@
a small QML file emphasizing a particular type or feature.
Red heart demonstrates using a bezierCurve API to stroke and fill a red heart.
- \snippet quick/canvas/bezierCurve/bezierCurve.qml 0
+ \snippet canvas/bezierCurve/bezierCurve.qml 0
Talk bubble demonstrates using a quadraticCurveTo API to stroke and fill a customized talk bubble:
- \snippet quick/canvas/quadraticCurveTo/quadraticCurveTo.qml 0
+ \snippet canvas/quadraticCurveTo/quadraticCurveTo.qml 0
This example also demonstrates the fillText API:
- \snippet quick/canvas/quadraticCurveTo/quadraticCurveTo.qml 1
+ \snippet canvas/quadraticCurveTo/quadraticCurveTo.qml 1
Squircle demonstrates using a collection of simple moveTo/lineTo path APIs to draw a smooth squircle.
@@ -50,9 +50,9 @@
Smile face demonstrates using several complex path APIs to draw an fill a smile face.
Clip demonstrates using clip API to clip a given image.
- \snippet quick/canvas/clip/clip.qml 0
+ \snippet canvas/clip/clip.qml 0
Tiger demonstrates using SVG path API to draw a tiger with a collection of SVG path strings.
- \snippet quick/canvas/tiger/tiger.qml 0
+ \snippet canvas/tiger/tiger.qml 0
*/
diff --git a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
index 0756d339ff..69e703cca7 100644
--- a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
+++ b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml
@@ -116,13 +116,12 @@ Item {
if (canvas.stroke)
ctx.stroke();
- ctx.restore();
-
// ![1]
ctx.fillStyle = "white";
ctx.font = "Bold 17px";
- ctx.fillText("Qt Quick", 110, 140);
+ ctx.fillText("Qt Quick", 40, 70);
// ![1]
+ ctx.restore();
}
}
}
diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
index be37a5936d..4f0818ac71 100644
--- a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
+++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
@@ -42,7 +42,7 @@
#include <QStyleHints>
#include <QGuiApplication>
-
+#include <qqmlfile.h>
MaskedMouseArea::MaskedMouseArea(QQuickItem *parent)
: QQuickItem(parent),
@@ -74,7 +74,7 @@ void MaskedMouseArea::setMaskSource(const QUrl &source)
{
if (m_maskSource != source) {
m_maskSource = source;
- m_maskImage = QImage(source.toLocalFile());
+ m_maskImage = QImage(QQmlFile::urlToLocalFileOrQrc(source));
emit maskSourceChanged();
}
}
diff --git a/examples/quick/demos/calqlatr/doc/images/qml-calqlatr-demo-small.png b/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png
index af67f63dd1..af67f63dd1 100644
--- a/examples/quick/demos/calqlatr/doc/images/qml-calqlatr-demo-small.png
+++ b/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png
Binary files differ
diff --git a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
index 60a9725e53..7217c7d806 100644
--- a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
+++ b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
@@ -26,13 +26,11 @@
****************************************************************************/
/*!
- \title QML Demo - Calqlatr
+ \title Qt Quick Demo - Calqlatr
+ \ingroup qtquickdemos
\example demos/calqlatr
- \brief This is an example calculator written in QML.
- \image qml-calqlatr-demo-small.png
- \ingroup qmldemos
-
- This demo implements a simple calculator app, designed for portrait devices.
+ \brief A simple calculator app, designed for portrait devices.
+ \image qtquick-demo-calqlatr.png
This app has the logic implemented in Javascipt and the appearance implemented in QML.
*/
diff --git a/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png b/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png
new file mode 100644
index 0000000000..94b641d891
--- /dev/null
+++ b/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png
Binary files differ
diff --git a/examples/quick/demos/clocks/doc/src/clocks.qdoc b/examples/quick/demos/clocks/doc/src/clocks.qdoc
new file mode 100644
index 0000000000..b34f844cc6
--- /dev/null
+++ b/examples/quick/demos/clocks/doc/src/clocks.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Clocks
+ \ingroup qtquickdemos
+ \example demos/clocks
+ \brief An app that shows the current time in different cities.
+ \image qtquick-demo-clocks-small.png
+*/
+
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png
new file mode 100644
index 0000000000..6d41179c23
--- /dev/null
+++ b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png
new file mode 100644
index 0000000000..c8f37486f6
--- /dev/null
+++ b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/src/maroon.qdoc b/examples/quick/demos/maroon/doc/src/maroon.qdoc
new file mode 100644
index 0000000000..c18b6bc874
--- /dev/null
+++ b/examples/quick/demos/maroon/doc/src/maroon.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Maroon in Trouble
+ \ingroup qtquickdemos
+ \example demos/maroon
+ \brief A cute game designed for touchscreens.
+ \image qtquick-demo-maroon-med-1.png
+ \image qtquick-demo-maroon-med-2.png
+*/
+
diff --git a/examples/quick/demos/photosurface/doc/images/qml-photosurface-example-small.png b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
index a0cd823999..a0cd823999 100644
--- a/examples/quick/demos/photosurface/doc/images/qml-photosurface-example-small.png
+++ b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
Binary files differ
diff --git a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
index 343acce14a..48f8e8a14b 100644
--- a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
+++ b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
@@ -26,11 +26,11 @@
****************************************************************************/
/*!
- \title QML Demo - Photo Surface
+ \title Qt Quick Demo - Photo Surface
+ \ingroup qtquickdemos
\example demos/photosurface
- \brief This is the typical touch photo-shuffling example written in QML.
- \image qml-photosurface-example-small.png
- \ingroup qtquickexamples
+ \brief A touch-based app for shuffling photos around a virtual surface.
+ \image qtquick-demo-photosurface-small.png
This example demonstrates how to handle dragging, rotation and
pinch zooming within the same item using a PinchArea containing a MouseArea.
diff --git a/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png b/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png
new file mode 100644
index 0000000000..d872310a3e
--- /dev/null
+++ b/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png
Binary files differ
diff --git a/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc b/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc
new file mode 100644
index 0000000000..b0f1368a1c
--- /dev/null
+++ b/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Photo Viewer
+ \ingroup qtquickdemos
+ \example demos/photoviewer
+ \brief An online photo viewer that displays Flickr feeds.
+ \image qtquick-demo-photoviewer-small.png
+*/
+
diff --git a/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png b/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png
new file mode 100644
index 0000000000..0ad6c02251
--- /dev/null
+++ b/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png
Binary files differ
diff --git a/examples/quick/demos/rssnews/doc/src/rssnews.qdoc b/examples/quick/demos/rssnews/doc/src/rssnews.qdoc
new file mode 100644
index 0000000000..019b54d609
--- /dev/null
+++ b/examples/quick/demos/rssnews/doc/src/rssnews.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - RSS News
+ \ingroup qtquickdemos
+ \example demos/rssnews
+ \brief An RSS news reader.
+ \image qtquick-demo-rssnews-small.png
+*/
+
diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png
new file mode 100644
index 0000000000..cce9f11017
--- /dev/null
+++ b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png
Binary files differ
diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png
new file mode 100644
index 0000000000..ca9e8368b1
--- /dev/null
+++ b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png
Binary files differ
diff --git a/examples/quick/demos/samegame/doc/src/samegame.qdoc b/examples/quick/demos/samegame/doc/src/samegame.qdoc
new file mode 100644
index 0000000000..70042d73f0
--- /dev/null
+++ b/examples/quick/demos/samegame/doc/src/samegame.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Same Game
+ \ingroup qtquickdemos
+ \example demos/samegame
+ \brief A QML implementation of the popular puzzle game by Kuniaki Moribe.
+ \image qtquick-demo-samegame-med-1.png
+ \image qtquick-demo-samegame-med-2.png
+*/
+
diff --git a/examples/quick/demos/stocqt/content/CheckBox.qml b/examples/quick/demos/stocqt/content/CheckBox.qml
index 9c429d65dc..1e7dcf7c74 100644
--- a/examples/quick/demos/stocqt/content/CheckBox.qml
+++ b/examples/quick/demos/stocqt/content/CheckBox.qml
@@ -40,13 +40,12 @@
import QtQuick 2.0
-Row {
+Item {
id: button
property alias text: txt.text
property bool buttonEnabled: true
width: 140
height: 25
- spacing: 5
x: 5
MouseArea {
id: mouse
@@ -75,14 +74,14 @@ Row {
radius: 1
color: mouse.pressed || buttonEnabled ? "#76644A" : "transparent"
}
- Text {
- id: txt
- anchors.left: checkbox.right
- anchors.leftMargin: 4
- anchors.verticalCenter: parent.verticalCenter
- text: "Close "
- color: "#ecc089"
- font.pixelSize: 18
- }
+ }
+ Text {
+ id: txt
+ anchors.left: checkbox.right
+ anchors.leftMargin: 4
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Close "
+ color: "#ecc089"
+ font.pixelSize: 18
}
}
diff --git a/examples/quick/demos/stocqt/content/StockSettings.qml b/examples/quick/demos/stocqt/content/StockSettings.qml
index 5978a3b6a0..07152410fa 100644
--- a/examples/quick/demos/stocqt/content/StockSettings.qml
+++ b/examples/quick/demos/stocqt/content/StockSettings.qml
@@ -88,7 +88,6 @@ Rectangle {
anchors.leftMargin: 30
anchors.top: startDateText.bottom
anchors.topMargin: 8
- date: new Date(1995, 3, 25)
}
Text {
@@ -212,4 +211,6 @@ Rectangle {
onClicked: root.chartType = "all"
}
}
+
+ Component.onCompleted: startDatePicker.date = new Date(1995, 3, 25)
}
diff --git a/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png b/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png
new file mode 100644
index 0000000000..1783881e1f
--- /dev/null
+++ b/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png
Binary files differ
diff --git a/examples/quick/demos/stocqt/doc/src/stocqt.qdoc b/examples/quick/demos/stocqt/doc/src/stocqt.qdoc
new file mode 100644
index 0000000000..7001bfb395
--- /dev/null
+++ b/examples/quick/demos/stocqt/doc/src/stocqt.qdoc
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - StocQt
+ \ingroup qtquickdemos
+ \example demos/stocqt
+ \brief A configurable stock chart for the NASDAQ-100.
+ \image qtquick-demo-stocqt.png
+*/
+
diff --git a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png
new file mode 100644
index 0000000000..930ee39929
--- /dev/null
+++ b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png
new file mode 100644
index 0000000000..9eff191a47
--- /dev/null
+++ b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png
Binary files differ
diff --git a/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
new file mode 100644
index 0000000000..9ba252fcb5
--- /dev/null
+++ b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title Qt Quick Demo - Tweet Search
+ \ingroup qtquickdemos
+ \example demos/tweetsearch
+ \brief A Twitter search client with 3D effects.
+ \image qtquick-demo-tweetsearch-med-1.png
+ \image qtquick-demo-tweetsearch-med-2.png
+*/
+
diff --git a/examples/quick/dialogs/ColorDialogs.qml b/examples/quick/dialogs/ColorDialogs.qml
index 7817c8edf8..f3d253aa8c 100644
--- a/examples/quick/dialogs/ColorDialogs.qml
+++ b/examples/quick/dialogs/ColorDialogs.qml
@@ -46,8 +46,8 @@ Rectangle {
width: 320
height: 200
color: palette.window
-
SystemPalette { id: palette }
+ clip: true
ColorDialog {
id: colorDialog
@@ -62,7 +62,7 @@ Rectangle {
Column {
anchors.fill: parent
- anchors.margins: 8
+ anchors.margins: 12
spacing: 8
Text {
font.bold: true
@@ -106,4 +106,38 @@ Rectangle {
}
}
}
+
+ Rectangle {
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: 50
+ color: Qt.darker(palette.window, 1.1)
+ border.color: Qt.darker(palette.window, 1.3)
+ Row {
+ spacing: 6
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 12
+ height: parent.height - 6
+ width: parent.width
+ Button {
+ text: "Open"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: colorDialog.open()
+ }
+ Button {
+ text: "Close"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: colorDialog.close()
+ }
+ Button {
+ text: "set to green"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: colorDialog.color = "green"
+ }
+ }
+ }
}
diff --git a/examples/quick/dialogs/FileDialogs.qml b/examples/quick/dialogs/FileDialogs.qml
index a6df29bb37..8ed64b0b3c 100644
--- a/examples/quick/dialogs/FileDialogs.qml
+++ b/examples/quick/dialogs/FileDialogs.qml
@@ -43,43 +43,11 @@ import QtQuick.Dialogs 1.0
import "../shared"
Rectangle {
-
width: 580
- height: 360
+ height: 400
color: palette.window
SystemPalette { id: palette }
-
- Rectangle {
- id: toolbar
- width: parent.width
- height: 40
- color: Qt.darker(palette.window, 1.1)
- border.color: Qt.darker(palette.window, 1.3)
- Row {
- spacing: 6
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 8
- height: parent.height - 6
- width: parent.width
- Button {
- text: "Open"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fileDialog.open()
- }
- Button {
- text: "Close"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fileDialog.close()
- }
- Button {
- text: "/tmp"
- anchors.verticalCenter: parent.verticalCenter
- // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
- onClicked: fileDialog.folder = "/tmp"
- }
- }
- }
+ clip: true
FileDialog {
id: fileDialog
@@ -97,10 +65,8 @@ Rectangle {
}
Column {
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: toolbar.bottom
- anchors.margins: 8
+ anchors.fill: parent
+ anchors.margins: 12
spacing: 8
Text {
color: palette.windowText
@@ -163,4 +129,39 @@ Rectangle {
wrapMode: Text.Wrap
}
}
+
+ Rectangle {
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: 50
+ color: Qt.darker(palette.window, 1.1)
+ border.color: Qt.darker(palette.window, 1.3)
+ Row {
+ spacing: 6
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 12
+ height: parent.height - 6
+ width: parent.width
+ Button {
+ text: "Open"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: fileDialog.open()
+ }
+ Button {
+ text: "Close"
+ anchors.verticalCenter: parent.verticalCenter
+ onClicked: fileDialog.close()
+ }
+ Button {
+ text: "go to /tmp"
+ anchors.verticalCenter: parent.verticalCenter
+ // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
+ onClicked: fileDialog.folder = "/tmp"
+ }
+ }
+ }
}
diff --git a/examples/quick/dialogs/dialogs.pro b/examples/quick/dialogs/dialogs.pro
new file mode 100644
index 0000000000..b76f396e9d
--- /dev/null
+++ b/examples/quick/dialogs/dialogs.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+
+QT += quick qml
+SOURCES += main.cpp
+RESOURCES += dialogs.qrc ../shared/shared.qrc
+
+OTHER_FILES += \
+ dialogs.qml \
+ FileDialogs.qml \
+ ColorDialogs.qml
+
+EXAMPLE_FILES = \
+ FileDialogs.qml \
+ ColorDialogs.qml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/dialogs
+INSTALLS += target
diff --git a/examples/quick/window/window/Window.qml b/examples/quick/dialogs/dialogs.qml
index 07900930d3..b5f9841a3f 100644
--- a/examples/quick/window/window/Window.qml
+++ b/examples/quick/dialogs/dialogs.qml
@@ -39,20 +39,21 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Window 2.0
+import "../shared"
-Window {
- width: 640
- height: 480
- visible: true //It's false by default
- property Component self
- Component.onCompleted: self = Qt.createComponent("Window.qml")
- Text{
- text: "Hello World!"
- anchors.centerIn: parent
+TabSet {
+ width: 580
+ height: 440
+
+ FileDialogs {
+ property string title: "File Dialog"
+ anchors.fill: parent
+ color: "#e3e3e3" // to match tab.png
}
- MouseArea{
+
+ ColorDialogs {
+ property string title: "Color Dialog"
anchors.fill: parent
- onClicked: self.createObject();
+ color: "#e3e3e3" // to match tab.png
}
}
diff --git a/examples/quick/dialogs/dialogs.qrc b/examples/quick/dialogs/dialogs.qrc
new file mode 100644
index 0000000000..efebfe4845
--- /dev/null
+++ b/examples/quick/dialogs/dialogs.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/dialogs">
+ <file>dialogs.qml</file>
+ <file>FileDialogs.qml</file>
+ <file>ColorDialogs.qml</file>
+ </qresource>
+</RCC>
diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/main.qml b/examples/quick/dialogs/main.cpp
index 410b3f68d1..bbf0c48104 100644
--- a/src/qml/doc/snippets/qml/qtbinding/resources/main.qml
+++ b/examples/quick/dialogs/main.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -37,10 +37,5 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-//![0]
-// main.qml
-import QtQuick 2.0
-
-Image { source: "images/background.png" }
-//![0]
+#include "../shared/shared.h"
+DECLARATIVE_EXAMPLE_MAIN(dialogs/dialogs)
diff --git a/examples/quick/draganddrop/doc/src/draganddrop.qdoc b/examples/quick/draganddrop/doc/src/draganddrop.qdoc
index 381fdd1299..2c62e271e6 100644
--- a/examples/quick/draganddrop/doc/src/draganddrop.qdoc
+++ b/examples/quick/draganddrop/doc/src/draganddrop.qdoc
@@ -37,12 +37,12 @@
It has a DragTile component which uses a MouseArea to move an item when dragged:
- \snippet quick/draganddrop/tiles/DragTile.qml 0
- \snippet quick/draganddrop/tiles/DragTile.qml 1
+ \snippet draganddrop/tiles/DragTile.qml 0
+ \snippet draganddrop/tiles/DragTile.qml 1
And a DropTile component which the dragged tiles can be dropped onto:
- \snippet quick/draganddrop/tiles/DropTile.qml 0
+ \snippet draganddrop/tiles/DropTile.qml 0
The keys property of the DropArea will only allow an item with matching key in
it's Drag.keys property to be dropped on it.
@@ -52,7 +52,7 @@
It uses a DelegateModel to move a delegate item to the position of another item
it is dragged over.
- \snippet quick/draganddrop/views/gridview.qml 0
- \snippet quick/draganddrop/views/gridview.qml 1
+ \snippet draganddrop/views/gridview.qml 0
+ \snippet draganddrop/views/gridview.qml 1
*/
diff --git a/examples/quick/imageelements/doc/src/imageelements.qdoc b/examples/quick/imageelements/doc/src/imageelements.qdoc
index 5abcece4fc..d88201faf9 100644
--- a/examples/quick/imageelements/doc/src/imageelements.qdoc
+++ b/examples/quick/imageelements/doc/src/imageelements.qdoc
@@ -25,7 +25,7 @@
**
****************************************************************************/
/*!
- \title QML Examples - Image Elements
+ \title Qt Quick Examples - Image Elements
\example imageelements
\brief This is a collection of QML examples relating to image types.
\image qml-imageelements-example.png
@@ -40,20 +40,20 @@
'Shadows' shows how to create a drop shadow effect for a rectangular item
using a BorderImage:
- \snippet quick/imageelements/content/ShadowRectangle.qml shadow
+ \snippet imageelements/content/ShadowRectangle.qml shadow
'AnimatedSprite' shows how to display a simple animation using an
AnimatedSprite object:
- \snippet quick/imageelements/animatedsprite.qml sprite
+ \snippet imageelements/animatedsprite.qml sprite
The sprite animation will loop 3 times.
'SpriteSequence' demonstrates using a sprite sequence to draw an animated
and interactive bear.
The SpriteSequence defines 5 different sprites. The bear is initially in
a 'still' state:
- \snippet quick/imageelements/spritesequence.qml still
+ \snippet imageelements/spritesequence.qml still
When the scene is clicked, an animation sets the sprite sequence to the
'falling' states and animates the bear's y property.
- \snippet quick/imageelements/spritesequence.qml animation
+ \snippet imageelements/spritesequence.qml animation
At the end of the animation the bear is set back to its initial state.
*/
diff --git a/examples/quick/mousearea/doc/src/mousearea.qdoc b/examples/quick/mousearea/doc/src/mousearea.qdoc
index b0d9abce8f..091be69e5d 100644
--- a/examples/quick/mousearea/doc/src/mousearea.qdoc
+++ b/examples/quick/mousearea/doc/src/mousearea.qdoc
@@ -37,10 +37,10 @@
of that click which are available to QML.
Signals are emitted by the MouseArea when clicks or other discrete operations occur within it
- \snippet quick/mousearea/mousearea.qml clicks
+ \snippet mousearea/mousearea.qml clicks
The MouseArea can also be used to drag items around. By setting the parameters of the drag property,
the target item will be dragged around if the user starts to drag within the MouseArea.
- \snippet quick/mousearea/mousearea.qml drag
+ \snippet mousearea/mousearea.qml drag
*/
diff --git a/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc b/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
index 9450c19259..7869383ca2 100644
--- a/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
+++ b/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
@@ -27,7 +27,7 @@
/*!
- \title Scenegraph Painted Item Example
+ \title Scene Graph - Painted Item
\brief Shows how to implement QPainter-based custom scenegraph items.
\example customitems/painteditem
\ingroup qtquickexamples
@@ -58,7 +58,7 @@
is the base class for all QPainter based items in the QML Scene Graph
framework.
- \snippet quick/customitems/painteditem/textballoon.h 0
+ \snippet customitems/painteditem/textballoon.h 0
To implement a QQuickPaintedItem you must implement QQuickPaintedIem's pure
virtual function \l {QQuickPaintedItem::}{paint()} which implements the
@@ -69,13 +69,13 @@
We have to be sure to initialize the rightAligned property for a
TextBalloon item.
- \snippet quick/customitems/painteditem/textballoon.cpp 0
+ \snippet customitems/painteditem/textballoon.cpp 0
Then we implement the \c paint() function which is automatically called by
- the Scenegraph framework to paint the contents of the item. The function
+ the Scene Graph framework to paint the contents of the item. The function
paints the item in local coordinates.
- \snippet quick/customitems/painteditem/textballoon.cpp 1
+ \snippet customitems/painteditem/textballoon.cpp 1
We start with setting the pen and brush on the item to define the look of
the item. After that we start drawing. Note that the \l {QQuickPaintedItem::}{boundingRect()}
@@ -90,7 +90,7 @@
\section2 BalloonView
- \snippet quick/customitems/painteditem/textballoons.qml 0
+ \snippet customitems/painteditem/textballoons.qml 0
The balloonModel contains two types at application start which will be
displayed by the balloonView. The balloonView alernates the TextBalloon
@@ -98,7 +98,7 @@
\section2 Controls
- \snippet quick/customitems/painteditem/textballoons.qml 1
+ \snippet customitems/painteditem/textballoons.qml 1
The controls part of the UI contains a rectangle with a MouseArea which
changes color when the mouse hovers over it. This control 'button' adds
diff --git a/examples/quick/particles/affectors/doc/src/affectors.qdoc b/examples/quick/particles/affectors/doc/src/affectors.qdoc
index 58661d5b70..a1407abda2 100644
--- a/examples/quick/particles/affectors/doc/src/affectors.qdoc
+++ b/examples/quick/particles/affectors/doc/src/affectors.qdoc
@@ -35,7 +35,7 @@
Each example is a small QML file emphasizing a particular type or feature.
Age demonstrates using an Age affector to prematurely end the lives of particles.
- \snippet quick/particles/affectors/content/age.qml 0
+ \snippet particles/affectors/content/age.qml 0
As you move the affector around the screen, the particles inside it
(which haven't already been affected) jump to a period near the end
@@ -44,7 +44,7 @@
the end of their life instantly.
Attractor demonstrates using an Attractor affector to simulate a black hole
- \snippet quick/particles/affectors/content/attractor.qml 0
+ \snippet particles/affectors/content/attractor.qml 0
All particles in the scene, including the rocket ship's exhaust and pellets, are pulled
towards the black hole. This effect is stronger closer to the black hole, so the
@@ -55,58 +55,58 @@
Custom Affector manipulates the properties of the particles directly in javascript.
One Affector is used to make the leaves rock back and forth as they fall, looking more
leaf-like than just spinning in circles:
- \snippet quick/particles/affectors/content/customaffector.qml 0
+ \snippet particles/affectors/content/customaffector.qml 0
Another is used to provide a slightly varying friction to the leaves as they 'land',
to look more natural:
- \snippet quick/particles/affectors/content/customaffector.qml 1
+ \snippet particles/affectors/content/customaffector.qml 1
Friction is similar to the falling leaves in the custom affector, except that it uses a
flat friction the whole way down instead of custom affectors.
- \snippet quick/particles/affectors/content/friction.qml 0
+ \snippet particles/affectors/content/friction.qml 0
Gravity is a convenience affector for applying a constant acceleration to particles inside it
- \snippet quick/particles/affectors/content/gravity.qml 0
+ \snippet particles/affectors/content/gravity.qml 0
GroupGoal sets up two particle groups for flaming and non-flaming balls, and gives you various
ways to transition between them.
- \snippet quick/particles/affectors/content/groupgoal.qml unlit
+ \snippet particles/affectors/content/groupgoal.qml unlit
The non-flaming balls have a one in a hundred chance of lighting on their own each second, but they also
have a GroupGoal set on the whole group. This affector affects all particles of the unlit group, when colliding
with particles in the lit group, and cause them to move to the lighting group.
- \snippet quick/particles/affectors/content/groupgoal.qml lighting
+ \snippet particles/affectors/content/groupgoal.qml lighting
lighting is an intermediate group so that the glow builds up and the transition is less jarring. So it automatically
moves into the lit group after 100ms.
- \snippet quick/particles/affectors/content/groupgoal.qml lit
+ \snippet particles/affectors/content/groupgoal.qml lit
The lit group also has TrailEmitters on it for additional fire and smoke, but does not transition anywhere.
There are two more GroupGoal objects that allow particles in the unlit group to transition to the lighting group
(and then to the lit group).
- \snippet quick/particles/affectors/content/groupgoal.qml groupgoal-pilot
+ \snippet particles/affectors/content/groupgoal.qml groupgoal-pilot
The first is just an area bound to the location of an image of a pilot flame. When unlit balls pass through the flame,
they go straight to lit because the pilot flame is so hot.
- \snippet quick/particles/affectors/content/groupgoal.qml groupgoal-ma
+ \snippet particles/affectors/content/groupgoal.qml groupgoal-ma
The second is bound to the location of the last pointer interaction, so that touching or clicking on unlit balls (which
is hard due to their constant movement) causes them to move to the lighting group.
Move shows some simple effects you can get by altering trajectory midway.
The red particles have an affector that affects their position, jumping them forwards by 120px.
- \snippet quick/particles/affectors/content/move.qml A
+ \snippet particles/affectors/content/move.qml A
The green particles have an affector that affects their velocity, but with some angle variation. By adding some random direction
velocity to their existing forwards velocity, they begin to spray off in a cone.
- \snippet quick/particles/affectors/content/move.qml B
+ \snippet particles/affectors/content/move.qml B
The blue particles have an affector that affects their acceleration, and because it sets relative to false this resets the acceleration instead of
adding to it. Once the blue particles reach the affector, their horizontal velocity stops increasing as their vertical velocity decreases.
- \snippet quick/particles/affectors/content/move.qml C
+ \snippet particles/affectors/content/move.qml C
SpriteGoal has an affector which interacts with the sprite engine of particles, if they are being drawn as sprites by ImageParticle.
- \snippet quick/particles/affectors/content/spritegoal.qml 0
+ \snippet particles/affectors/content/spritegoal.qml 0
The SpriteGoal follows the image of the rocket ship on screen, and when it interacts with particles drawn by ImageParticle as sprites,
it instructs them to move immediately to the "explode" state, which in this case is the animation of the asteroid breaking into many pieces.
Turbulence has a flame with smoke, and both sets of particles being affected by a Turbulence affector. This gives a faint wind effect.
- \snippet quick/particles/affectors/content/turbulence.qml 0
+ \snippet particles/affectors/content/turbulence.qml 0
To make the wind change direction, subsitute a black and white noise image in the noiseSource parameter (it currently uses a default noise source).
Wander uses a Wander affector to add some horizontal drift to snowflakes as they fall down.
- \snippet quick/particles/affectors/content/wander.qml 0
+ \snippet particles/affectors/content/wander.qml 0
There are different movements given by applying the Wander to different attributes of the trajectory, so the example makes it easy to play around and see the difference.
*/
diff --git a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
index ccef82c922..fb53a67831 100644
--- a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
+++ b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
@@ -36,19 +36,19 @@
Blur Particles adds a blur effect to the particles, which increases over the particle's life time.
It uses a custom vertex shader:
- \snippet quick/particles/customparticle/content/blurparticles.qml vertex
+ \snippet particles/customparticle/content/blurparticles.qml vertex
to propagate life time simulation to a custom fragement shader:
- \snippet quick/particles/customparticle/content/blurparticles.qml fragment
+ \snippet particles/customparticle/content/blurparticles.qml fragment
which has access to both the normal image sampler and a blurred sampler, the image plus a ShaderEffect.
Fragment Shader just uses the particle system as a vertex delivery system.
- \snippet quick/particles/customparticle/content/fragmentshader.qml 0
+ \snippet particles/customparticle/content/fragmentshader.qml 0
Image Colors uses CustomParticle to assign colors to particles based on their location in a picture.
The vertex shader,
- \snippet quick/particles/customparticle/content/imagecolors.qml vertex
+ \snippet particles/customparticle/content/imagecolors.qml vertex
passes along the starting position for each vertex to the fragment shader,
- \snippet quick/particles/customparticle/content/imagecolors.qml fragment
+ \snippet particles/customparticle/content/imagecolors.qml fragment
which uses it to determine the color for that particle.
*/
diff --git a/examples/quick/particles/emitters/doc/src/emitters.qdoc b/examples/quick/particles/emitters/doc/src/emitters.qdoc
index 8eb7919000..acf8ce41c4 100644
--- a/examples/quick/particles/emitters/doc/src/emitters.qdoc
+++ b/examples/quick/particles/emitters/doc/src/emitters.qdoc
@@ -34,27 +34,27 @@
Each example is a small QML file emphasizing a particular type or feature.
Velocity from motion gives the effect of strong particle motion through primarily moving the emitters:
- \snippet quick/particles/emitters/content/velocityfrommotion.qml 0
+ \snippet particles/emitters/content/velocityfrommotion.qml 0
Burst and pulse calls the burst and pulse methods on two idential emitters.
- \snippet quick/particles/emitters/content/burstandpulse.qml 0
+ \snippet particles/emitters/content/burstandpulse.qml 0
Note how burst takes an argument of number of particles to emit, and pulse takes an argument of number of milliseconds to emit for.
This gives a slightly different behaviour, which is easy to see in this example.
Custom Emitter connects to the emitParticles signal to set arbitrary values on particle data as they're emitted;
- \snippet quick/particles/emitters/content/customemitter.qml 0
+ \snippet particles/emitters/content/customemitter.qml 0
This is used to emit curving particles in six rotating spokes.
Emit mask sets an image mask on the Emitter, to emit out of an arbitrary shape.
- \snippet quick/particles/emitters/content/emitmask.qml 0
+ \snippet particles/emitters/content/emitmask.qml 0
Maximum emitted emits no more than a certain number of particles at a time. This example makes it easy to see what happens when the limit is reached.
Shape and Direction emits particles out of an unfilled Ellipse shape, using a TargetDirection
- \snippet quick/particles/emitters/content/shapeanddirection.qml 0
+ \snippet particles/emitters/content/shapeanddirection.qml 0
This sends the particles towards the center of the ellipse with proportional speed, keeping the ellipse outline as they move to the center.
TrailEmitter uses that type to add smoke particles to trail the fire particles in the scene.
- \snippet quick/particles/emitters/content/customemitter.qml 0
+ \snippet particles/emitters/content/customemitter.qml 0
*/
diff --git a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
index c8f2dc988b..4fda13746a 100644
--- a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
+++ b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
@@ -35,25 +35,25 @@
Each example is a small QML file emphasizing a particular type or feature.
All at once shows off several of the features of ImageParticle at the same time.
- \snippet quick/particles/imageparticle/content/allatonce.qml 0
+ \snippet particles/imageparticle/content/allatonce.qml 0
Colored shows a simple ImageParticle with some color variation.
- \snippet quick/particles/imageparticle/content/colored.qml 0
+ \snippet particles/imageparticle/content/colored.qml 0
Color Table sets the color over life on the particles to provide a fixed rainbow effect.
- \snippet quick/particles/imageparticle/content/colortable.qml 0
+ \snippet particles/imageparticle/content/colortable.qml 0
Deformation spins and squishes a starfish particle.
- \snippet quick/particles/imageparticle/content/deformation.qml spin
- \snippet quick/particles/imageparticle/content/deformation.qml deform
+ \snippet particles/imageparticle/content/deformation.qml spin
+ \snippet particles/imageparticle/content/deformation.qml deform
Rotation demonstrates the autoRotate property, so that particles rotate in the direction that they travel.
Sharing demonstrates what happens when multiple ImageParticles try to render the same particle.
The following ImageParticle renders the particles inside the ListView:
- \snippet quick/particles/imageparticle/content/sharing.qml 0
+ \snippet particles/imageparticle/content/sharing.qml 0
The following ImageParticle is placed inside the list highlight, and renders the particles above the other ImageParticle.
- \snippet quick/particles/imageparticle/content/sharing.qml 1
+ \snippet particles/imageparticle/content/sharing.qml 1
Note that because it sets the color and alpha in this ImageParticle, it renders the particles in a different color.
Since it doesn't specify anything about the rotation, it shares the rotation with the other ImageParticle so that the flowers are rotated the same way in both.
Note that you can undo rotation in another ImageParticle, you just need to explicity set rotationVariation to 0.
diff --git a/examples/quick/particles/system/doc/src/system.qdoc b/examples/quick/particles/system/doc/src/system.qdoc
index 2bef4c6947..99be23d9d1 100644
--- a/examples/quick/particles/system/doc/src/system.qdoc
+++ b/examples/quick/particles/system/doc/src/system.qdoc
@@ -35,7 +35,7 @@
Each example is a small QML file emphasizing a particular type or feature.
Dynamic comparison compares using the particle system to getting a similar effect with the following code that dynamically instantiates Image types.
- \snippet quick/particles/system/content/dynamiccomparison.qml fake
+ \snippet particles/system/content/dynamiccomparison.qml fake
Note how the Image objects are not able to be randomly colorized.
Start and Stop simply sets the running and paused states of a ParticleSystem. While the system does not perform any simulation when stopped or paused, a restart restarts the simulation from the beginning, while unpausing resumes the simulation from where it was.
@@ -43,14 +43,14 @@
Timed group changes is an example that highlights the ParticleGroup type. While normally referring to groups with a string name is sufficient, additional effects can be
done by setting properties on groups.
The first group has a variable duration on it, but always transitions to the second group.
- \snippet quick/particles/system/content/timedgroupchanges.qml 0
+ \snippet particles/system/content/timedgroupchanges.qml 0
The second group has a TrailEmitter on it, and a fixed duration for emitting into the third group. By placing the TrailEmitter as a direct child of the ParticleGroup, it automatically selects that group to follow.
- \snippet quick/particles/system/content/timedgroupchanges.qml 1
+ \snippet particles/system/content/timedgroupchanges.qml 1
The third group has an Affector as a direct child, which makes the affector automatically target this group. The affector means that as soon as particles enter this group, a burst function can be called on another emitter, using the x,y positions of this particle.
- \snippet quick/particles/system/content/timedgroupchanges.qml 2
+ \snippet particles/system/content/timedgroupchanges.qml 2
If TrailEmitter does not suit your needs for multiple emitters, you can also dynamically create Emitters while still using the same ParticleSystem and image particle
- \snippet quick/particles/system/content/dynamicemitters.qml 0
+ \snippet particles/system/content/dynamicemitters.qml 0
Note that this effect, a flurry of flying rainbow spears, would be better served with TrailEmitter. It is only done with dynamic emitters in this example to show the concept more simply.
Multiple Painters shows how to control paint ordering of individual particles. While the paint ordering of particles within one ImagePainter is not strictly defined, ImageParticle objects follow the normal Z-ordering rules for \l {Qt Quick} items. This example allow you to paint the inside of the particles above the black borders using a pair of ImageParticles each painting different parts of the same logical particle.
diff --git a/examples/quick/positioners/doc/src/positioners.qdoc b/examples/quick/positioners/doc/src/positioners.qdoc
index 3a20b145ef..794b3b25f9 100644
--- a/examples/quick/positioners/doc/src/positioners.qdoc
+++ b/examples/quick/positioners/doc/src/positioners.qdoc
@@ -38,15 +38,15 @@
It consists of a scene populated with items in a variety of positioners: Column, Row, Grid and Flow.
Each positioner has animations described as Transitions.
- \snippet quick/positioners/positioners-transitions.qml move
+ \snippet positioners/positioners-transitions.qml move
The move transition specifies how items inside a positioner will animate when they are displaced by the appearance or disappearance of other items.
- \snippet quick/positioners/positioners-transitions.qml add
+ \snippet positioners/positioners-transitions.qml add
The add transition specifies how items will appear when they are added to a positioner.
- \snippet quick/positioners/positioners-transitions.qml populate
+ \snippet positioners/positioners-transitions.qml populate
The populate transition specifies how items will appear when their parent positioner is first created.
Attached Properties shows how the Positioner attached property can be used to determine where an item is within a positioner.
- \snippet quick/positioners/positioners-attachedproperties.qml 0
+ \snippet positioners/positioners-attachedproperties.qml 0
*/
diff --git a/examples/quick/quick.pro b/examples/quick/quick.pro
index 2d8acb3345..311e264af1 100644
--- a/examples/quick/quick.pro
+++ b/examples/quick/quick.pro
@@ -20,6 +20,7 @@ SUBDIRS = accessibility \
customitems \
imageprovider \
window \
+ dialogs \
particles \
demos
diff --git a/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc b/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc
index b24b0bd97b..0917604a35 100644
--- a/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc
+++ b/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/textureinsgnode
+ \example scenegraph/textureinsgnode
\title Scene Graph - Rendering FBOs
\ingroup qtquickexamples
diff --git a/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc b/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc
index 476605b268..6f4a2514f0 100644
--- a/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc
+++ b/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/textureinthread
+ \example scenegraph/textureinthread
\title Scene Graph - Rendering FBOs in a thread
\ingroup qtquickexamples
diff --git a/src/quick/doc/snippets/qml/usecases/MyText.qml b/examples/quick/scenegraph/textureinthread/error.qml
index d58a4036bb..1dbd576ef7 100644
--- a/src/quick/doc/snippets/qml/usecases/MyText.qml
+++ b/examples/quick/scenegraph/textureinthread/error.qml
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -38,11 +38,12 @@
**
****************************************************************************/
-//![0]
import QtQuick 2.0
Text {
- color: "lightsteelblue"
- font { family: 'Courier'; pixelSize: 20; bold: true; capitalization: Font.SmallCaps }
+ width: 400
+ height: 100
+ text: 'Platform does not support threaded OpenGL needed by this example.'
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
}
-//![0]
diff --git a/examples/quick/scenegraph/textureinthread/main.cpp b/examples/quick/scenegraph/textureinthread/main.cpp
index 3286055496..801f1891b9 100644
--- a/examples/quick/scenegraph/textureinthread/main.cpp
+++ b/examples/quick/scenegraph/textureinthread/main.cpp
@@ -42,6 +42,9 @@
#include <QGuiApplication>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformintegration.h>
+
#include <QtQuick/QQuickView>
#include "threadrenderer.h"
@@ -50,6 +53,13 @@ int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
+ if (!QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::ThreadedOpenGL)) {
+ QQuickView view;
+ view.setSource(QUrl("qrc:///scenegraph/textureinthread/error.qml"));
+ view.show();
+ return app.exec();
+ }
+
qmlRegisterType<ThreadRenderer>("SceneGraphRendering", 1, 0, "Renderer");
int execReturn = 0;
@@ -63,7 +73,7 @@ int main(int argc, char **argv)
view.setPersistentSceneGraph(true);
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl("qrc:///scenegraph/textureinsgnode/main.qml"));
+ view.setSource(QUrl("qrc:///scenegraph/textureinthread/main.qml"));
view.show();
execReturn = app.exec();
diff --git a/examples/quick/scenegraph/textureinthread/textureinthread.pro b/examples/quick/scenegraph/textureinthread/textureinthread.pro
index b48c2a1863..7f5fbb76e9 100644
--- a/examples/quick/scenegraph/textureinthread/textureinthread.pro
+++ b/examples/quick/scenegraph/textureinthread/textureinthread.pro
@@ -1,5 +1,8 @@
QT += quick
+# To make threaded gl check...
+QT += core-private gui-private
+
HEADERS += threadrenderer.h
SOURCES += threadrenderer.cpp main.cpp
@@ -13,4 +16,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/quick/scenegraph/textureinthread
INSTALLS += target
OTHER_FILES += \
- main.qml
+ main.qml \
+ error.qml
diff --git a/examples/quick/scenegraph/textureinthread/textureinthread.qrc b/examples/quick/scenegraph/textureinthread/textureinthread.qrc
index 9ecf0ada1c..66eb53b736 100644
--- a/examples/quick/scenegraph/textureinthread/textureinthread.qrc
+++ b/examples/quick/scenegraph/textureinthread/textureinthread.qrc
@@ -1,5 +1,6 @@
<RCC>
- <qresource prefix="/scenegraph/textureinsgnode">
+ <qresource prefix="/scenegraph/textureinthread">
<file>main.qml</file>
+ <file>error.qml</file>
</qresource>
</RCC>
diff --git a/examples/quick/shadereffects/doc/src/shadereffects.qdoc b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
index 6f6311a5ae..3d5f42eacc 100644
--- a/examples/quick/shadereffects/doc/src/shadereffects.qdoc
+++ b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
@@ -25,7 +25,7 @@
**
****************************************************************************/
/*!
- \title QML Examples - Shader Effects
+ \title Qt Quick Examples - Shader Effects
\example shadereffects
\image qml-shadereffects-example.png
\brief This is a shader effects example
@@ -35,17 +35,17 @@
with shaders in \l {Qt Quick}.
ShaderEffects typically operate on other types, using a ShaderEffectSource
- \snippet quick/shadereffects/shadereffects.qml source
+ \snippet shadereffects/shadereffects.qml source
In the above snippet, theItem is the id of a complex QML object in the file.
ShaderEffects can use this ShaderEffectSource as a texture in their fragment shader.
- \snippet quick/shadereffects/shadereffects.qml fragment
+ \snippet shadereffects/shadereffects.qml fragment
You can use any custom property on the ShaderEffect in your shader. This makes
animated shader code very easy.
- \snippet quick/shadereffects/shadereffects.qml properties
+ \snippet shadereffects/shadereffects.qml properties
ShaderEffects can also have a custom vertext shader. Setting the mesh property on ShaderEffect
provides more vertices for you to manipulate, enabling many effects.
- \snippet quick/shadereffects/shadereffects.qml vertex
+ \snippet shadereffects/shadereffects.qml vertex
*/
diff --git a/examples/quick/window/screen/screenInfo.qml b/examples/quick/shared/TabSet.qml
index 8f60d83933..10263a70ac 100644
--- a/examples/quick/window/screen/screenInfo.qml
+++ b/examples/quick/shared/TabSet.qml
@@ -39,52 +39,63 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Window 2.0 as Window
Item {
- id: root
- width: 400
- height: 200
- Item {
- id: main
- state: "orientation " + Window.Screen.orientation
+ id: tabWidget
- property bool landscapeWindow: Window.Screen.primaryOrientation == Qt.LandscapeOrientation
- property real baseWidth: landscapeWindow ? root.height : root.width
- property real baseHeight: landscapeWindow ? root.width : root.height
- property real rotationDelta: landscapeWindow ? -90 : 0
+ // Setting the default property to stack.children means any child items
+ // of the TabWidget are actually added to the 'stack' item's children.
+ // See the "Property Binding"
+ // documentation for details on default properties.
+ default property alias content: stack.children
- rotation: rotationDelta
- width: main.baseWidth
- height: main.baseHeight
- anchors.centerIn: parent
+ property int current: 0
- Text {
- text: "Screen is " + Window.Screen.width + "x" + Window.Screen.height + " and primarily orientation " + Window.Screen.primaryOrientation
- anchors.centerIn:parent
- }
+ onCurrentChanged: setZOrders()
+ Component.onCompleted: setZOrders()
+ function setZOrders() {
+ for (var i = 0; i < stack.children.length; ++i)
+ stack.children[i].z = (i == current ? 1 : 0)
+ }
- states: [
- State {
- name: "orientation " + Qt.LandscapeOrientation
- PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
- },
- State {
- name: "orientation " + Qt.InvertedPortraitOrientation
- PropertyChanges { target: main; rotation: 180 + rotationDelta; }
- },
- State {
- name: "orientation " + Qt.InvertedLandscapeOrientation
- PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
- }
- ]
+ Row {
+ id: header
- transitions: Transition {
- SequentialAnimation {
- RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
- NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
+ Repeater {
+ model: stack.children.length
+ delegate: Rectangle {
+ width: tabWidget.width / stack.children.length; height: 36
+
+ Rectangle {
+ width: parent.width; height: 1
+ anchors { bottom: parent.bottom; bottomMargin: 1 }
+ color: "#acb2c2"
+ }
+ BorderImage {
+ anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 }
+ border { left: 7; right: 7 }
+ source: "images/tab.png"
+ visible: tabWidget.current == index
+ }
+ Text {
+ horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter
+ anchors.fill: parent
+ text: stack.children[index].title
+ elide: Text.ElideRight
+ font.bold: tabWidget.current == index
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: tabWidget.current = index
+ }
}
}
}
+
+ Item {
+ id: stack
+ width: tabWidget.width
+ anchors.top: header.bottom; anchors.bottom: tabWidget.bottom
+ }
}
diff --git a/examples/quick/shared/images/qt-logo.png b/examples/quick/shared/images/qt-logo.png
new file mode 100644
index 0000000000..7d3e97eb36
--- /dev/null
+++ b/examples/quick/shared/images/qt-logo.png
Binary files differ
diff --git a/examples/quick/shared/images/tab.png b/examples/quick/shared/images/tab.png
new file mode 100644
index 0000000000..ad8021605f
--- /dev/null
+++ b/examples/quick/shared/images/tab.png
Binary files differ
diff --git a/examples/quick/shared/qmldir b/examples/quick/shared/qmldir
index cc4eb3c793..4f7c50540d 100644
--- a/examples/quick/shared/qmldir
+++ b/examples/quick/shared/qmldir
@@ -3,3 +3,4 @@ CheckBox 2.1 CheckBox.qml
LauncherList 2.0 LauncherList.qml
SimpleLauncherDelegate 2.0 SimpleLauncherDelegate.qml
Slider 2.0 Slider.qml
+TabSet 2.1 TabSet.qml
diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h
index eab15f3e0a..c59e858d47 100644
--- a/examples/quick/shared/shared.h
+++ b/examples/quick/shared/shared.h
@@ -47,9 +47,9 @@
QQuickView view;\
view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
view.setSource(QUrl("qrc:///" #NAME ".qml")); \
+ view.setResizeMode(QQuickView::SizeRootObjectToView);\
if (QGuiApplication::platformName() == QLatin1String("qnx") || \
QGuiApplication::platformName() == QLatin1String("eglfs")) {\
- view.setResizeMode(QQuickView::SizeRootObjectToView);\
view.showFullScreen();\
} else {\
view.show();\
diff --git a/examples/quick/shared/shared.qrc b/examples/quick/shared/shared.qrc
index 0b574ac879..6aaeca5211 100644
--- a/examples/quick/shared/shared.qrc
+++ b/examples/quick/shared/shared.qrc
@@ -6,7 +6,11 @@
<file>Slider.qml</file>
<file>images/slider_handle.png</file>
<file>CheckBox.qml</file>
+ <file>TabSet.qml</file>
<file>images/back.png</file>
<file>images/next.png</file>
+ <file>images/qt-logo.png</file>
+ <file>images/checkmark.png</file>
+ <file>images/tab.png</file>
</qresource>
</RCC>
diff --git a/examples/quick/text/doc/src/text.qdoc b/examples/quick/text/doc/src/text.qdoc
index 1f173ac843..c93d2db8aa 100644
--- a/examples/quick/text/doc/src/text.qdoc
+++ b/examples/quick/text/doc/src/text.qdoc
@@ -25,7 +25,7 @@
**
****************************************************************************/
/*!
- \title QML Examples - Text
+ \title Qt Quick Examples - Text
\example text
\brief This is a collection of QML examples relating to text
\image qml-text-example.png
@@ -38,24 +38,24 @@
'Hello' shows how to change and animate the letter spacing of a Text type.
It uses a sequential animation to first animate the font.letterSpacing property
from 0 to 50 over 3 seconds and then move the text to a random position on screen:
- \snippet quick/text/fonts/hello.qml letterspacing
+ \snippet text/fonts/hello.qml letterspacing
'Fonts' shows different ways of using fonts with the Text type.
Simply by name, using the font.family property directly:
- \snippet quick/text/fonts/fonts.qml name
+ \snippet text/fonts/fonts.qml name
or using a FontLoader type:
- \snippet quick/text/fonts/fonts.qml fontloader
+ \snippet text/fonts/fonts.qml fontloader
or using a FontLoader and specifying a local font file:
- \snippet quick/text/fonts/fonts.qml fontloaderlocal
+ \snippet text/fonts/fonts.qml fontloaderlocal
or finally using a FontLoader and specifying a remote font file:
- \snippet quick/text/fonts/fonts.qml fontloaderremote
+ \snippet text/fonts/fonts.qml fontloaderremote
'Available Fonts' shows how to use the QML global Qt object and a list view
to display all the fonts available on the system.
The ListView type uses the list of fonts available as its model:
- \snippet quick/text/fonts/availableFonts.qml model
+ \snippet text/fonts/availableFonts.qml model
Inside the delegate, the font family is set with the modelData:
- \snippet quick/text/fonts/availableFonts.qml delegate
+ \snippet text/fonts/availableFonts.qml delegate
'Banner' is a simple example showing how to create a banner using a row of text
types and a NumberAnimation.
@@ -66,5 +66,5 @@
'Text Layout' shows how to create a more complex layout for a text item.
This example lays out the text in two columns using the onLineLaidOut handler
that allows you to position and resize each line:
- \snippet quick/text/styledtext-layout.qml layout
+ \snippet text/styledtext-layout.qml layout
*/
diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp
index 52c2c17cfe..04545fe830 100644
--- a/examples/quick/textureprovider/etcprovider.cpp
+++ b/examples/quick/textureprovider/etcprovider.cpp
@@ -121,6 +121,10 @@ void EtcTexture::bind()
"paddedWidth: " << m_paddedSize.width() << "paddedHeight: " << m_paddedSize.height();
#endif
+#ifndef QT_NO_DEBUG
+ while (glGetError() != GL_NO_ERROR) { }
+#endif
+
QOpenGLContext *ctx = QOpenGLContext::currentContext();
Q_ASSERT(ctx != 0);
ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES,
@@ -128,6 +132,7 @@ void EtcTexture::bind()
(m_paddedSize.width() * m_paddedSize.height()) >> 1,
m_data.data() + 16);
+#ifndef QT_NO_DEBUG
// Gracefully fail in case of an error...
GLuint error = glGetError();
if (error != GL_NO_ERROR) {
@@ -137,6 +142,7 @@ void EtcTexture::bind()
m_texture_id = 0;
return;
}
+#endif
m_uploaded = true;
updateBindOptions(true);
diff --git a/examples/quick/threading/doc/src/threading.qdoc b/examples/quick/threading/doc/src/threading.qdoc
index 71fcdf820b..1cced3b9d3 100644
--- a/examples/quick/threading/doc/src/threading.qdoc
+++ b/examples/quick/threading/doc/src/threading.qdoc
@@ -33,17 +33,17 @@
Threaded ListModel contains a ListView and a ListModel. The ListModel is updated asynchronusly in another thread, and the results propagate back to the main thread.
A timer requests updates from the worker thread periodically:
- \snippet quick/threading/threadedlistmodel/timedisplay.qml 0
+ \snippet threading/threadedlistmodel/timedisplay.qml 0
Inside the worker thread, the ListModel is synchronized once the data is finished loading:
- \snippet quick/threading/threadedlistmodel/dataloader.js 0
+ \snippet threading/threadedlistmodel/dataloader.js 0
WorkerScript contains an example of using a WorkerScript to offload expensive calculations into another thread. This keeps the UI from being blocked. This example calculates numbers in Pascal's Triangle, and not in a very optimal way, so it will often take several seconds to complete the calculation. By doing this in a WorkerScript in another thread, the UI is not blocked during this time.
When the UI needs another value, a request is sent to the WorkerScript:
- \snippet quick/threading/workerscript/workerscript.qml 0
+ \snippet threading/workerscript/workerscript.qml 0
The workerscript then is free to take a really long time to calculate it:
- \snippet quick/threading/workerscript/workerscript.js 0
+ \snippet threading/workerscript/workerscript.js 0
When it's done, the result returns to the main scene via the WorkerScript type:
- \snippet quick/threading/workerscript/workerscript.qml 1
+ \snippet threading/workerscript/workerscript.qml 1
*/
diff --git a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
index 164409076c..09a5f51105 100644
--- a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
+++ b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
@@ -34,21 +34,21 @@
Multipoint Flames demonstrates distinguishing different fingers in a MultiPointTouchArea, by assigning a different colored flame to each touch point.
The MultipointTouchArea sets up multiple touch points:
- \snippet quick/touchinteraction/multipointtouch/multiflame.qml 0
+ \snippet touchinteraction/multipointtouch/multiflame.qml 0
The flames are then simply bound to the coordiates of the touch point, and whether it is currently pressed, like so:
- \snippet quick/touchinteraction/multipointtouch/multiflame.qml 1
+ \snippet touchinteraction/multipointtouch/multiflame.qml 1
Bear-Whack demonstrates using a MultiPointTouchArea to add multiple finger support to a simple game. The interaction with the game
is done through a SpriteGoal that follows the TouchPoint. The TouchPoints added to the MultiPointTouchArea are a component with all
this logic embedded into it:
- \snippet quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml 0
+ \snippet touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml 0
Flick Resize uses a PinchArea to allow Pinch-to-Resize behavior. This is easily achieved just by listening to the PinchArea signals and responding
to user input.
- \snippet quick/touchinteraction/pincharea/flickresize.qml 0
+ \snippet touchinteraction/pincharea/flickresize.qml 0
Flickable is a simple example demonstrating the Flickable type. The object inside the flickable is very big, but the flickable itself is very small:
- \snippet quick/touchinteraction/flickable/basic-flickable.qml 0
+ \snippet touchinteraction/flickable/basic-flickable.qml 0
Corkboards shows a more complex Flickable usecase, with types on the flickable that respond to mouse and keyboard interaction.
This doesn't require special code, the Qt Quick types automatically cooperate with Flickable for accepting the touch events.
diff --git a/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc b/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc
index 1ebe7eb9f5..3a14dd465a 100644
--- a/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc
+++ b/examples/quick/ui-components/slideswitch/doc/src/example-slideswitch.qdoc
@@ -28,7 +28,7 @@
/*!
\page qmlexampletoggleswitch.html tutorial
-\title QML Example - Toggle Switch
+\title Qt Quick Examples - Toggle Switch
\brief A reusable switch component made in QML
\ingroup qtquickexamples
@@ -48,12 +48,12 @@ The objects that compose the switch are:
\endlist
\section1 Switch.qml
-\snippet quick/ui-components/slideswitch/content/Switch.qml 0
+\snippet ui-components/slideswitch/content/Switch.qml 0
\section1 Walkthrough
\section2 Interface
-\snippet quick/ui-components/slideswitch/content/Switch.qml 1
+\snippet 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.
@@ -76,14 +76,14 @@ Item {
the text will only be visible when the switch is on.
\section2 Images and user interaction
-\snippet quick/ui-components/slideswitch/content/Switch.qml 4
+\snippet 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 quick/ui-components/slideswitch/content/Switch.qml 5
+\snippet 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
@@ -91,7 +91,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 quick/ui-components/slideswitch/content/Switch.qml 6
+\snippet ui-components/slideswitch/content/Switch.qml 6
We define the two states of the switch:
\list
@@ -105,13 +105,13 @@ For more information on states see \l{Qt Quick States}.
We add two JavaScript functions to our switch:
-\snippet quick/ui-components/slideswitch/content/Switch.qml 2
+\snippet 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 quick/ui-components/slideswitch/content/Switch.qml 3
+\snippet 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.
@@ -119,7 +119,7 @@ This second function is called when the knob is released and we want to make sur
For more information on scripts see \l{Using JavaScript Expressions in QML}.
\section2 Transition
-\snippet quick/ui-components/slideswitch/content/Switch.qml 7
+\snippet 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 knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
@@ -128,5 +128,5 @@ For more information on transitions see \l{Animation and Transitions in Qt Quick
\section1 Usage
The switch can be used in a QML file, like this:
-\snippet quick/ui-components/slideswitch/slideswitch.qml 0
+\snippet ui-components/slideswitch/slideswitch.qml 0
*/
diff --git a/examples/quick/views/doc/src/views.qdoc b/examples/quick/views/doc/src/views.qdoc
index 21a2d2e5e0..2d664c9bd9 100644
--- a/examples/quick/views/doc/src/views.qdoc
+++ b/examples/quick/views/doc/src/views.qdoc
@@ -35,48 +35,48 @@
This is a collection of small QML examples relating to model and view functionality. They demonstrate how to show data from a model using the \l {Qt Quick} view types.
\section2 GridView and PathView demonstrate usage of these types to display views.
- \snippet quick/views/gridview/gridview-example.qml 0
+ \snippet views/gridview/gridview-example.qml 0
\section2 Dynamic List demonstrates animation of runtime additions and removals to a ListView.
The ListView.onAdd signal handler runs an animation when new items are added to the
view, and the ListView.onRemove another when they are removed.
- \snippet quick/views/listview/dynamiclist.qml 0
- \snippet quick/views/listview/dynamiclist.qml 1
+ \snippet views/listview/dynamiclist.qml 0
+ \snippet views/listview/dynamiclist.qml 1
\section2 Expanding Delegates demonstrates delegates that expand when activated.
It has a complex delegate the size and appearance of which can change, displacing
other items in the view.
- \snippet quick/views/listview/expandingdelegates.qml 0
- \snippet quick/views/listview/expandingdelegates.qml 1
- \snippet quick/views/listview/expandingdelegates.qml 2
- \snippet quick/views/listview/expandingdelegates.qml 3
+ \snippet views/listview/expandingdelegates.qml 0
+ \snippet views/listview/expandingdelegates.qml 1
+ \snippet views/listview/expandingdelegates.qml 2
+ \snippet views/listview/expandingdelegates.qml 3
\section2 Highlight demonstrates adding a custom highlight to a ListView.
- \snippet quick/views/listview/highlight.qml 0
+ \snippet views/listview/highlight.qml 0
\section2 Highlight Ranges shows the three different highlight range modes of ListView.
- \snippet quick/views/listview/highlightranges.qml 0
- \snippet quick/views/listview/highlightranges.qml 1
- \snippet quick/views/listview/highlightranges.qml 2
+ \snippet views/listview/highlightranges.qml 0
+ \snippet views/listview/highlightranges.qml 1
+ \snippet views/listview/highlightranges.qml 2
\section2 Sections demonstrates the various section headers and footers available to ListView.
- \snippet quick/views/listview/sections.qml 0
+ \snippet views/listview/sections.qml 0
\section2 Packages demonstrates using Packages to transition delegates between two views.
It has a Package which defines delegate items for each view and an item that can
be transferred between delegates.
- \snippet quick/views/package/Delegate.qml 0
+ \snippet views/package/Delegate.qml 0
A DelegateModel allows the individual views to access their specific items from
the shared package delegate.
- \snippet quick/views/package/view.qml 0
+ \snippet views/package/view.qml 0
\section2 ObjectModel uses an ObjectModel for the model instead of a ListModel.
- \snippet quick/views/visualitemmodel/visualitemmodel.qml 0
+ \snippet views/objectmodel/objectmodel.qml 0
*/
diff --git a/examples/quick/window/window/twowindows.qml b/examples/quick/window/ScreenInfo.qml
index 4a8d2f4f1b..e4abc8d69d 100644
--- a/examples/quick/window/window/twowindows.qml
+++ b/examples/quick/window/ScreenInfo.qml
@@ -38,52 +38,58 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtQuick.Window 2.0
+import QtQuick 2.1
+import QtQuick.Window 2.1
-QtObject {
- property var win1: Window {
- width: 320
- height: 240
- x: 0
- y: 0
- visible: true
- color: "#ccffff"
- title: "First Window"
- Text {
- anchors.centerIn: parent
- text: "First Window"
- Text {
- id: statusText
- anchors.top: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
- MouseArea {
- anchors.fill: parent
- onClicked: win2.visible = !win2.visible
+Item {
+ id: root
+ width: 400
+ height: propertyGrid.implicitHeight + 16
+
+ function orientationToString(o) {
+ switch (o) {
+ case Qt.PrimaryOrientation:
+ return "primary";
+ case Qt.PortraitOrientation:
+ return "portrait";
+ case Qt.LandscapeOrientation:
+ return "landscape";
+ case Qt.InvertedPortraitOrientation:
+ return "inverted portrait";
+ case Qt.InvertedLandscapeOrientation:
+ return "inverted landscape";
}
+ return "unknown";
}
- property var win2: Window {
- width: 320
- height: 240
- x: 220
- y: 120
- visible: true
- color: "green"
- title: "Second Window: " + color
- Rectangle {
- anchors.fill: parent
- anchors.margins: 10
- Text {
- anchors.centerIn: parent
- text: "Second Window"
- }
- MouseArea {
- anchors.fill: parent
- onClicked: win2.color = "#ffffcc"
- }
+
+ Grid {
+ id: propertyGrid
+ columns: 2
+ spacing: 8
+ x: spacing
+ y: spacing
+
+ //! [screen]
+ Text {
+ text: "Screen \"" + Screen.name + "\":"
+ font.bold: true
}
- onVisibleChanged: statusText.text = "second window is " + (visible ? "visible" : "invisible")
+ Item { width: 1; height: 1 } // spacer
+
+ Text { text: "dimensions" }
+ Text { text: Screen.width + "x" + Screen.height }
+
+ Text { text: "logical pixel density" }
+ Text { text: Screen.logicalPixelDensity.toFixed(2) + " dots/mm" }
+
+ Text { text: "available virtual desktop" }
+ Text { text: Screen.desktopAvailableWidth + "x" + Screen.desktopAvailableHeight }
+
+ Text { text: "orientation" }
+ Text { text: orientationToString(Screen.orientation) + " (" + Screen.orientation + ")" }
+
+ Text { text: "primary orientation" }
+ Text { text: orientationToString(Screen.primaryOrientation) + " (" + Screen.primaryOrientation + ")" }
+ //! [screen]
}
}
diff --git a/examples/quick/window/Splash.qml b/examples/quick/window/Splash.qml
new file mode 100644
index 0000000000..092e6e6fc2
--- /dev/null
+++ b/examples/quick/window/Splash.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.1
+
+//! [splash-properties]
+Window {
+ visible: true
+ width: splashImage.width
+ height: splashImage.height
+ color: "transparent"
+ title: "Splash Window"
+ modality: Qt.ApplicationModal
+ flags: Qt.SplashScreen
+ property int timeout: 2000
+//! [splash-properties]
+//! [screen-properties]
+ x: (Screen.width - splashImage.width) / 2
+ y: (Screen.height - splashImage.height) / 2
+//! [screen-properties]
+
+ Image {
+ id: splashImage
+ source: "../../shared/images/qt-logo.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+ //! [timer]
+ Timer {
+ interval: timeout; running: true; repeat: false
+ onTriggered: visible = false
+ }
+ //! [timer]
+}
diff --git a/examples/quick/window/doc/images/qml-window-example.png b/examples/quick/window/doc/images/qml-window-example.png
new file mode 100644
index 0000000000..72487b4d93
--- /dev/null
+++ b/examples/quick/window/doc/images/qml-window-example.png
Binary files differ
diff --git a/examples/quick/window/doc/src/window.qdoc b/examples/quick/window/doc/src/window.qdoc
new file mode 100644
index 0000000000..07d2f115c1
--- /dev/null
+++ b/examples/quick/window/doc/src/window.qdoc
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+ \title Qt Quick Examples - Window and Screen
+ \example window
+ \brief This example demonstrates the Window and Screen types in QML
+ \image qml-window-example.png
+ \ingroup qtquickexamples
+
+ This example shows you how to create a Window in QML, how to control its
+ \l {QQuickWindow::visibility} {visibility}, how to present a splash screen
+ during application startup, and how to access the properties of the
+ \l Screen. It also demonstrates how to package QML into
+ \l {The Qt Resource System} {resources} and provide an
+ \l {Setting the Application Icon} {icon} to create a standalone QML desktop application.
+
+ A splash screen can be created with the \l {Qt::SplashScreen} {Qt.SplashScreen} flag,
+ and should be \l {Qt::ApplicationModal} {ApplicationModal} to prevent interaction
+ with the main window. If the splash window is also transparent, and showing a
+ partially transparent image, then it will look like a shaped window.
+ \snippet window/Splash.qml splash-properties
+
+ In this example a \l Timer will automatically dismiss the splash screen,
+ but in a real application you might want to connect to a signal from the
+ application logic to hide the splash when initialization is complete.
+ \snippet window/Splash.qml timer
+
+ The main window in this example is the control window, with some buttons
+ and checkboxes to control and provide feedback on the state of a secondary
+ window. Each checkbox has a binding to the property whose state it is
+ displaying, and also an onClicked handler to change the state. This is the
+ typical pattern to create a two-way binding while avoiding binding loops.
+ \snippet window/window.qml windowedCheckbox
+
+ The \l Screen has several properties which are generally useful to applications
+ which need to rotate some content when the screen orientation changes, to position
+ windows on the screen or to convert real units to logical pixel units. ScreenInfo.qml
+ (which is displayed inline in window.qml, or can be run by itself with qmlscene)
+ simply displays the property values, while the splash screen uses them to
+ center the window on the screen.
+ \snippet window/Splash.qml screen-properties
+
+ If a Window is nested inside an \l Item or another Window, the inner window
+ becomes "transient for" the outer one (see \l Window for more explanation).
+ But if you want to create multiple top-level windows as unrelated peers, you
+ can create them inside a non-visual \l QtObject root item, as this example does.
+*/
diff --git a/examples/quick/window/window/window.cpp b/examples/quick/window/main.cpp
index 277effc20c..2223c607b4 100644
--- a/examples/quick/window/window/window.cpp
+++ b/examples/quick/window/main.cpp
@@ -49,7 +49,7 @@ int main(int argc, char* argv[])
QGuiApplication app(argc, argv);
QQmlEngine engine;
QQmlComponent component(&engine);
- component.loadUrl(QUrl("qrc:///window/window/Window.qml"));
+ component.loadUrl(QUrl("qrc:///window/window.qml"));
if ( component.isReady() )
component.create();
else
diff --git a/examples/quick/window/resources/icon.icns b/examples/quick/window/resources/icon.icns
new file mode 100644
index 0000000000..88b4b24449
--- /dev/null
+++ b/examples/quick/window/resources/icon.icns
Binary files differ
diff --git a/examples/quick/window/resources/icon.ico b/examples/quick/window/resources/icon.ico
new file mode 100644
index 0000000000..52af30a6ca
--- /dev/null
+++ b/examples/quick/window/resources/icon.ico
Binary files differ
diff --git a/examples/quick/window/resources/icon.svg b/examples/quick/window/resources/icon.svg
new file mode 100644
index 0000000000..0b6153206d
--- /dev/null
+++ b/examples/quick/window/resources/icon.svg
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.48.2 r9819"
+ version="1.0"
+ sodipodi:docname="icon.svg"
+ inkscape:export-filename="/Users/rutledge/dev/qt5-stable/qtdeclarative/examples/quick/window/window/icon80.png"
+ inkscape:export-xdpi="61.509998"
+ inkscape:export-ydpi="61.509998"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient4009">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4011" />
+ <stop
+ id="stop4019"
+ offset="0.875"
+ style="stop-color:#ffffff;stop-opacity:0.49803922;" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop4013" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 186.64798 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="559.62469 : 186.64798 : 1"
+ inkscape:persp3d-origin="279.81235 : 124.43199 : 1"
+ id="perspective4876" />
+ <inkscape:perspective
+ id="perspective2836"
+ inkscape:persp3d-origin="22 : 14.666667 : 1"
+ inkscape:vp_z="44 : 22 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 22 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <filter
+ inkscape:collect="always"
+ id="filter4063"
+ x="-0.195491"
+ width="1.390982"
+ y="-0.16235915"
+ height="1.3247183">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.3077485"
+ id="feGaussianBlur4065" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10"
+ guidetolerance="10"
+ objecttolerance="10000"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.9775825"
+ inkscape:cx="62.656189"
+ inkscape:cy="42.423381"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:window-width="1280"
+ inkscape:window-height="744"
+ inkscape:window-x="2003"
+ inkscape:window-y="156"
+ showgrid="true"
+ borderlayer="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:snap-global="false"
+ inkscape:window-maximized="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid7194"
+ visible="true"
+ enabled="true"
+ spacingx="8px"
+ spacingy="8px" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-66.38047,-391.3222)">
+ <path
+ id="path7304"
+ d="M 95.556318,434.65407 L 165.25811,434.65407 L 165.25811,490.10429 L 95.556318,490.10429 L 95.556318,434.65407 z"
+ style="fill:#01afaf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141000000000;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ style="fill:#a7c706;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 96.869177,465.30846 c 27.677903,3.04574 41.155393,12.11589 48.000003,24 l -48.000003,0 0,-24 z"
+ id="path7300"
+ sodipodi:nodetypes="cccc"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path7302"
+ d="M 165.46767,465.22201 C 137.78977,468.26775 124.31228,477.33791 117.46767,489.22201 L 165.46767,489.22201 L 165.46767,465.22201 z"
+ style="fill:#966406;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1" />
+ <path
+ style="fill:#80ffff;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:1;fill-opacity:1"
+ d="M 95.532809,434.35736 L 74.567964,420.38079 L 74.567964,497.25189 L 95.532809,490.26361 L 95.532809,434.35736 z"
+ id="path7270"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#00ffff;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 74.567964,455.3222 L 95.532809,462.31048"
+ id="path7272"
+ sodipodi:nodetypes="cc" />
+ <g
+ style="fill:#80ffff;fill-opacity:1"
+ id="g7278"
+ transform="matrix(-0.8735352,0,0,0.8735352,244.36615,64.570513)">
+ <path
+ style="fill:#80ffff;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
+ d="M 24,32 L 0,16 L 0,104 L 24,96 L 24,32 z"
+ id="path7280"
+ transform="translate(66.38047,391.3222)" />
+ <path
+ style="fill:#80ffff;fill-rule:evenodd;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
+ d="M 0,56 L 24,64"
+ id="path7282"
+ transform="translate(66.38047,391.3222)"
+ sodipodi:nodetypes="cc" />
+ </g>
+ <path
+ style="fill:#ffffff;fill-opacity:1;filter:url(#filter4063)"
+ d="m 119.74679,437.94232 c -0.0487,0.003 -0.0932,0.0315 -0.14149,0.0354 -0.1659,0.0132 -0.33372,0.008 -0.49523,0.0354 -0.96156,0.0643 -1.9037,0.14607 -2.86523,0.21224 -2.94807,0.23566 -5.19987,2.66253 -5.19987,6.01345 l 0,39.51194 3.32508,3.07747 0,-0.0354 33.2155,-5.58898 c 2.28673,-0.39587 4.06792,-3.06727 4.06792,-5.97808 l 0,-32.18967 -30.5625,-5.023 c -0.45263,-0.0748 -0.91269,-0.0942 -1.34418,-0.0708 z"
+ id="path3987"
+ inkscape:connector-curvature="0" />
+ <g
+ id="g3"
+ transform="matrix(0.20572087,0,0,0.20572087,113.4162,440.80626)">
+ <path
+ sodipodi:nodetypes="cccccccc"
+ id="path5"
+ style="fill:#006225"
+ d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path7"
+ style="fill:#80c342"
+ d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path11"
+ style="fill:#006225"
+ d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path13"
+ style="fill:#006225"
+ d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z"
+ style="fill:#ffffff"
+ id="path17"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path19"
+ style="fill:#006225"
+ d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z"
+ style="fill:#006225"
+ id="path21"
+ inkscape:connector-curvature="0" />
+ </g>
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5.24121141;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 96.506224,434.65407 L 166.20801,434.65407 L 166.20801,490.10429 L 96.506224,490.10429 L 96.506224,434.65407 z"
+ id="rect7265" />
+ </g>
+</svg>
diff --git a/examples/quick/window/resources/icon64.png b/examples/quick/window/resources/icon64.png
new file mode 100644
index 0000000000..0fa324401f
--- /dev/null
+++ b/examples/quick/window/resources/icon64.png
Binary files differ
diff --git a/examples/quick/window/resources/window.rc b/examples/quick/window/resources/window.rc
new file mode 100644
index 0000000000..4de84d297e
--- /dev/null
+++ b/examples/quick/window/resources/window.rc
@@ -0,0 +1,32 @@
+#include "winver.h"
+
+IDI_ICON1 ICON DISCARDABLE "icon.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGS 0x0L
+ FILEFLAGSMASK 0x3fL
+ FILEOS 0x00040004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "CompanyName", "Digia Plc and/or its subsidiary(-ies)"
+ VALUE "FileDescription", "QtQuick Window Example"
+ VALUE "FileVersion", "1.0.0.0"
+ VALUE "LegalCopyright", "Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies)."
+ VALUE "InternalName", "window"
+ VALUE "OriginalFilename", "window.exe"
+ VALUE "ProductName", "QtQuick Window Example"
+ VALUE "ProductVersion", "1.0.0.0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/examples/quick/window/window.pro b/examples/quick/window/window.pro
index 93e43fcd65..be35b24325 100644
--- a/examples/quick/window/window.pro
+++ b/examples/quick/window/window.pro
@@ -1,6 +1,16 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- window
+TEMPLATE = app
+QT += quick qml
+SOURCES += main.cpp
+RESOURCES += \
+ window.qrc \
+ ../shared/shared.qrc
EXAMPLE_FILES = \
- screen
+ window.qml
+
+target.path = $$[QT_INSTALL_EXAMPLES]/quick/window
+INSTALLS += target
+
+ICON = resources/icon64.png
+macx: ICON = resources/icon.icns
+win32: RC_FILE = resources/window.rc
diff --git a/examples/quick/window/window.qml b/examples/quick/window/window.qml
new file mode 100644
index 0000000000..1d7282f7a1
--- /dev/null
+++ b/examples/quick/window/window.qml
@@ -0,0 +1,180 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.1
+import "../shared" as Shared
+
+QtObject {
+ property real defaultSpacing: 10
+ property SystemPalette palette: SystemPalette { }
+
+ property var splashWindow: Splash { }
+
+ property var controlWindow: Window {
+ width: 400
+ height: col.implicitHeight + defaultSpacing * 2
+ color: palette.window
+ title: "Control Window"
+ visible: true
+ Column {
+ id: col
+ anchors.fill: parent
+ anchors.margins: defaultSpacing
+ spacing: defaultSpacing
+ property real cellWidth: col.width / 3 - spacing
+ Text { text: "Control the second window:" }
+ Grid {
+ id: grid
+ columns: 3
+ spacing: defaultSpacing
+ width: parent.width
+ Shared.Button {
+ id: showButton
+ width: col.cellWidth
+ text: testWindow.visible ? "Hide" : "Show"
+ onClicked: testWindow.visible = !testWindow.visible
+ }
+ //! [windowedCheckbox]
+ Shared.CheckBox {
+ text: "Windowed"
+ height: showButton.height
+ width: col.cellWidth
+ Binding on checked { value: testWindow.visibility === Window.Windowed }
+ onClicked: testWindow.visibility = Window.Windowed
+ }
+ //! [windowedCheckbox]
+ Shared.CheckBox {
+ height: showButton.height
+ width: col.cellWidth
+ text: "Full Screen"
+ Binding on checked { value: testWindow.visibility === Window.FullScreen }
+ onClicked: testWindow.visibility = Window.FullScreen
+ }
+ Shared.Button {
+ id: autoButton
+ width: col.cellWidth
+ text: "Automatic"
+ onClicked: testWindow.visibility = Window.AutomaticVisibility
+ }
+ Shared.CheckBox {
+ height: autoButton.height
+ text: "Minimized"
+ Binding on checked { value: testWindow.visibility === Window.Minimized }
+ onClicked: testWindow.visibility = Window.Minimized
+ }
+ Shared.CheckBox {
+ height: autoButton.height
+ text: "Maximized"
+ Binding on checked { value: testWindow.visibility === Window.Maximized }
+ onClicked: testWindow.visibility = Window.Maximized
+ }
+ }
+ function visibilityToString(v) {
+ switch (v) {
+ case Window.Windowed:
+ return "windowed";
+ case Window.Minimized:
+ return "minimized";
+ case Window.Maximized:
+ return "maximized";
+ case Window.FullScreen:
+ return "fullscreen";
+ case Window.AutomaticVisibility:
+ return "automatic";
+ case Window.Hidden:
+ return "hidden";
+ }
+ return "unknown";
+ }
+ Text {
+ text: "second window is " + (testWindow.visible ? "visible" : "invisible") +
+ " and has visibility " + parent.visibilityToString(testWindow.visibility)
+ }
+ Rectangle {
+ id: horizontalRule
+ color: "black"
+ width: parent.width
+ height: 1
+ }
+ ScreenInfo { }
+ }
+ }
+
+ property var testWindow: Window {
+ width: 320
+ height: 240
+ color: "#215400"
+ title: "Test Window with color " + color
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: defaultSpacing
+ Text {
+ anchors.centerIn: parent
+ text: "Second Window"
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: testWindow.color = "#e0c31e"
+ }
+ Shared.Button {
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: defaultSpacing
+ text: testWindow.visibility === Window.FullScreen ? "exit fullscreen" : "go fullscreen"
+ width: 150
+ onClicked: {
+ if (testWindow.visibility === Window.FullScreen)
+ testWindow.visibility = Window.AutomaticVisibility
+ else
+ testWindow.visibility = Window.FullScreen
+ }
+ }
+ Shared.Button {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.margins: defaultSpacing
+ text: "X"
+ width: 30
+ onClicked: testWindow.visible = false
+ }
+ }
+ }
+}
diff --git a/examples/quick/window/window.qrc b/examples/quick/window/window.qrc
new file mode 100644
index 0000000000..dc211bdaaf
--- /dev/null
+++ b/examples/quick/window/window.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/window">
+ <file>window.qml</file>
+ <file>Splash.qml</file>
+ <file>ScreenInfo.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/quick/window/window/nogui.qml b/examples/quick/window/window/nogui.qml
deleted file mode 100644
index 2a5734c773..0000000000
--- a/examples/quick/window/window/nogui.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQml 2.0
-
-/*
- This object's only functionality is to exist as a root object and
- display nothing, proving that qmlscene can run without windows.
- (A QtObject can't even have Component.onCompleted)
-*/
-QtObject {
- property string philosophy: "hello bleak windowless world"
-}
diff --git a/examples/quick/window/window/standalone.qml b/examples/quick/window/window/standalone.qml
deleted file mode 100644
index db73bf66eb..0000000000
--- a/examples/quick/window/window/standalone.qml
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtQuick.Window 2.0
-
-Item {
- width: 320
- height: 240
- // It's not possible to set an Item's windowTitle. If you want to modify
- // window properties, you need to explicitly create a Window.
- Text {
- id: text1
- anchors.centerIn: parent
- text: "First Window\n" + (Qt.application.supportsMultipleWindows ?
- "click the button to open a second window" : "only one window is allowed")
- }
- Rectangle {
- border.color: "black"
- radius: 4
- anchors.top: text1.bottom
- anchors.horizontalCenter: text1.horizontalCenter
- width: 100
- height: 30
- TextInput {
- id: ti1
- focus: true // but the modal popup will prevent input while it is open
- anchors.centerIn: parent
- }
- }
- Rectangle {
- border.color: "black"
- color: childWindow.visible ? "goldenrod" : "beige"
- radius: height / 4
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.margins: 10
- width: text.implicitWidth + 20
- height: text.implicitHeight + 20
- visible: Qt.application.supportsMultipleWindows
- Text {
- id: text
- text: "Pop up window"
- anchors.centerIn: parent
- }
- MouseArea {
- anchors.fill: parent
- onClicked: childWindow.visible = !childWindow.visible
- }
- }
-
- Window {
- id: childWindow
- width: 320
- height: 240
- x: 220
- y: 120
- color: "beige"
- title: "Second Window"
- modality: Qt.ApplicationModal
- flags: Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
- Text {
- id: text2
- anchors.centerIn: parent
- text: "Modal Frameless Stay-on-Top Window"
- }
- Text {
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.margins: 10
- text: "X"
- MouseArea{
- anchors.fill: parent
- onClicked: childWindow.visible = false
- }
- }
- Rectangle {
- border.color: "black"
- radius: 4
- anchors.top: text2.bottom
- anchors.horizontalCenter: text2.horizontalCenter
- width: 100
- height: 30
- TextInput {
- id: ti2
- focus: true
- anchors.centerIn: parent
- }
- }
- }
-}
diff --git a/examples/quick/window/window/window.pro b/examples/quick/window/window/window.pro
deleted file mode 100644
index 3525a893fa..0000000000
--- a/examples/quick/window/window/window.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-QT += qml
-
-SOURCES += window.cpp
-RESOURCES += window.qrc
-
-EXAMPLE_FILES = \
- nogui.qml \
- standalone.qml \
- twowindows.qml
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/window/window
-INSTALLS = target
diff --git a/examples/quick/window/window/window.qrc b/examples/quick/window/window/window.qrc
deleted file mode 100644
index c203c140fc..0000000000
--- a/examples/quick/window/window/window.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/window/window">
- <file>Window.qml</file>
- </qresource>
-</RCC>
diff --git a/qtdeclarative.pro b/qtdeclarative.pro
index 58c33f27ca..8bc15a5662 100644
--- a/qtdeclarative.pro
+++ b/qtdeclarative.pro
@@ -1 +1,2 @@
+CONFIG += tests_need_tools
load(qt_parts)
diff --git a/src/imports/dialogs/plugin.cpp b/src/imports/dialogs/plugin.cpp
index 67653e5965..bee0ee00bc 100644
--- a/src/imports/dialogs/plugin.cpp
+++ b/src/imports/dialogs/plugin.cpp
@@ -55,9 +55,36 @@
QT_BEGIN_NAMESPACE
+
+/*!
+ \group dialogs
+ \title Dialogs
+*/
+
+/*!
+ \page qtquickdialogs-index.html
+ \title Qt Quick Dialogs
+
+ \brief Qt Quick Dialogs submodule
+
+ The submodule is new in Qt 5.1.
+
+ \section1 Dialogs
+
+ \annotatedlist dialogs
+
+ \section1 Related information
+
+ \section2 Reference
+ \list
+ \li \l{Qt Quick Dialogs QML Types}{Qt Quick Dialogs QML Types}
+ \endlist
+
+*/
+
/*!
\qmlmodule QtQuick.Dialogs 1
- \title Qt Quick Dialog QML Types
+ \title Qt Quick Dialogs QML Types
\ingroup qmlmodules
\brief Provides QML types for standard file, color picker and message dialogs
diff --git a/src/imports/dialogs/qquickplatformcolordialog.cpp b/src/imports/dialogs/qquickplatformcolordialog.cpp
index 491a2e687c..ea3114c86e 100644
--- a/src/imports/dialogs/qquickplatformcolordialog.cpp
+++ b/src/imports/dialogs/qquickplatformcolordialog.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\qmltype ColorDialog
\instantiates QQuickPlatformColorDialog
\inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
+ \ingroup dialogs
\brief Dialog component for choosing a color.
\since Qt 5.1
diff --git a/src/imports/dialogs/qquickplatformfiledialog.cpp b/src/imports/dialogs/qquickplatformfiledialog.cpp
index d767f65499..5ae7fd0067 100644
--- a/src/imports/dialogs/qquickplatformfiledialog.cpp
+++ b/src/imports/dialogs/qquickplatformfiledialog.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\qmltype FileDialog
\instantiates QQuickPlatformFileDialog
\inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
+ \ingroup dialogs
\brief Dialog component for choosing files from a local filesystem.
\since Qt 5.1
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 421e215066..7ba2981a4e 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -279,7 +279,27 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
The following example shows a FolderListModel being used to provide a list
of QML files in a \l ListView:
- \snippet qml/folderlistmodel.qml 0
+ \qml
+ import QtQuick 2.0
+ import Qt.labs.folderlistmodel 1.0
+
+ ListView {
+ width: 200; height: 400
+
+ FolderListModel {
+ id: folderModel
+ nameFilters: ["*.qml"]
+ }
+
+ Component {
+ id: fileDelegate
+ Text { text: fileName }
+ }
+
+ model: folderModel
+ delegate: fileDelegate
+ }
+ \endqml
\section1 Path Separators
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index d40433e96b..4877c4cfca 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -493,7 +493,7 @@ Database connections are automatically closed during Javascript garbage collecti
The API can be used from JavaScript functions in your QML:
-\snippet quick/localstorage/localstorage/hello.qml 0
+\snippet localstorage/localstorage/hello.qml 0
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/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes
index e5381629cc..cc619dc4ff 100644
--- a/src/imports/qtquick2/plugins.qmltypes
+++ b/src/imports/qtquick2/plugins.qmltypes
@@ -3,12 +3,20 @@ import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
-// This file was auto-generated with the command 'qmlplugindump -builtins'.
+// This file was auto-generated with the command 'qmlplugindump -notrelocatable -builtins'.
Module {
Component {
name: "QAbstractItemModel"
prototype: "QObject"
+ Enum {
+ name: "LayoutChangeHint"
+ values: {
+ "NoLayoutChangeHint": 0,
+ "VerticalSortHint": 1,
+ "HorizontalSortHint": 2
+ }
+ }
Signal {
name: "dataChanged"
Parameter { name: "topLeft"; type: "QModelIndex" }
@@ -167,6 +175,7 @@ Module {
name: "QInputMethod"
prototype: "QObject"
exports: ["QtQuick/InputMethod 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Action"
values: {
@@ -215,6 +224,7 @@ Module {
Component {
name: "QObject"
exports: ["QtQml/QtObject 2.0", "QtQuick/QtObject 2.0"]
+ exportMetaObjectRevisions: [0, 0]
Property { name: "objectName"; type: "string" }
Signal {
name: "objectNameChanged"
@@ -228,9 +238,26 @@ Module {
}
}
Component {
+ name: "QQmlApplication"
+ prototype: "QObject"
+ Property { name: "arguments"; type: "QStringList"; isReadonly: true }
+ Property { name: "name"; type: "string" }
+ Property { name: "version"; type: "string" }
+ Signal { name: "aboutToQuit" }
+ Method {
+ name: "setName"
+ Parameter { name: "arg"; type: "string" }
+ }
+ Method {
+ name: "setVersion"
+ Parameter { name: "arg"; type: "string" }
+ }
+ }
+ Component {
name: "QQmlBind"
prototype: "QObject"
exports: ["QtQml/Binding 2.0", "QtQuick/Binding 2.0"]
+ exportMetaObjectRevisions: [0, 0]
Property { name: "target"; type: "QObject"; isPointer: true }
Property { name: "property"; type: "string" }
Property { name: "value"; type: "QVariant" }
@@ -244,6 +271,7 @@ Module {
"QtQml/Component 2.0",
"QtQuick/Component 2.0"
]
+ exportMetaObjectRevisions: [0, 0, 0]
attachedType: "QQmlComponentAttached"
Enum {
name: "CompilationMode"
@@ -298,13 +326,105 @@ Module {
name: "QQmlConnections"
prototype: "QObject"
exports: ["QtQml/Connections 2.0", "QtQuick/Connections 2.0"]
+ exportMetaObjectRevisions: [0, 0]
Property { name: "target"; type: "QObject"; isPointer: true }
Property { name: "ignoreUnknownSignals"; type: "bool" }
}
Component {
+ name: "QQmlDelegateModel"
+ defaultProperty: "delegate"
+ prototype: "QQmlInstanceModel"
+ exports: ["QtQuick/VisualDataModel 2.0"]
+ exportMetaObjectRevisions: [0]
+ attachedType: "QQmlDelegateModelAttached"
+ Property { name: "model"; type: "QVariant" }
+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "filterOnGroup"; type: "string" }
+ Property { name: "items"; type: "QQmlDelegateModelGroup"; isReadonly: true; isPointer: true }
+ Property {
+ name: "persistedItems"
+ type: "QQmlDelegateModelGroup"
+ isReadonly: true
+ isPointer: true
+ }
+ Property { name: "groups"; type: "QQmlDelegateModelGroup"; isList: true; isReadonly: true }
+ Property { name: "parts"; type: "QObject"; isReadonly: true; isPointer: true }
+ Property { name: "rootIndex"; type: "QVariant" }
+ Signal { name: "filterGroupChanged" }
+ Signal { name: "defaultGroupsChanged" }
+ Method {
+ name: "modelIndex"
+ type: "QVariant"
+ Parameter { name: "idx"; type: "int" }
+ }
+ Method { name: "parentModelIndex"; type: "QVariant" }
+ }
+ Component {
+ name: "QQmlDelegateModelAttached"
+ prototype: "QObject"
+ Property { name: "model"; type: "QQmlDelegateModel"; isReadonly: true; isPointer: true }
+ Property { name: "groups"; type: "QStringList" }
+ Property { name: "isUnresolved"; type: "bool"; isReadonly: true }
+ Signal { name: "unresolvedChanged" }
+ }
+ Component {
+ name: "QQmlDelegateModelGroup"
+ prototype: "QObject"
+ exports: ["QtQuick/VisualDataGroup 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "count"; type: "int"; isReadonly: true }
+ Property { name: "name"; type: "string" }
+ Property { name: "includeByDefault"; type: "bool" }
+ Signal { name: "defaultIncludeChanged" }
+ Signal {
+ name: "changed"
+ Parameter { name: "removed"; type: "QQmlV8Handle" }
+ Parameter { name: "inserted"; type: "QQmlV8Handle" }
+ }
+ Method {
+ name: "insert"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "create"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "resolve"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "remove"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "addGroups"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "removeGroups"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "setGroups"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "move"
+ Parameter { type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "get"
+ type: "QQmlV8Handle"
+ Parameter { name: "index"; type: "int" }
+ }
+ }
+ Component { name: "QQmlDelegateModelParts"; prototype: "QObject" }
+ Component {
name: "QQmlEasingValueType"
prototype: "QQmlValueType"
exports: ["QtQuick/Easing 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Type"
values: {
@@ -363,8 +483,111 @@ Module {
Property { name: "bezierCurve"; type: "QVariantList" }
}
Component {
+ name: "QQmlInstanceModel"
+ prototype: "QObject"
+ Property { name: "count"; type: "int"; isReadonly: true }
+ Signal {
+ name: "modelUpdated"
+ Parameter { name: "changeSet"; type: "QQmlChangeSet" }
+ Parameter { name: "reset"; type: "bool" }
+ }
+ Signal {
+ name: "createdItem"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "object"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "initItem"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "object"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "destroyingItem"
+ Parameter { name: "object"; type: "QObject"; isPointer: true }
+ }
+ }
+ Component {
+ name: "QQmlInstantiator"
+ defaultProperty: "delegate"
+ prototype: "QObject"
+ exports: ["QtQml/Instantiator 2.1", "QtQuick/Instantiator 2.1"]
+ exportMetaObjectRevisions: [0, 0]
+ Property { name: "active"; type: "bool" }
+ Property { name: "asynchronous"; type: "bool" }
+ Property { name: "model"; type: "QVariant" }
+ Property { name: "count"; type: "int"; isReadonly: true }
+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "object"; type: "QObject"; isReadonly: true; isPointer: true }
+ Signal {
+ name: "objectAdded"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "object"; type: "QObject"; isPointer: true }
+ }
+ Signal {
+ name: "objectRemoved"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "object"; type: "QObject"; isPointer: true }
+ }
+ Method {
+ name: "objectAt"
+ type: "QObject*"
+ Parameter { name: "index"; type: "int" }
+ }
+ }
+ Component {
+ name: "QQmlListElement"
+ prototype: "QObject"
+ exports: ["QtQuick/ListElement 2.0"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
+ name: "QQmlListModel"
+ prototype: "QAbstractListModel"
+ exports: ["QtQuick/ListModel 2.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "count"; type: "int"; isReadonly: true }
+ Property { name: "dynamicRoles"; type: "bool" }
+ Method { name: "clear" }
+ Method {
+ name: "remove"
+ Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "append"
+ Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "insert"
+ Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true }
+ }
+ Method {
+ name: "get"
+ type: "QQmlV8Handle"
+ Parameter { name: "index"; type: "int" }
+ }
+ Method {
+ name: "set"
+ Parameter { name: "index"; type: "int" }
+ Parameter { type: "QQmlV8Handle" }
+ }
+ Method {
+ name: "setProperty"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "property"; type: "string" }
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ Method {
+ name: "move"
+ Parameter { name: "from"; type: "int" }
+ Parameter { name: "to"; type: "int" }
+ Parameter { name: "count"; type: "int" }
+ }
+ Method { name: "sync" }
+ }
+ Component {
name: "QQmlLocale"
exports: ["QtQuick/Locale 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "MeasurementSystem"
values: {
@@ -404,9 +627,24 @@ Module {
}
}
Component {
+ name: "QQmlObjectModel"
+ defaultProperty: "children"
+ prototype: "QQmlInstanceModel"
+ exports: ["QtQuick/VisualItemModel 2.0"]
+ exportMetaObjectRevisions: [0]
+ attachedType: "QQmlObjectModelAttached"
+ Property { name: "children"; type: "QObject"; isList: true; isReadonly: true }
+ }
+ Component {
+ name: "QQmlObjectModelAttached"
+ prototype: "QObject"
+ Property { name: "index"; type: "int"; isReadonly: true }
+ }
+ Component {
name: "QQmlTimer"
prototype: "QObject"
exports: ["QtQml/Timer 2.0", "QtQuick/Timer 2.0"]
+ exportMetaObjectRevisions: [0, 0]
Property { name: "interval"; type: "int" }
Property { name: "running"; type: "bool" }
Property { name: "repeat"; type: "bool" }
@@ -422,6 +660,7 @@ Module {
name: "QQuickAbstractAnimation"
prototype: "QObject"
exports: ["QtQuick/Animation 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Loops"
values: {
@@ -461,14 +700,18 @@ Module {
name: "QQuickAccessibleAttached"
prototype: "QObject"
exports: ["QtQuick/Accessible 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "role"; type: "QAccessible::Role" }
Property { name: "name"; type: "string" }
Property { name: "description"; type: "string" }
+ Method { name: "valueChanged" }
+ Method { name: "cursorPositionChanged" }
}
Component {
name: "QQuickAnchorAnimation"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/AnchorAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "targets"; type: "QQuickItem"; isList: true; isReadonly: true }
Property { name: "duration"; type: "int" }
Property { name: "easing"; type: "QEasingCurve" }
@@ -485,6 +728,7 @@ Module {
name: "QQuickAnchorChanges"
prototype: "QQuickStateOperation"
exports: ["QtQuick/AnchorChanges 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "target"; type: "QQuickItem"; isPointer: true }
Property { name: "anchors"; type: "QQuickAnchorSet"; isReadonly: true; isPointer: true }
}
@@ -527,6 +771,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImage"
exports: ["QtQuick/AnimatedImage 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "playing"; type: "bool" }
Property { name: "paused"; type: "bool" }
Property { name: "currentFrame"; type: "int" }
@@ -539,6 +784,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/AnimatedSprite 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "LoopParameters"
values: {
@@ -698,6 +944,7 @@ Module {
defaultProperty: "animation"
prototype: "QObject"
exports: ["QtQuick/AnimationController 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "progress"; type: "double" }
Property { name: "animation"; type: "QQuickAbstractAnimation"; isPointer: true }
Method { name: "reload" }
@@ -712,8 +959,9 @@ Module {
}
Component {
name: "QQuickApplication"
- prototype: "QObject"
+ prototype: "QQmlApplication"
exports: ["QtQuick/Application 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "active"; type: "bool"; isReadonly: true }
Property { name: "layoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true }
Property { name: "supportsMultipleWindows"; type: "bool"; isReadonly: true }
@@ -723,6 +971,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
exports: ["QtQuick/Positioner 2.0"]
+ exportMetaObjectRevisions: [0]
attachedType: "QQuickPositionerAttached"
Property { name: "spacing"; type: "double" }
Property { name: "populate"; type: "QQuickTransition"; isPointer: true }
@@ -734,6 +983,7 @@ Module {
defaultProperty: "animation"
prototype: "QObject"
exports: ["QtQuick/Behavior 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "animation"; type: "QQuickAbstractAnimation"; isPointer: true }
Property { name: "enabled"; type: "bool" }
}
@@ -742,6 +992,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImageBase"
exports: ["QtQuick/BorderImage 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "TileMode"
values: {
@@ -760,6 +1011,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/Canvas 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "RenderTarget"
values: {
@@ -846,6 +1098,7 @@ Module {
name: "QQuickColorAnimation"
prototype: "QQuickPropertyAnimation"
exports: ["QtQuick/ColorAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "from"; type: "QColor" }
Property { name: "to"; type: "QColor" }
}
@@ -854,6 +1107,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickBasePositioner"
exports: ["QtQuick/Column 2.0"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "QQuickCurve"
@@ -867,6 +1121,7 @@ Module {
name: "QQuickDoubleValidator"
prototype: "QDoubleValidator"
exports: ["QtQuick/DoubleValidator 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "locale"; type: "string" }
Signal { name: "localeNameChanged" }
}
@@ -874,13 +1129,15 @@ Module {
name: "QQuickDrag"
prototype: "QObject"
exports: ["QtQuick/Drag 2.0"]
+ exportMetaObjectRevisions: [0]
attachedType: "QQuickDragAttached"
Enum {
name: "Axis"
values: {
"XAxis": 1,
"YAxis": 2,
- "XAndYAxis": 3
+ "XAndYAxis": 3,
+ "XandYAxis": 3
}
}
Property { name: "target"; type: "QQuickItem"; isPointer: true }
@@ -914,6 +1171,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/DropArea 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "containsDrag"; type: "bool"; isReadonly: true }
Property { name: "keys"; type: "QStringList" }
Property { name: "drag"; type: "QQuickDropAreaDrag"; isReadonly: true; isPointer: true }
@@ -945,6 +1203,7 @@ Module {
defaultProperty: "flickableData"
prototype: "QQuickItem"
exports: ["QtQuick/Flickable 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "BoundsBehavior"
values: {
@@ -1054,6 +1313,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/Flipable 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Side"
values: {
@@ -1070,6 +1330,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickBasePositioner"
exports: ["QtQuick/Flow 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Flow"
values: {
@@ -1086,11 +1347,13 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/FocusScope 2.0"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "QQuickFontLoader"
prototype: "QObject"
exports: ["QtQuick/FontLoader 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Status"
values: {
@@ -1108,6 +1371,7 @@ Module {
name: "QQuickFontValueType"
prototype: "QQmlValueType"
exports: ["QtQuick/Font 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "FontWeight"
values: {
@@ -1146,6 +1410,7 @@ Module {
defaultProperty: "stops"
prototype: "QObject"
exports: ["QtQuick/Gradient 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "stops"; type: "QQuickGradientStop"; isList: true; isReadonly: true }
Signal { name: "updated" }
}
@@ -1153,6 +1418,7 @@ Module {
name: "QQuickGradientStop"
prototype: "QObject"
exports: ["QtQuick/GradientStop 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "position"; type: "double" }
Property { name: "color"; type: "QColor" }
}
@@ -1160,7 +1426,8 @@ Module {
name: "QQuickGrid"
defaultProperty: "data"
prototype: "QQuickBasePositioner"
- exports: ["QtQuick/Grid 2.0"]
+ exports: ["QtQuick/Grid 2.0", "QtQuick/Grid 2.1"]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "Flow"
values: {
@@ -1168,6 +1435,22 @@ Module {
"TopToBottom": 1
}
}
+ Enum {
+ name: "HAlignment"
+ values: {
+ "AlignLeft": 1,
+ "AlignRight": 2,
+ "AlignHCenter": 4
+ }
+ }
+ Enum {
+ name: "VAlignment"
+ values: {
+ "AlignTop": 32,
+ "AlignBottom": 64,
+ "AlignVCenter": 128
+ }
+ }
Property { name: "rows"; type: "int" }
Property { name: "columns"; type: "int" }
Property { name: "rowSpacing"; type: "double" }
@@ -1175,18 +1458,43 @@ Module {
Property { name: "flow"; type: "Flow" }
Property { name: "layoutDirection"; type: "Qt::LayoutDirection" }
Property { name: "effectiveLayoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true }
+ Property { name: "horizontalItemAlignment"; revision: 1; type: "HAlignment" }
+ Property {
+ name: "effectiveHorizontalItemAlignment"
+ revision: 1
+ type: "HAlignment"
+ isReadonly: true
+ }
+ Property { name: "verticalItemAlignment"; revision: 1; type: "VAlignment" }
+ Signal {
+ name: "horizontalAlignmentChanged"
+ revision: 1
+ Parameter { name: "alignment"; type: "HAlignment" }
+ }
+ Signal {
+ name: "effectiveHorizontalAlignmentChanged"
+ revision: 1
+ Parameter { name: "alignment"; type: "HAlignment" }
+ }
+ Signal {
+ name: "verticalAlignmentChanged"
+ revision: 1
+ Parameter { name: "alignment"; type: "VAlignment" }
+ }
}
Component {
name: "QQuickGridMesh"
prototype: "QQuickShaderEffectMesh"
exports: ["QtQuick/GridMesh 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "resolution"; type: "QSize" }
}
Component {
name: "QQuickGridView"
defaultProperty: "data"
prototype: "QQuickItemView"
- exports: ["QtQuick/GridView 2.0"]
+ exports: ["QtQuick/GridView 2.0", "QtQuick/GridView 2.1"]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickGridViewAttached"
Enum {
name: "Flow"
@@ -1223,6 +1531,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImageBase"
exports: ["QtQuick/Image 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "HAlignment"
values: {
@@ -1305,11 +1614,14 @@ Module {
prototype: "QQuickItem"
Property { name: "implicitWidth"; type: "double"; isReadonly: true }
Property { name: "implicitHeight"; type: "double"; isReadonly: true }
+ Signal { name: "implicitWidthChanged2"; revision: 1 }
+ Signal { name: "implicitHeightChanged2"; revision: 1 }
}
Component {
name: "QQuickIntValidator"
prototype: "QIntValidator"
exports: ["QtQuick/IntValidator 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "locale"; type: "string" }
Signal { name: "localeNameChanged" }
}
@@ -1317,7 +1629,8 @@ Module {
name: "QQuickItem"
defaultProperty: "data"
prototype: "QObject"
- exports: ["QtQuick/Item 2.0"]
+ exports: ["QtQuick/Item 2.0", "QtQuick/Item 2.1"]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "TransformOrigin"
values: {
@@ -1361,6 +1674,7 @@ Module {
Property { name: "clip"; type: "bool" }
Property { name: "focus"; type: "bool" }
Property { name: "activeFocus"; type: "bool"; isReadonly: true }
+ Property { name: "activeFocusOnTab"; revision: 1; type: "bool" }
Property { name: "rotation"; type: "double" }
Property { name: "scale"; type: "double" }
Property { name: "transformOrigin"; type: "TransformOrigin" }
@@ -1392,6 +1706,11 @@ Module {
Parameter { type: "bool" }
}
Signal {
+ name: "activeFocusOnTabChanged"
+ revision: 1
+ Parameter { type: "bool" }
+ }
+ Signal {
name: "parentChanged"
Parameter { type: "QQuickItem"; isPointer: true }
}
@@ -1411,6 +1730,11 @@ Module {
name: "clipChanged"
Parameter { type: "bool" }
}
+ Signal {
+ name: "windowChanged"
+ revision: 1
+ Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
+ }
Method { name: "update" }
Method {
name: "contains"
@@ -1427,6 +1751,16 @@ Module {
}
Method { name: "forceActiveFocus" }
Method {
+ name: "forceActiveFocus"
+ Parameter { name: "reason"; type: "Qt::FocusReason" }
+ }
+ Method {
+ name: "nextItemInFocusChain"
+ type: "QQuickItem*"
+ Parameter { name: "forward"; type: "bool" }
+ }
+ Method { name: "nextItemInFocusChain"; type: "QQuickItem*" }
+ Method {
name: "childAt"
type: "QQuickItem*"
Parameter { name: "x"; type: "double" }
@@ -1486,6 +1820,8 @@ Module {
name: "QQuickItemView"
defaultProperty: "flickableData"
prototype: "QQuickFlickable"
+ exports: ["QtQuick/ItemView 2.1"]
+ exportMetaObjectRevisions: [1]
Enum {
name: "LayoutDirection"
values: {
@@ -1577,6 +1913,7 @@ Module {
}
Method { name: "positionViewAtBeginning" }
Method { name: "positionViewAtEnd" }
+ Method { name: "forceLayout"; revision: 1 }
}
Component {
name: "QQuickItemViewAttached"
@@ -1595,6 +1932,7 @@ Module {
name: "QQuickKeyNavigationAttached"
prototype: "QObject"
exports: ["QtQuick/KeyNavigation 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Priority"
values: {
@@ -1614,6 +1952,7 @@ Module {
name: "QQuickKeysAttached"
prototype: "QObject"
exports: ["QtQuick/Keys 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Priority"
values: {
@@ -1789,62 +2128,16 @@ Module {
name: "QQuickLayoutMirroringAttached"
prototype: "QObject"
exports: ["QtQuick/LayoutMirroring 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "enabled"; type: "bool" }
Property { name: "childrenInherit"; type: "bool" }
}
Component {
- name: "QQuickListElement"
- prototype: "QObject"
- exports: ["QtQuick/ListElement 2.0"]
- }
- Component {
- name: "QQuickListModel"
- prototype: "QAbstractListModel"
- exports: ["QtQuick/ListModel 2.0"]
- Property { name: "count"; type: "int"; isReadonly: true }
- Property { name: "dynamicRoles"; type: "bool" }
- Method { name: "clear" }
- Method {
- name: "remove"
- Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "append"
- Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "insert"
- Parameter { name: "args"; type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "get"
- type: "QQmlV8Handle"
- Parameter { name: "index"; type: "int" }
- }
- Method {
- name: "set"
- Parameter { name: "index"; type: "int" }
- Parameter { type: "QQmlV8Handle" }
- }
- Method {
- name: "setProperty"
- Parameter { name: "index"; type: "int" }
- Parameter { name: "property"; type: "string" }
- Parameter { name: "value"; type: "QVariant" }
- }
- Method {
- name: "move"
- Parameter { name: "from"; type: "int" }
- Parameter { name: "to"; type: "int" }
- Parameter { name: "count"; type: "int" }
- }
- Method { name: "sync" }
- }
- Component {
name: "QQuickListView"
defaultProperty: "data"
prototype: "QQuickItemView"
- exports: ["QtQuick/ListView 2.0"]
+ exports: ["QtQuick/ListView 2.0", "QtQuick/ListView 2.1"]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickListViewAttached"
Enum {
name: "Orientation"
@@ -1882,6 +2175,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
exports: ["QtQuick/Loader 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Status"
values: {
@@ -1909,6 +2203,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/MouseArea 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "mouseX"; type: "double"; isReadonly: true }
Property { name: "mouseY"; type: "double"; isReadonly: true }
Property { name: "containsMouse"; type: "bool"; isReadonly: true }
@@ -1979,6 +2274,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/MultiPointTouchArea 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "touchPoints"; type: "QQuickTouchPoint"; isList: true; isReadonly: true }
Property { name: "minimumTouchPoints"; type: "int" }
Property { name: "maximumTouchPoints"; type: "int" }
@@ -2011,6 +2307,7 @@ Module {
name: "QQuickNumberAnimation"
prototype: "QQuickPropertyAnimation"
exports: ["QtQuick/NumberAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "from"; type: "double" }
Property { name: "to"; type: "double" }
}
@@ -2019,6 +2316,7 @@ Module {
defaultProperty: "data"
prototype: "QObject"
exports: ["QtQuick/Package 2.0"]
+ exportMetaObjectRevisions: [0]
attachedType: "QQuickPackageAttached"
Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
}
@@ -2032,6 +2330,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/PaintedItem 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "RenderTarget"
values: {
@@ -2050,12 +2349,14 @@ Module {
defaultProperty: "animations"
prototype: "QQuickAnimationGroup"
exports: ["QtQuick/ParallelAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "QQuickParentAnimation"
defaultProperty: "animations"
prototype: "QQuickAnimationGroup"
exports: ["QtQuick/ParentAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "target"; type: "QQuickItem"; isPointer: true }
Property { name: "newParent"; type: "QQuickItem"; isPointer: true }
Property { name: "via"; type: "QQuickItem"; isPointer: true }
@@ -2064,6 +2365,7 @@ Module {
name: "QQuickParentChange"
prototype: "QQuickStateOperation"
exports: ["QtQuick/ParentChange 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "target"; type: "QQuickItem"; isPointer: true }
Property { name: "parent"; type: "QQuickItem"; isPointer: true }
Property { name: "x"; type: "QQmlScriptString" }
@@ -2078,6 +2380,7 @@ Module {
defaultProperty: "pathElements"
prototype: "QObject"
exports: ["QtQuick/Path 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "pathElements"; type: "QQuickPathElement"; isList: true; isReadonly: true }
Property { name: "startX"; type: "double" }
Property { name: "startY"; type: "double" }
@@ -2088,6 +2391,7 @@ Module {
name: "QQuickPathAnimation"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/PathAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Orientation"
values: {
@@ -2140,6 +2444,7 @@ Module {
name: "QQuickPathArc"
prototype: "QQuickCurve"
exports: ["QtQuick/PathArc 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "ArcDirection"
values: {
@@ -2156,6 +2461,7 @@ Module {
name: "QQuickPathAttribute"
prototype: "QQuickPathElement"
exports: ["QtQuick/PathAttribute 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "name"; type: "string" }
Property { name: "value"; type: "double" }
}
@@ -2163,11 +2469,13 @@ Module {
name: "QQuickPathCatmullRomCurve"
prototype: "QQuickCurve"
exports: ["QtQuick/PathCurve 2.0"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "QQuickPathCubic"
prototype: "QQuickCurve"
exports: ["QtQuick/PathCubic 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "control1X"; type: "double" }
Property { name: "control1Y"; type: "double" }
Property { name: "control2X"; type: "double" }
@@ -2186,6 +2494,7 @@ Module {
name: "QQuickPathInterpolator"
prototype: "QObject"
exports: ["QtQuick/PathInterpolator 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "path"; type: "QQuickPath"; isPointer: true }
Property { name: "progress"; type: "double" }
Property { name: "x"; type: "double"; isReadonly: true }
@@ -2196,17 +2505,20 @@ Module {
name: "QQuickPathLine"
prototype: "QQuickCurve"
exports: ["QtQuick/PathLine 2.0"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "QQuickPathPercent"
prototype: "QQuickPathElement"
exports: ["QtQuick/PathPercent 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "value"; type: "double" }
}
Component {
name: "QQuickPathQuad"
prototype: "QQuickCurve"
exports: ["QtQuick/PathQuad 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "controlX"; type: "double" }
Property { name: "controlY"; type: "double" }
Property { name: "relativeControlX"; type: "double" }
@@ -2216,6 +2528,7 @@ Module {
name: "QQuickPathSvg"
prototype: "QQuickCurve"
exports: ["QtQuick/PathSvg 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "path"; type: "string" }
}
Component {
@@ -2223,6 +2536,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/PathView 2.0"]
+ exportMetaObjectRevisions: [0]
attachedType: "QQuickPathViewAttached"
Enum {
name: "HighlightRangeMode"
@@ -2313,6 +2627,7 @@ Module {
name: "QQuickPauseAnimation"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/PauseAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "duration"; type: "int" }
Signal {
name: "durationChanged"
@@ -2331,13 +2646,15 @@ Module {
name: "QQuickPinch"
prototype: "QObject"
exports: ["QtQuick/Pinch 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "Axis"
values: {
"NoDrag": 0,
"XAxis": 1,
"YAxis": 2,
- "XAndYAxis": 3
+ "XAndYAxis": 3,
+ "XandYAxis": 3
}
}
Property { name: "target"; type: "QQuickItem"; isPointer: true }
@@ -2357,6 +2674,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/PinchArea 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "enabled"; type: "bool" }
Property { name: "pinch"; type: "QQuickPinch"; isReadonly: true; isPointer: true }
Signal {
@@ -2383,6 +2701,7 @@ Module {
name: "QQuickPropertyAction"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/PropertyAction 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "target"; type: "QObject"; isPointer: true }
Property { name: "property"; type: "string" }
Property { name: "properties"; type: "string" }
@@ -2402,6 +2721,7 @@ Module {
name: "QQuickPropertyAnimation"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/PropertyAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "duration"; type: "int" }
Property { name: "from"; type: "QVariant" }
Property { name: "to"; type: "QVariant" }
@@ -2436,6 +2756,7 @@ Module {
name: "QQuickPropertyChanges"
prototype: "QQuickStateOperation"
exports: ["QtQuick/PropertyChanges 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "target"; type: "QObject"; isPointer: true }
Property { name: "restoreEntryValues"; type: "bool" }
Property { name: "explicit"; type: "bool" }
@@ -2445,6 +2766,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/Rectangle 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "color"; type: "QColor" }
Property { name: "gradient"; type: "QQuickGradient"; isPointer: true }
Property { name: "border"; type: "QQuickPen"; isReadonly: true; isPointer: true }
@@ -2455,6 +2777,7 @@ Module {
defaultProperty: "delegate"
prototype: "QQuickItem"
exports: ["QtQuick/Repeater 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "model"; type: "QVariant" }
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "count"; type: "int"; isReadonly: true }
@@ -2478,6 +2801,7 @@ Module {
name: "QQuickRotation"
prototype: "QQuickTransform"
exports: ["QtQuick/Rotation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "origin"; type: "QVector3D" }
Property { name: "angle"; type: "double" }
Property { name: "axis"; type: "QVector3D" }
@@ -2486,6 +2810,7 @@ Module {
name: "QQuickRotationAnimation"
prototype: "QQuickPropertyAnimation"
exports: ["QtQuick/RotationAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "RotationDirection"
values: {
@@ -2504,6 +2829,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickBasePositioner"
exports: ["QtQuick/Row 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "layoutDirection"; type: "Qt::LayoutDirection" }
Property { name: "effectiveLayoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true }
}
@@ -2511,6 +2837,7 @@ Module {
name: "QQuickScale"
prototype: "QQuickTransform"
exports: ["QtQuick/Scale 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "origin"; type: "QVector3D" }
Property { name: "xScale"; type: "double" }
Property { name: "yScale"; type: "double" }
@@ -2530,6 +2857,7 @@ Module {
name: "QQuickScriptAction"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/ScriptAction 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "script"; type: "QQmlScriptString" }
Property { name: "scriptName"; type: "string" }
}
@@ -2538,12 +2866,14 @@ Module {
defaultProperty: "animations"
prototype: "QQuickAnimationGroup"
exports: ["QtQuick/SequentialAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
}
Component {
name: "QQuickShaderEffect"
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/ShaderEffect 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "CullMode"
values: {
@@ -2572,6 +2902,7 @@ Module {
name: "QQuickShaderEffectMesh"
prototype: "QObject"
exports: ["QtQuick/ShaderEffectMesh 2.0"]
+ exportMetaObjectRevisions: [0]
Signal { name: "geometryChanged" }
}
Component {
@@ -2579,6 +2910,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/ShaderEffectSource 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "WrapMode"
values: {
@@ -2612,6 +2944,7 @@ Module {
name: "QQuickSmoothedAnimation"
prototype: "QQuickNumberAnimation"
exports: ["QtQuick/SmoothedAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "ReversingMode"
values: {
@@ -2628,6 +2961,7 @@ Module {
name: "QQuickSpringAnimation"
prototype: "QQuickNumberAnimation"
exports: ["QtQuick/SpringAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "velocity"; type: "double" }
Property { name: "spring"; type: "double" }
Property { name: "damping"; type: "double" }
@@ -2640,6 +2974,7 @@ Module {
name: "QQuickSprite"
prototype: "QQuickStochasticState"
exports: ["QtQuick/Sprite 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "source"; type: "QUrl" }
Property { name: "reverse"; type: "bool" }
Property { name: "frameSync"; type: "bool" }
@@ -2759,6 +3094,7 @@ Module {
defaultProperty: "sprites"
prototype: "QQuickItem"
exports: ["QtQuick/SpriteSequence 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "running"; type: "bool" }
Property { name: "interpolate"; type: "bool" }
Property { name: "goalSprite"; type: "string" }
@@ -2802,6 +3138,7 @@ Module {
defaultProperty: "changes"
prototype: "QObject"
exports: ["QtQuick/State 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "name"; type: "string" }
Property { name: "when"; type: "QQmlBinding"; isPointer: true }
Property { name: "extend"; type: "string" }
@@ -2812,6 +3149,7 @@ Module {
name: "QQuickStateChangeScript"
prototype: "QQuickStateOperation"
exports: ["QtQuick/StateChangeScript 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "script"; type: "QQmlScriptString" }
Property { name: "name"; type: "string" }
}
@@ -2819,6 +3157,7 @@ Module {
name: "QQuickStateGroup"
prototype: "QObject"
exports: ["QtQuick/StateGroup 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "state"; type: "string" }
Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true }
Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true }
@@ -2882,6 +3221,7 @@ Module {
name: "QQuickSystemPalette"
prototype: "QObject"
exports: ["QtQuick/SystemPalette 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "ColorGroup"
values: {
@@ -2912,6 +3252,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
exports: ["QtQuick/Text 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "HAlignment"
values: {
@@ -3062,11 +3403,13 @@ Module {
}
Method { name: "doLayout" }
}
+ Component { name: "QQuickTextDocument"; prototype: "QObject" }
Component {
name: "QQuickTextEdit"
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
- exports: ["QtQuick/TextEdit 2.0"]
+ exports: ["QtQuick/TextEdit 2.0", "QtQuick/TextEdit 2.1"]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "HAlignment"
values: {
@@ -3144,6 +3487,7 @@ Module {
Property { name: "persistentSelection"; type: "bool" }
Property { name: "textMargin"; type: "double" }
Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" }
+ Property { name: "selectByKeyboard"; revision: 1; type: "bool" }
Property { name: "selectByMouse"; type: "bool" }
Property { name: "mouseSelectionMode"; type: "SelectionMode" }
Property { name: "canPaste"; type: "bool"; isReadonly: true }
@@ -3152,6 +3496,13 @@ Module {
Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true }
Property { name: "baseUrl"; type: "QUrl" }
Property { name: "renderType"; type: "RenderType" }
+ Property {
+ name: "textDocument"
+ revision: 1
+ type: "QQuickTextDocument"
+ isReadonly: true
+ isPointer: true
+ }
Signal { name: "contentSizeChanged" }
Signal {
name: "colorChanged"
@@ -3202,6 +3553,11 @@ Module {
Parameter { name: "textMargin"; type: "double" }
}
Signal {
+ name: "selectByKeyboardChanged"
+ revision: 1
+ Parameter { name: "selectByKeyboard"; type: "bool" }
+ }
+ Signal {
name: "selectByMouseChanged"
Parameter { name: "selectByMouse"; type: "bool" }
}
@@ -3280,6 +3636,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
exports: ["QtQuick/TextInput 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "EchoMode"
values: {
@@ -3482,6 +3839,7 @@ Module {
name: "QQuickTouchPoint"
prototype: "QObject"
exports: ["QtQuick/TouchPoint 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "pointId"; type: "int"; isReadonly: true }
Property { name: "pressed"; type: "bool"; isReadonly: true }
Property { name: "x"; type: "double"; isReadonly: true }
@@ -3502,6 +3860,7 @@ Module {
defaultProperty: "animations"
prototype: "QObject"
exports: ["QtQuick/Transition 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "from"; type: "string" }
Property { name: "to"; type: "string" }
Property { name: "reversible"; type: "bool" }
@@ -3513,6 +3872,7 @@ Module {
name: "QQuickTranslate"
prototype: "QQuickTransform"
exports: ["QtQuick/Translate 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "x"; type: "double" }
Property { name: "y"; type: "double" }
}
@@ -3520,6 +3880,7 @@ Module {
name: "QQuickVector3dAnimation"
prototype: "QQuickPropertyAnimation"
exports: ["QtQuick/Vector3dAnimation 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "from"; type: "QVector3D" }
Property { name: "to"; type: "QVector3D" }
}
@@ -3527,6 +3888,7 @@ Module {
name: "QQuickViewSection"
prototype: "QObject"
exports: ["QtQuick/ViewSection 2.0"]
+ exportMetaObjectRevisions: [0]
Enum {
name: "SectionCriteria"
values: {
@@ -3552,6 +3914,7 @@ Module {
name: "QQuickViewTransitionAttached"
prototype: "QObject"
exports: ["QtQuick/ViewTransition 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "index"; type: "int"; isReadonly: true }
Property { name: "item"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "destination"; type: "QPointF"; isReadonly: true }
@@ -3559,134 +3922,10 @@ Module {
Property { name: "targetItems"; type: "QObject"; isList: true; isReadonly: true }
}
Component {
- name: "QQuickVisualDataGroup"
- prototype: "QObject"
- exports: ["QtQuick/VisualDataGroup 2.0"]
- Property { name: "count"; type: "int"; isReadonly: true }
- Property { name: "name"; type: "string" }
- Property { name: "includeByDefault"; type: "bool" }
- Signal { name: "defaultIncludeChanged" }
- Signal {
- name: "changed"
- Parameter { name: "removed"; type: "QQmlV8Handle" }
- Parameter { name: "inserted"; type: "QQmlV8Handle" }
- }
- Method {
- name: "insert"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "create"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "resolve"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "remove"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "addGroups"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "removeGroups"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "setGroups"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "move"
- Parameter { type: "QQmlV8Function"; isPointer: true }
- }
- Method {
- name: "get"
- type: "QQmlV8Handle"
- Parameter { name: "index"; type: "int" }
- }
- }
- Component {
- name: "QQuickVisualDataModel"
- defaultProperty: "delegate"
- prototype: "QQuickVisualModel"
- exports: ["QtQuick/VisualDataModel 2.0"]
- attachedType: "QQuickVisualDataModelAttached"
- Property { name: "model"; type: "QVariant" }
- Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
- Property { name: "filterOnGroup"; type: "string" }
- Property { name: "items"; type: "QQuickVisualDataGroup"; isReadonly: true; isPointer: true }
- Property {
- name: "persistedItems"
- type: "QQuickVisualDataGroup"
- isReadonly: true
- isPointer: true
- }
- Property { name: "groups"; type: "QQuickVisualDataGroup"; isList: true; isReadonly: true }
- Property { name: "parts"; type: "QObject"; isReadonly: true; isPointer: true }
- Property { name: "rootIndex"; type: "QVariant" }
- Signal { name: "filterGroupChanged" }
- Signal { name: "defaultGroupsChanged" }
- Method {
- name: "modelIndex"
- type: "QVariant"
- Parameter { name: "idx"; type: "int" }
- }
- Method { name: "parentModelIndex"; type: "QVariant" }
- }
- Component {
- name: "QQuickVisualDataModelAttached"
- prototype: "QObject"
- Property { name: "model"; type: "QQuickVisualDataModel"; isReadonly: true; isPointer: true }
- Property { name: "groups"; type: "QStringList" }
- Property { name: "isUnresolved"; type: "bool"; isReadonly: true }
- Signal { name: "unresolvedChanged" }
- }
- Component { name: "QQuickVisualDataModelParts"; prototype: "QObject" }
- Component {
- name: "QQuickVisualItemModel"
- defaultProperty: "children"
- prototype: "QQuickVisualModel"
- exports: ["QtQuick/VisualItemModel 2.0"]
- attachedType: "QQuickVisualItemModelAttached"
- Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true }
- }
- Component {
- name: "QQuickVisualItemModelAttached"
- prototype: "QObject"
- Property { name: "index"; type: "int"; isReadonly: true }
- }
- Component {
- name: "QQuickVisualModel"
- prototype: "QObject"
- Property { name: "count"; type: "int"; isReadonly: true }
- Signal {
- name: "modelUpdated"
- Parameter { name: "changeSet"; type: "QQuickChangeSet" }
- Parameter { name: "reset"; type: "bool" }
- }
- Signal {
- name: "createdItem"
- Parameter { name: "index"; type: "int" }
- Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
- }
- Signal {
- name: "initItem"
- Parameter { name: "index"; type: "int" }
- Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
- }
- Signal {
- name: "destroyingItem"
- Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
- }
- }
- Component {
name: "QQuickWorkerScript"
prototype: "QObject"
exports: ["QtQuick/WorkerScript 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "source"; type: "QUrl" }
Signal {
name: "message"
@@ -3701,6 +3940,7 @@ Module {
name: "QRegExpValidator"
prototype: "QValidator"
exports: ["QtQuick/RegExpValidator 2.0"]
+ exportMetaObjectRevisions: [0]
Property { name: "regExp"; type: "QRegExp" }
Signal {
name: "regExpChanged"
@@ -3866,9 +4106,11 @@ Module {
"SplashScreen": 15,
"Desktop": 17,
"SubWindow": 18,
+ "ForeignWindow": 33,
"WindowType_Mask": 255,
"MSWindowsFixedSizeDialogHint": 256,
"MSWindowsOwnDC": 512,
+ "BypassWindowManagerHint": 1024,
"X11BypassWindowManagerHint": 1024,
"FramelessWindowHint": 2048,
"WindowTitleHint": 4096,
@@ -3907,9 +4149,11 @@ Module {
"SplashScreen": 15,
"Desktop": 17,
"SubWindow": 18,
+ "ForeignWindow": 33,
"WindowType_Mask": 255,
"MSWindowsFixedSizeDialogHint": 256,
"MSWindowsOwnDC": 512,
+ "BypassWindowManagerHint": 1024,
"X11BypassWindowManagerHint": 1024,
"FramelessWindowHint": 2048,
"WindowTitleHint": 4096,
@@ -4105,7 +4349,8 @@ Module {
"AA_X11InitThreads": 10,
"AA_SynthesizeTouchForUnhandledMouseEvents": 11,
"AA_SynthesizeMouseForUnhandledTouchEvents": 12,
- "AA_AttributeCount": 13
+ "AA_UseHighDpiPixmaps": 13,
+ "AA_AttributeCount": 14
}
}
Enum {
@@ -4790,6 +5035,15 @@ Module {
}
}
Enum {
+ name: "Edge"
+ values: {
+ "TopEdge": 1,
+ "LeftEdge": 2,
+ "RightEdge": 4,
+ "BottomEdge": 8
+ }
+ }
+ Enum {
name: "ConnectionType"
values: {
"AutoConnection": 0,
@@ -4916,6 +5170,7 @@ Module {
"ImhDate": 128,
"ImhTime": 256,
"ImhPreferLatin": 512,
+ "ImhMultiLine": 1024,
"ImhDigitsOnly": 65536,
"ImhFormattedNumbersOnly": 131072,
"ImhUppercaseOnly": 262144,
@@ -4941,6 +5196,7 @@ Module {
"ImhDate": 128,
"ImhTime": 256,
"ImhPreferLatin": 512,
+ "ImhMultiLine": 1024,
"ImhDigitsOnly": 65536,
"ImhFormattedNumbersOnly": 131072,
"ImhUppercaseOnly": 262144,
@@ -5010,7 +5266,8 @@ Module {
"ItemIsDropEnabled": 8,
"ItemIsUserCheckable": 16,
"ItemIsEnabled": 32,
- "ItemIsTristate": 64
+ "ItemIsTristate": 64,
+ "ItemNeverHasChildren": 128
}
}
Enum {
diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes
index b79702edb6..59e69114e1 100644
--- a/src/imports/window/plugins.qmltypes
+++ b/src/imports/window/plugins.qmltypes
@@ -3,7 +3,7 @@ import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
-// This file was auto-generated with the command '../../../bin/qmlplugindump.app/Contents/MacOS/qmlplugindump QtQuick.Window 2.1 -notrelocatable'.
+// This file was auto-generated with the command 'qmlplugindump QtQuick.Window 2.1 -notrelocatable'.
Module {
Component {
@@ -23,15 +23,23 @@ Module {
name: "QQuickScreen"
prototype: "QObject"
exports: ["QtQuick.Window/Screen 2.0"]
+ exportMetaObjectRevisions: [0]
attachedType: "QQuickScreenAttached"
}
Component {
name: "QQuickScreenAttached"
prototype: "QObject"
+ Property { name: "name"; revision: 1; type: "string"; isReadonly: true }
Property { name: "width"; type: "int"; isReadonly: true }
Property { name: "height"; type: "int"; isReadonly: true }
+ Property { name: "desktopAvailableWidth"; revision: 1; type: "int"; isReadonly: true }
+ Property { name: "desktopAvailableHeight"; revision: 1; type: "int"; isReadonly: true }
+ Property { name: "logicalPixelDensity"; revision: 1; type: "double"; isReadonly: true }
Property { name: "primaryOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
Property { name: "orientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
+ Signal { name: "nameChanged"; revision: 1 }
+ Signal { name: "desktopGeometryChanged"; revision: 1 }
+ Signal { name: "logicalPixelDensityChanged"; revision: 1 }
Method {
name: "angleBetween"
type: "int"
@@ -62,6 +70,11 @@ Module {
Signal { name: "beforeRendering" }
Signal { name: "afterRendering" }
Signal {
+ name: "closing"
+ revision: 1
+ Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true }
+ }
+ Signal {
name: "colorChanged"
Parameter { type: "QColor" }
}
@@ -95,6 +108,7 @@ Module {
Property { name: "maximumWidth"; revision: 1; type: "int" }
Property { name: "maximumHeight"; revision: 1; type: "int" }
Property { name: "visible"; type: "bool" }
+ Property { name: "active"; revision: 1; type: "bool"; isReadonly: true }
Property { name: "visibility"; revision: 1; type: "Visibility" }
Property { name: "contentOrientation"; revision: 1; type: "Qt::ScreenOrientation" }
Property { name: "opacity"; revision: 1; type: "double" }
@@ -155,6 +169,7 @@ Module {
revision: 1
Parameter { name: "visibility"; type: "QWindow::Visibility" }
}
+ Signal { name: "activeChanged"; revision: 1 }
Signal {
name: "contentOrientationChanged"
revision: 1
@@ -169,6 +184,7 @@ Module {
revision: 1
Parameter { name: "opacity"; type: "double" }
}
+ Method { name: "requestActivate"; revision: 1 }
Method {
name: "setVisible"
Parameter { name: "visible"; type: "bool" }
@@ -222,5 +238,9 @@ Module {
revision: 1
Parameter { name: "h"; type: "int" }
}
+ Method {
+ name: "alert"
+ Parameter { name: "msec"; type: "int" }
+ }
}
}
diff --git a/src/particles/qquickmaskextruder.cpp b/src/particles/qquickmaskextruder.cpp
index f8ed042a9b..d59902bf3a 100644
--- a/src/particles/qquickmaskextruder.cpp
+++ b/src/particles/qquickmaskextruder.cpp
@@ -118,7 +118,7 @@ bool QQuickMaskExtruder::contains(const QRectF &bounds, const QPointF &point)
QPointF pt = point - bounds.topLeft();
QPoint p(pt.x() * m_img.width() / bounds.width(),
pt.y() * m_img.height() / bounds.height());
- return m_img.rect().contains(p) && (bool)m_img.pixelIndex(p);
+ return m_img.rect().contains(p) && (m_img.pixel(p) & 0xff000000);
}
void QQuickMaskExtruder::ensureInitialized(const QRectF &rf)
diff --git a/src/particles/qquickparticleemitter.cpp b/src/particles/qquickparticleemitter.cpp
index b4e3a82cb2..6d9b945def 100644
--- a/src/particles/qquickparticleemitter.cpp
+++ b/src/particles/qquickparticleemitter.cpp
@@ -203,7 +203,7 @@ QT_BEGIN_NAMESPACE
Emits count particles from this emitter immediately.
*/
-/*! \qmlmethod QtQuick.Particles2::Emitter::burst(int x, int y, int count)
+/*! \qmlmethod QtQuick.Particles2::Emitter::burst(int count, int x, int y)
Emits count particles from this emitter immediately. The particles are emitted
as if the Emitter was positioned at x,y but all other properties are the same.
@@ -357,7 +357,7 @@ void QQuickParticleEmitter::emitWindow(int timeStamp)
m_last_timestamp = timeStamp/1000.;
m_last_emission = m_last_timestamp;
m_reset_last = false;
- m_emitCap = particleCount();
+ m_emitCap = -1;
}
if (m_pulseLeft){
@@ -424,6 +424,8 @@ void QQuickParticleEmitter::emitWindow(int timeStamp)
if (datum->lifeSpan >= m_system->maxLife){
datum->lifeSpan = m_system->maxLife;
+ if (m_emitCap == -1)
+ m_emitCap = particleCount();
m_emitCap--;//emitCap keeps us from reemitting 'infinite' particles after their life. Unless you reset the emitter.
}
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp
index dcb553912d..53ad15775c 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/qml/debugger/qqmldebugserver.cpp
@@ -417,10 +417,13 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
if (s_dataStreamVersion > QDataStream().version())
s_dataStreamVersion = QDataStream().version();
}
+
// Send the hello answer immediately, since it needs to arrive before
// the plugins below start sending messages.
+
QByteArray helloAnswer;
{
+ QReadLocker readPluginsLock(&d->pluginsLock);
QQmlDebugStream out(&helloAnswer, QIODevice::WriteOnly);
QStringList pluginNames;
QList<float> pluginVersions;
diff --git a/src/qml/debugger/qqmlprofilerservice.cpp b/src/qml/debugger/qqmlprofilerservice.cpp
index cb85fc0e1f..0ba939cdca 100644
--- a/src/qml/debugger/qqmlprofilerservice.cpp
+++ b/src/qml/debugger/qqmlprofilerservice.cpp
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
// instance will be set, unset in constructor. Allows static methods to be inlined.
QQmlProfilerService *QQmlProfilerService::instance = 0;
Q_GLOBAL_STATIC(QQmlProfilerService, profilerInstance)
-
+bool QQmlProfilerService::enabled = false;
// convert to a QByteArray that can be sent to the debug client
// use of QDataStream can skew results
@@ -76,12 +76,46 @@ QByteArray QQmlProfilerData::toByteArray() const
if (messageType == (int)QQmlProfilerService::Event &&
detailType == (int)QQmlProfilerService::AnimationFrame)
ds << framerate << animationcount;
+ if (messageType == (int)QQmlProfilerService::PixmapCacheEvent) {
+ ds << detailData;
+ switch (detailType) {
+ case QQmlProfilerService::PixmapSizeKnown: ds << line << column; break;
+ case QQmlProfilerService::PixmapReferenceCountChanged: ds << animationcount; break;
+ case QQmlProfilerService::PixmapCacheCountChanged: ds << animationcount; break;
+ default: break;
+ }
+ }
+ if (messageType == (int)QQmlProfilerService::SceneGraphFrame) {
+ switch (detailType) {
+ // RendererFrame: preprocessTime, updateTime, bindingTime, renderTime
+ case QQmlProfilerService::SceneGraphRendererFrame: ds << subtime_1 << subtime_2 << subtime_3 << subtime_4; break;
+ // AdaptationLayerFrame: glyphCount (which is an integer), glyphRenderTime, glyphStoreTime
+ case QQmlProfilerService::SceneGraphAdaptationLayerFrame: ds << (int)subtime_1 << subtime_2 << subtime_3; break;
+ // ContextFrame: compiling material time
+ case QQmlProfilerService::SceneGraphContextFrame: ds << subtime_1; break;
+ // RenderLoop: syncTime, renderTime, swapTime
+ case QQmlProfilerService::SceneGraphRenderLoopFrame: ds << subtime_1 << subtime_2 << subtime_3; break;
+ // TexturePrepare: bind, convert, swizzle, upload, mipmap
+ case QQmlProfilerService::SceneGraphTexturePrepare: ds << subtime_1 << subtime_2 << subtime_3 << subtime_4 << subtime_5; break;
+ // TextureDeletion: deletionTime
+ case QQmlProfilerService::SceneGraphTextureDeletion: ds << subtime_1; break;
+ // PolishAndSync: polishTime, waitTime, syncTime, animationsTime,
+ case QQmlProfilerService::SceneGraphPolishAndSync: ds << subtime_1 << subtime_2 << subtime_3 << subtime_4; break;
+ // WindowsRenderLoop: GL time, make current time, SceneGraph time
+ case QQmlProfilerService::SceneGraphWindowsRenderShow: ds << subtime_1 << subtime_2 << subtime_3; break;
+ // WindowsAnimations: update time
+ case QQmlProfilerService::SceneGraphWindowsAnimations: ds << subtime_1; break;
+ // WindowsRenderWindow: polish time
+ case QQmlProfilerService::SceneGraphWindowsPolishFrame: ds << subtime_1; break;
+ default:break;
+ }
+ }
+
return data;
}
QQmlProfilerService::QQmlProfilerService()
- : QQmlDebugService(QStringLiteral("CanvasFrameRate"), 1),
- m_enabled(false)
+ : QQmlDebugService(QStringLiteral("CanvasFrameRate"), 1)
{
m_timer.start();
@@ -131,6 +165,11 @@ void QQmlProfilerService::animationFrame(qint64 delta)
profilerInstance()->animationFrameImpl(delta);
}
+void QQmlProfilerService::sceneGraphFrame(SceneGraphFrameType frameType, qint64 value1, qint64 value2, qint64 value3, qint64 value4, qint64 value5)
+{
+ profilerInstance()->sceneGraphFrameImpl(frameType, value1, value2, value3, value4, value5);
+}
+
void QQmlProfilerService::sendProfilingData()
{
profilerInstance()->sendMessages();
@@ -160,88 +199,136 @@ bool QQmlProfilerService::stopProfilingImpl()
void QQmlProfilerService::sendStartedProfilingMessageImpl()
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)StartTrace,
- QString(), -1, -1, 0, 0, 0};
+ QString(), -1, -1, 0, 0, 0,
+ 0, 0, 0, 0, 0};
QQmlDebugService::sendMessage(ed.toByteArray());
}
void QQmlProfilerService::addEventImpl(EventType event)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)event,
- QString(), -1, -1, 0, 0, 0};
+ QString(), -1, -1, 0, 0, 0,
+ 0, 0, 0, 0, 0};
processMessage(ed);
}
void QQmlProfilerService::startRange(RangeType range, BindingType bindingType)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeStart, (int)range,
- QString(), -1, -1, 0, 0, (int)bindingType};
+ QString(), -1, -1, 0, 0, (int)bindingType,
+ 0, 0, 0, 0, 0};
processMessage(rd);
}
void QQmlProfilerService::rangeData(RangeType range, const QString &rData)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeData, (int)range,
- rData, -1, -1, 0, 0, 0};
+ rData, -1, -1, 0, 0, 0,
+ 0, 0, 0, 0, 0};
processMessage(rd);
}
void QQmlProfilerService::rangeData(RangeType range, const QUrl &rData)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeData, (int)range,
- rData.toString(), -1, -1, 0, 0, 0};
+ rData.toString(), -1, -1, 0, 0, 0,
+ 0, 0, 0, 0, 0};
processMessage(rd);
}
void QQmlProfilerService::rangeLocation(RangeType range, const QString &fileName, int line, int column)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeLocation, (int)range,
- fileName, line, column, 0, 0, 0};
+ fileName, line, column, 0, 0, 0,
+ 0, 0, 0, 0, 0};
processMessage(rd);
}
void QQmlProfilerService::rangeLocation(RangeType range, const QUrl &fileName, int line, int column)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeLocation, (int)range,
- fileName.toString(), line, column, 0, 0, 0};
+ fileName.toString(), line, column, 0, 0, 0,
+ 0, 0, 0, 0, 0};
processMessage(rd);
}
void QQmlProfilerService::endRange(RangeType range)
{
- if (!QQmlDebugService::isDebuggingEnabled() || !m_enabled)
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
return;
QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)RangeEnd, (int)range,
- QString(), -1, -1, 0, 0, 0};
+ QString(), -1, -1, 0, 0, 0,
+ 0, 0, 0, 0, 0};
+ processMessage(rd);
+}
+
+void QQmlProfilerService::pixmapEventImpl(PixmapEventType eventType, const QUrl &url)
+{
+ // assuming enabled checked by caller
+ QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)PixmapCacheEvent, (int)eventType,
+ url.toString(), -1, -1, -1, -1, -1,
+ 0, 0, 0, 0, 0};
+ processMessage(rd);
+}
+
+void QQmlProfilerService::pixmapEventImpl(PixmapEventType eventType, const QUrl &url, int width, int height)
+{
+ // assuming enabled checked by caller
+ QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)PixmapCacheEvent, (int)eventType,
+ url.toString(), width, height, -1, -1, -1,
+ 0, 0, 0, 0, 0};
+ processMessage(rd);
+}
+
+void QQmlProfilerService::pixmapEventImpl(PixmapEventType eventType, const QUrl &url, int count)
+{
+ // assuming enabled checked by caller
+ QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)PixmapCacheEvent, (int)eventType,
+ url.toString(), -1, -1, -1, count, -1,
+ 0, 0, 0, 0, 0};
+ processMessage(rd);
+}
+
+void QQmlProfilerService::sceneGraphFrameImpl(SceneGraphFrameType frameType, qint64 value1, qint64 value2, qint64 value3, qint64 value4, qint64 value5)
+{
+ if (!QQmlDebugService::isDebuggingEnabled() || !enabled)
+ return;
+
+ // because I already have some space to store ints in the struct, I'll use it to store the frame data
+ // even though the field names do not match
+ QQmlProfilerData rd = {m_timer.nsecsElapsed(), (int)SceneGraphFrame, (int)frameType, QString(),
+ -1, -1, -1, -1, -1,
+ value1, value2, value3, value4, value5};
processMessage(rd);
}
void QQmlProfilerService::animationFrameImpl(qint64 delta)
{
Q_ASSERT(QQmlDebugService::isDebuggingEnabled());
- if (!m_enabled)
+ if (!enabled)
return;
int animCount = QUnifiedTimer::instance()->runningAnimationCount();
@@ -250,7 +337,8 @@ void QQmlProfilerService::animationFrameImpl(qint64 delta)
// trim fps to integer
int fps = 1000 / delta;
QQmlProfilerData ed = {m_timer.nsecsElapsed(), (int)Event, (int)AnimationFrame,
- QString(), -1, -1, fps, animCount, 0};
+ QString(), -1, -1, fps, animCount, 0,
+ 0, 0, 0, 0, 0};
processMessage(ed);
}
}
@@ -267,12 +355,12 @@ void QQmlProfilerService::processMessage(const QQmlProfilerData &message)
bool QQmlProfilerService::profilingEnabled()
{
- return m_enabled;
+ return enabled;
}
void QQmlProfilerService::setProfilingEnabled(bool enable)
{
- m_enabled = enable;
+ enabled = enable;
}
/*
@@ -281,6 +369,7 @@ void QQmlProfilerService::setProfilingEnabled(bool enable)
void QQmlProfilerService::sendMessages()
{
QMutexLocker locker(&m_dataMutex);
+
QList<QByteArray> messages;
for (int i = 0; i < m_data.count(); ++i)
messages << m_data.at(i).toByteArray();
@@ -303,7 +392,7 @@ void QQmlProfilerService::stateAboutToBeChanged(QQmlDebugService::State newState
return;
if (state() == Enabled
- && m_enabled) {
+ && enabled) {
stopProfilingImpl();
sendMessages();
}
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h
index a50fb5ea08..fb08a30c6a 100644
--- a/src/qml/debugger/qqmlprofilerservice_p.h
+++ b/src/qml/debugger/qqmlprofilerservice_p.h
@@ -74,12 +74,18 @@ struct Q_AUTOTEST_EXPORT QQmlProfilerData
//###
QString detailData; //used by RangeData and RangeLocation
- int line; //used by RangeLocation
- int column; //used by RangeLocation
+ int line; //used by RangeLocation, also as "width" for pixmaps
+ int column; //used by RangeLocation, also as "height" for pixmaps
int framerate; //used by animation events
- int animationcount; //used by animation events
+ int animationcount; //used by animation events, also as "cache/reference count" for pixmaps
int bindingType;
+ qint64 subtime_1;
+ qint64 subtime_2;
+ qint64 subtime_3;
+ qint64 subtime_4;
+ qint64 subtime_5;
+
QByteArray toByteArray() const;
};
@@ -99,6 +105,8 @@ public:
RangeLocation,
RangeEnd,
Complete, // end of transmission
+ PixmapCacheEvent,
+ SceneGraphFrame,
MaximumMessage
};
@@ -132,14 +140,43 @@ public:
MaximumBindingType
};
+ enum PixmapEventType {
+ PixmapSizeKnown,
+ PixmapReferenceCountChanged,
+ PixmapCacheCountChanged,
+ PixmapLoadingStarted,
+ PixmapLoadingFinished,
+ PixmapLoadingError,
+
+ MaximumPixmapEventType
+ };
+
+ enum SceneGraphFrameType {
+ SceneGraphRendererFrame,
+ SceneGraphAdaptationLayerFrame,
+ SceneGraphContextFrame,
+ SceneGraphRenderLoopFrame,
+ SceneGraphTexturePrepare,
+ SceneGraphTextureDeletion,
+ SceneGraphPolishAndSync,
+ SceneGraphWindowsRenderShow,
+ SceneGraphWindowsAnimations,
+ SceneGraphWindowsPolishFrame,
+
+ MaximumSceneGraphFrameType
+ };
+
static void initialize();
static bool startProfiling();
static bool stopProfiling();
static void sendStartedProfilingMessage();
+ static bool profilingEnabled();
+
static void addEvent(EventType);
static void animationFrame(qint64);
+ static void sceneGraphFrame(SceneGraphFrameType frameType, qint64 value1, qint64 value2 = -1, qint64 value3 = -1, qint64 value4 = -1, qint64 value5 = -1);
static void sendProfilingData();
QQmlProfilerService();
@@ -163,15 +200,22 @@ private:
void rangeLocation(RangeType, const QUrl &, int, int);
void endRange(RangeType);
+ // overloading depending on parameters
+ void pixmapEventImpl(PixmapEventType eventType, const QUrl &url);
+ void pixmapEventImpl(PixmapEventType eventType, const QUrl &url, int width, int height);
+ void pixmapEventImpl(PixmapEventType eventType, const QUrl &url, int count);
+
+ void sceneGraphFrameImpl(SceneGraphFrameType frameType, qint64 value1, qint64 value2, qint64 value3, qint64 value4, qint64 value5);
+
- bool profilingEnabled();
void setProfilingEnabled(bool enable);
void sendMessages();
void processMessage(const QQmlProfilerData &);
+public:
+ static bool enabled;
private:
QElapsedTimer m_timer;
- bool m_enabled;
QVector<QQmlProfilerData> m_data;
QMutex m_dataMutex;
QMutex m_initializeMutex;
@@ -183,6 +227,7 @@ private:
friend struct QQmlHandlingSignalProfiler;
friend struct QQmlObjectCreatingProfiler;
friend struct QQmlCompilingProfiler;
+ friend struct QQmlPixmapProfiler;
};
//
@@ -288,6 +333,49 @@ struct QQmlCompilingProfiler {
bool enabled;
};
+struct QQmlPixmapProfiler {
+ QQmlPixmapProfiler() {
+ QQmlProfilerService *instance = QQmlProfilerService::instance;
+ enabled = instance ?
+ instance->profilingEnabled() : false;
+ }
+
+ ~QQmlPixmapProfiler() {}
+
+ void startLoading(const QUrl &pixmapUrl) {
+ if (enabled) {
+ QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapLoadingStarted, pixmapUrl);
+ }
+ }
+ void finishLoading(const QUrl &pixmapUrl) {
+ if (enabled) {
+ QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapLoadingFinished, pixmapUrl);
+ }
+ }
+ void errorLoading(const QUrl &pixmapUrl) {
+ if (enabled) {
+ QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapLoadingError, pixmapUrl);
+ }
+ }
+ void cacheCountChanged(const QUrl &pixmapUrl, int cacheCount) {
+ if (enabled) {
+ QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapCacheCountChanged, pixmapUrl, cacheCount);
+ }
+ }
+ void referenceCountChanged(const QUrl &pixmapUrl, int referenceCount) {
+ if (enabled) {
+ QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapReferenceCountChanged, pixmapUrl, referenceCount);
+ }
+ }
+ void setSize(const QUrl &pixmapUrl, int width, int height) {
+ if (enabled) {
+ QQmlProfilerService::instance->pixmapEventImpl(QQmlProfilerService::PixmapSizeKnown, pixmapUrl, width, height);
+ }
+ }
+
+ bool enabled;
+};
+
QT_END_NAMESPACE
#endif // QQMLPROFILERSERVICE_P_H
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 4ce44ba46e..84cf64eddd 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -30,7 +30,7 @@ qhp.QtQml.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtqml/qtqml.tags
-depends += qtcore qtxmlpatterns qtgui qtquick
+depends += qtcore qtxmlpatterns qtgui qtquick qtdoc
headerdirs += ..
diff --git a/src/quick/doc/snippets/qml/visualdatagroup.qml b/src/qml/doc/snippets/delegatemodel/visualdatagroup.qml
index 4254b50e63..4254b50e63 100644
--- a/src/quick/doc/snippets/qml/visualdatagroup.qml
+++ b/src/qml/doc/snippets/delegatemodel/visualdatagroup.qml
diff --git a/src/quick/doc/snippets/qml/visualdatamodel.qml b/src/qml/doc/snippets/delegatemodel/visualdatamodel.qml
index 0513c5b5f2..0513c5b5f2 100644
--- a/src/quick/doc/snippets/qml/visualdatamodel.qml
+++ b/src/qml/doc/snippets/delegatemodel/visualdatamodel.qml
diff --git a/src/quick/doc/snippets/qml/visualdatamodel_rootindex/main.cpp b/src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/main.cpp
index da1086146c..da1086146c 100644
--- a/src/quick/doc/snippets/qml/visualdatamodel_rootindex/main.cpp
+++ b/src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/main.cpp
diff --git a/src/quick/doc/snippets/qml/visualdatamodel_rootindex/view.qml b/src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/view.qml
index 1e8cfade96..1e8cfade96 100644
--- a/src/quick/doc/snippets/qml/visualdatamodel_rootindex/view.qml
+++ b/src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/view.qml
diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/main.cpp b/src/qml/doc/snippets/qml/qtbinding/resources/main.cpp
deleted file mode 100644
index 844c850366..0000000000
--- a/src/qml/doc/snippets/qml/qtbinding/resources/main.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QQuickView>
-#include <QQmlContext>
-
-//![0]
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QQuickView view;
- view.setSource(QUrl("qrc:/main.qml"));
- view.show();
-
- return app.exec();
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro b/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro
deleted file mode 100644
index 5aee288a6e..0000000000
--- a/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-QT += qml
-
-SOURCES += main.cpp
-RESOURCES += example.qrc
diff --git a/src/qml/doc/src/cppclasses/topic.qdoc b/src/qml/doc/src/cppclasses/topic.qdoc
index 66a374e811..7c21793cfd 100644
--- a/src/qml/doc/src/cppclasses/topic.qdoc
+++ b/src/qml/doc/src/cppclasses/topic.qdoc
@@ -88,7 +88,7 @@ properties of a QQmlContext, and how to access the context for an object.
Dynamic object instantiation and dynamic expression evaluation are both core
concepts in QML. QML documents define object types which can be instantiated
at run-time using a QQmlComponent. An instance of the QQmlComponent class can
-be created in C++ directly, or via the \l{QML:Qt::createComponent()}
+be created in C++ directly, or via the \l{QtQml2::Qt::createComponent()}
{Qt.createComponent()} function in imperative QML code. Arbitrary expressions
can be calculated in C++ via the QQmlExpression class, and such expressions
can interact directly the QML context.
diff --git a/src/qml/doc/src/cppintegration/contextproperties.qdoc b/src/qml/doc/src/cppintegration/contextproperties.qdoc
index aaac43e470..1c2bced738 100644
--- a/src/qml/doc/src/cppintegration/contextproperties.qdoc
+++ b/src/qml/doc/src/cppintegration/contextproperties.qdoc
@@ -74,7 +74,7 @@ QML code invokes a method on the object instance:
\endtable
(Note that date/time values returned from C++ to QML can be formatted through
-\l{QML:Qt::formatDateTime}{Qt.formatDateTime()} and associated functions.)
+\l{QtQml2::Qt::formatDateTime}{Qt.formatDateTime()} and associated functions.)
If the QML item needs to receive signals from the context property, it can connect to them using the
\l Connections type. For example, if \c ApplicationData has a signal named \c
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc
index dc1b4cae9c..74a93436f5 100644
--- a/src/qml/doc/src/cppintegration/data.qdoc
+++ b/src/qml/doc/src/cppintegration/data.qdoc
@@ -124,7 +124,7 @@ QQuaternion and QMatrix4x4, are only available from QML when the \l {Qt Quick}
module is included.
As a convenience, many of these types can be specified in QML by string values,
-or by a related method provided by the \l {QML:Qt} object. For example, the \l
+or by a related method provided by the \l {QtQml2::Qt} object. For example, the \l
{Image::sourceSize} property is of type \l size (which automatically translates
to the QSize type) and can be specified by a string value formatted as
"width\c{x}height", or by the Qt.size() function:
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
index 763e72447d..d0fb03a03c 100644
--- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
+++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
@@ -39,17 +39,17 @@ core QML features, including properties, signals and bindings. It also shows how
extensions can be deployed through plugins.
You can find the source code for this tutorial in \c Qt's
-examples/quick/tutorials/extending directory.
+examples/qml/tutorials/extending directory.
Tutorial chapters:
\list 1
-\li \l{quick/tutorials/extending/chapter1-basics}{Creating a New Type}
-\li \l{quick/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
-\li \l{quick/tutorials/extending/chapter3-bindings}{Property Binding}
-\li \l{quick/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
-\li \l{quick/tutorials/extending/chapter5-listproperties}{Using List Property Types}
-\li \l{quick/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
+\li \l{tutorials/extending/chapter1-basics}{Creating a New Type}
+\li \l{tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
+\li \l{tutorials/extending/chapter3-bindings}{Property Binding}
+\li \l{tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
+\li \l{tutorials/extending/chapter5-listproperties}{Using List Property Types}
+\li \l{tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
\li \l{qml-extending-tutorial7.html}{In Summary}
\endlist
@@ -104,7 +104,7 @@ this new class must:
Here is our \c PieChart class, defined in \c piechart.h:
-\snippet quick/tutorials/extending/chapter1-basics/piechart.h 0
+\snippet tutorials/extending/chapter1-basics/piechart.h 0
The class inherits from QQuickPaintedItem because we want to override
QQuickPaintedItem::paint() in perform drawing operations with the QPainter API.
@@ -120,15 +120,15 @@ simply sets and returns the \c m_name and \c m_color values as appropriate, and
implements \c paint() to draw a simple pie chart. It also turns off the
QGraphicsItem::ItemHasNoContents flag to enable painting:
-\snippet quick/tutorials/extending/chapter1-basics/piechart.cpp 0
+\snippet tutorials/extending/chapter1-basics/piechart.cpp 0
\dots 0
-\snippet quick/tutorials/extending/chapter1-basics/piechart.cpp 1
+\snippet tutorials/extending/chapter1-basics/piechart.cpp 1
Now that we have defined the \c PieChart type, we will use it from QML. The \c app.qml
file creates a \c PieChart item and display the pie chart's details
using a standard QML \l Text item:
-\snippet quick/tutorials/extending/chapter1-basics/app.qml 0
+\snippet tutorials/extending/chapter1-basics/app.qml 0
Notice that although the color is specified as a string in QML, it is automatically
converted to a QColor object for the PieChart \c color property. Automatic conversions are
@@ -142,20 +142,20 @@ you don't register the type, \c app.qml won't be able to create a \c PieChart.
Here is the application \c main.cpp:
-\snippet quick/tutorials/extending/chapter1-basics/main.cpp 0
+\snippet tutorials/extending/chapter1-basics/main.cpp 0
This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart",
in a type namespace called "Charts", with a version of 1.0.
Lastly, we write a \c .pro project file that includes the files and the \c declarative library:
-\quotefile quick/tutorials/extending/chapter1-basics/chapter1-basics.pro
+\quotefile tutorials/extending/chapter1-basics/chapter1-basics.pro
Now we can build and run the application:
\image extending-tutorial-chapter1.png
-Try it yourself with the code in Qt's \c examples/quick/tutorials/extending/chapter1-basics directory.
+Try it yourself with the code in Qt's \c examples/qml/tutorials/extending/chapter1-basics directory.
*/
@@ -168,20 +168,20 @@ Suppose we want \c PieChart to have a "clearChart()" method that erases the
chart and then emits a "chartCleared" signal. Our \c app.qml would be able
to call \c clearChart() and receive \c chartCleared() signals like this:
-\snippet quick/tutorials/extending/chapter2-methods/app.qml 0
+\snippet tutorials/extending/chapter2-methods/app.qml 0
\image extending-tutorial-chapter2.png
To do this, we add a \c clearChart() method and a \c chartCleared() signal
to our C++ class:
-\snippet quick/tutorials/extending/chapter2-methods/piechart.h 0
+\snippet tutorials/extending/chapter2-methods/piechart.h 0
\dots
-\snippet quick/tutorials/extending/chapter2-methods/piechart.h 1
+\snippet tutorials/extending/chapter2-methods/piechart.h 1
\dots
-\snippet quick/tutorials/extending/chapter2-methods/piechart.h 2
+\snippet tutorials/extending/chapter2-methods/piechart.h 2
\dots
-\snippet quick/tutorials/extending/chapter2-methods/piechart.h 3
+\snippet tutorials/extending/chapter2-methods/piechart.h 3
The use of Q_INVOKABLE makes the \c clearChart() method available to the
Qt Meta-Object system, and in turn, to QML. Note that it could have
@@ -191,7 +191,7 @@ slots are also callable from QML. Both of these approaches are valid.
The \c clearChart() method simply changes the color to Qt::transparent,
repaints the chart, then emits the \c chartCleared() signal:
-\snippet quick/tutorials/extending/chapter2-methods/piechart.cpp 0
+\snippet tutorials/extending/chapter2-methods/piechart.cpp 0
Now when we run the application and click the window, the pie chart
disappears, and the application outputs:
@@ -200,7 +200,7 @@ disappears, and the application outputs:
The chart has been cleared
\endcode
-Try out the example yourself with the updated code in Qt's \c examples/quick/tutorials/extending/chapter2-methods directory.
+Try out the example yourself with the updated code in Qt's \c examples/qml/tutorials/extending/chapter2-methods directory.
*/
@@ -216,7 +216,7 @@ other types' values when property values are changed.
Let's enable property bindings for the \c color property. That means
if we have code like this:
-\snippet quick/tutorials/extending/chapter3-bindings/app.qml 0
+\snippet tutorials/extending/chapter3-bindings/app.qml 0
\image extending-tutorial-chapter3.png
@@ -231,17 +231,17 @@ It's easy to enable property binding for the \c color property.
We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "colorChanged" signal
is emitted whenever the value changes.
-\snippet quick/tutorials/extending/chapter3-bindings/piechart.h 0
+\snippet tutorials/extending/chapter3-bindings/piechart.h 0
\dots
-\snippet quick/tutorials/extending/chapter3-bindings/piechart.h 1
+\snippet tutorials/extending/chapter3-bindings/piechart.h 1
\dots
-\snippet quick/tutorials/extending/chapter3-bindings/piechart.h 2
+\snippet tutorials/extending/chapter3-bindings/piechart.h 2
\dots
-\snippet quick/tutorials/extending/chapter3-bindings/piechart.h 3
+\snippet tutorials/extending/chapter3-bindings/piechart.h 3
Then, we emit this signal in \c setPieSlice():
-\snippet quick/tutorials/extending/chapter3-bindings/piechart.cpp 0
+\snippet tutorials/extending/chapter3-bindings/piechart.cpp 0
It's important for \c setColor() to check that the color value has actually changed
before emitting \c colorChanged(). This ensures the signal is not emitted unnecessarily and
@@ -299,43 +299,43 @@ For example, let's replace the use of the \c property with a type called
"PieSlice" that has a \c color property. Instead of assigning a color,
we assign an \c PieSlice value which itself contains a \c color:
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
+\snippet tutorials/extending/chapter4-customPropertyTypes/app.qml 0
Like \c PieChart, this new \c PieSlice type inherits from QQuickPaintedItem and declares
its properties with Q_PROPERTY():
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
+\snippet tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
To use it in \c PieChart, we modify the \c color property declaration
and associated method signatures:
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
+\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
\dots
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
+\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
\dots
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
+\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
\dots
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3
+\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.h 3
There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice
is a visual item, so it must be set as a child of the \c PieChart using
QQuickItem::setParentItem() so that the \c PieChart knows to paint this child
item when its contents are drawn:
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
+\snippet tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
Like the \c PieChart type, the \c PieSlice type has to be registered
using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the
type to the "Charts" type namespace, version 1.0:
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
+\snippet tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
\dots
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp 1
+\snippet tutorials/extending/chapter4-customPropertyTypes/main.cpp 1
\dots
-\snippet quick/tutorials/extending/chapter4-customPropertyTypes/main.cpp 2
+\snippet tutorials/extending/chapter4-customPropertyTypes/main.cpp 2
-Try it out with the code in Qt's \c examples/quick/tutorials/extending/chapter4-customPropertyTypes directory.
+Try it out with the code in Qt's \c examples/qml/tutorials/extending/chapter4-customPropertyTypes directory.
*/
@@ -349,7 +349,7 @@ Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would
have multiple slices, with different colors and sizes. To do this, we could
have a \c slices property that accepts a list of \c PieSlice items:
-\snippet quick/tutorials/extending/chapter5-listproperties/app.qml 0
+\snippet tutorials/extending/chapter5-listproperties/app.qml 0
\image extending-tutorial-chapter5.png
@@ -360,11 +360,11 @@ function with a \c slices() function that returns a list of slices, and add
an internal \c append_slice() function (discussed below). We also use a QList to
store the internal list of slices as \c m_slices:
-\snippet quick/tutorials/extending/chapter5-listproperties/piechart.h 0
+\snippet tutorials/extending/chapter5-listproperties/piechart.h 0
\dots
-\snippet quick/tutorials/extending/chapter5-listproperties/piechart.h 1
+\snippet tutorials/extending/chapter5-listproperties/piechart.h 1
\dots
-\snippet quick/tutorials/extending/chapter5-listproperties/piechart.h 2
+\snippet tutorials/extending/chapter5-listproperties/piechart.h 2
Although the \c slices property does not have an associated \c WRITE function,
it is still modifiable because of the way QQmlListProperty works.
@@ -373,7 +373,7 @@ return a QQmlListProperty value and indicate that the internal
\c PieChart::append_slice() function is to be called whenever a request is made from QML
to add items to the list:
-\snippet quick/tutorials/extending/chapter5-listproperties/piechart.cpp 0
+\snippet tutorials/extending/chapter5-listproperties/piechart.cpp 0
The \c append_slice() function simply sets the parent item as before,
and adds the new item to the \c m_slices list. As you can see, the append function for a
@@ -384,7 +384,7 @@ The \c PieSlice class has also been modified to include \c fromAngle and \c angl
properties and to draw the slice according to these values. This is a straightforward
modification if you have read the previous pages in this tutorial, so the code is not shown here.
-The complete code can be seen in the updated \c examples/quick/tutorials/extending/chapter5-listproperties directory.
+The complete code can be seen in the updated \c examples/qml/tutorials/extending/chapter5-listproperties directory.
*/
@@ -407,22 +407,22 @@ and registers our QML types in the inherited \l{QQmlExtensionPlugin::}{registerT
Here is the \c ChartsPlugin definition in \c chartsplugin.h:
-\snippet quick/tutorials/extending/chapter6-plugins/chartsplugin.h 0
+\snippet tutorials/extending/chapter6-plugins/chartsplugin.h 0
And its implementation in \c chartsplugin.cpp:
-\snippet quick/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
+\snippet tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
Then, we write a \c .pro project file that defines the project as a plugin library
and specifies with DESTDIR that library files should be built into a "lib" subdirectory:
-\quotefile quick/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+\quotefile tutorials/extending/chapter6-plugins/chapter6-plugins.pro
Finally, we add a \l{qtqml-modules-qmldir.html}{qmldir} file that is
parsed by the QML engine. In this file, we specify that a plugin named
"chapter6-plugin" (the name of the example project) can be found in the "lib" subdirectory:
-\quotefile quick/tutorials/extending/chapter6-plugins/Charts/qmldir
+\quotefile tutorials/extending/chapter6-plugins/Charts/qmldir
Now we have a plugin, and instead of having a main.cpp and an executable, we can build
the project and then load the QML file using the \l{Prototyping with qmlscene}{qmlscene tool},
diff --git a/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc b/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
index 421b180f7b..e54404d2fd 100644
--- a/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
+++ b/src/qml/doc/src/javascript/dynamicobjectcreation.qdoc
@@ -35,15 +35,15 @@ useful to delay instantiation of objects until necessary, thereby improving
application startup time. It also allows visual objects to be dynamically
created and added to the scene in reaction to user input or other events.
-See the \l {declarative/toys/dynamicscene}{Dynamic Scene example} for a
+See the \l {QML Example - Dynamic Scene}{Dynamic Scene example} for a
demonstration of the concepts discussed on this page.
\section1 Creating Objects Dynamically
There are two ways to create objects dynamically from JavaScript. You can
-either call \l {QML:Qt::createComponent()}{Qt.createComponent()} to
-dynamically create a \l Component object, or use \l{QML:Qt::createQmlObject()}
+either call \l {QtQml2::Qt::createComponent()}{Qt.createComponent()} to
+dynamically create a \l Component object, or use \l{QtQml2::Qt::createQmlObject()}
{Qt.createQmlObject()} to create an object from a string of QML. Creating a
component is better if you have an existing component defined in a QML document
and you want to dynamically create instances of that component. Otherwise,
@@ -54,7 +54,7 @@ generated at runtime.
\section2 Creating a Component Dynamically
To dynamically load a component defined in a QML file, call the
-\l {QML:Qt::createComponent()}{Qt.createComponent()} function in the
+\l {QtQml2::Qt::createComponent()}{Qt.createComponent()} function in the
\l {QmlGlobalQtObject}{Qt object}.
This function takes the URL of the QML file as its only argument and creates
a \l Component object from this URL.
@@ -113,7 +113,7 @@ created object is a visual (Qt Quick) object. The created object will become a
child of the \c appWindow object in \c main.qml, and appear in the scene.
When using files with relative paths, the path should
-be relative to the file where \l {QML:Qt::createComponent()}
+be relative to the file where \l {QtQml2::Qt::createComponent()}
{Qt.createComponent()} is executed.
To connect signals to (or receive signals from) dynamically created objects,
@@ -127,7 +127,7 @@ It is also possible to instantiate components without blocking via the
\section2 Creating an Object from a String of QML
If the QML is not defined until runtime, you can create a QML object from
-a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+a string of QML using the \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()}
function, as in the following example:
\snippet qml/createQmlObject.qml 0
@@ -153,9 +153,9 @@ first, the bindings in the dynamic object will no longer work.
The actual creation context depends on how an object is created:
\list
-\li If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the
+\li If \l {QtQml2::Qt::createComponent()}{Qt.createComponent()} is used, the
creation context is the QQmlContext in which this method is called
-\li If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} is called, the
+\li If \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()} is called, the
creation context is the context of the parent object passed to this method
\li If a \c {Component{}} object is defined and \l {Component::createObject()}
{createObject()} or \l {Component::incubateObject()}{incubateObject()} is
@@ -221,7 +221,7 @@ Item {
This would result in an error, since objects can only be dynamically
destroyed if they were dynamically created.
-Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+Objects created with \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()}
can similarly be destroyed using \c destroy():
\snippet qml/createQmlObject.qml 0
diff --git a/src/qml/doc/src/javascript/imports.qdoc b/src/qml/doc/src/javascript/imports.qdoc
index f4d7f7dc08..809b74ed52 100644
--- a/src/qml/doc/src/javascript/imports.qdoc
+++ b/src/qml/doc/src/javascript/imports.qdoc
@@ -125,14 +125,14 @@ When a JavaScript file is imported, it must be imported with a qualifier. The
functions in that file are then accessible from the importing script via the
qualifier (that is, as \tt{Qualifier.functionName(params)}). Sometimes it is
desirable to have the functions made available in the importing context without
-needing to qualify them, and in this circumstance the \l{QML:Qt::include()}
+needing to qualify them, and in this circumstance the \l{QtQml2::Qt::include()}
{Qt.include()} function may be used to include one JavaScript file from another.
This copies all functions from the other file into the current file's
namespace, but ignores all pragmas and imports defined in that file.
For example, the QML code below left calls \c showCalculations() in \c script.js,
which in turn can call \c factorial() in \c factorial.js, as it has included
-\c factorial.js using \l {QML:Qt::include()}{Qt.include()}.
+\c factorial.js using \l {QtQml2::Qt::include()}{Qt.include()}.
\table
\row
@@ -142,7 +142,7 @@ which in turn can call \c factorial() in \c factorial.js, as it has included
\li \snippet qml/integrating-javascript/includejs/factorial.js 0
\endtable
-Notice that calling \l {QML:Qt::include()}{Qt.include()} copies all functions
+Notice that calling \l {QtQml2::Qt::include()}{Qt.include()} copies all functions
from \c factorial.js into the \c MyScript namespace, which means the QML
component can also access \c factorial() directly as \c MyScript.factorial().
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index 976403adea..386f9f49df 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -47,6 +47,20 @@
#include <QtQml> to use this macro.
*/
+/*!
+ \fn void qmlClearTypeRegistrations()
+ \relates QQmlEngine
+
+ Clears all stored type registrations, such as those produced with \l qmlRegisterType.
+
+ Do not call this function while a QQmlEngine exists or behavior will be undefined.
+ Any existing QQmlEngines must be deleted before calling this function. This function
+ only affects the application global cache. Delete the QQmlEngine to clear all cached
+ data relating to that engine.
+
+ #include <QtQml> to use this method.
+*/
+
/*!
\fn int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
diff --git a/src/qml/doc/src/qmllanguageref/documents/topic.qdoc b/src/qml/doc/src/qmllanguageref/documents/topic.qdoc
index f8a402476c..aed89f6423 100644
--- a/src/qml/doc/src/qmllanguageref/documents/topic.qdoc
+++ b/src/qml/doc/src/qmllanguageref/documents/topic.qdoc
@@ -91,13 +91,13 @@ separation between UI definition and logic implementation.
In the following example, the client developer defines a \c Button type with
a document in a file:
-\snippet ../src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml 0
+\snippet ../quick/doc/snippets/qml/qml-extending-types/components/Button.qml 0
The \c Button type can then be used in an application:
\table
\row
-\li \snippet ../src/quick/doc/snippets/qml/qml-extending-types/components/application.qml 0
+\li \snippet ../quick/doc/snippets/qml/qml-extending-types/components/application.qml 0
\li \image button-types.png
\endtable
diff --git a/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc b/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc
index af2a36c903..7ac1d400eb 100644
--- a/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc
+++ b/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc
@@ -68,7 +68,7 @@
as a new QML type. It provides the current time through \c hour and \c minute
properties.
- \snippet qml/plugins/plugin.cpp 0
+ \snippet plugins/plugin.cpp 0
\dots
To make this type available, we create a plugin class named \c QExampleQmlPlugin
@@ -78,7 +78,7 @@
definition to register the plugin with the Qt meta object system using a unique
identifier for the plugin.
- \snippet qml/plugins/plugin.cpp plugin
+ \snippet plugins/plugin.cpp plugin
The \c TimeModel class receives a \c{1.0} version of this plugin library, as
a QML type called \c Time. The Q_ASSERT() macro can ensure the type namespace is
@@ -111,13 +111,13 @@
that is built by the project (as shown above in the \c .pro file) so both of these
need to be specified in the \c qmldir file:
- \quotefile qml/plugins/imports/TimeExample/qmldir
+ \quotefile plugins/imports/TimeExample/qmldir
Once the project is built and installed, the new \c Time component is
accessible by any QML component that imports the \c TimeExample
module
- \snippet qml/plugins/plugins.qml 0
+ \snippet plugins/plugins.qml 0
The full source code is available in the \l {qml/plugins}{plugins example}.
diff --git a/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc b/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc
index de3698c533..57d54e27e0 100644
--- a/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc
+++ b/src/qml/doc/src/qmllanguageref/modules/qmldir.qdoc
@@ -223,6 +223,11 @@ cannot be used if an earlier version is imported. If the client had imported
version 1.0 of the module, they can use the \c MyButton type but \b not the
\c MyWindow type.
+A version cannot be imported if no types have been explicitly exported for that
+version. If a module provides a \c MyButton type in version 1.0 and a
+\c MyWindow type in version 1.1, you cannot import version 1.2 or version 2.0 of
+that module.
+
A type can be defined by different files in different versions. In this case,
the most closely matching version will be used when imported by clients.
For example, if a module had specified the following types via its \c qmldir
@@ -363,7 +368,7 @@ Module {
// The name of the type containing attached properties
// and methods.
- attachedType: "QDeclarativeAnimationAttached"
+ attachedType: "QQuickAnimationAttached"
// The list of exports determines how a type can be imported.
// Each string has the format "URI/Name version" and matches the
diff --git a/src/qml/doc/src/qmllanguageref/qmlreference.qdoc b/src/qml/doc/src/qmllanguageref/qmlreference.qdoc
index 34336c2def..0bc8f90238 100644
--- a/src/qml/doc/src/qmllanguageref/qmlreference.qdoc
+++ b/src/qml/doc/src/qmllanguageref/qmlreference.qdoc
@@ -52,15 +52,6 @@ modules.
\li \l{qtqml-syntax-basics.html#comments}{Comments}
\endlist
- \li \l{qtqml-javascript-topic.html}{Integrating QML and JavaScript}
- \list
- \li \l{qtqml-javascript-expressions.html}{Using JavaScript Expressions with QML}
- \li \l{qtqml-javascript-dynamicobjectcreation.html}{Dynamic QML Object Creation from JavaScript}
- \li \l{qtqml-javascript-resources.html}{Defining JavaScript Resources In QML}
- \li \l{qtqml-javascript-imports.html}{Importing JavaScript Resources In QML}
- \li \l{qtqml-javascript-hostenvironment.html}{JavaScript Host Environment}
- \endlist
-
\li \l{qtqml-syntax-objectattributes.html}{QML Object Attributes}
\list
\li \l{qtqml-syntax-objectattributes.html#the-id-attribute}{The \e id Attribute}
@@ -71,8 +62,18 @@ modules.
\endlist
\li \l{qtqml-syntax-propertybinding.html}{Property Binding}
+
\li \l{qtqml-syntax-signals.html}{Signal and Handler Event System}
+ \li \l{qtqml-javascript-topic.html}{Integrating QML and JavaScript}
+ \list
+ \li \l{qtqml-javascript-expressions.html}{Using JavaScript Expressions with QML}
+ \li \l{qtqml-javascript-dynamicobjectcreation.html}{Dynamic QML Object Creation from JavaScript}
+ \li \l{qtqml-javascript-resources.html}{Defining JavaScript Resources In QML}
+ \li \l{qtqml-javascript-imports.html}{Importing JavaScript Resources In QML}
+ \li \l{qtqml-javascript-hostenvironment.html}{JavaScript Host Environment}
+ \endlist
+
\li \l{qtqml-typesystem-topic.html}{The QML Type System}
\list
\li \l{qtqml-typesystem-basictypes.html}{Basic Types}
diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
index fba072d2e4..6344d16caa 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc
@@ -27,7 +27,6 @@
/*!
\page qtqml-syntax-signals.html
-\ingroup qml-features
\title Signal and Handler Event System
\brief the event sytem in QML
@@ -294,4 +293,3 @@ output:
*/
-
diff --git a/src/qml/doc/src/qmltypereference.qdoc b/src/qml/doc/src/qmltypereference.qdoc
index 54e10b63a8..f0aadbaf32 100644
--- a/src/qml/doc/src/qmltypereference.qdoc
+++ b/src/qml/doc/src/qmltypereference.qdoc
@@ -93,7 +93,7 @@ MyDatePicker { minDate: "2000-01-01"; maxDate: "2020-12-31" }
\endqml
To read a date value returned from a C++ extension class, use
-\l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatDate()}{Qt.formatDate()} and \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
When integrating with C++, note that any QDate value
\l{qtqml-cppintegration-data.html}{passed into QML from C++} is automatically
@@ -124,7 +124,7 @@ MyTimePicker { time: "14:22:15" }
\endqml
To read a time value returned from a C++ extension class, use
-\l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatTime()}{Qt.formatTime()} and \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
Note that when converting historical times to and from javascript that QDateTime and the JS Date object
have different methods of calculating historical daylight savings time application. This can lead to variations of one hour
@@ -153,7 +153,7 @@ To create a \c point value, specify it as a "x,y" string:
CustomObject { myPointProperty: "0,20" }
\endqml
-Or use the \l{QML:Qt::point()}{Qt.point()} function:
+Or use the \l{QtQml2::Qt::point()}{Qt.point()} function:
\qml
CustomObject { myPointProperty: Qt.point(0, 20) }
@@ -191,7 +191,7 @@ To create a \c size value, specify it as a "width x height" string:
Image { sourceSize: "150x50" }
\endqml
-Or use the \l{QML:Qt::size()}{Qt.size()} function:
+Or use the \l{QtQml2::Qt::size()}{Qt.size()} function:
\qml
Image { sourceSize: Qt.size(150, 50) }
@@ -231,7 +231,7 @@ To create a \c rect value, specify it as a "x, y, width x height" string:
CustomObject { myRectProperty: "50,50,100x100" }
\endqml
-Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
+Or use the \l{QtQml2::Qt::rect()}{Qt.rect()} function:
\qml
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc
index 8bd41875fe..2c6bc640ff 100644
--- a/src/qml/doc/src/qtqml.qdoc
+++ b/src/qml/doc/src/qtqml.qdoc
@@ -31,7 +31,7 @@
\brief The Qt QML module defines and implements the QML language
The Qt QML module provides a framework for developing applications and libraries
-with the \l{The QML Language}{QML language}. It defines and implements the
+with the \l{QML Application Developer Resources}{QML language}. It defines and implements the
language and engine infrastructure, and provides an API to enable application
developers to extend the QML language with custom types and integrate QML code
with JavaScript and C++. The Qt QML module provides both a \l{Qt QML QML Types}
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index 154c7cfd0d..6ca979db37 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -94,7 +94,7 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the
\list
\li QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString.
-\li The \l {QML:Qt} object now provides a \l{QML:Qt::inputMethod} property to access the active
+\li The \l {QtQml2::Qt}{Qt} global object now provides an \l{QtQml2::Qt::inputMethod}{inputMethod} property to access the active
text input method for an application.
\endlist
diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri
index aafc50db9b..9b2926ec7e 100644
--- a/src/qml/qml/qml.pri
+++ b/src/qml/qml/qml.pri
@@ -51,6 +51,7 @@ SOURCES += \
$$PWD/qqmlmemoryprofiler.cpp \
$$PWD/qqmlplatform.cpp \
$$PWD/qqmlbinding.cpp \
+ $$PWD/qqmlabstracturlinterceptor.cpp \
$$PWD/qqmlapplicationengine.cpp
HEADERS += \
@@ -123,6 +124,7 @@ HEADERS += \
$$PWD/qqmlplatform_p.h \
$$PWD/qqmlbinding_p.h \
$$PWD/qqmlextensionplugin_p.h \
+ $$PWD/qqmlabstracturlinterceptor_p.h \
$$PWD/qqmlapplicationengine_p.h \
$$PWD/qqmlapplicationengine.h
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h
index 7e6e0d1d36..fb0133f305 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -102,6 +102,8 @@ class QQmlPropertyValueInterceptor;
listName[listLen+nameLen] = '>'; \
listName[listLen+nameLen+1] = '\0';
+void Q_QML_EXPORT qmlClearTypeRegistrations();
+
template<typename T>
int qmlRegisterType()
{
@@ -417,11 +419,17 @@ class QQmlContext;
class QQmlEngine;
class QJSValue;
class QJSEngine;
-Q_QML_EXPORT void qmlExecuteDeferred(QObject *);
-Q_QML_EXPORT QQmlContext *qmlContext(const QObject *);
-Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *);
-Q_QML_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true);
-Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create);
+
+namespace QtQml {
+ // declared in namespace to avoid symbol conflicts with QtDeclarative
+ Q_QML_EXPORT void qmlExecuteDeferred(QObject *);
+ Q_QML_EXPORT QQmlContext *qmlContext(const QObject *);
+ Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *);
+ Q_QML_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true);
+ Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *,
+ const QMetaObject *, bool create);
+}
+using namespace QtQml;
template<typename T>
QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
diff --git a/src/qml/qml/qqmlabstracturlinterceptor.cpp b/src/qml/qml/qqmlabstracturlinterceptor.cpp
new file mode 100644
index 0000000000..a68d5f7489
--- /dev/null
+++ b/src/qml/qml/qqmlabstracturlinterceptor.cpp
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \class QQmlAbstractUrlInterceptor
+ \inmodule QtQml
+ \brief allows you to control QML file loading.
+
+ \note This class is in an extended validation period and still subject to change. It should be treated as private API for 5.1
+
+ QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs
+ before they are used by the QML engine. This is primarily useful for altering
+ file urls into other file urls, such as selecting different graphical assets
+ for the current platform.
+
+ Relative URLs are intercepted after being resolved against the file path of the
+ current QML context. URL interception also occurs after setting the base path for
+ a loaded QML file. This means that the content loaded for that QML file uses the
+ intercepted URL, but inside the file the pre-intercepted URL is used for resolving
+ relative paths. This allows for interception of .qml file loading without needing
+ all paths (or local types) inside intercepted content to insert a different relative path.
+
+ Compared to setNetworkAccessManagerFactory, QQmlAbstractUrlInterceptor affects all URLs
+ and paths, including local files and embedded resource files. QQmlAbstractUrlInterceptor
+ is synchronous, and for asynchronous files must return a url with an asynchronous scheme
+ (such as http or a custom scheme handled by your own custom QNetworkAccessManager). You
+ can use a QQmlAbstractUrlInterceptor to change file URLs into networked URLs which are
+ handled by your own custom QNetworkAccessManager.
+
+ To implement support for a custom networked scheme, see setNetworkAccessManagerFactory.
+*/
+
+/*
+ \enum QQmlAbstractUrlInterceptor::DataType
+
+ Specifies where URL interception is taking place place.
+
+ Because QML loads qmldir files for locating types, there are two URLs involved in loading a QML type. The URL of the (possibly implicit) qmldir used for locating the type and the URL of the file which defines the type. Intercepting
+ both leads to either complex URL replacement or double URL replacements for the same file.
+
+ \value QmldirFile The URL being intercepted is for a Qmldir file. Intercepting this, but not the QmlFile, allows for swapping out entire sub trees.
+ \value JavaScriptFile The URL being intercepted is an import for a Javascript file.
+ \value QmlFile The URL being intercepted is for a Qml file. Intercepting this, but not the Qmldir file, leaves the base dir of a QML file untouched and acts like replacing the file with another file.
+ \value UrlString The URL being intercepted is a url property in a QML file, and not being used to load a file through the engine.
+
+*/
+
+/*!
+ \fn QUrl QQmlAbstractUrlInterceptor::intercept(const QUrl& url, DataType type)
+
+ A pure virtual function where you can intercept the url. The returned value is taken as the
+ new value for the url. The type of url being intercepted is given by the type variable.
+*/
diff --git a/src/qml/qml/qqmlabstracturlinterceptor_p.h b/src/qml/qml/qqmlabstracturlinterceptor_p.h
new file mode 100644
index 0000000000..186d59e301
--- /dev/null
+++ b/src/qml/qml/qqmlabstracturlinterceptor_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//Private API for 5.1 (at least)
+#ifndef QQMLABSTRACTURLINTERCEPTOR_H
+#define QQMLABSTRACTURLINTERCEPTOR_H
+
+#include <QtCore/qurl.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_QML_EXPORT QQmlAbstractUrlInterceptor
+{
+ Q_FLAGS(InterceptionPoint)
+public:
+ enum DataType { //Matches QQmlDataBlob::Type
+ QmlFile = 0,
+ JavaScriptFile = 1,
+ QmldirFile = 2,
+ UrlString = 0x1000
+ };
+
+ QQmlAbstractUrlInterceptor() {}
+ virtual ~QQmlAbstractUrlInterceptor() {}
+ virtual QUrl intercept(const QUrl &path, DataType type) = 0;
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp
index a5f8f463c9..25095a465e 100644
--- a/src/qml/qml/qqmlapplicationengine.cpp
+++ b/src/qml/qml/qqmlapplicationengine.cpp
@@ -133,7 +133,8 @@ void QQmlApplicationEnginePrivate::_q_finishLoad(QObject *o)
case QQmlComponent::Null:
return; //These cases just wait for the next status update
}
- delete c;
+
+ c->deleteLater();
}
/*!
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp
index 7279762565..cd527f6b1b 100644
--- a/src/qml/qml/qqmlcompileddata.cpp
+++ b/src/qml/qml/qqmlcompileddata.cpp
@@ -223,7 +223,6 @@ QQmlInstruction::Type QQmlCompiledData::instructionType(const QQmlInstruction *i
return QQmlInstruction::I;
FOR_EACH_QML_INSTR(QML_CHECK_INSTR_CODE)
- Q_UNREACHABLE();
Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid instruction address");
return static_cast<QQmlInstruction::Type>(0);
# undef QML_CHECK_INSTR_CODE
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp
index 6951c8c387..7b27a4c314 100644
--- a/src/qml/qml/qqmlcompiler.cpp
+++ b/src/qml/qml/qqmlcompiler.cpp
@@ -60,6 +60,7 @@
#include "qqmlscriptstring.h"
#include "qqmlglobal_p.h"
#include "qqmlbinding_p.h"
+#include "qqmlabstracturlinterceptor_p.h"
#include <private/qv4compiler_p.h>
#include <QDebug>
@@ -517,6 +518,10 @@ void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop,
// Encoded dir-separators defeat QUrl processing - decode them first
string.replace(QLatin1String("%2f"), QLatin1String("/"), Qt::CaseInsensitive);
QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string));
+ // Apply URL interceptor
+ if (engine->urlInterceptor())
+ u = engine->urlInterceptor()->intercept(u,
+ QQmlAbstractUrlInterceptor::UrlString);
instr.propertyIndex = prop->index;
instr.value = output->indexForUrl(u);
output->addInstruction(instr);
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 7cf7c5475e..ccef0a6bb6 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -229,7 +229,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
to specify how each list item is to be displayed.
\c Component objects can also be created dynamically using
- \l{QML:Qt::createComponent()}{Qt.createComponent()}.
+ \l{QtQml2::Qt::createComponent()}{Qt.createComponent()}.
\section2 Creation Context
@@ -1226,9 +1226,8 @@ void QQmlComponent::createObject(QQmlV8Function *args)
instances to be instantiated asynchronously and not cause freezes in the UI.
The \a parent argument specifies the parent the created instance will have. Omitting the
- parameter or passing null will create anobject with no parent. In this case, a reference
- to the created object must be maintained by the application of the object will eventually
- be garbage collected.
+ parameter or passing null will create an object with no parent. In this case, a reference
+ to the created object must be held so that it is not destroyed by the garbage collector.
The \a properties argument is specified as a map of property-value items which will be
set on the created object during its construction. \a mode may be Qt.Synchronous or
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index e0a16d1f44..7fa2472335 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -48,6 +48,7 @@
#include "qqmlengine_p.h"
#include "qqmlengine.h"
#include "qqmlinfo.h"
+#include "qqmlabstracturlinterceptor_p.h"
#include <private/qv4bindings_p.h>
#include <private/qv8bindings_p.h>
@@ -431,6 +432,7 @@ QUrl QQmlContextData::resolvedUrl(const QUrl &src)
{
QQmlContextData *ctxt = this;
+ QUrl resolved;
if (src.isRelative() && !src.isEmpty()) {
if (ctxt) {
while(ctxt) {
@@ -441,14 +443,20 @@ QUrl QQmlContextData::resolvedUrl(const QUrl &src)
}
if (ctxt)
- return ctxt->url.resolved(src);
+ resolved = ctxt->url.resolved(src);
else if (engine)
- return engine->baseUrl().resolved(src);
+ resolved = engine->baseUrl().resolved(src);
}
- return QUrl();
} else {
- return src;
+ resolved = src;
}
+
+ if (resolved.isEmpty()) //relative but no ctxt
+ return resolved;
+
+ if (engine && engine->urlInterceptor())
+ resolved = engine->urlInterceptor()->intercept(resolved, QQmlAbstractUrlInterceptor::UrlString);
+ return resolved;
}
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h
index 14f1fef90a..cedb2d688a 100644
--- a/src/qml/qml/qqmldata_p.h
+++ b/src/qml/qml/qqmldata_p.h
@@ -82,7 +82,7 @@ public:
hasTaintedV8Object(false), isQueuedForDeletion(false), rootObjectInCreation(false),
hasVMEMetaObject(false), parentFrozen(false), notifyList(0), context(0), outerContext(0),
bindings(0), signalHandlers(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0),
- lineNumber(0), columnNumber(0), compiledData(0), deferredIdx(0), v8objectid(0),
+ lineNumber(0), columnNumber(0), compiledData(0), deferredData(0), v8objectid(0),
propertyCache(0), guards(0), extendedData(0) {
init();
}
@@ -173,8 +173,13 @@ public:
quint16 lineNumber;
quint16 columnNumber;
+ struct DeferredData {
+ unsigned int deferredIdx;
+ QQmlCompiledData *compiledData;//Not always the same as the other compiledData
+ QQmlContextData *context;//Could be either context or outerContext
+ };
QQmlCompiledData *compiledData;
- unsigned int deferredIdx;
+ DeferredData *deferredData;
quint32 v8objectid;
v8::Persistent<v8::Object> v8object;
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 2e875a37fc..a304365dfe 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -66,6 +66,7 @@
#include <private/qv8debugservice_p.h>
#include <private/qdebugmessageservice_p.h>
#include "qqmlincubator.h"
+#include "qqmlabstracturlinterceptor_p.h"
#include <private/qv8profilerservice_p.h>
#include <private/qqmlboundsignal_p.h>
@@ -274,8 +275,9 @@ QQmlImageProviderBase::~QQmlImageProviderBase()
/*!
\qmltype Qt
- \instantiates QQmlEnginePrivate
- \ingroup qml-utility-elements
+\inqmlmodule QtQml 2
+\instantiates QQmlEnginePrivate
+\ingroup qml-utility-elements
\brief The QML global Qt object provides useful enums and functions from Qt.
\keyword QmlGlobalQtObject
@@ -509,7 +511,7 @@ QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e)
outputWarningsToStdErr(true), sharedContext(0), sharedScope(0),
cleanup(0), erroredBindings(0), inProgressCreations(0),
workerScriptEngine(0), activeVME(0),
- networkAccessManager(0), networkAccessManagerFactory(0),
+ networkAccessManager(0), networkAccessManagerFactory(0), urlInterceptor(0),
scarceResourcesRefCount(0), typeLoader(e), importDatabase(e), uniqueId(1),
incubatorCount(0), incubationController(0), mutex(QMutex::Recursive)
{
@@ -721,17 +723,17 @@ void QQmlData::flushPendingBindingImpl(int coreIndex)
}
}
+bool QQmlEnginePrivate::baseModulesUninitialized = true;
void QQmlEnginePrivate::init()
{
Q_Q(QQmlEngine);
- static bool firstTime = true;
- if (firstTime) {
+ if (baseModulesUninitialized) {
qmlRegisterType<QQmlComponent>("QML", 1, 0, "Component"); // required for the Compiler.
registerBaseTypes("QtQml", 2, 0); // import which provides language building blocks.
QQmlData::init();
- firstTime = false;
+ baseModulesUninitialized = false;
}
qRegisterMetaType<QVariant>();
@@ -831,6 +833,8 @@ QQmlEngine::QQmlEngine(QQmlEnginePrivate &dd, QObject *parent)
Any QQmlContext's created on this engine will be
invalidated, but not destroyed (unless they are parented to the
QQmlEngine object).
+
+ See QJSEngine docs for details on cleaning up the JS engine.
*/
QQmlEngine::~QQmlEngine()
{
@@ -923,6 +927,35 @@ QQmlContext *QQmlEngine::rootContext() const
}
/*!
+ \internal
+ This API is private for 5.1
+
+ Sets the \a urlInterceptor to be used when resolving URLs in QML.
+ This also applies to URLs used for loading script files and QML types.
+ This should not be modifed while the engine is loading files, or URL
+ selection may be inconsistent.
+*/
+void QQmlEngine::setUrlInterceptor(QQmlAbstractUrlInterceptor *urlInterceptor)
+{
+ Q_D(QQmlEngine);
+ d->urlInterceptor = urlInterceptor;
+}
+
+/*!
+ \internal
+ This API is private for 5.1
+
+ Returns the current QQmlAbstractUrlInterceptor. It must not be modified outside
+ the GUI thread.
+*/
+QQmlAbstractUrlInterceptor *QQmlEngine::urlInterceptor() const
+{
+ Q_D(const QQmlEngine);
+ return d->urlInterceptor;
+}
+
+
+/*!
Sets the \a factory to use for creating QNetworkAccessManager(s).
QNetworkAccessManager is used for all network access by QML. By
@@ -1246,11 +1279,13 @@ void QQmlEnginePrivate::doDeleteInEngineThread()
delete d;
}
-Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object)
+namespace QtQml {
+
+void qmlExecuteDeferred(QObject *object)
{
QQmlData *data = QQmlData::get(object);
- if (data && data->compiledData && data->deferredIdx) {
+ if (data && data->deferredData) {
QQmlObjectCreatingProfiler prof;
if (prof.enabled) {
QQmlType *type = QQmlMetaType::qmlType(object->metaObject());
@@ -1265,8 +1300,9 @@ Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object)
QQmlComponentPrivate::beginDeferred(ep, object, &state);
// Release the reference for the deferral action (we still have one from construction)
- data->compiledData->release();
- data->compiledData = 0;
+ data->deferredData->compiledData->release();
+ delete data->deferredData;
+ data->deferredData = 0;
QQmlComponentPrivate::complete(ep, &state);
}
@@ -1319,6 +1355,41 @@ QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
return qmlAttachedPropertiesObjectById(*idCache, object, create);
}
+} // namespace QtQml
+
+#if QT_DEPRECATED_SINCE(5, 1)
+
+// Also define symbols outside namespace to keep binary compatibility with Qt 5.0
+
+Q_QML_EXPORT void qmlExecuteDeferred(QObject *obj)
+{
+ QtQml::qmlExecuteDeferred(obj);
+}
+
+Q_QML_EXPORT QQmlContext *qmlContext(const QObject *obj)
+{
+ return QtQml::qmlContext(obj);
+}
+
+Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *obj)
+{
+ return QtQml::qmlEngine(obj);
+}
+
+Q_QML_EXPORT QObject *qmlAttachedPropertiesObjectById(int id, const QObject *obj, bool create)
+{
+ return QtQml::qmlAttachedPropertiesObjectById(id, obj, create);
+}
+
+Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
+ const QMetaObject *attachedMetaObject,
+ bool create)
+{
+ return QtQml::qmlAttachedPropertiesObject(idCache, object, attachedMetaObject, create);
+}
+
+#endif // QT_DEPRECATED_SINCE(5, 1)
+
QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
{
#ifndef QQML_NO_DEBUG_PROTOCOL
@@ -1472,6 +1543,12 @@ void QQmlData::destroyed(QObject *object)
compiledData = 0;
}
+ if (deferredData) {
+ deferredData->compiledData->release();
+ delete deferredData;
+ deferredData = 0;
+ }
+
QQmlAbstractBoundSignal *signalHandler = signalHandlers;
while (signalHandler) {
if (signalHandler->isEvaluating()) {
diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h
index 45826a4a67..ab25e06235 100644
--- a/src/qml/qml/qqmlengine.h
+++ b/src/qml/qml/qqmlengine.h
@@ -51,6 +51,7 @@
QT_BEGIN_NAMESPACE
+class QQmlAbstractUrlInterceptor;
class Q_QML_EXPORT QQmlImageProviderBase
{
@@ -119,6 +120,9 @@ public:
QNetworkAccessManager *networkAccessManager() const;
+ void setUrlInterceptor(QQmlAbstractUrlInterceptor* urlInterceptor);
+ QQmlAbstractUrlInterceptor* urlInterceptor() const;
+
void addImageProvider(const QString &id, QQmlImageProviderBase *);
QQmlImageProviderBase *imageProvider(const QString &id) const;
void removeImageProvider(const QString &id);
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index b5af0bb7cd..0d852c1c1b 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -125,6 +125,9 @@ public:
~QQmlEnginePrivate();
void init();
+ // No mutex protecting baseModulesUninitialized, because use outside QQmlEngine
+ // is just qmlClearTypeRegistrations (which can't be called while an engine exists)
+ static bool baseModulesUninitialized;
class PropertyCapture {
public:
@@ -173,6 +176,8 @@ public:
QHash<QString,QSharedPointer<QQmlImageProviderBase> > imageProviders;
+ QQmlAbstractUrlInterceptor* urlInterceptor;
+
// Scarce resources are "exceptionally high cost" QVariant types where allowing the
// normal JavaScript GC to clean them up is likely to lead to out-of-memory or other
// out-of-resource situations. When such a resource is passed into JavaScript we
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index babdd6ea71..f77b176404 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -54,10 +54,10 @@ QT_BEGIN_NAMESPACE
QQmlExtensionPlugin is a plugin interface that makes it possible to
create QML extensions that can be loaded dynamically into QML applications.
- These extensions allow custom QML types to be made available to the QML engine.
-
+ These extensions allow custom QML types to be made available to the QML engine.
+
To write a QML extension plugin:
-
+
\list
\li Subclass QQmlExtensionPlugin, implement registerTypes() method to register types
using qmlRegisterType(), and export the class using the Q_PLUGIN_METADATA() macro
@@ -74,10 +74,10 @@ QT_BEGIN_NAMESPACE
\section1 An example
Suppose there is a new \c TimeModel C++ class that should be made available
- as a new QML element. It provides the current time through \c hour and \c minute
+ as a new QML element. It provides the current time through \c hour and \c minute
properties, like this:
- \snippet qml/plugins/plugin.cpp 0
+ \snippet plugins/plugin.cpp 0
\dots
To make this class available as a QML type, create a plugin that registers
@@ -85,13 +85,13 @@ QT_BEGIN_NAMESPACE
module will be named \c TimeExample (as defined in the project
file further below).
- \snippet qml/plugins/plugin.cpp plugin
+ \snippet plugins/plugin.cpp plugin
- This registers the \c TimeModel class with the 1.0 version of this
- plugin library, as a QML type called \c Time. The Q_ASSERT statement
+ This registers the \c TimeModel class with the 1.0 version of this
+ plugin library, as a QML type called \c Time. The Q_ASSERT statement
ensures the module is imported correctly by any QML components that use this plugin.
- The project file defines the project as a plugin library and specifies
+ The project file defines the project as a plugin library and specifies
it should be built into the \c imports/TimeExample directory:
\code
@@ -102,19 +102,19 @@ QT_BEGIN_NAMESPACE
DESTDIR = imports/TimeExample
TARGET = qmlqtimeexampleplugin
...
- \endcode
+ \endcode
Finally, a \l{Module Definition qmldir Files}{qmldir file} is required in the \c imports/TimeExample directory
that describes the plugin. This directory includes a \c Clock.qml file that
should be bundled with the plugin, so it needs to be specified in the \c qmldir
file:
- \quotefile qml/plugins/imports/TimeExample/qmldir
+ \quotefile plugins/imports/TimeExample/qmldir
- Once the project is built and installed, the new \c Time element can be
+ Once the project is built and installed, the new \c Time element can be
used by any QML component that imports the \c TimeExample module:
- \snippet qml/plugins/plugins.qml 0
+ \snippet plugins/plugins.qml 0
The full source code is available in the \l {qml/plugins}{plugins example}.
@@ -134,7 +134,7 @@ QT_BEGIN_NAMESPACE
plugin.
The \a uri is an identifier for the plugin generated by the QML engine
- based on the name and path of the extension's plugin library.
+ based on the name and path of the extension's plugin library.
*/
/*!
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 08e255084a..50b2c8af0d 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -163,6 +163,14 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa
typedef QMap<QString, QString> StringStringMap;
Q_GLOBAL_STATIC(StringStringMap, qmlEnginePluginsWithRegisteredTypes); // stores the uri
+void qmlClearEnginePlugins()
+{
+ foreach (const QString &s, qmlEnginePluginsWithRegisteredTypes()->values()) {
+ QPluginLoader loader(s);
+ loader.unload(); // ### Always returns false, worth doing?
+ }
+ qmlEnginePluginsWithRegisteredTypes()->clear();
+}
class QQmlImportNamespace
{
diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h
index 140ca6695e..06b50c09e9 100644
--- a/src/qml/qml/qqmlimport_p.h
+++ b/src/qml/qml/qqmlimport_p.h
@@ -182,6 +182,8 @@ private:
QQmlEngine *engine;
};
+void qmlClearEnginePlugins();// For internal use by qmlClearRegisteredProperties
+
QT_END_NAMESPACE
#endif // QQMLIMPORT_P_H
diff --git a/src/qml/qml/qqmlinfo.cpp b/src/qml/qml/qqmlinfo.cpp
index 66670e2658..32f0eeef36 100644
--- a/src/qml/qml/qqmlinfo.cpp
+++ b/src/qml/qml/qqmlinfo.cpp
@@ -165,6 +165,8 @@ QQmlInfo::~QQmlInfo()
}
}
+namespace QtQml {
+
QQmlInfo qmlInfo(const QObject *me)
{
QQmlInfoPrivate *d = new QQmlInfoPrivate;
@@ -188,5 +190,27 @@ QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors)
return QQmlInfo(d);
}
+} // namespace QtQml
+
+#if QT_DEPRECATED_SINCE(5, 1)
+
+// Also define symbols outside namespace to keep binary compatibility with Qt 5.0
+
+QQmlInfo qmlInfo(const QObject *me)
+{
+ return QtQml::qmlInfo(me);
+}
+
+QQmlInfo qmlInfo(const QObject *me, const QQmlError &error)
+{
+ return QtQml::qmlInfo(me, error);
+}
+
+QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors)
+{
+ return QtQml::qmlInfo(me, errors);
+}
+
+#endif // QT_DEPRECATED_SINCE(5, 1)
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlinfo.h b/src/qml/qml/qqmlinfo.h
index 16fca9428e..56ac788624 100644
--- a/src/qml/qml/qqmlinfo.h
+++ b/src/qml/qml/qqmlinfo.h
@@ -48,6 +48,15 @@
QT_BEGIN_NAMESPACE
+class QQmlInfo;
+
+namespace QtQml {
+ // declared in namespace to avoid symbol conflicts with QtDeclarative
+ Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me);
+ Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error);
+ Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors);
+}
+using namespace QtQml;
class QQmlInfoPrivate;
class Q_QML_EXPORT QQmlInfo : public QDebug
@@ -82,18 +91,14 @@ public:
#endif
private:
- friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me);
- friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error);
- friend Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors);
+ friend Q_QML_EXPORT QQmlInfo QtQml::qmlInfo(const QObject *me);
+ friend Q_QML_EXPORT QQmlInfo QtQml::qmlInfo(const QObject *me, const QQmlError &error);
+ friend Q_QML_EXPORT QQmlInfo QtQml::qmlInfo(const QObject *me, const QList<QQmlError> &errors);
QQmlInfo(QQmlInfoPrivate *);
QQmlInfoPrivate *d;
};
-Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me);
-Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error);
-Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList<QQmlError> &errors);
-
QT_END_NAMESPACE
#endif // QQMLINFO_H
diff --git a/src/qml/qml/qqmlinstruction.cpp b/src/qml/qml/qqmlinstruction.cpp
index c2eba72a4e..d58971b7a0 100644
--- a/src/qml/qml/qqmlinstruction.cpp
+++ b/src/qml/qml/qqmlinstruction.cpp
@@ -58,7 +58,7 @@ void QQmlCompiledData::dump(QQmlInstruction *instr, int idx)
qWarning().nospace() << idx << "\t\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding;
break;
case QQmlInstruction::DeferInit:
- qWarning().nospace() << idx << "\t\t" << "DEFER_INIT\t\t" << instr->deferInit.bindingsSize << "\t" << instr->deferInit.parserStatusSize;
+ qWarning().nospace() << idx << "\t\t" << "DEFER_INIT\t\t" << instr->deferInit.bindingsSize << "\t" << instr->deferInit.parserStatusSize << "\t" << instr->deferInit.objectStackSize << "\t" << instr->deferInit.listStackSize;
break;
case QQmlInstruction::Done:
qWarning().nospace() << idx << "\t\t" << "DONE";
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index 15ddcc7c29..194a5ca7e7 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -772,10 +772,10 @@ V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data);
\inqmlmodule QtQml 2
\brief Provides locale specific properties and formatted data
- The Locale object may only be created via the \l{QML:Qt::locale()}{Qt.locale()} function.
+ The Locale object may only be created via the \l{QtQml2::Qt::locale()}{Qt.locale()} function.
It cannot be created directly.
- The \l{QML:Qt::locale()}{Qt.locale()} function returns a JS Locale object representing the
+ The \l{QtQml2::Qt::locale()}{Qt.locale()} function returns a JS Locale object representing the
locale with the specified name, which has the format
"language[_territory][.codeset][@modifier]" or "C".
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 372475d85c..b29df4d252 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -46,6 +46,7 @@
#include <private/qqmlcustomparser_p.h>
#include <private/qqmlguard_p.h>
#include <private/qhashedstring_p.h>
+#include <private/qqmlimport_p.h>
#include <QtCore/qdebug.h>
#include <QtCore/qstringlist.h>
@@ -582,16 +583,18 @@ void QQmlTypePrivate::init() const
while(mo) {
QQmlType *t = metaTypeData()->metaObjectToType.value(mo);
if (t) {
- if (t->d->extraData.cd->extFunc) {
- QMetaObjectBuilder builder;
- clone(builder, t->d->extraData.cd->extMetaObject, t->d->baseMetaObject, baseMetaObject);
- builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
- QMetaObject *mmo = builder.toMetaObject();
- mmo->d.superdata = baseMetaObject;
- if (!metaObjects.isEmpty())
- metaObjects.last().metaObject->d.superdata = mmo;
- QQmlProxyMetaObject::ProxyData data = { mmo, t->d->extraData.cd->extFunc, 0, 0 };
- metaObjects << data;
+ if (t->d->regType == QQmlType::CppType) {
+ if (t->d->extraData.cd->extFunc) {
+ QMetaObjectBuilder builder;
+ clone(builder, t->d->extraData.cd->extMetaObject, t->d->baseMetaObject, baseMetaObject);
+ builder.setFlags(QMetaObjectBuilder::DynamicMetaObject);
+ QMetaObject *mmo = builder.toMetaObject();
+ mmo->d.superdata = baseMetaObject;
+ if (!metaObjects.isEmpty())
+ metaObjects.last().metaObject->d.superdata = mmo;
+ QQmlProxyMetaObject::ProxyData data = { mmo, t->d->extraData.cd->extFunc, 0, 0 };
+ metaObjects << data;
+ }
}
}
mo = mo->d.superdata;
@@ -1066,6 +1069,29 @@ QQmlType *QQmlTypeModuleVersion::type(const QHashedV8String &name) const
else return 0;
}
+void qmlClearTypeRegistrations() // Declared in qqml.h
+{
+ //Only cleans global static, assumed no running engine
+ QWriteLocker lock(metaTypeDataLock());
+ QQmlMetaTypeData *data = metaTypeData();
+
+ for (int i = 0; i < data->types.count(); ++i)
+ delete data->types.at(i);
+
+ QQmlMetaTypeData::TypeModules::const_iterator i = data->uriToModule.constBegin();
+ for (; i != data->uriToModule.constEnd(); ++i)
+ delete *i;
+
+ data->types.clear();
+ data->idToType.clear();
+ data->nameToType.clear();
+ data->urlToType.clear();
+ data->metaObjectToType.clear();
+ data->uriToModule.clear();
+
+ QQmlEnginePrivate::baseModulesUninitialized = true; //So the engine re-registers its types
+ qmlClearEnginePlugins();
+}
int registerAutoParentFunction(QQmlPrivate::RegisterAutoParent &autoparent)
{
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 497afffb5d..f522812398 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -231,6 +231,7 @@ private:
friend int registerSingletonType(const QQmlPrivate::RegisterSingletonType &);
friend int registerInterface(const QQmlPrivate::RegisterInterface &);
friend int registerCompositeType(const QQmlPrivate::RegisterCompositeType &);
+ friend Q_QML_EXPORT void qmlClearTypeRegistrations();
QQmlType(int, const QQmlPrivate::RegisterInterface &);
QQmlType(int, const QString &, const QQmlPrivate::RegisterSingletonType &);
QQmlType(int, const QString &, const QQmlPrivate::RegisterType &);
@@ -259,6 +260,7 @@ private:
//Used by register functions and creates the QQmlTypeModule for them
friend void addTypeToData(QQmlType* type, QQmlMetaTypeData *data);
friend struct QQmlMetaTypeData;
+ friend Q_QML_EXPORT void qmlClearTypeRegistrations();
QQmlTypeModule();
~QQmlTypeModule();
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index 570435ae81..b5b11d2c6a 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -253,7 +253,7 @@ namespace QQmlPrivate
};
struct RegisterCompositeType {
- const QUrl &url;
+ QUrl url;
const char *uri;
int versionMajor;
int versionMinor;
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index bbce8e625e..8d8503f344 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qqmltypeloader_p.h"
+#include "qqmlabstracturlinterceptor_p.h"
#include <private/qqmlengine_p.h>
#include <private/qqmlglobal_p.h>
@@ -250,6 +251,23 @@ QQmlDataBlob::~QQmlDataBlob()
}
/*!
+ Sets the manager, and does stuff like selection which needs access to the manager.
+ Must be called before loading can occur.
+*/
+void QQmlDataBlob::startLoading(QQmlDataLoader *manager)
+{
+ Q_ASSERT(status() == QQmlDataBlob::Null);
+ Q_ASSERT(m_manager == 0);
+ m_data.setStatus(QQmlDataBlob::Loading);
+ m_manager = manager;
+
+ //Set here because we need to get the engine from the manager
+ if (manager && manager->engine() && manager->engine()->urlInterceptor())
+ m_url = manager->engine()->urlInterceptor()->intercept(m_url,
+ (QQmlAbstractUrlInterceptor::DataType)m_type);
+}
+
+/*!
Returns the type provided to the constructor.
*/
QQmlDataBlob::Type QQmlDataBlob::type() const
@@ -892,12 +910,7 @@ void QQmlDataLoader::load(QQmlDataBlob *blob, Mode mode)
qWarning("QQmlDataLoader::load(%s): %s thread", qPrintable(blob->m_url.toString()),
m_thread->isThisThread()?"Compile":"Engine");
#endif
-
- Q_ASSERT(blob->status() == QQmlDataBlob::Null);
- Q_ASSERT(blob->m_manager == 0);
-
- blob->m_data.setStatus(QQmlDataBlob::Loading);
- blob->m_manager = this;
+ blob->startLoading(this);
if (m_thread->isThisThread()) {
unlock();
@@ -930,11 +943,7 @@ void QQmlDataLoader::loadWithStaticData(QQmlDataBlob *blob, const QByteArray &da
m_thread->isThisThread()?"Compile":"Engine");
#endif
- Q_ASSERT(blob->status() == QQmlDataBlob::Null);
- Q_ASSERT(blob->m_manager == 0);
-
- blob->m_data.setStatus(QQmlDataBlob::Loading);
- blob->m_manager = this;
+ blob->startLoading(this);
if (m_thread->isThisThread()) {
unlock();
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h
index 68b8f33f88..1bd07661f7 100644
--- a/src/qml/qml/qqmltypeloader_p.h
+++ b/src/qml/qml/qqmltypeloader_p.h
@@ -68,6 +68,7 @@
#include <private/qqmldirparser_p.h>
#include <private/qqmlbundle_p.h>
#include <private/qflagpointer_p.h>
+#include <private/qqmlabstracturlinterceptor_p.h>
QT_BEGIN_NAMESPACE
@@ -92,15 +93,17 @@ public:
Error // Error
};
- enum Type {
- QmlFile,
- JavaScriptFile,
- QmldirFile
+ enum Type { //Matched in QQmlAbstractUrlInterceptor
+ QmlFile = QQmlAbstractUrlInterceptor::QmlFile,
+ JavaScriptFile = QQmlAbstractUrlInterceptor::JavaScriptFile,
+ QmldirFile = QQmlAbstractUrlInterceptor::QmldirFile
};
QQmlDataBlob(const QUrl &, Type);
virtual ~QQmlDataBlob();
+ void startLoading(QQmlDataLoader* manager);
+
Type type() const;
Status status() const;
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index ad76b702ce..736ed5f8bc 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -47,6 +47,7 @@
#include <private/qmetaobjectbuilder_p.h>
#include "qqmldata_p.h"
#include "qqml.h"
+#include "qqmlinfo.h"
#include "qqmlcustomparser_p.h"
#include "qqmlengine.h"
#include "qqmlcontext.h"
@@ -134,12 +135,12 @@ bool QQmlVME::initDeferred(QObject *object)
{
QQmlData *data = QQmlData::get(object);
- if (!data || !data->context || !data->compiledData)
+ if (!data || !data->deferredData)
return false;
- QQmlContextData *ctxt = data->context;
- QQmlCompiledData *comp = data->compiledData;
- int start = data->deferredIdx;
+ QQmlContextData *ctxt = data->deferredData->context;
+ QQmlCompiledData *comp = data->deferredData->compiledData;
+ int start = data->deferredData->deferredIdx;
State initState;
initState.flags = State::Deferred;
@@ -1045,10 +1046,19 @@ QObject *QQmlVME::run(QList<QQmlError> *errors,
if (instr.deferCount) {
QObject *target = objects.top();
QQmlData *data = QQmlData::get(target, true);
- data->compiledData = COMP;
- data->compiledData->addref(); // Keep this data referenced until we're initialized
- data->deferredIdx = INSTRUCTIONSTREAM - COMP->bytecode.constData();
- Q_ASSERT(data->deferredIdx != 0);
+ if (data->deferredData) {
+ //This rare case still won't always work right
+ qmlInfo(target) << "Setting deferred property across multiple components may not work";
+ delete data->deferredData;
+ }
+ data->deferredData = new QQmlData::DeferredData;
+ //If we're in a CreateQML here, data->compiledData could be reset later
+ data->deferredData->compiledData = COMP;
+ data->deferredData->context = CTXT;
+ // Keep this data referenced until we're initialized
+ data->deferredData->compiledData->addref();
+ data->deferredData->deferredIdx = INSTRUCTIONSTREAM - COMP->bytecode.constData();
+ Q_ASSERT(data->deferredData->deferredIdx != 0);
INSTRUCTIONSTREAM += instr.deferCount;
}
QML_END_INSTR(Defer)
@@ -1469,7 +1479,7 @@ bool QQmlVMEGuard::isOK() const
return false;
for (int ii = 0; ii < m_contextCount; ++ii)
- if (m_contexts[ii].isNull())
+ if (m_contexts[ii].isNull() || !m_contexts[ii]->engine)
return false;
return true;
diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp
index 4aa257d54a..d217b5e2f5 100644
--- a/src/qml/qml/v4/qv4irbuilder.cpp
+++ b/src/qml/qml/v4/qv4irbuilder.cpp
@@ -638,7 +638,14 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
QByteArray utf8Name = name.toUtf8();
const char *enumName = utf8Name.constData();
- const QMetaObject *meta = baseName->meta.propertyCache(m_engine)->firstCppMetaObject();
+ const QQmlPropertyCache *cache = baseName->meta.propertyCache(m_engine);
+ if (!cache) {
+ //Happens in some cases where they make properties with uppercase names
+ qFatal("QV4: Unable to resolve enum: '%s'",
+ QString(*baseName->id + QLatin1Char('.') + ast->name.toString()).toLatin1().constData());
+ }
+
+ const QMetaObject *meta = cache->firstCppMetaObject();
bool found = false;
for (int ii = 0; !found && ii < meta->enumeratorCount(); ++ii) {
QMetaEnum e = meta->enumerator(ii);
diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp
index 5b1464afe6..dbd0851fec 100644
--- a/src/qml/qml/v8/qjsengine.cpp
+++ b/src/qml/qml/v8/qjsengine.cpp
@@ -195,6 +195,10 @@ QJSEngine::QJSEngine(QJSEnginePrivate &dd, QObject *parent)
/*!
Destroys this QJSEngine.
+
+ Garbage is not collected from the persistent JS heap during QJSEngine
+ destruction. If you need all memory freed, call collectGarbage manually
+ right before destroying the QJSEngine.
*/
QJSEngine::~QJSEngine()
{
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index b5f4bf555c..457d0bb969 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -821,7 +821,7 @@ to \c format.
The \a date parameter may be a JavaScript \c Date object, a \l{date}{date}
property, a QDate, or QDateTime value. The \a format parameter may be any of
the possible format values as described for
-\l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+\l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
If \a format is not specified, \a date is formatted using
\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}.
@@ -862,7 +862,7 @@ Returns a string representation of \c time, optionally formatted according to
The \a time parameter may be a JavaScript \c Date object, a QTime, or QDateTime
value. The \a format parameter may be any of the possible format values as
-described for \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
+described for \l{QtQml2::Qt::formatDateTime()}{Qt.formatDateTime()}.
If \a format is not specified, \a time is formatted using
\l {Qt::DefaultLocaleShortDate}{Qt.DefaultLocaleShortDate}.
@@ -978,7 +978,7 @@ For example, if the following date/time value was specified:
\endcode
This \a dateTime value could be passed to \c Qt.formatDateTime(),
-\l {QML:Qt::formatDate()}{Qt.formatDate()} or \l {QML:Qt::formatTime()}{Qt.formatTime()}
+\l {QtQml2::Qt::formatDate()}{Qt.formatDate()} or \l {QtQml2::Qt::formatTime()}{Qt.formatTime()}
with the \a format values below to produce the following results:
\table
@@ -1138,7 +1138,7 @@ For example, if the above snippet had misspelled color as 'colro' then the array
Note that this function returns immediately, and therefore may not work if
the \a qml string loads new components (that is, external QML files that have not yet been loaded).
-If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead.
+If this is the case, consider using \l{QtQml2::Qt::createComponent()}{Qt.createComponent()} instead.
See \l {Dynamic QML Object Creation from JavaScript} for more information on using this function.
*/
@@ -1264,7 +1264,7 @@ For example:
See \l {Dynamic QML Object Creation from JavaScript} for more information on using this function.
To create a QML object from an arbitrary string of QML (instead of a file),
-use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
+use \l{QtQml2::Qt::createQmlObject()}{Qt.createQmlObject()}.
*/
v8::Handle<v8::Value> createComponent(const v8::Arguments &args)
{
@@ -1344,7 +1344,7 @@ v8::Handle<v8::Value> createComponent(const v8::Arguments &args)
Example:
\snippet qml/qsTranslate.qml 0
- \sa {Localization And Internationalization Support In Qt Quick}
+ \sa {Internationalization and Localization with Qt Quick}
*/
v8::Handle<v8::Value> qsTranslate(const v8::Arguments &args)
{
@@ -1401,7 +1401,7 @@ v8::Handle<v8::Value> qsTranslate(const v8::Arguments &args)
Example:
\snippet qml/qtTranslateNoOp.qml 0
- \sa {Localization And Internationalization Support In Qt Quick}
+ \sa {Internationalization and Localization with Qt Quick}
*/
v8::Handle<v8::Value> qsTranslateNoOp(const v8::Arguments &args)
{
@@ -1425,7 +1425,7 @@ v8::Handle<v8::Value> qsTranslateNoOp(const v8::Arguments &args)
Example:
\snippet qml/qsTr.qml 0
- \sa {Localization And Internationalization Support In Qt Quick}
+ \sa {Internationalization and Localization with Qt Quick}
*/
v8::Handle<v8::Value> qsTr(const v8::Arguments &args)
{
@@ -1479,7 +1479,7 @@ v8::Handle<v8::Value> qsTr(const v8::Arguments &args)
Example:
\snippet qml/qtTrNoOp.qml 0
- \sa {Localization And Internationalization Support In Qt Quick}
+ \sa {Internationalization and Localization with Qt Quick}
*/
v8::Handle<v8::Value> qsTrNoOp(const v8::Arguments &args)
{
@@ -1516,7 +1516,7 @@ v8::Handle<v8::Value> qsTrNoOp(const v8::Arguments &args)
Creating binary translation (QM) files suitable for use with this function requires passing
the \c -idbased option to the \c lrelease tool.
- \sa QT_TRID_NOOP, {Localization And Internationalization Support In Qt Quick}
+ \sa QT_TRID_NOOP, {Internationalization and Localization with Qt Quick}
*/
v8::Handle<v8::Value> qsTrId(const v8::Arguments &args)
{
@@ -1549,7 +1549,7 @@ v8::Handle<v8::Value> qsTrId(const v8::Arguments &args)
Example:
\snippet qml/qtTrIdNoOp.qml 0
- \sa qsTrId(), {Localization And Internationalization Support In Qt Quick}
+ \sa qsTrId(), {Internationalization and Localization with Qt Quick}
*/
v8::Handle<v8::Value> qsTrIdNoOp(const v8::Arguments &args)
{
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 16572c44dd..53b8a3c79d 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -157,7 +157,7 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
The example below illustrates using a DelegateModel with a ListView.
- \snippet qml/visualdatamodel.qml 0
+ \snippet delegatemodel/visualdatamodel.qml 0
*/
QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
@@ -230,6 +230,8 @@ QQmlDelegateModel::~QQmlDelegateModel()
cacheItem->objectRef = 0;
if (!cacheItem->isReferenced())
delete cacheItem;
+ else if (cacheItem->incubationTask)
+ cacheItem->incubationTask->vdm = 0;
}
}
@@ -395,10 +397,10 @@ void QQmlDelegateModel::setDelegate(QQmlComponent *delegate)
the new directory's contents.
\c main.cpp:
- \snippet qml/visualdatamodel_rootindex/main.cpp 0
+ \snippet delegatemodel/visualdatamodel_rootindex/main.cpp 0
\c view.qml:
- \snippet qml/visualdatamodel_rootindex/view.qml 0
+ \snippet delegatemodel/visualdatamodel_rootindex/view.qml 0
If the \l model is a QAbstractItemModel subclass, the delegate can also
reference a \c hasModelChildren property (optionally qualified by a
@@ -602,7 +604,7 @@ QQmlDelegateModelGroup *QQmlDelegateModelPrivate::group_at(
The following example illustrates using groups to select items in a model.
- \snippet qml/visualdatagroup.qml 0
+ \snippet delegatemodel/visualdatagroup.qml 0
*/
QQmlListProperty<QQmlDelegateModelGroup> QQmlDelegateModel::groups()
@@ -778,9 +780,28 @@ void QQmlDelegateModelPrivate::emitDestroyingPackage(QQuickPackage *package)
QQmlDelegateModelGroupPrivate::get(m_groups[i])->destroyingPackage(package);
}
+static bool isDoneIncubating(QQmlIncubator::Status status)
+{
+ return status == QQmlIncubator::Ready || status == QQmlIncubator::Error;
+}
+
void QQDMIncubationTask::statusChanged(Status status)
{
- vdm->incubatorStatusChanged(this, status);
+ if (vdm) {
+ vdm->incubatorStatusChanged(this, status);
+ } else if (isDoneIncubating(status)) {
+ Q_ASSERT(incubating);
+ // The model was deleted from under our feet, cleanup ourselves
+ if (incubating->object) {
+ delete incubating->object;
+
+ incubating->object = 0;
+ incubating->contextData->destroy();
+ incubating->contextData = 0;
+ }
+ incubating->scriptRef = 0;
+ incubating->deleteLater();
+ }
}
void QQmlDelegateModelPrivate::releaseIncubator(QQDMIncubationTask *incubationTask)
@@ -808,7 +829,7 @@ void QQmlDelegateModelPrivate::removeCacheItem(QQmlDelegateModelItem *cacheItem)
void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status)
{
Q_Q(QQmlDelegateModel);
- if (status != QQmlIncubator::Ready && status != QQmlIncubator::Error)
+ if (!isDoneIncubating(status))
return;
QQmlDelegateModelItem *cacheItem = incubationTask->incubating;
@@ -935,7 +956,7 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, bo
// Remove the temporary reference count.
cacheItem->scriptRef -= 1;
- if (cacheItem->object)
+ if (cacheItem->object && (!cacheItem->incubationTask || isDoneIncubating(cacheItem->incubationTask->status())))
return cacheItem->object;
cacheItem->releaseObject();
@@ -950,7 +971,7 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, bo
/*
If asynchronous is true or the component is being loaded asynchronously due
to an ancestor being loaded asynchronously, item() may return 0. In this
- case itemCreated() will be emitted when the item is available. The item
+ case createdItem() will be emitted when the item is available. The item
at this stage does not have any references, so item() must be called again
to ensure a reference is held. Any call to item() which returns a valid item
must be matched by a call to release() in order to destroy the item.
@@ -1766,8 +1787,12 @@ QQmlDelegateModelItem::~QQmlDelegateModelItem()
Q_ASSERT(objectRef == 0);
Q_ASSERT(!object);
- if (incubationTask && metaType->model)
- QQmlDelegateModelPrivate::get(metaType->model)->releaseIncubator(incubationTask);
+ if (incubationTask) {
+ if (metaType->model)
+ QQmlDelegateModelPrivate::get(metaType->model)->releaseIncubator(incubationTask);
+ else
+ delete incubationTask;
+ }
metaType->release();
diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp
index a2a1fa23ad..234494e088 100644
--- a/src/qml/types/qqmlinstantiator.cpp
+++ b/src/qml/types/qqmlinstantiator.cpp
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
QQmlInstantiatorPrivate::QQmlInstantiatorPrivate()
: componentComplete(true)
+ , effectiveReset(false)
, active(true)
, async(false)
, ownModel(false)
@@ -124,7 +125,7 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo
{
Q_Q(QQmlInstantiator);
- if (componentComplete)
+ if (!componentComplete || effectiveReset)
return;
if (reset) {
@@ -162,7 +163,7 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo
objects = objects.mid(0, index) + movedObjects + objects.mid(index);
} else for (int i = 0; i < insert.count; ++i) {
int modelIndex = index + i;
- QObject* obj = instanceModel->object(i, async);
+ QObject* obj = instanceModel->object(modelIndex, async);
if (obj)
_q_createdItem(modelIndex, obj);
}
@@ -378,8 +379,11 @@ void QQmlInstantiator::setModel(const QVariant &v)
if (!d->ownModel)
d->makeModel();
- if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel *>(d->instanceModel))
+ if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel *>(d->instanceModel)) {
+ d->effectiveReset = true;
dataModel->setModel(v);
+ d->effectiveReset = false;
+ }
}
if (d->instanceModel != prevModel) {
diff --git a/src/qml/types/qqmlinstantiator_p_p.h b/src/qml/types/qqmlinstantiator_p_p.h
index 79459299dc..a7d6905a7e 100644
--- a/src/qml/types/qqmlinstantiator_p_p.h
+++ b/src/qml/types/qqmlinstantiator_p_p.h
@@ -75,10 +75,11 @@ public:
void _q_createdItem(int, QObject *);
void _q_modelUpdated(const QQmlChangeSet &, bool);
- bool componentComplete;
- bool active;
- bool async;
- bool ownModel;
+ bool componentComplete:1;
+ bool effectiveReset:1;
+ bool active:1;
+ bool async:1;
+ bool ownModel:1;
QVariant model;
QQmlInstanceModel *instanceModel;
QQmlComponent *delegate;
diff --git a/src/quick/doc/images/qml-extending-types.png b/src/quick/doc/images/qml-extending-types.png
deleted file mode 100644
index 6990d7c190..0000000000
--- a/src/quick/doc/images/qml-extending-types.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-animation.png b/src/quick/doc/images/qml-uses-animation.png
deleted file mode 100644
index b54361260c..0000000000
--- a/src/quick/doc/images/qml-uses-animation.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-integratingjs.png b/src/quick/doc/images/qml-uses-integratingjs.png
deleted file mode 100644
index 3bb0d8aadf..0000000000
--- a/src/quick/doc/images/qml-uses-integratingjs.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-layouts-anchors.png b/src/quick/doc/images/qml-uses-layouts-anchors.png
deleted file mode 100644
index 769597cf52..0000000000
--- a/src/quick/doc/images/qml-uses-layouts-anchors.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-layouts-direct.png b/src/quick/doc/images/qml-uses-layouts-direct.png
deleted file mode 100644
index 0682da36f8..0000000000
--- a/src/quick/doc/images/qml-uses-layouts-direct.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-layouts-positioners.png b/src/quick/doc/images/qml-uses-layouts-positioners.png
deleted file mode 100644
index ebdd9c58dd..0000000000
--- a/src/quick/doc/images/qml-uses-layouts-positioners.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-styling-text.png b/src/quick/doc/images/qml-uses-styling-text.png
deleted file mode 100644
index af2518a9e8..0000000000
--- a/src/quick/doc/images/qml-uses-styling-text.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-styling.png b/src/quick/doc/images/qml-uses-styling.png
deleted file mode 100644
index a6bf68e783..0000000000
--- a/src/quick/doc/images/qml-uses-styling.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-text.png b/src/quick/doc/images/qml-uses-text.png
deleted file mode 100644
index 6b3d88cb3f..0000000000
--- a/src/quick/doc/images/qml-uses-text.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-userinput.png b/src/quick/doc/images/qml-uses-userinput.png
deleted file mode 100644
index 2793e8d1d7..0000000000
--- a/src/quick/doc/images/qml-uses-userinput.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-visual-opacity.png b/src/quick/doc/images/qml-uses-visual-opacity.png
deleted file mode 100644
index ab238deb54..0000000000
--- a/src/quick/doc/images/qml-uses-visual-opacity.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-visual-rectangles.png b/src/quick/doc/images/qml-uses-visual-rectangles.png
deleted file mode 100644
index acf7cb160a..0000000000
--- a/src/quick/doc/images/qml-uses-visual-rectangles.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/images/qml-uses-visual-transforms.png b/src/quick/doc/images/qml-uses-visual-transforms.png
deleted file mode 100644
index d89fc75256..0000000000
--- a/src/quick/doc/images/qml-uses-visual-transforms.png
+++ /dev/null
Binary files differ
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 37ace7b0db..fba4ff89df 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -34,7 +34,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtquick/qtquick.tags
-depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols
+depends += qtcore qtxmlpatterns qtqml qtgui qtlinguist qtquickcontrols qtdoc
headerdirs += ..
diff --git a/src/quick/doc/snippets/qml/codingconventions/dotproperties.qml b/src/quick/doc/snippets/qml/codingconventions/dotproperties.qml
deleted file mode 100644
index bbb40a77ee..0000000000
--- a/src/quick/doc/snippets/qml/codingconventions/dotproperties.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
-
-//! [0]
-Rectangle {
- anchors.left: parent.left; anchors.top: parent.top; anchors.right: parent.right; anchors.leftMargin: 20
-}
-
-Text {
- text: "hello"
- font.bold: true; font.italic: true; font.pixelSize: 20; font.capitalization: Font.AllUppercase
-}
-
-//! [0]
-
-//! [1]
-Rectangle {
- anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: 20 }
-}
-
-Text {
- text: "hello"
- font { bold: true; italic: true; pixelSize: 20; capitalization: Font.AllUppercase }
-}
-//! [1]
-
-}
diff --git a/src/quick/doc/snippets/qml/codingconventions/javascript-imports.qml b/src/quick/doc/snippets/qml/codingconventions/javascript-imports.qml
deleted file mode 100644
index fd8301cebe..0000000000
--- a/src/quick/doc/snippets/qml/codingconventions/javascript-imports.qml
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//![0]
-import "myscript.js" as Script
-
-Rectangle { color: "blue"; width: Script.calculateWidth(parent) }
-//![0]
diff --git a/src/quick/doc/snippets/qml/codingconventions/javascript.qml b/src/quick/doc/snippets/qml/codingconventions/javascript.qml
deleted file mode 100644
index 72c954f699..0000000000
--- a/src/quick/doc/snippets/qml/codingconventions/javascript.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
-
-//![0]
-Rectangle { color: "blue"; width: parent.width / 3 }
-//![0]
-
-//![1]
-Rectangle {
- color: "blue"
- width: {
- var w = parent.width / 3
- console.debug(w)
- return w
- }
-}
-//![1]
-
-//![2]
-function calculateWidth(object)
-{
- var w = object.width / 3
- // ...
- // more javascript code
- // ...
- console.debug(w)
- return w
-}
-
-Rectangle { color: "blue"; width: calculateWidth(parent) }
-//![2]
-}
diff --git a/src/quick/doc/snippets/qml/codingconventions/lists.qml b/src/quick/doc/snippets/qml/codingconventions/lists.qml
deleted file mode 100644
index c45129187e..0000000000
--- a/src/quick/doc/snippets/qml/codingconventions/lists.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
- Item {
-//! [0]
-states: [
- State {
- name: "open"
- PropertyChanges { target: container; width: 200 }
- }
-]
-//! [0]
- }
- Item {
-//! [1]
-states: State {
- name: "open"
- PropertyChanges { target: container; width: 200 }
-}
-//! [1]
- }
-}
diff --git a/src/quick/doc/snippets/qml/codingconventions/myscript.js b/src/quick/doc/snippets/qml/codingconventions/myscript.js
deleted file mode 100644
index cfa646250b..0000000000
--- a/src/quick/doc/snippets/qml/codingconventions/myscript.js
+++ /dev/null
@@ -1,9 +0,0 @@
-function calculateWidth(parent)
-{
- var w = parent.width / 3
- // ...
- // more javascript code
- // ...
- console.debug(w)
- return w
-}
diff --git a/src/quick/doc/snippets/qml/codingconventions/photo.qml b/src/quick/doc/snippets/qml/codingconventions/photo.qml
deleted file mode 100644
index 5260f87127..0000000000
--- a/src/quick/doc/snippets/qml/codingconventions/photo.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//! [0]
-Rectangle {
- id: photo // id on the first line makes it easy to find an object
-
- property bool thumbnail: false // property declarations
- property alias image: photoImage.source
-
- signal clicked // signal declarations
-
- function doSomething(x) // javascript functions
- {
- return x + photoImage.width
- }
-
- color: "gray" // object properties
- x: 20; y: 20; height: 150 // try to group related properties together
- width: { // large bindings
- if (photoImage.width > 200) {
- photoImage.width;
- } else {
- 200;
- }
- }
-
- Rectangle { // child objects
- id: border
- anchors.centerIn: parent; color: "white"
-
- Image { id: photoImage; anchors.centerIn: parent }
- }
-
- states: State { // states
- name: "selected"
- PropertyChanges { target: border; color: "red" }
- }
-
- transitions: Transition { // transitions
- from: ""; to: "selected"
- ColorAnimation { target: border; duration: 200 }
- }
-}
-//! [0]
-
diff --git a/src/qml/doc/snippets/qml/colors.qml b/src/quick/doc/snippets/qml/colors.qml
index 2885f13c81..473df711bd 100644
--- a/src/qml/doc/snippets/qml/colors.qml
+++ b/src/quick/doc/snippets/qml/colors.qml
@@ -42,7 +42,7 @@ import QtQuick 2.0
Rectangle {
width: 160; height: 250
-
+
Image {
width: 160; height: 200
source: "pics/checker.svg"
diff --git a/src/quick/doc/snippets/qml/usecases/Button.qml b/src/quick/doc/snippets/qml/usecases/Button.qml
deleted file mode 100644
index 6c4c0f7cd3..0000000000
--- a/src/quick/doc/snippets/qml/usecases/Button.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- id: container
- // The caption property is an alias to the text of the Text element, so Button users can set the text
- property alias caption: txt.text
- // The clicked signal is emitted whenever the button is clicked, so Button users can respond
- signal clicked
-
- // The button is set to have rounded corners and a thin black border
- radius: 4
- border.width: 1
- // This button has a fixed size, but it could resize based on the text
- width: 160
- height: 40
-
- // A SystemPalette is used to get colors from the system settings for the background
- SystemPalette { id: sysPalette }
-
- gradient: Gradient {
-
- // The top gradient is darker when 'pressed', all colors come from the system palette
- GradientStop { position: 0.0; color: ma.pressed ? sysPalette.dark : sysPalette.light }
-
- GradientStop { position: 1.0; color: sysPalette.button }
- }
-
- Text {
- id: txt
- // This is the default value of the text, but most Button users will set their own with the caption property
- text: "Button"
- font.bold: true
- font.pixelSize: 16
- anchors.centerIn: parent
- }
-
- MouseArea {
- id: ma
- anchors.fill: parent
- // This re-emits the clicked signal on the root item, so that Button users can respond to it
- onClicked: container.clicked()
- }
-}
-
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/animations.qml b/src/quick/doc/snippets/qml/usecases/animations.qml
deleted file mode 100644
index 1887acf901..0000000000
--- a/src/quick/doc/snippets/qml/usecases/animations.qml
+++ /dev/null
@@ -1,187 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
-
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- Column {
- //![states]
-
- Item {
- id: container
- width: 320
- height: 120
-
- Rectangle {
- id: rect
- color: "red"
- width: 120
- height: 120
-
- MouseArea {
- anchors.fill: parent
- onClicked: container.state == 'other' ? container.state = '' : container.state = 'other'
- }
- }
- states: [
- // This adds a second state to the container where the rectangle is farther to the right
-
- State { name: "other"
-
- PropertyChanges {
- target: rect
- x: 200
- }
- }
- ]
- transitions: [
- // This adds a transition that defaults to applying to all state changes
-
- Transition {
-
- // This applies a default NumberAnimation to any changes a state change makes to x or y properties
- NumberAnimation { properties: "x,y" }
- }
- ]
- }
- //![states]
- //![behave]
- Item {
- width: 320
- height: 120
-
- Rectangle {
- color: "green"
- width: 120
- height: 120
-
- // This is the behavior, and it applies a NumberAnimation to any attempt to set the x property
- Behavior on x {
-
- NumberAnimation {
- //This specifies how long the animation takes
- duration: 600
- //This selects an easing curve to interpolate with, the default is Easing.Linear
- easing.type: Easing.OutBounce
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: parent.x == 0 ? parent.x = 200 : parent.x = 0
- }
- }
- }
- //![behave]
- //![constant]
- Item {
- width: 320
- height: 120
-
- Rectangle {
- color: "blue"
- width: 120
- height: 120
-
- // By setting this SequentialAnimation on x, it and animations within it will automatically animate
- // the x property of this element
- SequentialAnimation on x {
- id: xAnim
- // Animations on properties start running by default
- running: false
- loops: Animation.Infinite // The animation is set to loop indefinitely
- NumberAnimation { from: 0; to: 200; duration: 500; easing.type: Easing.InOutQuad }
- NumberAnimation { from: 200; to: 0; duration: 500; easing.type: Easing.InOutQuad }
- PauseAnimation { duration: 250 } // This puts a bit of time between the loop
- }
-
- MouseArea {
- anchors.fill: parent
- // The animation starts running when you click within the rectangle
- onClicked: xAnim.running = true
- }
- }
- }
- //![constant]
-
- //![scripted]
- Item {
- width: 320
- height: 120
-
- Rectangle {
- id: rectangle
- color: "yellow"
- width: 120
- height: 120
-
- MouseArea {
- anchors.fill: parent
- // The animation starts running when you click within the rectange
- onClicked: anim.running = true;
- }
- }
-
- // This animation specifically targets the Rectangle's properties to animate
- SequentialAnimation {
- id: anim
- // Animations on their own are not running by default
- // The default number of loops is one, restart the animation to see it again
-
- NumberAnimation { target: rectangle; property: "x"; from: 0; to: 200; duration: 500 }
-
- NumberAnimation { target: rectangle; property: "x"; from: 200; to: 0; duration: 500 }
- }
- }
- //![scripted]
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/integratingjs-inline.qml b/src/quick/doc/snippets/qml/usecases/integratingjs-inline.qml
deleted file mode 100644
index 24758d4e09..0000000000
--- a/src/quick/doc/snippets/qml/usecases/integratingjs-inline.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
- id: container
- width: 320
- height: 480
-
- function randomNumber() {
- return Math.random() * 360;
- }
-
- function getNumber() {
- return container.randomNumber();
- }
-
- MouseArea {
- anchors.fill: parent
- // This line uses the JS function from the item
- onClicked: rectangle.rotation = container.getNumber();
- }
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- Rectangle {
- id: rectangle
- anchors.centerIn: parent
- width: 160
- height: 160
- color: "green"
- Behavior on rotation { RotationAnimation { direction: RotationAnimation.Clockwise } }
- }
-
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/integratingjs.qml b/src/quick/doc/snippets/qml/usecases/integratingjs.qml
deleted file mode 100644
index 9e7ed2a35b..0000000000
--- a/src/quick/doc/snippets/qml/usecases/integratingjs.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-import "myscript.js" as Logic
-
-Item {
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- MouseArea {
- anchors.fill: parent
- // This line uses the JS function from the separate JS file
- onClicked: rectangle.rotation = Logic.getRandom(rectangle.rotation);
- }
-
- Rectangle {
- id: rectangle
- anchors.centerIn: parent
- width: 160
- height: 160
- color: "green"
- Behavior on rotation { RotationAnimation { direction: RotationAnimation.Clockwise } }
- }
-
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/layouts.qml b/src/quick/doc/snippets/qml/usecases/layouts.qml
deleted file mode 100644
index e9483d2b9b..0000000000
--- a/src/quick/doc/snippets/qml/usecases/layouts.qml
+++ /dev/null
@@ -1,142 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![import]
-import QtQuick 2.0
-
-//![import]
-
-Column {
-
-//![direct]
-Item {
- width: 100; height: 100
-
- Rectangle {
- // Manually positioned at 20,20
- x: 20
- y: 20
- width: 80
- height: 80
- color: "red"
- }
-}
-//![direct]
-
-//![anchors]
-Item {
- width: 200; height: 200
-
- Rectangle {
- // Anchored to 20px off the top right corner of the parent
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.margins: 20 // Sets all margins at once
-
- width: 80
- height: 80
- color: "orange"
- }
-
- Rectangle {
- // Anchored to 20px off the top center corner of the parent.
- // Notice the different group property syntax for 'anchors' compared to
- // the previous Rectangle. Both are valid.
- anchors { horizontalCenter: parent.horizontalCenter; top: parent.top; topMargin: 20 }
-
- width: 80
- height: 80
- color: "green"
- }
-}
-//![anchors]
-
-//![positioners]
-Item {
- width: 300; height: 100
-
- Row { // The "Row" type lays out its child items in a horizontal line
- spacing: 20 // Places 20px of space between items
-
- Rectangle { width: 80; height: 80; color: "red" }
- Rectangle { width: 80; height: 80; color: "green" }
- Rectangle { width: 80; height: 80; color: "blue" }
- }
-}
-//![positioners]
-
-Item {
- width: 300; height: 400
-
- Rectangle {
- id: middleRect
- //This Rectangle has its y animated, for the others to follow
- x: 120
- y: 220
- SequentialAnimation on y {
- loops: -1
- NumberAnimation { from: 220; to: 380; easing.type: Easing.InOutQuad; duration: 1200 }
- NumberAnimation { from: 380; to: 220; easing.type: Easing.InOutQuad; duration: 1200 }
- }
- width: 80
- height: 80
- color: "green"
- }
- Rectangle {
- // x,y bound to the position of middleRect
- x: middleRect.x - 100
- y: middleRect.y
- width: 80
- height: 80
- color: "red"
- }
-
- Rectangle {
- // Anchored to the position of middleRect
- anchors.left: middleRect.right
- anchors.leftMargin: 20
- anchors.verticalCenter: middleRect.verticalCenter
- width: 80
- height: 80
- color: "blue"
- }
-}
-
-}
diff --git a/src/quick/doc/snippets/qml/usecases/myscript.js b/src/quick/doc/snippets/qml/usecases/myscript.js
deleted file mode 100644
index 84b0c801a2..0000000000
--- a/src/quick/doc/snippets/qml/usecases/myscript.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-// myscript.js
-function getRandom(previousValue) {
- return Math.floor(previousValue + Math.random() * 90) % 360;
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/styling.qml b/src/quick/doc/snippets/qml/usecases/styling.qml
deleted file mode 100644
index b46b9e3d55..0000000000
--- a/src/quick/doc/snippets/qml/usecases/styling.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- Column {
- width: childrenRect.width
- anchors.centerIn: parent
- spacing: 8
- // Each of these is a Button as styled in Button.qml
- Button { caption: "Eeny"; onClicked: console.log("Eeny");}
- Button { caption: "Meeny"; onClicked: console.log("Meeny");}
- Button { caption: "Miny"; onClicked: console.log("Miny");}
- Button { caption: "Mo"; onClicked: console.log("Mo");}
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/text.qml b/src/quick/doc/snippets/qml/usecases/text.qml
deleted file mode 100644
index c7adc12763..0000000000
--- a/src/quick/doc/snippets/qml/usecases/text.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
- id: root
- width: 480
- height: 320
-
- Rectangle {
- color: "#272822"
- width: 480
- height: 320
- }
-
- Column {
- spacing: 20
-
- Text {
- text: 'I am the very model of a modern major general!'
-
- // color can be set on the entire element with this property
- color: "yellow"
-
- }
-
- Text {
- // For text to wrap, a width has to be explicitly provided
- width: root.width
-
- // This setting makes the text wrap at word boundaries when it goes past the width of the Text object
- wrapMode: Text.WordWrap
-
- // You can use \ to escape quotation marks, or to add new lines (\n). Use \\ to get a \ in the string
- text: 'I am the very model of a modern major general. I\'ve information vegetable, animal and mineral. I know the kings of england and I quote the fights historical; from Marathon to Waterloo in order categorical.'
-
- // color can be set on the entire element with this property
- color: "white"
-
- }
-
- Text {
- text: 'I am the very model of a modern major general!'
-
- // color can be set on the entire element with this property
- color: "yellow"
-
- // font properties can be set effciently on the whole string at once
- font { family: 'Courier'; pixelSize: 20; italic: true; capitalization: Font.SmallCaps }
-
- }
-
- Text {
- // HTML like markup can also be used
- text: '<font color="white">I am the <b>very</b> model of a modern <i>major general</i>!</font>'
-
- // This could also be written font { pointSize: 14 }. Both syntaxes are valid.
- font.pointSize: 14
-
- // StyledText format supports fewer tags, but is more efficient than RichText
- textFormat: Text.StyledText
-
- }
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/userinput-keys.qml b/src/quick/doc/snippets/qml/usecases/userinput-keys.qml
deleted file mode 100644
index 73b42b2f59..0000000000
--- a/src/quick/doc/snippets/qml/usecases/userinput-keys.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
- id: root
-
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- Rectangle {
- id: rectangle
- x: 40
- y: 20
- width: 120
- height: 120
- color: "red"
-
- focus: true
- Keys.onUpPressed: rectangle.y -= 10
- Keys.onDownPressed: rectangle.y += 10
- Keys.onLeftPressed: rectangle.x += 10
- Keys.onRightPressed: rectangle.x -= 10
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/visual-opacity.qml b/src/quick/doc/snippets/qml/usecases/visual-opacity.qml
deleted file mode 100644
index d5a1e6f91f..0000000000
--- a/src/quick/doc/snippets/qml/usecases/visual-opacity.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
-
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- Item {
- x: 20
- y: 270
- width: 200
- height: 200
- MouseArea {
- anchors.fill: parent
- onClicked: topRect.visible = !topRect.visible
- }
- Rectangle {
- x: 20
- y: 20
- width: 100
- height: 100
- color: "red"
- }
- Rectangle {
- id: topRect
- opacity: 0.5
-
- x: 100
- y: 100
- width: 100
- height: 100
- color: "blue"
- }
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/visual-rects.qml b/src/quick/doc/snippets/qml/usecases/visual-rects.qml
deleted file mode 100644
index 16cfd7bae5..0000000000
--- a/src/quick/doc/snippets/qml/usecases/visual-rects.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
-
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- // This element displays a rectangle with a gradient and a border
- Rectangle {
- x: 160
- y: 20
- width: 100
- height: 100
- radius: 8 // This gives rounded corners to the Rectangle
- gradient: Gradient { // This sets a vertical gradient fill
- GradientStop { position: 0.0; color: "aqua" }
- GradientStop { position: 1.0; color: "teal" }
- }
- border { width: 3; color: "white" } // This sets a 3px wide black border to be drawn
- }
-
- // This rectangle is a plain color with no border
- Rectangle {
- x: 40
- y: 20
- width: 100
- height: 100
- color: "red"
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/visual-transforms.qml b/src/quick/doc/snippets/qml/usecases/visual-transforms.qml
deleted file mode 100644
index 924f4b79ff..0000000000
--- a/src/quick/doc/snippets/qml/usecases/visual-transforms.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
-
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- Rectangle {
- rotation: 45 // This rotates the Rectangle by 45 degrees
- x: 20
- y: 160
- width: 100
- height: 100
- color: "blue"
- }
- Rectangle {
- scale: 0.8 // This scales the Rectangle down to 80% size
- x: 160
- y: 160
- width: 100
- height: 100
- color: "green"
- }
-}
-//![0]
diff --git a/src/quick/doc/snippets/qml/usecases/visual.qml b/src/quick/doc/snippets/qml/usecases/visual.qml
deleted file mode 100644
index fe381136cb..0000000000
--- a/src/quick/doc/snippets/qml/usecases/visual.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
-
- width: 320
- height: 480
-
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
- }
-
- //![image]
- // This element displays an image. Because the source is online, it may take some time to fetch
- Image {
- x: 40
- y: 20
- width: 61
- height: 73
- source: "http://codereview.qt-project.org/static/logo_qt.png"
- }
- //![image]
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/xmlrole.qml b/src/quick/doc/snippets/qml/xmlrole.qml
index 0f75135da2..0f75135da2 100644
--- a/src/qml/doc/snippets/qml/xmlrole.qml
+++ b/src/quick/doc/snippets/qml/xmlrole.qml
diff --git a/src/quick/doc/src/advtutorial.qdoc b/src/quick/doc/src/advtutorial.qdoc
index a27cb78eba..80a0173f32 100644
--- a/src/quick/doc/src/advtutorial.qdoc
+++ b/src/quick/doc/src/advtutorial.qdoc
@@ -81,7 +81,7 @@ To begin with, we create our Same Game application with a main screen like this:
This is defined by the main application file, \c samegame.qml, which looks like this:
-\snippet quick/tutorials/samegame/samegame1/samegame.qml 0
+\snippet tutorials/samegame/samegame1/samegame.qml 0
This gives you a basic game window that includes the main canvas for the
blocks, a "New Game" button and a score display.
@@ -99,7 +99,7 @@ The \c Button item in the code above is defined in a separate component file nam
To create a functional button, we use the QML types \l Text and \l MouseArea inside a \l Rectangle.
Here is the \c Button.qml code:
-\snippet quick/tutorials/samegame/samegame1/Button.qml 0
+\snippet 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
@@ -109,7 +109,7 @@ 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:
-\snippet quick/tutorials/samegame/samegame1/Block.qml 0
+\snippet tutorials/samegame/samegame1/Block.qml 0
At the moment, the block doesn't do anything; it is just an image. As the
tutorial progresses we will animate and give behaviors to the blocks.
@@ -153,7 +153,7 @@ create the blocks in JavaScript.
Here is the JavaScript code for generating the blocks, contained in a new
file, \c samegame.js. The code is explained below.
-\snippet quick/tutorials/samegame/samegame2/samegame.js 0
+\snippet tutorials/samegame/samegame2/samegame.js 0
The \c startNewGame() function deletes the blocks created in the previous game and
calculates the number of rows and columns of blocks required to fill the game window for the new game.
@@ -165,7 +165,7 @@ and moves the new block to its position on the game canvas. This involves severa
\list
-\li \l {QML:Qt::createComponent()}{Qt.createComponent()} is called to
+\li \l {QtQml2::Qt::createComponent()}{Qt.createComponent()} is called to
generate a type from \c Block.qml. If the component is ready,
we can call \c createObject() to create an instance of the \c Block
item.
@@ -189,14 +189,14 @@ Now we need to call the JavaScript code in \c samegame.js from our QML files.
To do this, we add this line to \c samegame.qml which imports
the JavaScript file as a \l{QML Modules}{module}:
-\snippet quick/tutorials/samegame/samegame2/samegame.qml 2
+\snippet tutorials/samegame/samegame2/samegame.qml 2
This allows us to refer to any functions within \c samegame.js using "SameGame"
as a prefix: for example, \c SameGame.startNewGame() or \c SameGame.createBlock().
This means we can now connect the New Game button's \c onClicked handler to the \c startNewGame()
function, like this:
-\snippet quick/tutorials/samegame/samegame2/samegame.qml 1
+\snippet tutorials/samegame/samegame2/samegame.qml 1
So, when you click the New Game button, \c startNewGame() is called and generates a field of blocks, like this:
@@ -237,7 +237,7 @@ As this is a tutorial about QML, not game design, we will only discuss \c handle
To make it easier for the JavaScript code to interface with the QML types, we have added an Item called \c gameCanvas to \c samegame.qml. It replaces the background as the item which contains the blocks. It also accepts mouse input from the user. Here is the item code:
-\snippet quick/tutorials/samegame/samegame3/samegame.qml 1
+\snippet tutorials/samegame/samegame3/samegame.qml 1
The \c gameCanvas item is the exact size of the board, and has a \c score property and a \l MouseArea to handle mouse clicks.
The blocks are now created as its children, and its dimensions are used to determine the board size so that
@@ -247,7 +247,7 @@ Note that it can still be accessed from the script.
When clicked, the \l MouseArea calls \c{handleClick()} in \c samegame.js, which determines whether the player's click should cause any blocks to be removed, and updates \c gameCanvas.score with the current score if necessary. Here is the \c handleClick() function:
-\snippet quick/tutorials/samegame/samegame3/samegame.js 1
+\snippet tutorials/samegame/samegame3/samegame.js 1
Note that if \c score was a global variable in the \c{samegame.js} file you would not be able to bind to it. You can only bind to QML properties.
@@ -255,17 +255,17 @@ Note that if \c score was a global variable in the \c{samegame.js} file you woul
When the player clicks a block and triggers \c handleClick(), \c handleClick() also calls \c victoryCheck() to update the score and to check whether the player has completed the game. Here is the \c victoryCheck() code:
-\snippet quick/tutorials/samegame/samegame3/samegame.js 2
+\snippet tutorials/samegame/samegame3/samegame.js 2
This updates the \c gameCanvas.score value and displays a "Game Over" dialog if the game is finished.
The Game Over dialog is created using a \c Dialog type that is defined in \c Dialog.qml. Here is the \c Dialog.qml code. Notice how it is designed to be usable imperatively from the script file, via the functions and signals:
-\snippet quick/tutorials/samegame/samegame3/Dialog.qml 0
+\snippet tutorials/samegame/samegame3/Dialog.qml 0
And this is how it is used in the main \c samegame.qml file:
-\snippet quick/tutorials/samegame/samegame3/samegame.qml 2
+\snippet 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.
@@ -274,7 +274,7 @@ We give the dialog a \l {Item::z}{z} value of 100 to ensure it is displayed on t
It's not much fun to play Same Game if all the blocks are the same color, so we've modified the \c createBlock() function in \c samegame.js to randomly create a different type of block (for either red, green or blue) each time it is called. \c Block.qml has also changed so that each block contains a different image depending on its type:
-\snippet quick/tutorials/samegame/samegame3/Block.qml 0
+\snippet tutorials/samegame/samegame3/Block.qml 0
\section2 A working game
@@ -286,7 +286,7 @@ Here is a screenshot of what has been accomplished so far:
This is what \c samegame.qml looks like now:
-\snippet quick/tutorials/samegame/samegame3/samegame.qml 0
+\snippet tutorials/samegame/samegame3/samegame.qml 0
The game works, but it's a little boring right now. Where are the smooth animated transitions? Where are the high scores?
If you were a QML expert you could have written these in the first iteration, but in this tutorial they've been saved
@@ -319,7 +319,7 @@ In \c BoomBlock.qml, we apply a \l SpringAnimation behavior to the \c x and \c y
block will follow and animate its movement in a spring-like fashion towards the specified position (whose
values will be set by \c samegame.js).Here is the code added to \c BoomBlock.qml:
-\snippet quick/tutorials/samegame/samegame4/content/BoomBlock.qml 1
+\snippet tutorials/samegame/samegame4/content/BoomBlock.qml 1
The \c spring and \c damping values can be changed to modify the spring-like effect of the animation.
@@ -336,7 +336,7 @@ animate the opacity value so that it gradually fades in and out, instead of abru
visible and invisible. To do this, we'll apply a \l Behavior on the \c opacity property of the \c Image
type in \c BoomBlock.qml:
-\snippet quick/tutorials/samegame/samegame4/content/BoomBlock.qml 2
+\snippet tutorials/samegame/samegame4/content/BoomBlock.qml 2
Note the \c{opacity: 0} which means the block is transparent when it is first created. We could set the opacity
in \c samegame.js when we create and destroy the blocks,
@@ -362,14 +362,14 @@ To fade out, we set \c dying to true instead of setting opacity to 0 when a bloc
Finally, we'll add a cool-looking particle effect to the blocks when they are destroyed. To do this, we first add a \l ParticleSystem in
\c BoomBlock.qml, like so:
-\snippet quick/tutorials/samegame/samegame4/content/BoomBlock.qml 3
+\snippet tutorials/samegame/samegame4/content/BoomBlock.qml 3
To fully understand this you should read the \l Particles documentation, but it's important to note that \c emitRate is set
to zero so that particles are not emitted normally.
Also, we extend the \c dying State, which creates a burst of particles by calling the \c burst() method on the particles type. The code for the states now look
like this:
-\snippet quick/tutorials/samegame/samegame4/content/BoomBlock.qml 4
+\snippet tutorials/samegame/samegame4/content/BoomBlock.qml 4
Now the game is beautifully animated, with subtle (or not-so-subtle) animations added for all of the
player's actions. The end result is shown below, with a different set of images to demonstrate basic theming:
@@ -386,32 +386,32 @@ To do this, we will show a dialog when the game is over to request the player's
This requires a few changes to \c Dialog.qml. In addition to a \c Text type, it now has a
\c TextInput child item for receiving keyboard text input:
-\snippet quick/tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet tutorials/samegame/samegame4/content/Dialog.qml 0
\dots 4
-\snippet quick/tutorials/samegame/samegame4/content/Dialog.qml 2
+\snippet tutorials/samegame/samegame4/content/Dialog.qml 2
\dots 4
-\snippet quick/tutorials/samegame/samegame4/content/Dialog.qml 3
+\snippet 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 types can retrieve the text entered by the user through an \c inputText property:
-\snippet quick/tutorials/samegame/samegame4/content/Dialog.qml 0
-\snippet quick/tutorials/samegame/samegame4/content/Dialog.qml 1
+\snippet tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet tutorials/samegame/samegame4/content/Dialog.qml 1
\dots 4
-\snippet quick/tutorials/samegame/samegame4/content/Dialog.qml 3
+\snippet tutorials/samegame/samegame4/content/Dialog.qml 3
Now the dialog can be used in \c samegame.qml:
-\snippet quick/tutorials/samegame/samegame4/samegame.qml 0
+\snippet tutorials/samegame/samegame4/samegame.qml 0
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 quick/tutorials/samegame/samegame4/content/samegame.js 3
+\snippet tutorials/samegame/samegame4/content/samegame.js 3
\dots 4
-\snippet quick/tutorials/samegame/samegame4/content/samegame.js 4
+\snippet tutorials/samegame/samegame4/content/samegame.js 4
\section3 Storing high scores offline
@@ -419,7 +419,7 @@ Now we need to implement the functionality to actually save the High Scores tabl
Here is the \c saveHighScore() function in \c samegame.js:
-\snippet quick/tutorials/samegame/samegame4/content/samegame.js 2
+\snippet tutorials/samegame/samegame4/content/samegame.js 2
First we call \c sendHighScore() (explained in the section below) if it is possible to send the high scores to an online database.
@@ -438,7 +438,7 @@ If the player entered their name we can send the data to the web service us
If the player enters a name, we send the data to the service using this code in \c samegame.js:
-\snippet quick/tutorials/samegame/samegame4/content/samegame.js 1
+\snippet tutorials/samegame/samegame4/content/samegame.js 1
The \l XMLHttpRequest in this code is the same as the \c XMLHttpRequest() as you'll find in standard browser JavaScript, and can be used in the same way to dynamically get XML
or QML from the web service to display the high scores. We don't worry about the response in this case - we just post the high
diff --git a/src/quick/doc/src/appdevguide/applicationdevelopers.qdoc b/src/quick/doc/src/appdevguide/applicationdevelopers.qdoc
deleted file mode 100644
index 80fdc3607d..0000000000
--- a/src/quick/doc/src/appdevguide/applicationdevelopers.qdoc
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-applicationdevelopers.html
-\title QML Application Developer Resources
-\brief Essential documentation for QML application developers
-
-QML is a declarative language that allows user interfaces to be described in
-terms of their visual components and how they interact and relate with one
-another. It is a highly readable language that was designed to enable
-components to be interconnected in a dynamic manner, and it allows components
-to be easily reused and customized within a user interface. Using the
-\c QtQuick module, designers and developers can easily build fluid animated
-user interfaces in QML, and have the option of connecting these user
-interfaces to any back-end C++ libraries.
-
-This page links to all the information you need to start developing
-applications with \l{Qt QML}{QML} and \l{Qt Quick}.
-
-\section2 Other QML modules
-
-Qt Quick only provides basic visual types, much of Qt's functionality is exposed to QML
-through other modules. If you require the functionality of those modules, you should browse
-their QML documentation. Qt Essentials modules exposing QML types include:
-
-\list
-\li \l {Qt Multimedia} for playing and managing multimedia content and cameras.
-\li \l {Qt WebKit} for rendering web content.
-\endlist
-
-\section1 Quick Start
-
-\list
-\li \l{qtquick-quickstart-basics.html}{QML Basics}
- \list
- \li \l{qtquick-quickstart-basics.html#creating-a-qml-document}{Creating a QML Document}
- \li \l{qtquick-quickstart-basics.html#loading-and-displaying-the-qml-document}{Loading and Displaying the QML Document}
- \endlist
-\li \l{qtquick-quickstart-essentials.html}{QML Essentials}
- \list
- \li \l{qtquick-quickstart-essentials.html#handling-user-input}{Handling User Input}
- \li \l{qtquick-quickstart-essentials.html#property-bindings}{Property Bindings}
- \li \l{qtquick-quickstart-essentials.html#animations}{Animations}
- \li \l{qtquick-quickstart-essentials.html#defining-custom-qml-types-for-re-use}{Defining Custom QML Types for Re-use}
- \endlist
-\endlist
-
-\section1 Code Samples and Demos
-
-To learn more about uses of QML code, there are several code samples which show
-how QML types are used. In addition, there are several demos which show how
-QML code is used in applications.
-
-\list
-\li \l{Qt Quick Code Samples}
-\li \l{QML Demos}
-\endlist
-\section1 Features And Use-Case Solutions
-
-\list
-\li \l{qtquick-usecase-visual.html}{Visual types in QML}
-\li \l{qtquick-usecase-userinput.html}{Responding to User Input in QML}
-\li \l{qtquick-usecase-animations.html}{Animations in QML}
-\li \l{qtquick-usecase-text.html}{Displaying Text in QML}
-\li \l{qtquick-usecase-layouts.html}{Layouts in QML}
-\li \l{qtquick-usecase-styling.html}{Style and Theme Support}
-\li \l{qtquick-usecase-integratingjs.html}{Integrating JavaScript in QML}
-\endlist
-
-
-\section1 In-Depth Documentation
-
-\section2 What is QML?
-
-QML is a user interface specification and programming language.
-It allows developers and designers alike to create highly performant, fluidly
-animated and visually appealing applications. QML offers a highly readable,
-declarative, JSON-like syntax with support for imperative JavaScript
-expressions combined with dynamic property bindings.
-
-The QML language and engine infrastructure is provided by the \l {Qt QML} module.
-For in-depth information about the QML language, please see the
-\l{Qt QML} module documentation.
-
-\section2 What is Qt Quick?
-
-Qt Quick is the standard library of types and functionality for QML. It
-includes visual types, interactive types, animations, models and views,
-particle effects and shader effects. A QML application developer can get
-access to all of that functionality with a single import statement.
-
-The \c QtQuick QML library is provided by the \l{Qt Quick} module.
-For in-depth information about the various QML types and other functionality
-provided by Qt Quick, please see the \l{Qt Quick} module documentation.
-
-\section1 Advanced Application Development Topics
-
-\list
-\li \l{qtquick-deployment.html}{Deploying QML Applications}
-\li \l{qtquick-performance.html}{Performance Considerations and Suggestions}
-\li \l{qtquick-internationalization.html}{Internationalization and Localization}
-\li Testing and Debugging
- \list
- \li \l{qtquick-qmlscene.html}{Prototyping with qmlscene}
- \li \l{qtquick-debugging.html}{Debugging QML Applications}
- \li \l{qtquick-qtquicktest.html}{Qt Quick Test: QML Unit Testing Framework}
- \endlist
-\li \l{qml-codingconventions.html}{QML Coding Conventions}
-\li \l{qtquick-glossary.html}{Glossary of Terms}
-\endlist
-
-\section1 Release Notes and Porting Guides
-
-\list
-\li \l{Qt QML Release Notes}
-\li \l{Qt Quick Release Notes}
-\li \l{Porting QML Applications to Qt 5}
-\endlist
-
-*/
diff --git a/src/quick/doc/src/appdevguide/codingconventions.qdoc b/src/quick/doc/src/appdevguide/codingconventions.qdoc
deleted file mode 100644
index 385c00d2a6..0000000000
--- a/src/quick/doc/src/appdevguide/codingconventions.qdoc
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qml-codingconventions.html
-\title QML Coding Conventions
-\brief code style convention
-
-This document contains the QML coding conventions that we follow in our documentation and examples and recommend that others follow.
-
-\section1 QML Object Declarations
-
-Throughout our documentation and examples, \l{QML Object Attributes}{QML object attributes} are always structured in the following order:
-
-\list
-\li id
-\li property declarations
-\li signal declarations
-\li JavaScript functions
-\li object properties
-\li child objects
-\li states
-\li transitions
-\endlist
-
-For better readability, we separate these different parts with an empty line.
-
-
-For example, a hypothetical \e photo QML object would look like this:
-
-\snippet qml/codingconventions/photo.qml 0
-
-
-\section1 Grouped Properties
-
-If using multiple properties from a group of properties,
-consider using \e {group notation} instead of \e {dot notation} if it
-improves readability.
-
-For example, this:
-
-\snippet qml/codingconventions/dotproperties.qml 0
-
-could be written like this:
-
-\snippet qml/codingconventions/dotproperties.qml 1
-
-
-\section1 Lists
-
-If a list contains only one element, we generally omit the square brackets.
-
-For example, it is very common for a component to only have one state.
-
-In this case, instead of:
-
-\snippet qml/codingconventions/lists.qml 0
-
-we will write this:
-
-\snippet qml/codingconventions/lists.qml 1
-
-
-\section1 JavaScript Code
-
-If the script is a single expression, we recommend writing it inline:
-
-\snippet qml/codingconventions/javascript.qml 0
-
-If the script is only a couple of lines long, we generally use a block:
-
-\snippet qml/codingconventions/javascript.qml 1
-
-If the script is more than a couple of lines long or can be used by different objects, we recommend creating a function and calling it like this:
-
-\snippet qml/codingconventions/javascript.qml 2
-
-For long scripts, we will put the functions in their own JavaScript file and import it like this:
-
-\snippet qml/codingconventions/javascript-imports.qml 0
-
-*/
diff --git a/src/quick/doc/src/appdevguide/debugging.qdoc b/src/quick/doc/src/appdevguide/debugging.qdoc
deleted file mode 100644
index 07d9bac801..0000000000
--- a/src/quick/doc/src/appdevguide/debugging.qdoc
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-debugging.html
-\ingroup qtquick-tools
-\title Debugging QML Applications
-\brief debugging tools in QML
-
-\section1 Console API
-
-\section2 Log
-
-\c console.log, console.debug, console.info, console.warn and console.error can be used to print
-debugging information to the console. For example:
-
-\code
-function f(a, b) {
- console.log("a is ", a, "b is ", b);
-}
-\endcode
-
-The output is generated using the qDebug, qWarning, qCritical methods in C++
-(see also \l {Debugging Techniques}).
-
-Setting the environment variable QML_CONSOLE_EXTENDED also prints the source
-code location of the call.
-
-\section2 Assert
-
-\c console.assert tests that an expression is true. If not, it will write an optional message
-to the console and print the stack trace.
-
-\code
-function f() {
- var x = 12
- console.assert(x == 12, "This will pass");
- console.assert(x > 12, "This will fail");
-}
-\endcode
-
-\section2 Timer
-
-\c console.time and console.timeEnd log the time (in milliseconds) that was spent between
-the calls. Both take a string argument that identifies the measurement. For example:
-
-\code
-function f() {
- console.time("wholeFunction");
- console.time("firstPart");
- // first part
- console.timeEnd("firstPart");
- // second part
- console.timeEnd("wholeFunction");
-}
-\endcode
-
-\section2 Trace
-
-\c console.trace prints the stack trace of the JavaScript execution at the point where
-it was called. The stack trace info contains the function name, file name, line number
-and column number. The stack trace is limited to last 10 stack frames.
-
-\section2 Count
-
-\c console.count prints the current number of times a particular piece of code has been executed,
-along with a message. That is,
-
-\code
-function f() {
- console.count("f called");
-}
-\endcode
-
-will print \c{f called: 1}, \c{f called: 2} ... whenever \c{f()} is executed.
-
-\section2 Profile
-
-\c console.profile turns on the QML and JavaScript profilers. Nested calls are not
-supported and a warning will be printed to the console.
-
-\c console.profileEnd turns off the QML and JavaScript profilers. Calling this function
-without a previous call to console.profile will print a warning to the console. A
-profiling client should have been attached before this call to receive and store the
-profiling data. For example:
-
-\code
-function f() {
- console.profile();
- //Call some function that needs to be profiled.
- //Ensure that a client is attached before ending
- //the profiling session.
- console.profileEnd();
-}
-\endcode
-
-\section2 Exception
-
-\c console.exception prints an error message together with the stack trace of JavaScript
-execution at the point where it is called.
-
-\section1 Debugging module imports
-
-The \c QML_IMPORT_TRACE environment variable can be set to enable debug output
-from QML's import loading mechanisms.
-
-For example, for a simple QML file like this:
-
-\qml
-import QtQuick 2.0
-
-Rectangle { width: 100; height: 100 }
-\endqml
-
-If you set \c {QML_IMPORT_TRACE=1} before running the \l{qtquick-qmlscene.html}
-{QML Scene} (or your QML C++ application), you will see output similar to this:
-
-\code
-QQmlImportDatabase::addImportPath "/qt-sdk/imports"
-QQmlImportDatabase::addImportPath "/qt-sdk/bin/QMLViewer.app/Contents/MacOS"
-QQmlImportDatabase::addToImport 0x106237370 "." -1.-1 File as ""
-QQmlImportDatabase::addToImport 0x106237370 "Qt" 4.7 Library as ""
-QQmlImportDatabase::resolveType "Rectangle" = "QDeclarativeRectangle"
-\endcode
-
-
-\section1 Debugging with Qt Creator
-
-\l{http://qt-project.org/doc/qtcreator}{Qt Creator} provides built-in
-support for QML debugging. QML projects and standalone C++ applications that
-utilize QML can be debugged on desktops as well as on remote devices.
-For more information, see the Qt Creator Manual.
-
-*/
diff --git a/src/quick/doc/src/appdevguide/deployment.qdoc b/src/quick/doc/src/appdevguide/deployment.qdoc
deleted file mode 100644
index 3788cbdb08..0000000000
--- a/src/quick/doc/src/appdevguide/deployment.qdoc
+++ /dev/null
@@ -1,212 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-deployment.html
-\title Deploying QML Applications
-\brief Deploying QML applications
-
-
-
-QML documents are loaded and executed by the QML runtime. This includes the
-Declarative UI engine along with the built-in QML types and plugin modules,
-and it also provides access to third-party QML types and modules.
-
-Applications that use QML need to invoke the QML runtime in order to
-execute QML documents. This can be done by creating a QQuickView
-or a QQmlEngine, as described below. In addition, the Declarative UI
-package includes the qmlscene tool, which loads \c .qml files. This tool is
-useful for developing and testing QML code without the need to write
-a C++ application to load the QML runtime.
-
-
-
-\section1 Deploying QML-based applications
-
-To deploy an application that uses QML, the QML runtime must be invoked by
-the application. This is done by writing a Qt C++ application that loads the
-QQmlEngine by either:
-
-\list
-\li Loading the QML file through a QQuickView instance, or
-\li Creating a QQmlEngine instance and loading QML files with QQmlComponent
-\endlist
-
-
-\section2 Deploying with QQuickView
-
-QQuickView is a QWindow-based class that is able to load QML files.
-For example, if there is a QML file, \c application.qml, it will
-look like this:
-
-\qml
- import QtQuick 2.0
-
- Rectangle { width: 100; height: 100; color: "red" }
-\endqml
-
-It can be loaded in a Qt application's \c main.cpp file like this:
-
-\code
- #include <QGuiApplication>
- #include <QQuickView>
-
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
-
- QQuickView view;
- view.setSource(QUrl::fromLocalFile("application.qml"));
- view.show();
-
- return app.exec();
- }
-\endcode
-
-This creates a QWindow-based view that displays the contents of
-\c application.qml.
-
-The application's \c .pro \l{qmake Project Files}{project file} must specify
-the \c declarative module for the \c QT variable. For example:
-
-\code
- TEMPLATE += app
- QT += quick
- SOURCES += main.cpp
-\endcode
-
-
-\section2 Creating a QQmlEngine directly
-
-If \c application.qml does not have any graphical components, or if it is
-preferred to avoid QQuickView for other reasons, the QQmlEngine
-can be constructed directly instead. In this case, \c application.qml is
-loaded as a QQmlComponent instance rather than placed into a view:
-
-\code
- #include <QGuiApplication>
- #include <QQmlEngine>
- #include <QQmlContext>
- #include <QQmlComponent>
-
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
-
- QQmlEngine engine;
- QQmlContext *objectContext = new QQmlContext(engine.rootContext());
-
- QQmlComponent component(&engine, "application.qml");
- QObject *object = component.create(objectContext);
-
- // ... delete object and objectContext when necessary
-
- return app.exec();
- }
-\endcode
-
-QGuiApplication can be replaced by a QCoreApplication in the code above in case you are not
-using any graphical items from Qt Quick. This allows using QML as a language without any
-dependencies to the \l {Qt GUI} module.
-
-See \l{qtqml-cppintegration-data.html}{qtqml-cppintegration-exposecppattributes.html}{Exposing Attributes of C++ Types to QML}
-for more information about using QQmlEngine, QQmlContext and QQmlComponent, as well
-as details on including QML files through \l{The Qt Resource System}{Qt's Resource system}.
-
-
-
-\section1 Developing and Prototyping with QML Scene
-
-The Declarative UI package includes a QML runtime tool,
-\l{qtquick-qmlscene.html}{qmlscene}, which loads and displays QML documents.
-This is useful during the application development phase for prototyping
-QML-based applications without writing your own C++ applications to invoke
-the QML runtime.
-
-
-
-\section1 Managing resource files with the Qt resource system
-
-The \l {The Qt Resource System}{Qt resource system} allows resource files to be stored as
-binary files in an application executable. This can be useful when building a mixed
-QML/C++ application as it enables QML files (as well as other resources such as images
-and sound files) to be referred to through the resource system URI scheme rather than
-relative or absolute paths to filesystem resources. Note, however, that if you use the resource
-system, the application executable must be re-compiled whenever a QML source file is changed
-in order to update the resources in the package.
-
-To use the resource system in a mixed QML/C++ application:
-
-\list
-\li Create a \c .qrc \l {The Qt Resource System}{resource collection file} that lists resource
- files in XML format
-\li From C++, load the main QML file as a resource using the \c :/ prefix or as a URL with the
- \c qrc scheme
-\endlist
-
-Once this is done, all files specified by relative paths in QML will be loaded from
-the resource system instead. Use of the resource system is completely transparent to
-the QML layer; this means all QML code should refer to resource files using relative
-paths and should \e not use the \c qrc scheme. This scheme should only be used from
-C++ code for referring to resource files.
-
-Here is a application packaged using the \l {The Qt Resource System}{Qt resource system}.
-The directory structure looks like this:
-
-\code
-project
- |- example.qrc
- |- main.qml
- |- images
- |- background.png
- |- main.cpp
- |- project.pro
-\endcode
-
-The \c main.qml and \c background.png files will be packaged as resource files. This is
-done in the \c example.qrc resource collection file:
-
-\snippet ../src/qml/doc/snippets/qml/qtbinding/resources/example.qdoc 0
-
-Since \c background.png is a resource file, \c main.qml can refer to it using the relative
-path specified in \c example.qrc:
-
-\snippet ../src/qml/doc/snippets/qml/qtbinding/resources/main.qml 0
-
-To allow QML to locate resource files correctly, the \c main.cpp loads the main QML
-file, \c main.qml, as a resource file using the \c qrc scheme:
-
-\snippet ../src/qml/doc/snippets/qml/qtbinding/resources/main.cpp 0
-
-Finally, \c project.pro uses the RESOURCES variable to indicate that \c example.qrc should
-be used to build the application resources:
-
-\quotefile ../src/qml/doc/snippets/qml/qtbinding/resources/resources.pro
-
-See \l {The Qt Resource System} for more information.
-
-*/
diff --git a/src/quick/doc/src/appdevguide/glossary.qdoc b/src/quick/doc/src/appdevguide/glossary.qdoc
deleted file mode 100644
index 3c02918576..0000000000
--- a/src/quick/doc/src/appdevguide/glossary.qdoc
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-glossary.html
-\title Qt Quick Glossary Of Terms
-\brief Glossary of terms used in the documentation for QML and Qt Quick
-
-\section1 Common Terms
-
-\table
- \header
- \li Term
- \li Definition
-
- \row
- \li QML
- \li The language in which QML applications are written. The language
- architecture and engine are implemented by the Qt QML module.
-
- \row
- \li Qt Quick
- \li The standard library of types and functionality for the
- QML language, which is provided by the Qt Quick module,
- and may be accessed with "import QtQuick 2.0"
-
- \row
- \li Type
- \li In QML, a \e type may refer to either a
- \l{qtqml-typesystem-topic.html}{Basic Type} or a
- \l{qtqml-typesystem-topic.html#qml-object-types}{QML Object Type}.
-
- The QML language provides a number of built in
- (\l{qtqml-typesystem-basictypes.html}{basic types}), and the
- Qt Quick module provides various \l{qtquick-qmltypereference.html}
- {Qt Quick types} for building QML applications. Types can also be
- provided by third-party developers through
- (\l{qtqml-modules-topic.html}{modules}) or by the application
- developer in the application itself through
- \l{qtqml-documents-definetypes.html}{QML Documents}.
-
- See \l{qtqml-typesystem-topic.html}{The QML Type System}
- for more details.
-
- \row
- \li Basic Type
- \li A \l{qtqml-typesystem-topic.html}{basic type} is a simple type
- such as \c int, \c string and \c bool. Unlike
- \l{qtqml-typesystem-topic.html#qml-object-types}{object types},
- an object cannot be instantiated from a basic type; for example,
- it is not possible to create an \c int object with properties,
- methods, signals and so on.
-
- Basic types are built into the QML language, whereas object types
- cannot be used unless the appropriate
- \l{qtqml-modules-topic.html}{module} is imported.
-
- See \l{qtqml-typesystem-topic.html}{The QML Type System}
- for more details.
-
- \row
- \li Object Type
- \li A \l{qtqml-typesystem-topic.html#qml-object-types}{QML Object Type}
- is a type that can be instantiated by the QML engine.
-
- A QML type can be defined either by a document in a .qml file
- beginning with a capital letter, or by a QObject-based C++ class.
-
- See \l{qtqml-typesystem-topic.html}{The QML Type System}
- for more details.
-
- \row
- \li Object
- \li A QML object is an instance of a
- \l{qtqml-typesystem-topic.html#qml-object-types}{QML Object Type}.
-
- Such objects are created by the engine when it processes
- \l{qtqml-syntax-basics.html#object-declarations}{object declarations},
- which specify the objects to be created and the attributes that are to
- be defined for each object.
-
- Additionally, objects can be dynamically created at runtime through
- Component.createObject() and Qt.createQmlObject().
-
- See also \l{#lazy-instantiation}{Lazy Instantiation}.
-
- \row
- \li Component
- \li A component is a template from which a QML object or object
- tree is created. It is produced when a document is loaded by
- the QML engine. Once it has been loaded, it can be used to
- instantiate the object or object tree that it represents.
-
- Additionally, the \l Component type is a special type that can
- can be used to declare a component inline within a document.
- Component objects can also be dynamically created through
- Qt.createComponent() to dynamically create QML objects.
-
- \row
- \li Document
- \li A \l{qtqml-documents-topic.html}{QML Document} is a self
- contained piece of QML source code that begins with one or more
- import statements and contains a single top-level object
- declaration. A document may reside in a .qml file or a text string.
-
- If it is placed in a .qml file whose name begins with a capital
- letter, the file is recognized by the engine as a definition of
- a QML type. The top-level object declaration encapsulates the
- object tree that will be instantiated by the type.
-
- \row
- \li Property
- \li A property is an attribute of an object type that has a name and
- an associated value; this value can be read (and in most cases, also
- written to) externally.
-
- An object can have one or more properties. Some properties
- are associated with the canvas (e.g., x, y, width, height,
- and opacity) while others may be data specific to that type
- (e.g., the "text" property of the \l Text type).
-
- See \l{qtqml-syntax-objectattributes.html}{QML Object Attributes}
- for more details.
-
- \row
- \li Binding
- \li A binding is a JavaScript expression which is "bound" to a
- property. The value of the property at any point in time
- will be the value returned by evaluating that expression.
-
- See \l{qtqml-syntax-propertybinding.html}{Property Binding}
- for more details.
-
- \row
- \li Signal
- \li A signal is a notification from a QML object. When an object emits
- a signal, other objects can receive and process this signal through
- a \l{Signal Attributes}{signal handler}.
-
- Most properties of QML objects
- have a change signal, and also an associated change signal handler
- which may be defined by clients to implement functionality. For
- example, the "onClicked()" handler of an instance of the MouseArea
- type might be defined in an application to cause a sound to be
- played.
-
- See \l{qtqml-syntax-signals.html}{Signal and Handler Event System}
- for more details.
-
- \row
- \li Signal Handler
- \li A signal handler is the expression (or function) which is triggered
- by a signal. It is also known as a "slot" in C++.
-
- See \l{qtqml-syntax-signals.html}{Signal and Handler Event System}
- for more details.
-
- \row
- \target lazy-instantiation
- \li Lazy Instantiation
- \li Object instances can be instantiated "lazily" at run-time,
- to avoid performing unnecessary work until needed. Qt Quick
- provides the \l Loader type to make lazy instantiation more
- convenient.
-\endtable
-
-\section1 Indexed Alphabetically
-
-*/
diff --git a/src/quick/doc/src/appdevguide/internationalization.qdoc b/src/quick/doc/src/appdevguide/internationalization.qdoc
deleted file mode 100644
index 9c3e9d9cfb..0000000000
--- a/src/quick/doc/src/appdevguide/internationalization.qdoc
+++ /dev/null
@@ -1,280 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-internationalization.html howto
-\ingroup qml-features
-\title Internationalization and Localization with Qt Quick
-\brief Following these steps, you can write your Qt Quick application so it can be localized for multiple languages
-
-\section1 Internationalizing your Application
-
-The following sections describe various aspects of internationalizing your QML
-source code. If you follow these guides for all the user interface components in
-your application, it becomes possible to localize every aspect of your
-application for different languages and local cultural conventions such as the
-way dates and numbers are formatted.
-
-\section2 1. Use qsTr() for all Literal User Interface Strings
-
-Strings in QML can be marked for translation using the qsTr(), qsTranslate(),
-qsTrId(), QT_TR_NOOP(), QT_TRANSLATE_NOOP(), and QT_TRID_NOOP() functions. The
-most common way of marking strings is with the qsTr() function. For example:
-
-\code
-Text {
- id: txt1;
- text: qsTr("Back");
-}
-\endcode
-
-This code makes "Back" a key entry in the translation files. At runtime, the
-translation system looks up the keyword "Back" and then gets the corresponding
-translation value for the current system locale. The result is returned to the
-\c text property and the user interface will show the appropriate translation of
-"Back" for the current locale.
-
-
-\section2 2. Add Context for the Translator
-
-User interface strings are often short so you need to help the person
-translating the text understand the context of the text. You can add context
-information in the source code as extra descriptive text before the string to be
-translated. These extra descriptions are included in the .ts translation files
-delivered to the translator.
-
-\note The .ts files are XML files with the source texts and a place for the
-translated text. The updated .ts files are converted into binary translation
-files and included as part of the final application.
-
-In the following code snippet, the text on the \c {//:} line is the main comment
-for the translator.
-
-The text on the \c{//~} line is optional extra information. The first word of
-the text is used as an additional identifier in the XML element in the .ts file
-so make sure the first word is not part of the sentence. For example, the
-comment "Context Not related to that" is converted to "<extra-Context>Not
-related to that" in the .ts file.
-
-\code
-Text {
- id: txt1;
- // This user interface string is only used here
- //: The back of the object, not the front
- //~ Context Not related to back-stepping
- text: qsTr("Back");
-}
-\endcode
-
-\section2 3. Disambiguate Identical Texts
-
-The translation system consolidates the user interface text strings into unique
-items. This consolidation saves the person doing the translation work having to
-translate the same text multiple times. However, in some cases, the text is
-identical but has a different meaning. For example, in English, "back" means
-take a step backward and also means the part of an object opposite to the front.
-You need to tell the translation system about these two separate meanings so the
-translator can create two separate translations.
-
-Differentiate between identical texts by adding some id text as the second
-parameter of the qsTr() function.
-
-In the following code snippet, the \c {not front} text is an id to differentiate
-this "Back" text from the backstepping "Back" text:
-
-\code
-Text {
- id: txt1;
- // This user interface string is used only here
- //: The back of the object, not the front
- //~ Context Not related to back-stepping
- text: qsTr("Back", "not front");
-}
-\endcode
-
-\section2 4. Use \c %x to Insert Parameters into a String
-
-Different languages put words together in different orders so it is not a good
-idea to create sentences by concatenating words and data. Instead, use \c % to
-insert parameters into strings. For example, the following snippet has a string
-with two number parameters \c %1 and \c %2. These parameters are inserted with
-the \c .arg() functions.
-
-\code
-Text {
- text: qsTr("File %1 of %2").arg(counter).arg(total)
-}
-\endcode
-
-%1 refers to the first parameter and \c %2 refers to the second parameter so this
-code produces output like: "File 2 of 3".
-
-\section2 5. Use %Lx so Numbers are Localized
-
-If you include the \c %L modifier when you specify a parameter, the number is
-localized according to the current regional settings. For example, in the
-following code snippet, \c %L1 means to format the first parameters according to
-the number formatting conventions of the currently selected locale (geographical
-region):
-
-\code
-Text {
- text: qsTr("%L1").arg(total)
-}
-\endcode
-
-Then, with the above code, if \c total is the number "4321.56" (four thousand
-three hundred and twenty one point fifty six); with English regional settings,
-(locale) the output is "4,321.56"; with German regional settings, the output is
-"4.321,56".
-
-\section2 6. Internationalize Dates, Times and Currencies
-
-There are no special in-string modifiers for formatting dates and times.
-Instead, you need to query the current locale (geographical region) and use the
-methods of \l {QtQuick2::Date}{Date} to format the string.
-
-\c Qt.locale() returns a \l {QtQuick2::Locale}{Locale} object which contains all
-kinds of information about the locale. In particular, the \l
-{QtQuick2::Locale::name}{Locale.name} property contains the language and country
-information for the current locale. You can use the value as is, or you can
-parse it to determine the appropriate content for the current locale.
-
-The following snippet gets the current date and time with Date(), then converts
-that to a string for the current locale. Then it inserts the date string into
-the %1 parameter for the appropriate translation.
-
-\code
-Text {
- text: qsTr("Date %1").arg(Date().toLocaleString(Qt.locale()))
-}
-\endcode
-
-To make sure currency numbers are localized, use the \l
-{QtQuick2::Number}{Number} type. This type has similar functions as the Date
-type for converting numbers into localized currency strings.
-
-\section2 7. Use QT_TR_NOOP() for Translatable Data Text Strings
-
-If the user changes the system language without a reboot, depending on the
-system, the strings in arrays and list models and other data structures might
-not be refreshed automatically. To force the texts to be refreshed when they are
-displayed in the user interface, you need declare the strings with the
-QT_TR_NOOP() macro. Then, when you populate the objects for display, you need to
-explicitly retrieve the translation for each text. For example:
-
-\code
-ListModel {
- id: myListModel;
- ListElement {
- //: Capital city of Finland
- name: QT_TR_NOOP("Helsinki");
- }
- }
-
-...
-
-Text {
- text: qsTr(myListModel.get(0).name); // get the translation of the name property in element 0
- }
-\endcode
-
-
-\section2 8. Use Locale to Extend Localization Features
-
-If you want different graphics or audio for different geographical regions, you
-can use Qt.locale() to get the current locale. Then you choose appropriate
-graphics or audio for that locale.
-
-The following code snippet shows how you could select an appropriate icon
-that represents the language of the current locale.
-
-\code
-Component.onCompleted: {
- switch (Qt.locale().name.substring(0,2)) {
- case "en": // show the English-language icon
- languageIcon = "../images/language-icon_en.png";
- break;
- case "fi": // show the Finnish language icon
- languageIcon = "../images/language-icon_fi.png";
- break;
- default: // show a default language icon
- languageIcon = "../images/language-icon_default.png";
- }
-}
-\endcode
-
-\section1 Localizing your Application
-
-Qt Quick applications use the same underlying localization system as Qt C++
-applications (lupdate, lrelease and .ts files). You use the same tools as
-described in the \l {Qt Linguist Manual: Release Manager}{Qt Linguist Manual}.
-You can even have user interface strings in C++ and QML source in the same
-application. The system will create a single combined translation file and the
-strings are accessible from QML and C++.
-
-\section2 Use a Conditional to Hide QML Source From the Compiler
-
-The \c lupdate tool extracts user interface strings from your application.
-lupdate reads your application's .pro file to identify which source files
-contain texts to be translated. This means your source files must be listed in
-the \c SOURCES or \c HEADERS entry in the .pro file. If your files are not
-listed the texts in them will not be found.
-
-However, the SOURCES variable is intended for C++ source files. If you list QML
-or JavaScript source files there, the compiler tries to build them as though
-they are C++ files. As a workaround, you can use an \c lupdate_only{...}
-conditional statement so the \c lupdate tool sees the .qml files but the C++
-compiler ignores them.
-
-For example, the following .pro file snippet specifies two .qml files in
-the application.
-
-\code
-lupdate_only{
-SOURCES = main.qml \
- MainPage.qml
-}
-\endcode
-
-
-You can also specify the .qml source files with a wildcard match. The
-search is not recursive so you need to specify each directory where there are
-user interface strings in the source code:
-
-\code
-lupdate_only{
-SOURCES = *.qml \
- *.js \
- content/*.qml \
- content/*.js
-}
-\endcode
-
-See the \l {Qt Linguist Manual} for more details about Qt localization.
-
-*/
diff --git a/src/quick/doc/src/appdevguide/performance.qdoc b/src/quick/doc/src/appdevguide/performance.qdoc
deleted file mode 100644
index c6c4835afc..0000000000
--- a/src/quick/doc/src/appdevguide/performance.qdoc
+++ /dev/null
@@ -1,1147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-performance.html
-\title Performance Considerations And Suggestions
-\brief Discussion of performance-related tradeoffs and best-practices
-
-\section1 Timing Considerations
-
-As an application developer, you must strive to allow the rendering engine
-to achieve a consistent 60 frames-per-second refresh rate. 60 FPS means
-that there is approximately 16 milliseconds between each frame in which
-processing can be done, which includes the processing required to upload
-the draw primitives to the graphics hardware.
-
-In practice, this means that the application developer should:
-\list
- \li use asynchronous,event driven programming wherever possible
- \li use worker threads to do significant processing
- \li never manually spin the event loop
- \li never spend more than a couple of milliseconds per frame within blocking functions.
-\endlist
-
-Failure to do so will result in skipped frames, which has a drastic effect on the
-user experience.
-
-\note A pattern which is tempting, but should \e never be used, is creating your
-own QEventLoop or calling QCoreApplication::processEvents() in order to avoid
-blocking within a C++ code block invoked from QML. This is dangerous because
-when an event loop is entered in a signal handler or binding, the QML engine
-continues to run other bindings, animations, transitions, etc. Those bindings
-can then cause side effects which, for example, destroy the hierarchy containing
-your event loop.
-
-\section1 Profiling
-
-The most important tip is: use the QML profiler included with Qt Creator. Knowing
-where time is spent in an application will allow you to focus on problem areas which
-actually exist, rather than problem areas which potentially exist. See the Qt Creator
-manual for more information on how to use the QML profiling tool.
-
-Determining which bindings are being run the most often, or which functions your
-application is spending the most time in, will allow you to decide whether you need
-to optimize the problem areas, or redesign some implementation details of your
-application so that the performance is improved. Attempting to optimize code without
-profiling is likely to result in very minor rather than significant performance
-improvements.
-
-\section1 JavaScript Code
-
-Most QML applications will have a large amount of JavaScript code in them, in the
-form of dynamic functions, signal handlers, and property binding expressions.
-This is generally not a problem. Thanks to some optimizations in the QML engine,
-such as to the bindings compiler, it can for some use-cases be faster than calling a C++
-function. However, care must be taken to ensure that unnecessary processing isn't
-triggered accidentally.
-
-\section2 Bindings
-
-There are two types of bindings in QML: optimized and non-optimized bindings.
-It is a good idea to keep binding expressions as simple as possible, since the
-QML engine makes use of an optimized binding expression evaluator which can
-evaluate simple binding expressions without needing to switch into a full
-JavaScript execution environment. These optimized bindings are evaluated far
-more efficiently than more complex (non-optimized) bindings. The basic
-requirement for optimization of bindings is that the type information of every
-symbol accessed must be known at compile time.
-
-Things to avoid in binding expressions to maximize optimizability:
-\list
- \li declaring intermediate JavaScript variables
- \li accessing "var" properties
- \li calling JavaScript functions
- \li constructing closures or defining functions within the binding expression
- \li accessing properties outside of the immediate evaluation scope
- \li writing to other properties as side effects
-\endlist
-
-The QML_COMPILER_STATS environment variable may be set when running a QML application
-to print statistics about how many bindings were able to be optimized.
-
-Bindings are quickest when they know the type of objects and properties they are working
-with. This means that non-final property lookup in a binding expression can be slower
-in some cases, where it is possible that the type of the property being looked up has
-been changed (for example, by a derived type).
-
-The immediate evaluation scope can be summarized by saying that it contains:
-\list
- \li the properties of the expression scope object (for binding expressions, this is
- the object to which the property binding belongs)
- \li ids of any objects in the component
- \li the properties of the root item in the component
-\endlist
-
-Ids of objects from other components and properties of any such objects, as
-well as symbols defined in or included from a JavaScript import, are not in the
-immediate evaluation scope, and thus bindings which access any of those things
-will not be optimized.
-
-Note that if a binding cannot be optimized by the QML engine's optimized binding
-expression evaluator, and thus must be evaluated by the full JavaScript environment,
-some of the tips listed above will no longer apply. For example, it can sometimes be
-beneficial to cache the result of property resolution in an intermediate JavaScript
-variable in a very complex binding. Upcoming sections have more information on these
-sorts of optimizations.
-
-\section2 Type-Conversion
-
-One major cost of using JavaScript is that in most cases when a property from a QML
-type is accessed, a JavaScript object with an external resource containing the
-underlying C++ data (or a reference to it) is created. In most cases, this is fairly
-inexpensive, but in others it can be quite expensive. One example of where it is
-expensive is assigning a C++ QVariantMap Q_PROPERTY to a QML "variant" property.
-Lists can also be expensive, although sequences of specific types (QList of int,
-qreal, bool, QString, and QUrl) should be inexpensive; other list types involve an
-expensive conversion cost (creating a new JavaScript Array, and adding new types
-one by one, with per-type conversion from C++ type instance to JavaScript value).
-
-Converting between some basic property types (such as "string" and "url" properties)
-can also be expensive. Using the closest matching property type will avoid unnecessary
-conversion.
-
-If you must expose a QVariantMap to QML, use a "var" property rather than a "variant"
-property. In general, "property var" should be considered to be superior to
-"property variant" for every use-case in QtQuick 2.0 (note that "property variant"
-is marked as obsolete in the QtQuick 2.0 documentation), as it allows a true JavaScript
-reference to be stored (which can reduce the number of conversions required in certain
-expressions).
-
-\section2 Resolving Properties
-
-Property resolution takes time. While in some cases the result of a lookup can be
-cached and reused, it is always best to avoid doing unnecessary work altogether, if
-possible.
-
-In the following example, we have a block of code which is run often (in this case, it
-is the contents of an explicit loop; but it could be a commonly-evaluated binding expression,
-for example) and in it, we resolve the object with the "rect" id and its "color" property
-multiple times:
-
-\qml
-// bad.qml
-import QtQuick 2.0
-
-Item {
- width: 400
- height: 200
- Rectangle {
- id: rect
- anchors.fill: parent
- color: "blue"
- }
-
- function printValue(which, value) {
- console.log(which + " = " + value);
- }
-
- Component.onCompleted: {
- var t0 = new Date();
- for (var i = 0; i < 1000; ++i) {
- printValue("red", rect.color.r);
- printValue("green", rect.color.g);
- printValue("blue", rect.color.b);
- printValue("alpha", rect.color.a);
- }
- var t1 = new Date();
- console.log("Took: " + (t1.valueOf() - t0.valueOf()) + " milliseconds for 1000 iterations");
- }
-}
-\endqml
-
-We could instead resolve the common base just once in the block:
-
-\qml
-// good.qml
-import QtQuick 2.0
-
-Item {
- width: 400
- height: 200
- Rectangle {
- id: rect
- anchors.fill: parent
- color: "blue"
- }
-
- function printValue(which, value) {
- console.log(which + " = " + value);
- }
-
- Component.onCompleted: {
- var t0 = new Date();
- for (var i = 0; i < 1000; ++i) {
- var rectColor = rect.color; // resolve the common base.
- printValue("red", rectColor.r);
- printValue("green", rectColor.g);
- printValue("blue", rectColor.b);
- printValue("alpha", rectColor.a);
- }
- var t1 = new Date();
- console.log("Took: " + (t1.valueOf() - t0.valueOf()) + " milliseconds for 1000 iterations");
- }
-}
-\endqml
-
-Just this simple change results in a significant performance improvement.
-Note that the code above can be improved even further (since the property
-being looked up never changes during the loop processing), by hoisting the
-property resolution out of the loop, as follows:
-
-\qml
-// better.qml
-import QtQuick 2.0
-
-Item {
- width: 400
- height: 200
- Rectangle {
- id: rect
- anchors.fill: parent
- color: "blue"
- }
-
- function printValue(which, value) {
- console.log(which + " = " + value);
- }
-
- Component.onCompleted: {
- var t0 = new Date();
- var rectColor = rect.color; // resolve the common base outside the tight loop.
- for (var i = 0; i < 1000; ++i) {
- printValue("red", rectColor.r);
- printValue("green", rectColor.g);
- printValue("blue", rectColor.b);
- printValue("alpha", rectColor.a);
- }
- var t1 = new Date();
- console.log("Took: " + (t1.valueOf() - t0.valueOf()) + " milliseconds for 1000 iterations");
- }
-}
-\endqml
-
-\section2 Property Bindings
-
-A property binding expression will be re-evaluated if any of the properties
-it references are changed. As such, binding expressions should be kept as
-simple as possible.
-
-If you have a loop where you do some processing, but only the final result
-of the processing is important, it is often better to update a temporary
-accumulator which you afterwards assign to the property you need to update,
-rather than incrementally updating the property itself, in order to avoid
-triggering re-evaluation of binding expressions during the intermediate
-stages of accumulation.
-
-The following contrived example illustrates this point:
-
-\qml
-// bad.qml
-import QtQuick 2.0
-
-Item {
- id: root
- width: 200
- height: 200
- property int accumulatedValue: 0
-
- Text {
- anchors.fill: parent
- text: root.accumulatedValue.toString()
- onTextChanged: console.log("text binding re-evaluated")
- }
-
- Component.onCompleted: {
- var someData = [ 1, 2, 3, 4, 5, 20 ];
- for (var i = 0; i < someData.length; ++i) {
- accumulatedValue = accumulatedValue + someData[i];
- }
- }
-}
-\endqml
-
-The loop in the onCompleted handler causes the "text" property binding to
-be re-evaluated six times (which then results in any other property bindings
-which rely on the text value, as well as the onTextChanged signal handler,
-to be re-evaluated each time, and lays out the text for display each time).
-This is clearly unnecessary in this case, since we really only care about
-the final value of the accumulation.
-
-It could be rewritten as follows:
-
-\qml
-// good.qml
-import QtQuick 2.0
-
-Item {
- id: root
- width: 200
- height: 200
- property int accumulatedValue: 0
-
- Text {
- anchors.fill: parent
- text: root.accumulatedValue.toString()
- onTextChanged: console.log("text binding re-evaluated")
- }
-
- Component.onCompleted: {
- var someData = [ 1, 2, 3, 4, 5, 20 ];
- var temp = accumulatedValue;
- for (var i = 0; i < someData.length; ++i) {
- temp = temp + someData[i];
- }
- accumulatedValue = temp;
- }
-}
-\endqml
-
-\section2 Sequence tips
-
-As mentioned earlier, some sequence types are fast (for example, QList<int>, QList<qreal>,
-QList<bool>, QList<QString>, QStringList and QList<QUrl>) while others will be
-much slower. Aside from using these types wherever possible instead of slower types,
-there are some other performance-related semantics you need to be aware of to achieve
-the best performance.
-
-Firstly, there are two different implementations for sequence types: one for where
-the sequence is a Q_PROPERTY of a QObject (we'll call this a reference sequence),
-and another for where the sequence is returned from a Q_INVOKABLE function of a
-QObject (we'll call this a copy sequence).
-
-A reference sequence is read and written via QMetaObject::property() and thus is read
-and written as a QVariant. This means that changing the value of any element in the
-sequence from JavaScript will result in three steps occurring: the complete sequence
-will be read from the QObject (as a QVariant, but then cast to a sequence of the correct
-type); the element at the specified index will be changed in that sequence; and the
-complete sequence will be written back to the QObject (as a QVariant).
-
-A copy sequence is far simpler as the actual sequence is stored in the JavaScript
-object's resource data, so no read/modify/write cycle occurs (instead, the resource
-data is modified directly).
-
-Therefore, writes to elements of a reference sequence will be much slower than writes
-to elements of a copy sequence. In fact, writing to a single element of an N-element
-reference sequence is equivalent in cost to assigning a N-element copy sequence to that
-reference sequence, so you're usually better off modifying a temporary copy sequence
-and then assigning the result to a reference sequence, during computation.
-
-Assume the existence (and prior registration into the "Qt.example 1.0" namespace) of the
-following C++ type:
-
-\code
-class SequenceTypeExample : public QQuickItem
-{
- Q_OBJECT
- Q_PROPERTY (QList<qreal> qrealListProperty READ qrealListProperty WRITE setQrealListProperty NOTIFY qrealListPropertyChanged)
-
-public:
- SequenceTypeExample() : QQuickItem() { m_list << 1.1 << 2.2 << 3.3; }
- ~SequenceTypeExample() {}
-
- QList<qreal> qrealListProperty() const { return m_list; }
- void setQrealListProperty(const QList<qreal> &list) { m_list = list; emit qrealListPropertyChanged(); }
-
-signals:
- void qrealListPropertyChanged();
-
-private:
- QList<qreal> m_list;
-};
-\endcode
-
-The following example writes to elements of a reference sequence in a
-tight loop, resulting in bad performance:
-
-\qml
-// bad.qml
-import QtQuick 2.0
-import Qt.example 1.0
-
-SequenceTypeExample {
- id: root
- width: 200
- height: 200
-
- Component.onCompleted: {
- var t0 = new Date();
- qrealListProperty.length = 100;
- for (var i = 0; i < 500; ++i) {
- for (var j = 0; j < 100; ++j) {
- qrealListProperty[j] = j;
- }
- }
- var t1 = new Date();
- console.log("elapsed: " + (t1.valueOf() - t0.valueOf()) + " milliseconds");
- }
-}
-\endqml
-
-The QObject property read and write in the inner loop caused by the
-\c{"qrealListProperty[j] = j"} expression makes this code very suboptimal. Instead,
-something functionally equivalent but much faster would be:
-
-\qml
-// good.qml
-import QtQuick 2.0
-import Qt.example 1.0
-
-SequenceTypeExample {
- id: root
- width: 200
- height: 200
-
- Component.onCompleted: {
- var t0 = new Date();
- var someData = [1.1, 2.2, 3.3]
- someData.length = 100;
- for (var i = 0; i < 500; ++i) {
- for (var j = 0; j < 100; ++j) {
- someData[j] = j;
- }
- qrealListProperty = someData;
- }
- var t1 = new Date();
- console.log("elapsed: " + (t1.valueOf() - t0.valueOf()) + " milliseconds");
- }
-}
-\endqml
-
-Secondly, a change signal for the property is emitted if any element in it changes.
-If you have many bindings to a particular element in a sequence property, it is better
-to create a dynamic property which is bound to that element, and use that dynamic
-property as the symbol in the binding expressions instead of the sequence element,
-as it will only cause re-evaluation of bindings if its value changes.
-
-This is an unusual use-case which most clients should never hit, but is worth being
-aware of, in case you find yourself doing something like this:
-
-\qml
-// bad.qml
-import QtQuick 2.0
-import Qt.example 1.0
-
-SequenceTypeExample {
- id: root
-
- property int firstBinding: qrealListProperty[1] + 10;
- property int secondBinding: qrealListProperty[1] + 20;
- property int thirdBinding: qrealListProperty[1] + 30;
-
- Component.onCompleted: {
- var t0 = new Date();
- for (var i = 0; i < 1000; ++i) {
- qrealListProperty[2] = i;
- }
- var t1 = new Date();
- console.log("elapsed: " + (t1.valueOf() - t0.valueOf()) + " milliseconds");
- }
-}
-\endqml
-
-Note that even though only the element at index 2 is modified in the loop, the three
-bindings will all be re-evaluated since the granularity of the change signal is that
-the entire property has changed. As such, adding an intermediate binding can
-sometimes be beneficial:
-
-\qml
-// good.qml
-import QtQuick 2.0
-import Qt.example 1.0
-
-SequenceTypeExample {
- id: root
-
- property int intermediateBinding: qrealListProperty[1]
- property int firstBinding: intermediateBinding + 10;
- property int secondBinding: intermediateBinding + 20;
- property int thirdBinding: intermediateBinding + 30;
-
- Component.onCompleted: {
- var t0 = new Date();
- for (var i = 0; i < 1000; ++i) {
- qrealListProperty[2] = i;
- }
- var t1 = new Date();
- console.log("elapsed: " + (t1.valueOf() - t0.valueOf()) + " milliseconds");
- }
-}
-\endqml
-
-In the above example, only the intermediate binding will be re-evaluated each time,
-resulting in a significant performance increase.
-
-\section2 Value-Type tips
-
-Value-type properties (font, color, vector3d, etc) have similar QObject property
-and change notification semantics to sequence type properties. As such, the tips
-given above for sequences are also applicable for value-type properties. While
-they are usually less of a problem with value-types (since the number of
-sub-properties of a value-type is usually far less than the number of elements
-in a sequence), any increase in the number of bindings being re-evaluated needlessly
-will have a negative impact on performance.
-
-\section2 Other JavaScript Objects
-
-Different JavaScript engines provide different optimizations. The JavaScript engine
-which \l {Qt Quick}{Qt Quick 2} uses is optimized for object instantiation and property
-lookup, but the optimizations which it provides relies on certain criteria. If your
-application does not meet the criteria, the JavaScript engine falls back to a
-"slow-path" mode with much worse performance. As such, always try to ensure you
-meet the following criteria:
-
-\list
-\li Avoid using eval() if at all possible
-\li Do not delete properties of objects
-\endlist
-
-\section1 Common Interface Elements
-
-\section2 Text Elements
-
-Calculating text layouts can be a slow operation. Consider using the \c PlainText
-format instead of \c StyledText wherever possible, as this reduces the amount of work
-required of the layout engine. If you cannot use \c PlainText (as you need to embed
-images, or use tags to specify ranges of characters to have certain formatting (bold,
-italic, etc) as opposed to the entire text) then you should use \c StyledText.
-
-You should only use \c AutoText if the text might be (but probably isn't)
-\c StyledText as this mode will incur a parsing cost. The \c RichText mode should
-not be used, as \c StyledText provides almost all of its features at a fraction of
-its cost.
-
-\section2 Images
-
-Images are a vital part of any user interface. Unfortunately, they are also a big
-source of problems due to the time it takes to load them, the amount of memory they
-consume, and the way in which they are used.
-
-\section3 Asynchronous Loading
-
-Images are often quite large, and so it is wise to ensure that loading an image doesn't
-block the UI thread. Set the "asynchronous" property of the QML Image element to
-\c true to enable asynchronous loading of images from the local file system (remote
-images are always loaded asynchronously) where this would not result in a negative impact
-upon the aesthetics of the user interface.
-
-Image elements with the "asynchronous" property set to \c true will load images in
-a low-priority worker thread.
-
-\section3 Explicit Source Size
-
-If your application loads a large image but displays it in a small-sized element, set
-the "sourceSize" property to the size of the element being rendered to ensure that the
-smaller-scaled version of the image is kept in memory, rather than the large one.
-
-Beware that changing the sourceSize will cause the image to be reloaded.
-
-\section3 Avoid Run-time Composition
-
-Also remember that you can avoid doing composition work at run-time by providing the
-pre-composed image resource with your application (for example, providing elements with shadow
-effects).
-
-\section2 Position Elements With Anchors
-
-It is more efficient to use anchors rather than bindings to position items
-relative to each other. Consider this use of bindings to position rect2
-relative to rect1:
-
-\code
-Rectangle {
- id: rect1
- x: 20
- width: 200; height: 200
-}
-Rectangle {
- id: rect2
- x: rect1.x
- y: rect1.y + rect1.height
- width: rect1.width - 20
- height: 200
-}
-\endcode
-
-This is achieved more efficiently using anchors:
-
-\code
-Rectangle {
- id: rect1
- x: 20
- width: 200; height: 200
-}
-Rectangle {
- id: rect2
- height: 200
- anchors.left: rect1.left
- anchors.top: rect1.bottom
- anchors.right: rect1.right
- anchors.rightMargin: 20
-}
-\endcode
-
-Positioning with bindings (by assigning binding expressions to the x, y, width
-and height properties of visual objects, rather than using anchors) is
-relatively slow, although it allows maximum flexibility.
-
-If the layout is not dynamic, the most performant way to specify the layout is
-via static initialization of the x, y, width and height properties. Item
-coordinates are always relative to their parent, so if you wanted to be a fixed
-offset from your parent's 0,0 coordinate you should not use anchors. In the
-following example the child Rectangle objects are in the same place, but the
-anchors code shown is not as resource efficient as the code which
-uses fixed positioning via static initialization:
-
-\code
-Rectangle {
- width: 60
- height: 60
- Rectangle {
- id: fixedPositioning
- x: 20
- y: 20
- width: 20
- height: 20
- }
- Rectangle {
- id: anchorPositioning
- anchors.fill: parent
- anchors.margins: 20
- }
-}
-\endcode
-
-\section1 Models and Views
-
-Most applications will have at least one model feeding data to a view. There are
-some semantics which application developers need to be aware of, in order to achieve
-maximal performance.
-
-\section2 Custom C++ Models
-
-It is often desirable to write your own custom model in C++ for use with a view in
-QML. While the optimal implementation of any such model will depend heavily on the
-use-case it must fulfil, some general guidelines are as follows:
-
-\list
-\li Be as asynchronous as possible
-\li Do all processing in a (low priority) worker thread
-\li Batch up backend operations so that (potentially slow) I/O and IPC is minimized
-\li Use a sliding slice window to cache results, whose parameters are determined with the help of profiling
-\endlist
-
-It is important to note that using a low-priority worker thread is recommended to
-minimise the risk of starving the GUI thread (which could result in worse perceived
-performance). Also, remember that synchronization and locking mechanisms can be a
-significant cause of slow performance, and so care should be taken to avoid
-unnecessary locking.
-
-\section2 ListModel
-
-QML provides a ListModel element which can be used to feed data to a ListView.
-It should suffice for most use-cases and be relatively performant so long as
-it is used correctly.
-
-\section3 Populate Within A Worker Thread
-
-ListModel elements can be populated in a (low priority) worker thread in JavaScript. The
-developer must explicitly call "sync()" on the ListModel from within the WorkerScript to
-have the changes synchronized to the main thread. See the WorkerScript documentation
-for more information.
-
-Please note that using a WorkerScript element will result in a separate JavaScript engine
-being created (as the JavaScript engine is per-thread). This will result in increased
-memory usage. Multiple WorkerScript elements will all use the same worker thread, however,
-so the memory impact of using a second or third WorkerScript element is negligible once
-an application already uses one.
-
-\section3 Don't Use Dynamic Roles
-
-The ListModel element in \c {QtQuick 2.0} is much more performant than in \c {QtQuick 1.0}. The
-performance improvements mainly come from assumptions about the type of roles within each
-element in a given model - if the type doesn't change, the caching performance improves
-dramatically. If the type can change dynamically from element to element, this optimization
-becomes impossible, and the performance of the model will be an order of magnitude worse.
-
-Therefore, dynamic typing is disabled by default; the developer must specifically set
-the boolean "dynamicRoles" property of the model to enable dynamic typing (and suffer
-the attendant performance degradation). We recommend that you do not use dynamic typing
-if it is possible to redesign your application to avoid it.
-
-\section2 Views
-
-View delegates should be kept as simple as possible. Have just enough QML in the delegate
-to display the necessary information. Any additional functionality which is not immediately
-required (for example, if it displays more information when clicked) should not be created until
-needed (see the upcoming section on lazy initialization).
-
-The following list is a good summary of things to keep in mind when designing a delegate:
-\list
-\li The fewer elements that are in a delegate, the faster they can be created, and thus
- the faster the view can be scrolled.
-\li Keep the number of bindings in a delegate to a minimum; in particular, use anchors
- rather than bindings for relative positioning within a delegate.
-\li Avoid using ShaderEffect elements within delegates.
-\li Never enable clipping on a delegate.
-\endlist
-
-You may set the \c cacheBuffer property of a view to allow asynchronous creation and
-buffering of delegates outside of the visible area. Utilizing a \c cacheBuffer is
-recommended for view delegates that are non-trivial and unlikely to be created within a
-single frame.
-
-Be mindful that a \c cacheBuffer keeps additional delegates in-memory and therefore the
-value derived from utilizing the \c cacheBuffer must be balanced against additional memory
-usage. Developers should use benchmarking to find the best value for their use-case, since
-the increased memory pressure caused by utilizing a \c cacheBuffer can, in some rare cases,
-cause reduced frame rate when scrolling.
-
-\section1 Visual Effects
-
-\l {Qt Quick}{Qt Quick 2} includes several features which allow developers and designers to create
-exceptionally appealing user interfaces. Fluidity and dynamic transitions as well
-as visual effects can be used to great effect in an application, but some care must
-be taken when using some of the features in QML as they can have performance implications.
-
-\section2 Animations
-
-In general, animating a property will cause any bindings which reference that property
-to be re-evaluated. Usually, this is what is desired but in other cases it may be better
-to disable the binding prior to performing the animation, and then reassign the binding
-once the animation has completed.
-
-Avoid running JavaScript during animation. For example, running a complex JavaScript
-expression for each frame of an x property animation should be avoided.
-
-Developers should be especially careful using script animations, as these are run in the main
-thread (and therefore can cause frames to be skipped if they take too long to complete).
-
-\section2 Particles
-
-The \l {QtQuick.Particles 2}{Qt Quick 2.0 Particles} module allows beautiful particle effects to be integrated
-seamlessly into user interfaces. However every platform has different graphics hardware
-capabilities, and the Particles module is unable to limit parameters to what your hardware
-can gracefully support. The more particles you attempt to render (and the larger they are),
-the faster your graphics hardware will need to be in order to render at 60 FPS. Affecting
-more particles requires a faster CPU. It is therefore important to test all
-particle effects on your target platform carefully, to calibrate the number and size of
-particles you can render at 60 FPS.
-
-It should be noted that a particle system can be disabled when not in use
-(for example, on a non-visible element) to avoid doing unnecessary simulation.
-
-See the \l{Particle System Performance Guide} for more in-depth information.
-
-\section2 Shaders
-
-Shaders written in GLSL allow for complex transformations and visual effects to be written,
-however they should be used with care. Using a ShaderEffectSource causes a scene to
-prerendered into an FBO before it can be drawn. This extra overhead is quite expensive.
-
-A ShaderEffect element can imply a ShaderEffectSource (and the indirect rendering costs
-associated with that) and also involves uploading a vertex and fragment shader program
-(which is then compiled into a GLSL shader). Each fragment shader runs once for every
-pixel of the scene, and so these should be kept as simple as possible.
-
-\section1 Controlling Element Lifetime
-
-By partitioning an application into simple, modular components, each contained in a single
-QML file, you can achieve faster application startup time and better control over memory
-usage, and reduce the number of active-but-invisible elements in your application.
-
-\section2 Lazy Initialization
-
-The QML engine does some tricky things to try to ensure that loading and initialization of
-components doesn't cause frames to be skipped. However, there is no better way to reduce
-startup time than to avoid doing work you don't need to do, and delaying the work until
-it is necessary. This may be achieved by using either \l Loader or creating components
-\l {qtqml-javascript-dynamicobjects.html}{dynamically}.
-
-\section3 Using Loader
-
-The Loader is an element which allows dynamic loading and unloading of components.
-
-\list
-\li Using the "active" property of a Loader, initialization can be delayed until required.
-\li Using the overloaded version of the "setSource()" function, initial property values can
- be supplied.
-\li Setting the Loader \l {Loader::asynchronous}{asynchronous} property to true may also
- improve fluidity while a component is instantiated.
-\endlist
-
-\section3 Using Dynamic Creation
-
-Developers can use the Qt.createComponent() function to create a component dynamically at
-runtime from within JavaScript, and then call createObject() to instantiate it. Depending
-on the ownership semantics specified in the call, the developer may have to delete the
-created object manually. See \l{qtqml-javascript-dynamicobjects.html}
-{Dynamic Object Management in QML} for more information.
-
-\section2 Destroy Unused Elements
-
-Elements which are invisible because they are a child of a non-visible element (for example, the
-second tab in a tab-widget, while the first tab is shown) should be initialized lazily in
-most cases, and deleted when no longer in use, to avoid the ongoing cost of leaving them
-active (for example, rendering, animations, property binding evaluation, etc).
-
-An item loaded with a Loader element may be released by resetting the "source" or
-"sourceComponent" property of the Loader, while other items may be explicitly
-released by calling destroy() on them. In some cases, it may be necessary to
-leave the item active, in which case it should be made invisible at the very least.
-
-See the upcoming section on Rendering for more information on active but invisible elements.
-
-\section1 Rendering
-
-The scene graph used for rendering in \c {QtQuick 2.0} allows highly dynamic, animated user
-interfaces to be rendered fluidly at 60 FPS. There are some things which can
-dramatically decrease rendering performance, however, and developers should be careful
-to avoid these pitfalls wherever possible.
-
-\section2 Clipping
-
-Clipping is disabled by default, and should only be enabled when required.
-
-Clipping is a visual effect, NOT an optimization. It increases (rather than reduces)
-complexity for the renderer. If clipping is enabled, an item will clip its own painting,
-as well as the painting of its children, to its bounding rectangle. This stops the renderer
-from being able to reorder the drawing order of elements freely, resulting in a sub-optimal
-best-case scene graph traversal.
-
-Clipping inside a delegate is especially bad and should be avoided at all costs.
-
-\section2 Over-drawing and Invisible Elements
-
-If you have elements which are totally covered by other (opaque) elements, it is best to
-set their "visible" property to \c false or they will be drawn needlessly.
-
-Similarly, elements which are invisible (for example, the second tab in a tab widget, while the
-first tab is shown) but need to be initialized at startup time (for example, if the cost of
-instantiating the second tab takes too long to be able to do it only when the tab is
-activated), should have their "visible" property set to \c false, in order to avoid the
-cost of drawing them (although as previously explained, they will still incur the cost of
-any animations or bindings evaluation since they are still active).
-
-\section2 Manual Layouts
-
-The scene graph renderer is able to batch up certain operations to minimise the number of
-OpenGL state changes required. However, this optimization is only possible for the
-built-in layout elements provided by \c {QtQuick 2.0}, and cannot be applied to manual layouts.
-
-Therefore, application developers should use the Row, Column, Grid, GridView, and ListView
-elements instead of manual layouts wherever possible.
-
-\section1 Memory Allocation And Collection
-
-The amount of memory which will be allocated by an application and the way in which that
-memory will be allocated are very important considerations. Aside from the obvious
-concerns about out-of-memory conditions on memory-constrained devices, allocating memory
-on the heap is a fairly computationally expensive operation, and certain allocation
-strategies can result in increased fragmentation of data across pages. JavaScript uses
-a managed memory heap which is automatically garbage collected, and this provides some
-advantages but also has some important implications.
-
-An application written in QML uses memory from both the C++ heap and an automatically
-managed JavaScript heap. The application developer needs to be aware of the subtleties
-of each in order to maximise performance.
-
-\section2 Tips For QML Application Developers
-
-The tips and suggestions contained in this section are guidelines only, and may not be
-applicable in all circumstances. Be sure to benchmark and analyze your application
-carefully using empirical metrics, in order to make the best decisions possible.
-
-\section3 Instantiate and initialize components lazily
-
-If your application consists of multiple views (for example, multiple tabs) but only
-one is required at any one time, you can use lazy instantiation to minimize the
-amount of memory you need to have allocated at any given time. See the prior section
-on \l{Lazy Initialization} for more information.
-
-\section3 Destroy unused objects
-
-If you lazily instantiate components, or dynamically create objects during a JavaScript
-expression, it is often better to manually \c{destroy()} them rather than waiting for
-automatic garbage collection to do so. See the prior section on
-\l{Controlling Element Lifetime} for more information.
-
-\section3 Don't manually invoke the garbage collector
-
-In most cases, it is not wise to manually invoke the garbage collector, as it will block
-the GUI thread for a substantial period of time. This can result in skipped frames and
-jerky animations, which should be avoided at all costs.
-
-There are some cases where manually invoking the garbage collector is acceptable (and
-this is explained in greater detail in an upcoming section), but in most cases, invoking
-the garbage collector is unnecessary and counter-productive.
-
-\section3 Avoid complex bindings
-
-Aside from the reduced performance of complex bindings (for example, due to having to
-enter the JavaScript execution context to perform evaluation), they also take up more
-memory both on the C++ heap and the JavaScript heap than bindings which can be
-evaluated by QML's optimized binding expression evaluator.
-
-\section3 Avoid defining multiple identical implicit types
-
-If a QML element has a custom property defined in QML, it becomes its own implicit type.
-This is explained in greater detail in an upcoming section. If multiple identical
-implicit types are defined inline in a component, some memory will be wasted. In that
-situation it is usually better to explicitly define a new component which can then be
-reused.
-
-Defining a custom property can often be a beneficial performance optimization (for
-example, to reduce the number of bindings which are required or re-evaluated), or it
-can improve the modularity and maintainability of a component. In those cases, using
-custom properties is encouraged. However, the new type should, if it is used more than
-once, be split into its own component (.qml file) in order to conserve memory.
-
-\section3 Re-use existing components
-
-If you are considering defining a new component, it's worth double checking that such a
-component doesn't already exist in the component set for your platform. Otherwise, you
-will be forcing the QML engine to generate and store type-data for a type which is
-essentially a duplicate of another pre-existing and potentially already loaded component.
-
-\section3 Use singleton types instead of pragma library scripts
-
-If you are using a pragma library script to store application-wide instance data,
-consider using a QObject singleton type instead. This should result in better performance,
-and will result in less JavaScript heap memory being used.
-
-\section2 Memory Allocation in a QML Application
-
-The memory usage of a QML application may be split into two parts: its C++ heap usage
-and its JavaScript heap usage. Some of the memory allocated in each will be unavoidable,
-as it is allocated by the QML engine or the JavaScript engine, while the rest is
-dependent upon decisions made by the application developer.
-
-The C++ heap will contain:
-\list
- \li the fixed and unavoidable overhead of the QML engine (implementation data
- structures, context information, and so on)
- \li per-component compiled data and type information, including per-type property
- metadata, which is generated by the QML engine depending on which modules are
- imported by the application and which components the application loads
- \li per-object C++ data (including property values) plus a per-element metaobject
- hierarchy, depending on which components the application instantiates
- \li any data which is allocated specifically by QML imports (libraries)
-\endlist
-
-The JavaScript heap will contain:
-\list
- \li the fixed and unavoidable overhead of the JavaScript engine itself (including
- built-in JavaScript types)
- \li the fixed and unavoidable overhead of our JavaScript integration (constructor
- functions for loaded types, function templates, and so on)
- \li per-type layout information and other internal type-data generated by the JavaScript
- engine at runtime, for each type (see note below, regarding types)
- \li per-object JavaScript data ("var" properties, JavaScript functions and signal
- handlers, and non-optimized binding expressions)
- \li variables allocated during expression evaluation
-\endlist
-
-Furthermore, there will be one JavaScript heap allocated for use in the main thread, and
-optionally one other JavaScript heap allocated for use in the WorkerScript thread. If an
-application does not use a WorkerScript element, that overhead will not be incurred. The
-JavaScript heap can be several megabytes in size, and so applications written for
-memory-constrained devices may be best served to avoid using the WorkerScript element
-despite its usefulness in populating list models asynchronously.
-
-Note that both the QML engine and the JavaScript engine will automatically generate their
-own caches of type-data about observed types. Every component loaded by an application
-is a distinct (explicit) type, and every element (component instance) which defines its
-own custom properties in QML is an implicit type. Any element (instance of a component)
-which does not define any custom properties is considered by the JavaScript and QML engines
-to be of the type explicitly defined by the component, rather than its own implicit type.
-
-Consider the following example:
-\qml
-import QtQuick 2.0
-
-Item {
- id: root
-
- Rectangle {
- id: r0
- color: "red"
- }
-
- Rectangle {
- id: r1
- color: "blue"
- width: 50
- }
-
- Rectangle {
- id: r2
- property int customProperty: 5
- }
-
- Rectangle {
- id: r3
- property string customProperty: "hello"
- }
-
- Rectangle {
- id: r4
- property string customProperty: "hello"
- }
-}
-\endqml
-
-In the previous example, the rectangles \c r0 and \c r1 do not have any custom properties,
-and thus the JavaScript and QML engines consider them both to be of the same type. That
-is, \c r0 and \c r1 are both considered to be of the explicitly defined \c Rectangle type.
-The rectangles \c r2, \c r3 and \c r4 each have custom properties and are each considered
-to be different (implicit) types. Note that \c r3 and \c r4 are each considered to be of
-different types, even though they have identical property information, simply because the
-custom property was not declared in the component which they are instances of.
-
-If \c r3 and \c r4 were both instances of a \c RectangleWithString component, and that
-component definition included the declaration of a string property named \c customProperty,
-then \c r3 and \c r4 would be considered to be the same type (that is, they would be
-instances of the \c RectangleWithString type, rather than defining their own implicit type).
-
-\section2 In-Depth Memory Allocation Considerations
-
-Whenever making decisions regarding memory allocation or performance trade-offs, it is
-important to keep in mind the impact of CPU-cache performance, operating system paging,
-and JavaScript engine garbage collection. Potential solutions should be benchmarked
-carefully in order to ensure that the best one is selected.
-
-No set of general guidelines can replace a solid understanding of the underlying
-principles of computer science combined with a practical knowledge of the implementation
-details of the platform for which the application developer is developing. Furthermore,
-no amount of theoretical calculation can replace a good set of benchmarks and analysis
-tools when making trade-off decisions.
-
-\section3 Fragmentation
-
-Fragmentation is a C++ development issue. If the application developer is not defining
-any C++ types or plugins, they may safely ignore this section.
-
-Over time, an application will allocate large portions of memory, write data to that
-memory, and subsequently free some portions of that memory once it has finished using
-some of the data. This can result in "free" memory being located in non-contiguous
-chunks, which cannot be returned to the operating system for other applications to use.
-It also has an impact on the caching and access characteristics of the application, as
-the "living" data may be spread across many different pages of physical memory. This
-in turn could force the operating system to swap which can cause filesystem I/O - which
-is, comparatively speaking, an extremely slow operation.
-
-Fragmentation can be avoided by utilizing pool allocators (and other contiguous memory
-allocators), by reducing the amount of memory which is allocated at any one time by
-carefully managing object lifetimes, by periodically cleansing and rebuilding caches,
-or by utilizing a memory-managed runtime with garbage collection (such as JavaScript).
-
-\section3 Garbage Collection
-
-JavaScript provides garbage collection. Memory which is allocated on the JavaScript
-heap (as opposed to the C++ heap) is owned by the JavaScript engine. The engine will
-periodically collect all unreferenced data on the JavaScript heap, and if fragmentation
-becomes an issue, it will compact its heap by moving all "living" data into a contiguous
-region of memory (allowing the freed memory to be returned to the operating system).
-
-\section4 Implications of Garbage Collection
-
-Garbage collection has advantages and disadvantages. It ensures that fragmentation is
-less of an issue, and it means that manually managing object lifetime is less important.
-However, it also means that a potentially long-lasting operation may be initiated by the
-JavaScript engine at a time which is out of the application developer's control. Unless
-JavaScript heap usage is considered carefully by the application developer, the frequency
-and duration of garbage collection may have a negative impact upon the application
-experience.
-
-\section4 Manually Invoking the Garbage Collector
-
-An application written in QML will (most likely) require garbage collection to be
-performed at some stage. While garbage collection will be automatically triggered by
-the JavaScript engine when the amount of available free memory is low, it is occasionally
-better if the application developer makes decisions about when to invoke the garbage
-collector manually (although usually this is not the case).
-
-The application developer is likely to have the best understanding of when an application
-is going to be idle for substantial periods of time. If a QML application uses a lot
-of JavaScript heap memory, causing regular and disruptive garbage collection cycles
-during particularly performance-sensitive tasks (for example, list scrolling, animations,
-and so forth), the application developer may be well served to manually invoke the
-garbage collector during periods of zero activity. Idle periods are ideal for performing
-garbage collection since the user will not notice any degradation of user experience
-(skipped frames, jerky animations, and so on) which would result from invoking the garbage
-collector while activity is occurring.
-
-The garbage collector may be invoked manually by calling \c{gc()} within JavaScript.
-This will cause a comprehensive collection and compaction cycle to be performed, which
-may take from between a few hundred to more than a thousand milliseconds to complete, and
-so should be avoided if at all possible.
-
-\section3 Memory vs Performance Trade-offs
-
-In some situations, it is possible to trade-off increased memory usage for decreased
-processing time. For example, caching the result of a symbol lookup used in a tight loop
-to a temporary variable in a JavaScript expression will result in a significant performance
-improvement when evaluating that expression, but it involves allocating a temporary variable.
-In some cases, these trade-offs are sensible (such as the case above, which is almost always
-sensible), but in other cases it may be better to allow processing to take slightly longer
-in order to avoid increasing the memory pressure on the system.
-
-In some cases, the impact of increased memory pressure can be extreme. In some situations,
-trading off memory usage for an assumed performance gain can result in increased page-thrash
-or cache-thrash, causing a huge reduction in performance. It is always necessary to benchmark
-the impact of trade-offs carefully in order to determine which solution is best in a given
-situation.
-
-For in-depth information on cache performance and memory-time trade-offs, please see
-Ulrich Drepper's excellent article "What Every Programmer Should Know About Memory"
-(available at http://ftp.linux.org.ua/pub/docs/developer/general/cpumemory.pdf as at 18th
-April 2012), and for information on C++-specific optimizations, please see Agner Fog's
-excellent manuals on optimizing C++ applications (available at
-http://www.agner.org/optimize/ as at 18th April 2012).
-
-*/
diff --git a/src/quick/doc/src/appdevguide/porting.qdoc b/src/quick/doc/src/appdevguide/porting.qdoc
deleted file mode 100644
index 050b2e550a..0000000000
--- a/src/quick/doc/src/appdevguide/porting.qdoc
+++ /dev/null
@@ -1,258 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page qtquick-porting-qt5.html
-\title Porting QML Applications to Qt 5
-\brief Lists the Qt 5.0 changes that affect the existing QML applications
-
-When porting QML-related code from Qt 4.8 to Qt 5, application developers should be aware that
-the QML infrastructure has undergone considerable changes in Qt 5. The sections below describe
-these changes and the impact they have on your existing code.
-
-This article describes the changes that affect your existing code. If you are
-interested in the summary of all new features in Qt 5 for QML application development, see
-\l{Qt QML Release Notes} and \l{Qt Quick Release Notes}.
-
-\section1 QML Language changes
-
-There are very few changes in the QML language that affect the porting of existing Qt 4.8 QML code to Qt 5. These are:
-
-\list
-\li Individual file imports no longer work (for example, import "MyType.qml"). Import the containing directory instead.
-\li Relative file paths in JavaScript files are now resolved relative to the location of the JavaScript file instead of the QML file that imported it.
-\endlist
-\li It's no longer possible to override signals from the base component.
-
-\section1 QtQuick Module
-
-The \c QtQuick module has been updated to version 2.0. All QML applications should update their import
-statements to use the new version:
-
-\qml
-import QtQuick 2.0
-\endqml
-
-
-\section2 Property and Method Changes
-
-\list
-\li ListView's \c highlightMoveSpeed and \c highlightResizeSpeed properties have been renamed to
-\l{ListView::}{highlightMoveVelocity} and \l{ListView::}{highlightResizeVelocity}, respectively.
-\li TextInput and TextEdit's \c openSoftwareInputPanel() and \c closeSoftwareInputPanel() methods
-have been removed. Use the new Qt.inputMethod property and call Qt.inputMethod.show()
-Qt.inputMethod.hide() to show and hide the virtual keyboard.
-\endlist
-
-\section2 Type and API Changes
-
-\list
-\li XmlListModel has moved into its own module, QtQuick.XmlListModel. Any code that uses the
-XmlListModel and XmlRole types must import \e {QtQuick.XmlListModel} instead.
-\li The local storage API that enables SQL support has been moved from the \l {QML Global Object}
-into a \c QtQuick.LocalStorage singleton type. Any code that requires the local storage API must import
-\e {QtQuick.LocalStorage} instead. See the \l {QtQuick.LocalStorage 2}{QtQuick.LocalStorage} documentation
-for examples.
-\li The \c LayoutItem type has been removed from the \c QtQuick module as it was specific to the
-Graphics View framework backend used in \l {Qt Quick 1}.
-\endlist
-
-\section2 Behavioral Changes
-
-\c {QtQuick 2.0} includes a number of behavioral changes and you should thoroughly test your applications after
-porting. These changes will not necessarily lead to run-time errors, but may break certain assumptions in your code.
-Below are the prominent changes to be aware of when porting your applications.
-
-Item opacity and visibility:
-
-\list
-\li The input handling details of \l{Item::}{opacity} and \l{Item::}{visible} have changed. An opacity of zero no
- longer affects input handling, where previously it stopped mouse input. A visibility of false no longer affects
- keyboard input, but still stops mouse input. The new \l{Item::}{enabled} property stops mouse and keyboard input, but does not affect how or whether
- the item is rendered. A workaround for applying the old behavior in most cases is to bind enabled to
- \tt {(visible && opacity > 0.0)}.
-\li Previously, if an item was in a positioner (i.e. a \l Row, \l Column, \l Grid and \l Flow)
- and the item's \c opacity changed to 0, or its \c visible value became \c false, the positioner
- would remove the item from its layout and collapse the space for that item. In \c {QtQuick 2.0}, this
- now only happens when an item's \c visible is \c false; the item opacity no longer affects whether
- the item is laid out. (This is consistent with the existing behavior of ListView and GridView).
-\endlist
-
-Text:
-
-\list
-\li The TextEdit::textFormat property now defaults to \c PlainText instead of \c AutoText.
-\li When Text::textFormat is set to \c Text.AutoText format, the text object will automatically
- switch to \c Text.StyledText instead of \c Text.RichText.
-\endlist
-
-Other:
-
-\list
-\li Modifying the Image::sourceSize now fits the image to the size, maintaining aspect
- ratio.
-\li For ListView and GridView, the \c cacheBuffer property now has a non-zero default and
- delegates in the cache buffer are created asynchronously. Also, using a \c RightToLeft layout
- now also reverses the \c preferredHighlightBegin and \c preferredHighlightEnd.
-\li For \l Loader, the \c sourceChanged and \c sourceComponentChanged signals are now only emitted
- when their respective properties change value. (Previously \l Loader emitted both of these signals
- when either of the relevant properties had changed.)
-\endlist
-
-
-\section2 Changes to experimental Qt.labs modules
-
-\list
-\li The \c Qt.labs.particles module has been removed. It is replaced by the fully-fledged \l
-QtQuick.Particles module which is an enormous improvement on its predecessor.
-\li The \c Qt.labs.shaders module has been removed as the \c ShaderEffectItem and \l
-ShaderEffectSource types from this module have been moved into the \c QtQuick module. Note the \c
-ShaderEffectItem type has been renamed to \l ShaderEffect.
-\endlist
-
-
-\section1 C++ code
-
-In Qt 5, all QML applications are rendered with an OpenGL scenegraph architecture rather than the
-Graphics View framework used in Qt 4. Due to the scale of this architectural change, the C++ API has
-been extensively restructured and the \c QtDeclarative module has been deprecated in favor of two
-new modules: \l {Qt QML}, which implements the QML engine and language infrastructure, and \l {Qt Quick},
-which implements the visual canvas and scenegraph backend.
-
-All classes that were previously in the \c QtDeclarative module have been moved into the \l {Qt QML}
-and \l {Qt Quick} modules, and their class names have been changed to reflect their new module
-locations. The class name changes are as follows:
-
-\table
-\header
- \li Qt QML
- \li Qt Quick
-\row
- \li
- \list
- \li QDeclarativeComponent -> QQmlComponent
- \li QDeclarativeContext -> QQmlContext
- \li QDeclarativeEngine -> QQmlEngine
- \li QDeclarativeError -> QQmlError
- \li QDeclarativeExpression -> QQmlExpression
- \li QDeclarativeExtensionPlugin -> QQmlExtensionPlugin
- \li QDeclarativeInfo -> QQmlInfo
- \li QDeclarativeListReference -> QQmlListReference
- \li QDeclarativeNetworkAccessManagerFactory -> QQmlNetworkAccessManagerFactory
- \li QDeclarativeParserStatus -> QQmlParserStatus
- \li QDeclarativeProperty -> QQmlProperty
- \li QDeclarativePropertyMap -> QQmlPropertyMap
- \li QDeclarativePropertyValueSource -> QQmlPropertyValueSource
- \li QDeclarativeScriptString -> QQmlScriptString
- \endlist
- \li
- \list
- \li QDeclarativeItem -> QQuickItem
- \li QDeclarativeView -> QQuickView
- \li QDeclarativeImageProvider -> QQuickImageProvider
- \endlist
-\endtable
-
-To use the new \c QQml* and \c QQuick* classes in Qt 5, link against the approprate module from
-your qmake \c .pro file. For example the following will link against both the \l {Qt QML} and \l {Qt Quick}
-modules:
-
-\code
-QT += qml quick
-\endcode
-
-Required header files can then be included:
-
-\code
-#include <QtQml/QQmlEngine>
-#include <QtQuick/QQuickView>
-\endcode
-
-(The \c QtDeclarative module is still available to developers as the \c {Qt Quick 1} module, as
-discussed \l {Qt Quick 1}{below}. However, it should not be used for
-new applications.)
-
-
-\section3 QDeclarativeItem and QDeclarativeView
-
-When porting to QQuickItem, note that QDeclarativeItem inherited from QGraphicsItem; in contrast,
-QQuickItem inherits directly from QObject, and any QGraphicsItem-specific functionality is no longer
-available. In particular, QQuickItem does not have a \c paint() method for performing custom
-rendering through the QPainter API. Instead, in Qt 5, custom rendering should be performed through
-the new \c QSG* classes to take full advantage of the scene graph. See the \l {Qt Quick Scene Graph}
-documentation details on using these classes.
-
-Alternatively, the QQuickPaintedItem provides a \c paint() method and can be used as
-a convenient way to port QDeclarativeItem-based classes that use the QPainter API. Note this method
-is less performant than using the \c QSG* classes.
-
-When porting from QDeclarativeView to QQuickView, note that QDeclarativeItem inherited from
-QGraphicsView. In contrast, QQuickView inherits from QQuickWindow and uses the QWindow
-infrastructure introduced in Qt 5; any QGraphicsView-specific functionality is no longer available.
-
-
-\section3 qmlscene Utility
-
-The \c qmlviewer tool provided for prototyping and testing QML applications in Qt 4.x has been
-replaced with the \c qmlscene tool which integrates with the new scenegraph features in Qt 5.
-
-
-\section2 QML plugins
-
-All QML plugins should extend QQmlExtensionPlugin in Qt 5.
-
-Additionally, plugins should use the new Qt plugin infrastructure introduced in Qt 5. QML plugins no
-longer require the Q_EXPORT_PLUGIN2() macro. Instead, they should use the Q_PLUGIN_METADATA() macro
-within the plugin class declaration.
-
-See the updated \l {qtqml-modules-cppplugins.html}{Creating C++ Plugins For QML} documentation for
-an overview of creating QML plugins in Qt 5.
-
-
-\keyword Qt Quick 1
-
-\section2 QtDeclarative module in Qt 5
-
-For the purposes of porting older applications, the \c {QtDeclarative} module is still available in Qt
-5 but has been renamed to \c {Qt Quick 1}. Applications that required Qt Quick 1 specific API (e.g.
-QDeclarativeView or QDeclarativeItem and the Graphics View integration) can use this module. Note
-that new applications should use the new \l {Qt QML} and \l {Qt Quick} modules instead.
-
-To use the \c {Qt Quick 1} module, add "quick1" to your qmake \c .pro file:
-
-\code
-QT += quick1
-\endcode
-
-Required header files can be included from the Qt Quick 1 module:
-
-\code
-#include <QtQuick1/QDeclarativeView>
-#include <QtQuick1/QDeclarativeItem>
-\endcode
-
-*/
diff --git a/src/quick/doc/src/appdevguide/qmlscene.qdoc b/src/quick/doc/src/appdevguide/qmlscene.qdoc
deleted file mode 100644
index 1a2e66e962..0000000000
--- a/src/quick/doc/src/appdevguide/qmlscene.qdoc
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtquick-qmlscene.html
- \ingroup qtquick-tools
- \title Prototyping with qmlscene
- \ingroup qttools
- \brief Utility to test and load QML files
-
- Qt 5 includes \c qmlscene, a utility to load QML documents.
- The \c{qmlscene} utility enables viewing your QML document even before the
- application is complete. This utility also provides the following
- additional features that are useful while developing QML applications:
- \list
- \li View the QML document in a maximized window.
- \li View the QML document in full-screen mode.
- \li Make the window transparent.
- \li Disable multi-sampling (anti-aliasing).
- \li Do not detect the version of the .qml file.
- \li Run all animations in slow motion.
- \li Resize the window to the size of the root item.
- \li Add the list of import paths.
- \li Add a named bundle.
- \li Use a translation file to set the language.
- \endlist
-
- The \c qmlscene utility is meant to be used for testing your QML
- applications, and not as a launcher in a production environment.
- To launch a QML application in a production environment, develop a custom
- C++ application or bundle the QML file in a module. See \l {Deploying QML
- applications} for more information.
-
- To load a .qml file, run the tool and select the file to be opened, or
- provide the file path on the command prompt:
-
- \code
- qmlscene myqmlfile.qml
- \endcode
-
- To see the configuration options, run \c qmlscene with the \c -help
- argument.
-
- \section1 Adding Module Import Paths
-
- Additional module import paths can be provided using the \c -I flag.
- For example, the \l{QML Plugin Example}{QML plugin example}
- creates a C++ plugin identified with the namespace, \c TimeExample.
- To load the plugin, you must run \c qmlscene with the \c{-I} flag from the
- example's base directory:
-
- \code
- qmlscene -I imports plugins.qml
- \endcode
-
- This adds the current directory to the import path so that \c qmlscene will
- find the plugin in the \c imports directory.
-
- \note By default, the current directory is included in the import search
- path, but modules in a namespace such as \c TimeExample are not found
- unless the path is explicitly added.
-
- \section1 Loading Test Data
-
- Often, QML applications are prototyped with test data that is later
- replaced by real data sources from C++ plugins. The \c qmlscene utility
- assists in this aspect by loading test data into the application context.
- It looks for a directory named \c {dummydata} in the same directory as
- the target QML file, and loads the .qml files in that directory as QML
- objects and bind them to the root context as properties named after the files.
-
- For example, the following QML document refers to a \c lottoNumbers
- property which does not exist within the document:
-
- \qml
- import QtQuick 2.0
-
- ListView {
- width: 200; height: 300
- model: lottoNumbers
- delegate: Text { text: number }
- }
- \endqml
-
- If, within the document's directory, there is a \c{dummydata} directory
- which contains a \c lottoNumbers.qml file like this:
-
- \qml
- import QtQuick 2.0
-
- ListModel {
- ListElement { number: 23 }
- ListElement { number: 44 }
- ListElement { number: 78 }
- }
- \endqml
-
- Then this model would be automatically loaded into the ListView in the
- previous document.
-
- Child properties are included when loaded from \c dummydata. The following
- document refers to a \c clock.time property:
-
- \qml
- import QtQuick 2.0
- Text { text: clock.time }
- \endqml
-
- The text value could be filled by a \c dummydata/clock.qml file with a
- \c time property in the root context:
-
- \qml
- import QtQuick 2.0
- QtObject { property int time: 54321 }
- \endqml
-
- To replace this with real data, bind the real data object to
- the root context in C++ using QQmlContext::setContextProperty(). This is
- detailed in \l{Integrating QML and C++}.
-
-*/
-
diff --git a/src/quick/doc/src/appdevguide/qtquicktest.qdoc b/src/quick/doc/src/appdevguide/qtquicktest.qdoc
deleted file mode 100644
index 62369c1526..0000000000
--- a/src/quick/doc/src/appdevguide/qtquicktest.qdoc
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qtquick-qtquicktest.html
- \title Qt Quick Test Reference Documentation
- \brief unit testing framework for QML
-
- \section1 Introduction
-
- QtQuickTest is a unit test framework for QML applications.
- Test cases are written as JavaScript functions within a TestCase
- type:
-
- \code
- import QtQuick 2.0
- import QtTest 1.0
-
- TestCase {
- name: "MathTests"
-
- function test_math() {
- compare(2 + 2, 4, "2 + 2 = 4")
- }
-
- function test_fail() {
- compare(2 + 2, 5, "2 + 2 = 5")
- }
- }
- \endcode
-
- Functions whose names start with \c{test_} are treated as test cases
- to be executed. See the documentation for the \l TestCase and
- \l SignalSpy types for more information on writing test cases.
-
- \section1 Running tests
-
- Test cases are launched by a C++ harness that consists of
- the following code:
-
- \code
- #include <QtQuickTest/quicktest.h>
- QUICK_TEST_MAIN(example)
- \endcode
-
- Where "example" is the identifier to use to uniquely identify
- this set of tests. You should add \c{CONFIG += qmltestcase}.
- for example:
-
- \code
- TEMPLATE = app
- TARGET = tst_example
- CONFIG += warn_on qmltestcase
- SOURCES += tst_example.cpp
- \endcode
-
- The test harness scans the specified source directory recursively
- for "tst_*.qml" files. If \c{QUICK_TEST_SOURCE_DIR} is not defined,
- then the current directory will be scanned when the harness is run.
- Other *.qml files may appear for auxillary QML components that are
- used by the test.
-
- The \c{-input} command-line option can be set at runtime to run
- test cases from a different directory. This may be needed to run
- tests on a target device where the compiled-in directory name refers
- to a host. For example:
-
- \code
- tst_example -input /mnt/SDCard/qmltests
- \endcode
-
- It is also possible to run a single file using the \c{-input} option.
- For example:
-
- \code
- tst_example -input data/test.qml
- \endcode
-
- \code
- tst_example -input <full_path>/test.qml
- \endcode
-
- \note Specifying the full path to the qml test file is for example
- needed for shadow builds.
-
- If your test case needs QML imports, then you can add them as
- \c{-import} options to the test program command-line by adding
- the following line to your .pro file:
-
- \code
- IMPORTPATH += $$PWD/../imports/my_module1 $$PWD/../imports/my_module2
- \endcode
-
- The \c{-functions} command-line option will return a list of the current
- tests functions. It is possible to run a single test function using the name
- of the test function as an argument. For example:
-
- \code
- tst_example Test_Name::function1
- \endcode
-
- The \c{-help} command-line option will return all the options available.
-
- \code
- tst_example -help
- \endcode
-*/
diff --git a/src/quick/doc/src/appdevguide/quickstart/basics.qdoc b/src/quick/doc/src/appdevguide/quickstart/basics.qdoc
deleted file mode 100644
index 15f3c2f5ff..0000000000
--- a/src/quick/doc/src/appdevguide/quickstart/basics.qdoc
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-quickstart-basics.html
-\title Quick Start Guide - QML Basics
-\brief Basic QML application development examples
-
-\section1 Creating a QML Document
-
-A QML document defines a hierarchy of objects with a highly-readable,
-structured layout. Every QML document consists of two parts: an imports
-section and an object declaration section. The types and functionality most
-common to user interfaces are provided in the \c{QtQuick}
-import.
-
-\section2 Importing and Using the QtQuick Module
-
-To use the \l{Qt Quick} module, a QML document needs to
-import it. The import syntax looks like this:
-
-\qml
-import QtQuick 2.0
-\endqml
-
-The types and functionality that \l{Qt Quick} provides can now
-be used in the QML document!
-
-\section2 Defining an Object Hierarchy
-
-The object declaration in a QML document defines what will be displayed in the
-visual scene. \l{Qt Quick} provides the basic building blocks
-for all user interfaces, including objects to display images and text, and to
-handle user input.
-
-A simple object declaration might be a colored rectangle with some text centered
-in it:
-
-\qml
-Rectangle {
- width: 200
- height: 100
- color: "red"
-
- Text {
- anchors.centerIn: parent
- text: "Hello, World!"
- }
-}
-\endqml
-
-This defines an object hierarchy with a root \l Rectangle object
-which has a child \l Text object. The \c parent of the \l Text object is
-automatically set to the \l Rectangle, and similarly, the \l Text object is
-added to the \c children property of the \l Rectangle object, by QML.
-
-\section2 Putting it Together
-
-The \l Rectangle and \l Text types used in the above example are both provided
-by the \c{QtQuick} import. Putting the import and object declaration
-together, we get a complete QML document:
-
-\qml
-import QtQuick 2.0
-
-Rectangle {
- width: 200
- height: 100
- color: "red"
-
- Text {
- anchors.centerIn: parent
- text: "Hello, World!"
- }
-}
-\endqml
-
-If we save that document as "HelloWorld.qml" we can load and display it.
-
-\section1 Loading and Displaying the QML Document
-
-To display the graphical scene defined by the QML document, it may be loaded
-with the \l{Prototyping with qmlscene}{qmlscene} tool. The
-\l{Prototyping with qmlscene}{qmlscene} tool should be installed into the
-Qt installation directory. Assuming that the Qt binaries are installed into
-or are available in the system executable path, you can display the QML
-document with the following command:
-
-\code
-qmlscene HelloWorld.qml
-\endcode
-
-You should see the text "Hello, World!" in the center of a red rectangle.
-
-*/
diff --git a/src/quick/doc/src/appdevguide/quickstart/essentials.qdoc b/src/quick/doc/src/appdevguide/quickstart/essentials.qdoc
deleted file mode 100644
index d7a9ec3cdb..0000000000
--- a/src/quick/doc/src/appdevguide/quickstart/essentials.qdoc
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-quickstart-essentials.html
-\title Quick Start Guide - QML Essentials
-\brief Essential QML application development examples
-
-\section1 Handling User Input
-
-One of the great advantages of using QML to define a user interface is that it
-allows the user interface designer to define how the application should react
-to events with simple JavaScript expressions. In QML, we refer to those events
-as \l{Signal and Handler Event System}{signals} and such signals can be handled
-with \l{qml-signals-and-handlers}{signal handlers}.
-
-For example, consider the following example:
-\qml
-import QtQuick 2.0
-
-Rectangle {
- width: 200
- height: 100
- color: "red"
-
- Text {
- anchors.centerIn: parent
- text: "Hello, World!"
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: parent.color = "blue"
- }
-}
-\endqml
-
-This example can be saved as "ClickableHelloWorld.qml" and run with qmlscene.
-Whenever the user clicks anywhere in the window, the rectangle will change
-from red to blue. Note that the \l MouseArea type also emits the clicked
-signal for touch events, so this code will also work on a mobile device.
-
-Keyboard user input can be similarly handled with a simple expression:
-
-\qml
-import QtQuick 2.0
-
-Rectangle {
- width: 200
- height: 100
- color: "red"
-
- Text {
- anchors.centerIn: parent
- text: "Hello, World!"
- }
-
- focus: true
- Keys.onPressed: {
- if (event.key == Qt.Key_Return) {
- color = "blue";
- event.accepted = true;
- }
- }
-}
-\endqml
-
-By accepting focus, the color can be changed to blue whenever the return key
-is pressed.
-
-\section1 Property Bindings
-
-Objects and their properties form the basis of a graphical interface defined
-in a QML document. The QML language allows properties to be bound to each
-other in various ways, enabling highly dynamic user interfaces.
-
-In the following example, the geometry of each child \l Rectangle is bound to
-that of the parent \l Rectangle. If the geometry of the parent \l Rectangle
-were to change, the geometry of each child \l Rectangle would automatically
-update due to the property bindings.
-
-\qml
-import QtQuick 2.0
-
-Rectangle {
- width: 400
- height: 200
-
- Rectangle {
- width: parent.width / 2
- height: parent.height
- }
-
- Rectangle {
- width: parent.width / 2
- height: parent.height
- x: parent.width / 2
- }
-}
-\endqml
-
-\section1 Animations
-
-Properties can also be dynamically updated via animations. The \c QtQuick
-import provides various animation types which can be used to animate changes
-to a property's value. In the following example, a property is animated which
-then gets displayed in a \l Text area:
-
-\qml
-import QtQuick 2.0
-
-Rectangle {
- color: "lightgray"
- width: 200
- height: 200
-
- property int animatedValue: 0
- SequentialAnimation on animatedValue {
- loops: Animation.Infinite
- PropertyAnimation { to: 150; duration: 1000 }
- PropertyAnimation { to: 0; duration: 1000 }
- }
-
- Text {
- anchors.centerIn: parent
- text: animatedValue
- }
-}
-\endqml
-
-The value being displayed will vary from 0 to 150 periodically.
-
-\section1 Defining Custom QML Types for Re-use
-
-One of the most important concepts in QML is that of type re-use. An
-application will probably have multiple visual types which are all similar
-(for example, multiple push buttons), and QML allows these sort of things to
-be defined as re-usable, custom types, to minimize code duplication and
-maximize readability.
-
-For example, imagine that the developer defines a new \c Button type in the
-\c Button.qml file:
-
-\snippet qml/qml-extending-types/components/Button.qml 0
-
-That type may now be re-used multiple times in the application, as follows:
-
-\table
-\row
-\li \snippet qml/qml-extending-types/components/application.qml 0
-\li \image qml-extending-types.png
-\endtable
-
-
-In this way, modular user interface types can be built up and re-used within
-an application.
-
-See \l {QML Object Attributes}
-for more details on how to develop your own reusable components.
-
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/animations.qdoc b/src/quick/doc/src/appdevguide/usecases/animations.qdoc
deleted file mode 100644
index 3249a632f5..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/animations.qdoc
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-animations.html
-\title Usecase - Animations In QML
-\brief Example of how to include animations in QML applications
-
-\l {Qt Quick} provides the ability to animate properties. Animating properties allows property values to move through
-intermediate values instead of immediately changing to the target value. To animate the position of an item, you can
-animate the properties that controle the item's position, x and y for example, so that the item's position
-changes each frame on the way to the target position.
-
-\section1 Fluid UIs
-
-QML was designed to facilitate the creation of fluid UIs. These are user interfaces where the UI components animate instead of appearing, disappearing, or jumping abruptly. Qt Quick provides two simple ways to have UI
-components move with animation instead of instantly appearing at their new location.
-
-\section2 States and Transitions
-
-Qt Quick allows you to declare various UI states in \l State objects. These states are comprised of property changes from a
-base state, and can be a useful way of organizing your UI logic. Transitions are objects you can associate with an item
-to define how its properties will animate when they change due to a state change.
-
-States and transitions for an item can be declared with the \l Item::states and \l Item::transitions properties.
-States are declared inside the states list property of an item, usually the root item of the component. Transitions
-defined on the same item are used to animate the changes in the state. Here is an example.
-
-\snippet qml/usecases/animations.qml states
-
-\section2 Animating Property Changes.
-
-Behaviors can be used to specify an animation for a property to use when it changes. This is then applied to all
-changes, regardless of their source. The following example animates a button moving around the
-screen using behaviors.
-
-\snippet qml/usecases/animations.qml behave
-
-\section1 Other Animations
-
-Not all animations have to be tied to a specific property or state. You can also create animations more generally, and
-specify target items and properties inside the animation. Here are some examples of different ways to do this:
-
-\snippet qml/usecases/animations.qml constant
-\snippet qml/usecases/animations.qml scripted
-\image qml-uses-animation.png
-
-More information about animations can be found on the \l{Important Concepts in Qt Quick - States, Transitions and
-Animations} page.
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/integratingjs.qdoc b/src/quick/doc/src/appdevguide/usecases/integratingjs.qdoc
deleted file mode 100644
index 4bad4a4033..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/integratingjs.qdoc
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-integratingjs.html
-\title Use Case - Integrating JavaScript in QML
-\brief Example of how to integrate JavaScript code in QML applications
-
-JavaScript code can be easily integrated into QML to provide UI logic, imperative control, or other benefits.
-
-\section1 Using JavaScript Expressions for Property Values
-
-JavaScript expressions can be used in QML as bindings. For example
-\code
-Item {
- width: Math.random()
- height: width < 100 ? 100 : (width + 50) / 2
-}
-\endcode
-
-Note that function calls, like Math.random(), will not be revaluated unless their arguments
-change. So binding to Math.random() will be one random number and not revaluated, but if the width is changed in some
-other manner, the height binding will be reevaluated to take that into account.
-
-\section1 Adding JavaScript Functions in QML
-
-JavaScript functions can be declared on QML items, like in the below example. This allows you to call the method
-using the item id.
-
-\snippet qml/usecases/integratingjs-inline.qml 0
-
-\section1 Using JavaScript files
-
-JavaScript files can be used for abstracting out logic from QML files. To do this, first place your functions inside a
-.js file like in the example shown.
-
-\snippet qml/usecases/myscript.js 0
-
-Then import the file into any .qml file that needs to use the functions, like the example QML file below.
-
-\snippet qml/usecases/integratingjs.qml 0
-
-\image qml-uses-integratingjs.png
-
-For further details on the JavaScript engine used by QML, as well as the difference from browser JS, see the full
-documentation on \c {Using JavaScript Expressions with QML}.
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/layouts.qdoc b/src/quick/doc/src/appdevguide/usecases/layouts.qdoc
deleted file mode 100644
index e8e35a93e7..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/layouts.qdoc
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-layouts.html
-\title Use Case - Layouts In QML
-\brief Example of how to create layouts for visual components in a QML application
-
-There are several ways to position items in QML.
-
-Below is a brief overview. For more details, see \l {Important Concepts In Qt Quick - Positioning}.
-
-\section1 Manual Positioning
-
-Items can be placed at specific x,y coordinates on the screen by setting their x,y properties. This will
-setup their position relative to the top left corner of their parent, according to the
-\l {Concepts - Visual Coordinates in Qt Quick}{visual coordinate system} rules.
-
-Combined with using \l{Property Binding}{bindings} instead of constant valudes for these properties, relative positioning is also easily
-accomplished by setting the x and y coordinates to the appropriate bindings.
-
-\snippet qml/usecases/layouts.qml import
-\snippet qml/usecases/layouts.qml direct
-
-\image qml-uses-layouts-direct.png
-
-
-\section1 Anchors
-
-The \c Item type provides the abilitiy to anchor to other \l Item types. There are six anchor lines for each item: \e left,
-\e right, \e{vertical center}, \e top, \e bottom and \e{horizontal center}. The three vertical anchor lines can be anchored to any of
-the three vertical anchor lines of another item, and the three horizontal anchor lines can be anchored to the
-horizontal anchor lines of another item.
-
-For full details, see \l {Positioning with Anchors} and the documentation of the \l{Item::anchors.top}{anchors property}.
-
-\snippet qml/usecases/layouts.qml import
-\snippet qml/usecases/layouts.qml anchors
-
-\image qml-uses-layouts-anchors.png
-
-
-\section1 Positioners
-
-For the common case of wanting to position a set of types in a regular pattern, Qt Quick provides some positioner
-types. Items placed in a positioner are automatically positioned in some way; for example, a \l Row positions items to be
-horizontally adjacent (forming a row).
-
-For full details see \l {Item Layouts} and the documentation for \l{qtquick-qmltypereference.html#positioning}{the positioner types}.
-
-\snippet qml/usecases/layouts.qml import
-\snippet qml/usecases/layouts.qml positioners
-
-\image qml-uses-layouts-positioners.png
-
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/styling.qdoc b/src/quick/doc/src/appdevguide/usecases/styling.qdoc
deleted file mode 100644
index f8c7a94d30..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/styling.qdoc
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-styling.html
-\title Use Case - Style And Theme Support
-\brief Example of how to style user interface components in QML
-
-The types provided in the \l {Qt Quick} module are not complete user interface components on their own. A common use case is to
-develop a set of custom styled user interface components out of the types in the \l {Qt Quick} module. This is easily
-accomplished by creating your own reusable components.
-
-With the reusable components approach, you define your own type with the appearance you want to have in your
-application and style that type directly. You then use that type in your application instead of the unstyled type. For
-example, you could create a MyText.qml which is a Text type with certain properties set by default, and use MyText
-instead of Text elsewhere in your application.
-
-\section1 Example Themed Text
-\section2 Button Definition
-\snippet qml/usecases/MyText.qml 0
-\section2 Using the Text
-\snippet qml/usecases/styling-text.qml texts
-\image qml-uses-styling-text.png
-
-Because the root item in MyText.qml is a Text item it will behave as a
-Text item, and the properties can be overriden in specific uses. However, the properties will be set to the values
-specified in MyText when the item is first generated, thus applying your style by default.
-
-For pre-styled user interface components, see the \c{Qt Components} add-on which provides a set of components.
-For accessing the system theme, see the \l{SystemPalette} type documentation.
-
-\section1 Example Themed Button
-\section2 Button Definition
-\snippet qml/usecases/Button.qml 0
-\section2 Using the Button
-\snippet qml/usecases/styling.qml 0
-\image qml-uses-styling.png
-
-For more examples of creating custom UI components in QML, see the tutorials.
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/text.qdoc b/src/quick/doc/src/appdevguide/usecases/text.qdoc
deleted file mode 100644
index 7b8e21eb5b..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/text.qdoc
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-text.html
-\title Use Case - Displaying Text In QML
-\brief Example of how to display text in QML
-To display text the Text type is provided by the \l {Qt Quick} module. For related uses, the \l{TextInput} and
-\l{TextEdit} types provide editable text controls. For full HTML markup, see the \l {Qt WebKit} module.
-
-\section1 Displaying and Formatting Text
-
-To display text in QML, create a Text item and set the text property to the text you wish to display. The Text item
-will now display that text.
-
-Several properties can be set on the Text item to style the entire block of text. These include color, font family,
-font size, bold and italic. For a full list of properties, consult the \l{Text} type documentation.
-
-Rich text like markup can be used to selectively style specific sections of text with a Text item. Set \l
-Text::textFormat to Text.StyledText to use this functionality. More details are available in the documentation of the
-\l{Text} type.
-
-\section1 Laying out Text
-
-By default, Text will display the text as a single line unless it contains embedded newlines. To wrap the line, set the
-wrapMode property and give the text an explicit width for it to wrap to. If the width or height is not explicitly set,
-reading these properties will return the parameters of the bounding rect of the text (if you have explicitly set width
-or height, you can still use paintedWidth and paintedHeight). With these parameters in mind, the Text can be positioned
-like any other Item.
-
-\section1 Example Code
-\snippet qml/usecases/text.qml 0
-\image qml-uses-text.png
-
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/userinput.qdoc b/src/quick/doc/src/appdevguide/usecases/userinput.qdoc
deleted file mode 100644
index 7e93a263f1..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/userinput.qdoc
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-userinput.html
-\title Use Case - Responding To User Input in QML
-\brief Example of how to accept user input and respond to it in a QML application
-
-\section1 Supported Types of User Input
-
-The \l {Qt Quick} module provides support for the most common types of user input,
-including mouse and touch events, text input and key-press events. Other
-modules provide support for other types of user input (for example, the
-\l {Qt Sensors} module provides support for shake-gestures in QML applications).
-
-This article covers how to handle basic user input; for further information
-about motion-gesture support, please see the \l {Qt Sensors} documentation. For
-information about audio-visual input, please see the \l {Qt Multimedia} documentation.
-
-\section2 Mouse and Touch Events
-
-The \l MouseArea type allows mouse and touch events to be handled in a QML
-application. A \l MouseArea can be combined with either an \l Image or a
-\l Rectangle and \l Text object to implement a simple button.
-
-\snippet qml/usecases/userinput.qml 0
-
-For more advanced use cases requiring multiple touch points, please read the
-documentation for the \l MultiPointTouchArea type and the \l PinchArea type.
-
-Note that some types have their own built in input handling. For example,
-\l Flickable responds to mouse dragging, mouse wheel scrolling, touch dragging,
-and touch flicking by default.
-
-\section2 Keyboard and Button Events
-
-Button and key presses, from buttons on a device, a keypad, or a keyboard,
-can all be handled using the \l Keys attached property. This attached property
-is available on all \l Item derived types, and works with the \l Item::focus property
-to determine which type receives the key event. For simple key handling, you can set the focus
-to true on a single \l Item and do all your key handling there.
-
-\snippet qml/usecases/userinput-keys.qml 0
-
-For text input the \l {Qt Quick} module provides several built-in types.
-In particular, the \l TextInput and \l TextEdit types allow for single-line
-entry and multi-line editing respectively.
-
-Here is all you need to get a working TextInput:
-
-\code
-import QtQuick 2.0
-
-TextInput {
- focus: true
- text: "Initial Text"
-}
-\endcode
-
-*/
diff --git a/src/quick/doc/src/appdevguide/usecases/visual.qdoc b/src/quick/doc/src/appdevguide/usecases/visual.qdoc
deleted file mode 100644
index fc7b96cadc..0000000000
--- a/src/quick/doc/src/appdevguide/usecases/visual.qdoc
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
-\page qtquick-usecase-visual.html
-\title Use Case - Visual Elements In QML
-\brief Example of how to display visual item types in a QML application
-
-\section1 The Rectangle Type
-
-For the most basic of visuals, \l {Qt Quick} provides a \l Rectangle type to draw rectangles. These rectangles can be colored with a
-color or a vertical gradient. The \l Rectangle type can also draw borders on the rectangle.
-
-For drawing custom shapes beyond rectangles, see the \l Canvas type or display
-a pre-rendered image using the \l Image type.
-
-\snippet qml/usecases/visual-rects.qml 0
-\image qml-uses-visual-rectangles.png
-
-\section1 The Image Type
-
-\l {Qt Quick} provides an \l Image type which may be used to display images. The
-\l Image type has a \l source property whose value can be a remote or local
-URL, or the URL of an image file embedded in a compiled resource file.
-
-\snippet qml/usecases/visual.qml image
-
-For more complex images there are other types similar to \l Image.
-\l BorderImage draws an image with grid scaling, suitable for images used as
-borders. \l AnimatedImage plays animated .gif and .mng images. \l AnimatedSprite
-and \l SpriteSequence play animations comprised of multiple frames stored adjacently
-in a non animated image format.
-
-For displaying video files and camera data, see the \l {Qt Multimedia} module.
-
-\section1 Shared Visual Properties
-
-All visual items provided by \l {Qt Quick} are based on the Item type, which provides a common set of attributes for
-visual items, including opacity and transform attributes.
-
-\section2 Opacity and Visibility
-
-The QML object types provided by Qt Quick have built-in support for \l{Item::opacity}{opacity}.
-Opacity can be animated to allow smooth transitions to or from a transparent
-state. Visibility can also be managed with the \l{Item::visible}{visible} property more efficiently,
-but at the cost of not being able to animate it.
-
-\snippet qml/usecases/visual-opacity.qml 0
-\image qml-uses-visual-opacity.png
-
-\section2 Transforms
-
-Qt Quick types have built-in support for transformations. If you wish to have your
-visual content rotated or scaled, you can set the \l Item::rotation or \l Item::scale
-property. These can also be animated.
-
-\snippet qml/usecases/visual-transforms.qml 0
-\image qml-uses-visual-transforms.png
-
-For more complex transformations, see the \l Item::transform property.
-
-*/
diff --git a/src/quick/doc/src/concepts/effects/sprites.qdoc b/src/quick/doc/src/concepts/effects/sprites.qdoc
index 3a82f1963b..805a423002 100644
--- a/src/quick/doc/src/concepts/effects/sprites.qdoc
+++ b/src/quick/doc/src/concepts/effects/sprites.qdoc
@@ -27,7 +27,6 @@
/*!
\ingroup qtquick-images-sprites
-\ingroup qml-features
\page qtquick-effects-sprites.html
\title Sprite Animations
\brief Sprite-based animations with flexible transitioning
diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc
index 4807921dc0..827f6d85c8 100644
--- a/src/quick/doc/src/concepts/input/focus.qdoc
+++ b/src/quick/doc/src/concepts/input/focus.qdoc
@@ -27,7 +27,6 @@
/*!
\page qtquick-input-focus.html
-\ingroup qml-features
\title Keyboard Focus in Qt Quick
\brief handling keyboard focus
diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
index 7310d25929..28bbbf1cca 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
@@ -49,12 +49,12 @@ via the \e modelData role.
Here is a ListView with a delegate that references its model item's
value using the \c modelData role:
-\snippet quick/models/stringlistmodel/view.qml 0
+\snippet models/stringlistmodel/view.qml 0
A Qt application can load this QML document and set the value of \c myModel
to a QStringList:
-\snippet quick/models/stringlistmodel/main.cpp 0
+\snippet models/stringlistmodel/main.cpp 0
The complete source code for this example is available in
\l {quick/modelviews/stringlistmodel}{examples/quick/modelviews/stringlistmodel}
@@ -74,11 +74,11 @@ The following application creates a \c DataObject class with
Q_PROPERTY values that will be accessible as named roles when a
QList<DataObject*> is exposed to QML:
-\snippet quick/models/objectlistmodel/dataobject.h 0
+\snippet models/objectlistmodel/dataobject.h 0
\dots 4
-\snippet quick/models/objectlistmodel/dataobject.h 1
+\snippet models/objectlistmodel/dataobject.h 1
\codeline
-\snippet quick/models/objectlistmodel/main.cpp 0
+\snippet models/objectlistmodel/main.cpp 0
\dots
The QObject* is available as the \c modelData property. As a convenience,
@@ -86,7 +86,7 @@ the properties of the object are also made available directly in the
delegate's context. Here, \c view.qml references the \c DataModel properties in
the ListView delegate:
-\snippet quick/models/objectlistmodel/view.qml 0
+\snippet models/objectlistmodel/view.qml 0
Note the use of \c color property with qualifier.
The properties of the object are not replicated in the \c model
@@ -130,21 +130,21 @@ which exposes the \e type and \e sizes roles. It reimplements
QAbstractItemModel::roleNames() to expose the role names, so that they can be
accessed via QML:
-\snippet quick/models/abstractitemmodel/model.h 0
+\snippet models/abstractitemmodel/model.h 0
\dots
-\snippet quick/models/abstractitemmodel/model.h 1
+\snippet models/abstractitemmodel/model.h 1
\dots
-\snippet quick/models/abstractitemmodel/model.h 2
+\snippet models/abstractitemmodel/model.h 2
\codeline
-\snippet quick/models/abstractitemmodel/model.cpp 0
+\snippet models/abstractitemmodel/model.cpp 0
\codeline
-\snippet quick/models/abstractitemmodel/main.cpp 0
+\snippet models/abstractitemmodel/main.cpp 0
\dots
This model is displayed by a ListView delegate that accesses the \e type and \e size
roles:
-\snippet quick/models/abstractitemmodel/view.qml 0
+\snippet models/abstractitemmodel/view.qml 0
QML views are automatically updated when the model changes. Remember the model
must follow the standard rules for model changes and notify the view when
diff --git a/src/quick/doc/src/concepts/positioning/layouts.qdoc b/src/quick/doc/src/concepts/positioning/layouts.qdoc
index 9165c2f6df..785bcc6ca6 100644
--- a/src/quick/doc/src/concepts/positioning/layouts.qdoc
+++ b/src/quick/doc/src/concepts/positioning/layouts.qdoc
@@ -28,7 +28,6 @@
/*!
\ingroup qtquick-positioners
\page qtquick-positioning-layouts.html
-\ingroup qml-features
\title Item Layouts
Positioner items are container items that manage the positions and sizes of
diff --git a/src/quick/doc/src/concepts/positioning/righttoleft.qdoc b/src/quick/doc/src/concepts/positioning/righttoleft.qdoc
index 7052de3b49..bc67594960 100644
--- a/src/quick/doc/src/concepts/positioning/righttoleft.qdoc
+++ b/src/quick/doc/src/concepts/positioning/righttoleft.qdoc
@@ -27,7 +27,6 @@
/*!
\page qtquick-positioning-righttoleft.html
-\ingroup qml-features
\title Right-to-left User Interfaces
\brief switching text flow and layout
\section1 Overview
@@ -139,7 +138,7 @@ The painting of these icons can be mirrored with a dedicated \c mirror property
\section1 Default layout direction
-The \l {QML:Qt::application}{Qt.application.layoutDirection} property can be used to query the active layout direction of the
+The \l {QtQml2::Qt::application}{Qt.application.layoutDirection} property can be used to query the active layout direction of the
application. It is based on QApplication::layoutDirection(), which most commonly determines the layout
direction from the active language translation file.
diff --git a/src/quick/doc/src/dynamicview-tutorial.qdoc b/src/quick/doc/src/dynamicview-tutorial.qdoc
index a04f057c72..fad09b396b 100644
--- a/src/quick/doc/src/dynamicview-tutorial.qdoc
+++ b/src/quick/doc/src/dynamicview-tutorial.qdoc
@@ -62,12 +62,12 @@ delegate which provides a template for constructing items in the view.
The code for the ListView and delegate looks like this:
-\snippet quick/tutorials/dynamicview/dynamicview1/dynamicview.qml 0
+\snippet tutorials/dynamicview/dynamicview1/dynamicview.qml 0
The model is defined in a separate QML file which looks like this:
-\snippet quick/tutorials/dynamicview/dynamicview1/PetsModel.qml 0
-\snippet quick/tutorials/dynamicview/dynamicview1/PetsModel.qml 1
+\snippet tutorials/dynamicview/dynamicview1/PetsModel.qml 0
+\snippet tutorials/dynamicview/dynamicview1/PetsModel.qml 1
\section2 Walkthrough
@@ -77,11 +77,11 @@ is the template from which each item in the ListView is constructed.
The \c name, \c age, \c type, and \c size variables referenced in the delegate are sourced from
the model data. The names correspond to roles defined in the model.
-\snippet quick/tutorials/dynamicview/dynamicview1/dynamicview.qml 1
+\snippet tutorials/dynamicview/dynamicview1/dynamicview.qml 1
The second part of the application is the ListView itself to which we bind the model and delegate.
-\snippet quick/tutorials/dynamicview/dynamicview1/dynamicview.qml 2
+\snippet tutorials/dynamicview/dynamicview1/dynamicview.qml 2
*/
/*!
@@ -97,7 +97,7 @@ Now that we have a visible list of items we want to be able to interact with the
by extending the delegate so the visible content can be dragged up and down the screen. The
updated delegate looks like this:
-\snippet quick/tutorials/dynamicview/dynamicview2/dynamicview.qml 0
+\snippet tutorials/dynamicview/dynamicview2/dynamicview.qml 0
\section2 Walkthrough
@@ -106,8 +106,8 @@ for mouse events and will allow us to drag the delegate's content item. It also
a container for the content item which is important as a delegate's root item is positioned by
the view and cannot be moved by other means.
-\snippet quick/tutorials/dynamicview/dynamicview2/dynamicview.qml 1
-\snippet quick/tutorials/dynamicview/dynamicview2/dynamicview.qml 2
+\snippet tutorials/dynamicview/dynamicview2/dynamicview.qml 1
+\snippet tutorials/dynamicview/dynamicview2/dynamicview.qml 2
Dragging the content item is enabled by binding it to the MouseArea's
\l {QtQuick2::MouseArea::drag.target}{drag.target} property. Because we still want the view to be
@@ -117,14 +117,14 @@ timeout has expired it is interpreted as moving the list and if it moves after i
dragging an item. To make it more obvious to the user when an item can be dragged we'll change the
background color of the content item when the timeout has expired.
-\snippet quick/tutorials/dynamicview/dynamicview2/dynamicview.qml 3
+\snippet tutorials/dynamicview/dynamicview2/dynamicview.qml 3
The other thing we'll need to do before an item can be dragged is to unset any anchors on the
content item so it can be freely moved around. We do this in a state change that is triggered
when the delegate item is held, at the same time we can reparent the content item to the root item
so that is above other items in the stacking order and isn't obscured as it is dragged around.
-\snippet quick/tutorials/dynamicview/dynamicview2/dynamicview.qml 4
+\snippet tutorials/dynamicview/dynamicview2/dynamicview.qml 4
*/
@@ -141,10 +141,10 @@ The next step in our application to move items within the list as they're dragge
can re-order the list. To achieve this we introduce three new types to our application;
VisualDataModel, \l Drag and DropArea.
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 0
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 1
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 2
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 5
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 0
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 1
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 2
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 5
\section2 Walkthrough
@@ -152,7 +152,7 @@ In order to re-order the view we need to determine when one item has been dragge
the Drag attached property we can generate events that are sent to the scene graph whenever the item
it is attached to moves.
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 1
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 1
Drag events are only sent while the active property is true, so in this example the first event
would be sent when the delegate was held with additional event sents when dragging. The
@@ -163,7 +163,7 @@ Then we use a DropArea in each view item to determine when the hot spot of the d
intersects another item, when a drag enters one of these DropAreas we can move the dragged item
to the index of the item it was dragged over.
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 3
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 3
To move the items within the view we use a VisualDataModel. The VisualDataModel type is used by
the view types to instantiate delegate items from model data and when constructed explicitly can
@@ -177,7 +177,7 @@ To utilize a VisualDataModel with a ListView we bind it to the \l {QtQuick2::Lis
property of the view and bind the \l {QtQuick2::VisualDataModel::model}{model} and
\l {QtQuick2::VisualDataModel::delegate}{delegate} to the VisualDataModel.
-\snippet quick/tutorials/dynamicview/dynamicview3/dynamicview.qml 4
+\snippet tutorials/dynamicview/dynamicview3/dynamicview.qml 4
*/
@@ -193,7 +193,7 @@ Drag and drop isn't the only way items in a view can be re-ordered, using a Visu
also possible to sort items based on model data. To do that we extend our VisualDataModel instance
like this:
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 0
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 0
\section2 Walkthrough
@@ -204,8 +204,8 @@ we want items to first be added to an unsorted group from where we can transfer
position in the items group. To do that we clear includeByDefault on the items group and set it on
a new group name 'unsorted'.
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 1
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 2
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 1
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 2
We sort the items by first finding the position in the items group to insert the first unsorted
item and then transfer the item to the items group before moving it to the pre-determined index and
@@ -216,19 +216,19 @@ with the \l {QtQuick2::VisualDataModel::get} {get} function. Through the model
handle we can access the same model data that is available in a delegate instance of that item and
compare against other items to determine relative position.
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 3
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 3
The lessThan argument to the sort function is a comparsion function which will determine the order
of the list. In this example it can be one of the following:
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 4
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 4
A sort is triggered whenever new items are added to the unsorted VisualDataGroup which we are
notified of by the \l {QtQuick2::VisualDataGroup::onChanged}{onChanged} handler. If no sort
function is currently selected we simply transfer all items from the unsorted group to the items
group, otherwise we call sort with the selected sort function.
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 5
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 5
Finally when the selected sort order changes we can trigger a full re-sort of the list by moving
all items from the items group to the unsorted group, which will trigger the
@@ -236,6 +236,6 @@ all items from the items group to the unsorted group, which will trigger the
items group in correct order. Note that the \l {QtQuick2::VisualDataGroup::onChanged}{onChanged}
handler will not be invoked recursively so there's no issue with it being invoked during a sort.
-\snippet quick/tutorials/dynamicview/dynamicview4/dynamicview.qml 6
+\snippet tutorials/dynamicview/dynamicview4/dynamicview.qml 6
*/
diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc
index 8d3bc30624..ddca973496 100644
--- a/src/quick/doc/src/examples.qdoc
+++ b/src/quick/doc/src/examples.qdoc
@@ -38,10 +38,13 @@ These are code samples that show how to use various aspects of Qt Quick. Larger
compound interfaces are grouped as applications as they demonstrate more Qt
Quick features.
+Here is a list of fully-functional demo applications.
To run the sample applications, open them in Qt Creator or use the included
\l {Prototyping with qmlscene}{qmlscene} tool.
-Some of these code samples have a corresponding \l{qtquick-tutorials}{tutorial}.
+\annotatedlist{qtquickdemos}
+
+Some of these code samples below have a corresponding \l{qtquick-tutorials}{tutorial}.
The Qt Quick features are covered in the \l {qtquick-overviews}{main page}.
This set of code samples are part of the collection of \l{Qt Examples}.
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index 43d6b952cb..d580ba8c96 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -64,6 +64,12 @@ information about the concepts which are central to \c QtQuick.
system for QML applications
\li \l{QtQuick.Window 2}{Window} - contains types for creating
top-level windows and accessing screen information
+ \li \l{QtQuick.Dialogs 1}{Dialogs} - contains types for creating and
+ interacting with system dialogs
+ \li \l{QtQuick.Controls 1.0}{Controls} - provides a set of reusable
+ UI components
+ \li \l{QtQuick.Layouts 1.0}{Layouts} - contains types that are used
+ to arrange items in the user interface
\endlist
\section1 Basic Types
@@ -78,9 +84,9 @@ In addition, the \c QtQuick module provides the following basic types:
\section1 Object Types
All of the object types provided by \c QtQuick are based on the \l{Item} type,
-which itself derives from \l{QML::QtObject}. \l{qtqml-typereference-topic.html#object-types}
+which itself derives from \l{QtQml2::QtObject}{QtObject}. \l{qtqml-typereference-topic.html#object-types}
{QML object types} provided by the Qt QML module
-(such as \l{QML::QtObject} and \l{QML::Component}) are also available when
+(such as \l{QtQml2::QtObject}{QtObject} and \l{QtQml2::Component}{Component}) are also available when
you import \c QtQuick.
\section2 Visual Types
@@ -311,9 +317,9 @@ For more details about the module itself, see the \l{Qt Quick} module page.
\li By a hexadecimal triplet or quad in the form \c "#RRGGBB" and \c "#AARRGGBB"
respectively. For example, the color red corresponds to a triplet of \c "#FF0000"
and a slightly transparent blue to a quad of \c "#800000FF".
- \li Using the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()},
- \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or
- \l{QML:Qt::tint()}{Qt.tint()} functions.
+ \li Using the \l{QtQml2::Qt::rgba()}{Qt.rgba()}, \l{QtQml2::Qt::hsla()}{Qt.hsla()},
+ \l{QtQml2::Qt::darker()}{Qt.darker()}, \l{QtQml2::Qt::lighter()}{Qt.lighter()} or
+ \l{QtQml2::Qt::tint()}{Qt.tint()} functions.
\endlist
Example:
@@ -335,7 +341,7 @@ For more details about the module itself, see the \l{Qt Quick} module page.
}
\endqml
- To test color values for equality, use the \l{QML:Qt::colorEqual()}{Qt.colorEqual()}
+ To test color values for equality, use the \l{QtQml2::Qt::colorEqual()}{Qt.colorEqual()}
function. This allows colors to be accurately compared whether they are in property
form or in any of the acceptable string specification forms.
@@ -576,7 +582,7 @@ console.log(c + " " + d); // false true
Rotation { angle: 60; axis: "0,1,0" }
\endqml
- or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
+ or with the \l{QtQml2::Qt::vector3d()}{Qt.vector3d()} function:
\qml
Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
diff --git a/src/quick/doc/src/qtquick.qdoc b/src/quick/doc/src/qtquick.qdoc
index 9fba663a1c..7163baa819 100644
--- a/src/quick/doc/src/qtquick.qdoc
+++ b/src/quick/doc/src/qtquick.qdoc
@@ -76,7 +76,7 @@ of the \l{qtquick-quickstart-basics.html}{QML Basics} and
\l{qtquick-quickstart-essentials.html}{QML Essentials} from the
\l{qtquick-applicationdevelopers.html}{QML Application Developer Resources}.
-To find out more about using the QML language, see the \l{Qt QML Module Documentation}.
+To find out more about using the QML language, see the \l{Qt QML} module documentation.
\section1 Qt Quick Module Documentation
@@ -125,6 +125,8 @@ Additional Qt Quick information:
system for Qt Quick
\li \l{QtQuick.Window 2}{Window} - contains types for creating
top-level windows and accessing screen information
+ \li \l{QtQuick.Dialogs 1}{Dialogs} - contains types for creating and
+ interacting with system dialogs
\endlist
\li \l{Qt Quick Release Notes} - list of changes and additions in the Qt Quick
\li \l{Qt Quick Code Samples} - list of all Qt Quick examples
diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc
index baa0312aa4..2b865073d3 100644
--- a/src/quick/doc/src/whatsnew.qdoc
+++ b/src/quick/doc/src/whatsnew.qdoc
@@ -29,7 +29,35 @@
\title Qt Quick Release Notes
\page qtquick-releasenotes.html
-\section1 Qt Quick in Qt 5
+\section1 Qt Quick in Qt 5.1
+
+\l{Qt Quick} 2.1 is new in Qt 5.1. This is a summary of improvements and new
+features introduced by the new import and new classes in Qt 5.1:
+\list
+\li New threaded render loop for Mac, Linux, and Embedded.
+\li New render loop for windows for smoother animations.
+\li New \l Window properties: activeFocusItem, minimumWidth, minimumHeight,
+ maximumWidth, maximumHeight, visibility, contentOrientation, and opacity.
+\li New \l Item property: activeFocusOnTab.
+\li New \l Grid properties: horizontalAlignment, verticalAlignment, and
+ effectiveHorizontalAlignment.
+\li New \l TextEdit properties: selectByKeyboard and textDocument
+\li A \l Window declared inside another Window or \l Item will automatically be
+ transient for (centered upon) the outer window.
+\endlist
+
+\section2 New Submodules
+
+In Qt 5.1, there are several new modules which extend Qt Quick functionalities.
+\list
+\li \l{Qt Quick Dialogs} - contains types for creating and interacting with system dialogs
+\li \l{Qt Quick Controls} - provides a set of reusable UI components
+\li \l{Qt Quick Layouts} - contains types that are used to arrange items in the user interface
+\endlist
+
+The \l{What's New in Qt 5.1} has more information about the Qt 5.1 release.
+
+\section1 Qt Quick in Qt 5.0
The \l {Qt Quick} module is new in Qt 5. It provides the visual canvas and scenegraph back-end
as well as the \c QtQuick QML module for QML application development.
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 0c58b9b800..4144256a38 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -266,7 +266,7 @@ QQuickCanvasItemPrivate::~QQuickCanvasItemPrivate()
requires the pixel data to be exchanged between the system memory and the
graphic card, which is significantly more expensive. Rendering may also be
synchronized with the V-sync signal (to avoid
- \l{en.wikipedia.org/wiki/Screen_tearing}{screen tearing}) which will further
+ \l{http://en.wikipedia.org/wiki/Screen_tearing}{screen tearing}) which will further
impact pixel operations with \c Canvas.FrambufferObject render target.
\section1 Tips for Porting Existing HTML5 Canvas applications
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index b366775c03..5709d58d58 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -264,50 +264,86 @@ public:
QImage qt_image_convolute_filter(const QImage& src, const QVector<qreal>& weights, int radius = 0)
{
- int sides = radius ? radius : qRound(qSqrt(weights.size()));
- int half = qFloor(sides/2);
+ // weights 3x3 => delta 1
+ int delta = radius ? radius : qFloor(qSqrt(weights.size()) / qreal(2));
+ int filterDim = 2 * delta + 1;
QImage dst = QImage(src.size(), src.format());
+
int w = src.width();
int h = src.height();
- for (int y = 0; y < dst.height(); ++y) {
- QRgb *dr = (QRgb*)dst.scanLine(y);
- for (int x = 0; x < dst.width(); ++x) {
- unsigned char* dRgb = ((unsigned char*)&dr[x]);
- unsigned char red=0, green=0, blue=0, alpha=0;
- int sy = y;
- int sx = x;
-
- for (int cy=0; cy<sides; cy++) {
- for (int cx=0; cx<sides; cx++) {
- int scy = sy + cy - half;
- int scx = sx + cx - half;
- if (scy >= 0 && scy < h && scx >= 0 && scx < w) {
- const QRgb *sr = (const QRgb*)(src.constScanLine(scy));
- const unsigned char* sRgb = ((const unsigned char*)&sr[scx]);
- qreal wt = radius ? weights[0] : weights[cy*sides+cx];
- red += sRgb[0] * wt;
- green += sRgb[1] * wt;
- blue += sRgb[2] * wt;
- alpha += sRgb[3] * wt;
- }
- }
- }
- dRgb[0] = red;
- dRgb[1] = green;
- dRgb[2] = blue;
- dRgb[3] = alpha;
- }
+
+ const QRgb *sr = (const QRgb *)(src.constBits());
+ int srcStride = src.bytesPerLine() / 4;
+
+ QRgb *dr = (QRgb*)dst.bits();
+ int dstStride = dst.bytesPerLine() / 4;
+
+ for (int y = 0; y < h; ++y) {
+ for (int x = 0; x < w; ++x) {
+ int red = 0;
+ int green = 0;
+ int blue = 0;
+ int alpha = 0;
+
+ qreal redF = 0;
+ qreal greenF = 0;
+ qreal blueF = 0;
+ qreal alphaF = 0;
+
+ int sy = y;
+ int sx = x;
+
+ for (int cy = 0; cy < filterDim; ++cy) {
+ int scy = sy + cy - delta;
+
+ if (scy < 0 || scy >= h)
+ continue;
+
+ const QRgb *sry = sr + scy * srcStride;
+
+ for (int cx = 0; cx < filterDim; ++cx) {
+ int scx = sx + cx - delta;
+
+ if (scx < 0 || scx >= w)
+ continue;
+
+ const QRgb col = sry[scx];
+
+ if (radius) {
+ red += qRed(col);
+ green += qGreen(col);
+ blue += qBlue(col);
+ alpha += qAlpha(col);
+ } else {
+ qreal wt = weights[cy * filterDim + cx];
+
+ redF += qRed(col) * wt;
+ greenF += qGreen(col) * wt;
+ blueF += qBlue(col) * wt;
+ alphaF += qAlpha(col) * wt;
+ }
+ }
+ }
+
+ if (radius)
+ dr[x] = qRgba(qRound(red * weights[0]), qRound(green * weights[0]), qRound(blue * weights[0]), qRound(alpha * weights[0]));
+ else
+ dr[x] = qRgba(qRound(redF), qRound(greenF), qRound(blueF), qRound(alphaF));
+ }
+
+ dr += dstStride;
}
+
return dst;
}
void qt_image_boxblur(QImage& image, int radius, bool quality)
{
int passes = quality? 3: 1;
- for (int i=0; i < passes; i++) {
- image = qt_image_convolute_filter(image, QVector<qreal>() << 1.0/(radius * radius * 1.0), radius);
- }
+ int filterSize = 2 * radius + 1;
+ for (int i = 0; i < passes; ++i)
+ image = qt_image_convolute_filter(image, QVector<qreal>() << 1.0 / (filterSize * filterSize), radius);
}
static QPainter::CompositionMode qt_composite_mode_from_string(const QString &compositeOperator)
@@ -431,7 +467,7 @@ static v8::Local<v8::Object> qt_create_image_data(qreal w, qreal h, QV8Engine* e
r->image = QImage(w, h, QImage::Format_ARGB32);
r->image.fill(0x00000000);
} else {
- Q_ASSERT(image.width() == w && image.height() == h);
+ Q_ASSERT(image.width() == int(w) && image.height() == int(h));
r->image = image.format() == QImage::Format_ARGB32 ? image : image.convertToFormat(QImage::Format_ARGB32);
}
v8::Local<v8::Object> pixelData = ed->constructorPixelArray->NewInstance();
@@ -3283,7 +3319,6 @@ QPainterPath QQuickContext2D::createTextGlyphs(qreal x, qreal y, const QString&
QPainterPath textPath;
textPath.addText(x - xoffset, y - yoffset+metrics.ascent(), state.font, text);
- textPath = state.matrix.map(textPath);
return textPath;
}
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
index 7c5841810b..237bd61c1b 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
@@ -54,86 +54,136 @@ QT_BEGIN_NAMESPACE
void qt_image_boxblur(QImage& image, int radius, bool quality);
-static QImage makeShadowImage(const QImage& image, qreal offsetX, qreal offsetY, qreal blur, const QColor& color)
-{
- QImage shadowImg(image.width() + blur + qAbs(offsetX),
- image.height() + blur + qAbs(offsetY),
- QImage::Format_ARGB32_Premultiplied);
- shadowImg.fill(0);
- QPainter tmpPainter(&shadowImg);
- tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
- qreal shadowX = offsetX > 0? offsetX : 0;
- qreal shadowY = offsetY > 0? offsetY : 0;
-
- tmpPainter.drawImage(shadowX, shadowY, image);
- tmpPainter.end();
-
- if (blur > 0)
- qt_image_boxblur(shadowImg, blur/2, true);
-
- // blacken the image with shadow color...
- tmpPainter.begin(&shadowImg);
- tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
- tmpPainter.fillRect(shadowImg.rect(), color);
- tmpPainter.end();
- return shadowImg;
-}
+namespace {
+ class ShadowImageMaker
+ {
+ public:
+ virtual ~ShadowImageMaker() {}
-static void fillRectShadow(QPainter* p, QRectF shadowRect, qreal offsetX, qreal offsetY, qreal blur, const QColor& color)
-{
- QRectF r = shadowRect;
- r.moveTo(0, 0);
+ void paintShapeAndShadow(QPainter *p, qreal offsetX, qreal offsetY, qreal blur, const QColor &color)
+ {
+ QRectF bounds = boundingRect().translated(offsetX, offsetY).adjusted(-2*blur, -2*blur, 2*blur, 2*blur);
+ QRect boundsAligned = bounds.toAlignedRect();
+
+ QImage shadowImage(boundsAligned.size(), QImage::Format_ARGB32_Premultiplied);
+ shadowImage.fill(0);
+
+ QPainter shadowPainter(&shadowImage);
+ shadowPainter.setRenderHints(p->renderHints());
+ shadowPainter.translate(offsetX - boundsAligned.left(), offsetY - boundsAligned.top());
+ paint(&shadowPainter);
+ shadowPainter.end();
+
+ if (blur > 0)
+ qt_image_boxblur(shadowImage, qMax(1, qRound(blur / 2)), true);
+
+ // blacken the image with shadow color...
+ shadowPainter.begin(&shadowImage);
+ shadowPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ shadowPainter.fillRect(shadowImage.rect(), color);
+ shadowPainter.end();
+
+ p->drawImage(boundsAligned.topLeft(), shadowImage);
+ paint(p);
+ }
- QImage shadowImage(r.size().width() + 1, r.size().height() + 1, QImage::Format_ARGB32_Premultiplied);
- QPainter tp;
- tp.begin(&shadowImage);
- tp.fillRect(r, p->brush());
- tp.end();
- shadowImage = makeShadowImage(shadowImage, offsetX, offsetY, blur, color);
+ virtual void paint(QPainter *p) const = 0;
+ virtual QRectF boundingRect() const = 0;
+ };
- qreal dx = shadowRect.left() + (offsetX < 0? offsetX:0);
- qreal dy = shadowRect.top() + (offsetY < 0? offsetY:0);
+ class FillRectShadow : public ShadowImageMaker
+ {
+ public:
+ FillRectShadow(const QRectF &rect, const QBrush &brush)
+ : m_rect(rect.normalized())
+ , m_brush(brush)
+ {
+ }
+
+ void paint(QPainter *p) const { p->fillRect(m_rect, m_brush); }
+ QRectF boundingRect() const { return m_rect; }
- p->drawImage(dx, dy, shadowImage);
- p->fillRect(shadowRect, p->brush());
+ private:
+ QRectF m_rect;
+ QBrush m_brush;
+ };
+
+ class FillPathShadow : public ShadowImageMaker
+ {
+ public:
+ FillPathShadow(const QPainterPath &path, const QBrush &brush)
+ : m_path(path)
+ , m_brush(brush)
+ {
+ }
+
+ void paint(QPainter *p) const { p->fillPath(m_path, m_brush); }
+ QRectF boundingRect() const { return m_path.boundingRect(); }
+
+ private:
+ QPainterPath m_path;
+ QBrush m_brush;
+ };
+
+ class StrokePathShadow : public ShadowImageMaker
+ {
+ public:
+ StrokePathShadow(const QPainterPath &path, const QPen &pen)
+ : m_path(path)
+ , m_pen(pen)
+ {
+ }
+
+ void paint(QPainter *p) const { p->strokePath(m_path, m_pen); }
+
+ QRectF boundingRect() const
+ {
+ qreal d = qMax(qreal(1), m_pen.widthF());
+ return m_path.boundingRect().adjusted(-d, -d, d, d);
+ }
+
+ private:
+ QPainterPath m_path;
+ QPen m_pen;
+ };
+
+ class DrawImageShadow : public ShadowImageMaker
+ {
+ public:
+ DrawImageShadow(const QImage &image, const QPointF &offset)
+ : m_image(image)
+ , m_offset(offset)
+ {
+ }
+
+ void paint(QPainter *p) const { p->drawImage(m_offset, m_image); }
+
+ QRectF boundingRect() const { return QRectF(m_image.rect()).translated(m_offset); }
+
+ private:
+ QImage m_image;
+ QPointF m_offset;
+ };
+}
+
+static void fillRectShadow(QPainter* p, QRectF shadowRect, qreal offsetX, qreal offsetY, qreal blur, const QColor& color)
+{
+ FillRectShadow shadowMaker(shadowRect, p->brush());
+ shadowMaker.paintShapeAndShadow(p, offsetX, offsetY, blur, color);
}
static void fillShadowPath(QPainter* p, const QPainterPath& path, qreal offsetX, qreal offsetY, qreal blur, const QColor& color)
{
- QRectF r = path.boundingRect();
- QImage img(r.size().width() + r.left() + 1,
- r.size().height() + r.top() + 1,
- QImage::Format_ARGB32_Premultiplied);
- img.fill(0);
- QPainter tp(&img);
- tp.fillPath(path.translated(0, 0), p->brush());
- tp.end();
-
- QImage shadowImage = makeShadowImage(img, offsetX, offsetY, blur, color);
- qreal dx = r.left() + (offsetX < 0? offsetX:0);
- qreal dy = r.top() + (offsetY < 0? offsetY:0);
-
- p->drawImage(dx, dy, shadowImage);
- p->fillPath(path, p->brush());
+ FillPathShadow shadowMaker(path, p->brush());
+ shadowMaker.paintShapeAndShadow(p, offsetX, offsetY, blur, color);
}
static void strokeShadowPath(QPainter* p, const QPainterPath& path, qreal offsetX, qreal offsetY, qreal blur, const QColor& color)
{
- QRectF r = path.boundingRect();
- QImage img(r.size().width() + r.left() + 1,
- r.size().height() + r.top() + 1,
- QImage::Format_ARGB32_Premultiplied);
- img.fill(0);
- QPainter tp(&img);
- tp.strokePath(path, p->pen());
- tp.end();
-
- QImage shadowImage = makeShadowImage(img, offsetX, offsetY, blur, color);
- qreal dx = r.left() + (offsetX < 0? offsetX:0);
- qreal dy = r.top() + (offsetY < 0? offsetY:0);
- p->drawImage(dx, dy, shadowImage);
- p->strokePath(path, p->pen());
+ StrokePathShadow shadowMaker(path, p->pen());
+ shadowMaker.paintShapeAndShadow(p, offsetX, offsetY, blur, color);
}
+
static inline void drawRepeatPattern(QPainter* p, const QImage& image, const QRectF& rect, const bool repeatX, const bool repeatY)
{
// Patterns must be painted so that the top left of the first image is anchored at
@@ -259,15 +309,16 @@ static void qt_drawImage(QPainter *p, QQuickContext2D::State& state, QImage imag
if (sw != dw || sh != dh)
image = image.scaled(dw, dh);
- if (shadow) {
- QImage shadow = makeShadowImage(image, state.shadowOffsetX, state.shadowOffsetY, state.shadowBlur, state.shadowColor);
- qreal shadow_dx = dx + (state.shadowOffsetX < 0? state.shadowOffsetY:0);
- qreal shadow_dy = dy + (state.shadowOffsetX < 0? state.shadowOffsetY:0);
- p->drawImage(shadow_dx, shadow_dy, shadow);
- }
//Strange OpenGL painting behavior here, without beginNativePainting/endNativePainting, only the first image is painted.
p->beginNativePainting();
- p->drawImage(dx, dy, image);
+
+ if (shadow) {
+ DrawImageShadow shadowMaker(image, QPointF(dx, dy));
+ shadowMaker.paintShapeAndShadow(p, state.shadowOffsetX, state.shadowOffsetY, state.shadowBlur, state.shadowColor);
+ } else {
+ p->drawImage(dx, dy, image);
+ }
+
p->endNativePainting();
}
diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp
index 729e32e564..84ab5bb8fb 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp
@@ -586,6 +586,7 @@ QQuickCanvasItem::RenderTarget QQuickContext2DImageTexture::renderTarget() const
void QQuickContext2DImageTexture::bind()
{
imageTexture()->bind();
+ updateBindOptions();
}
bool QQuickContext2DImageTexture::updateTexture()
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index a24d1a33c4..b2ae2e4d29 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -114,13 +114,13 @@ public:
\ingroup qtquick-input
\brief For specifying drag and drop events for moved Items
- Using the Drag attached property any Item can made a source of drag and drop
+ Using the Drag attached property any Item can be made a source of drag and drop
events within a scene.
- When a drag is \l active on an item any change in that items position will
- generate a drag events that will be sent to any DropArea that intersects
- the with new position of the item. Other items which implement drag and
- drop event handlers can also receive these events.
+ When a drag is \l active on an item any change in that item's position will
+ generate a drag event that will be sent to any DropArea that intersects
+ with the new position of the item. Other items which implement drag and
+ drop event handlers can also receive these events.
The following snippet shows how an item can be dragged with a MouseArea.
However, dragging is not limited to mouse drags, anything that can move an item
diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp
index 5dc8cec640..f5dbb7de76 100644
--- a/src/quick/items/qquickdroparea.cpp
+++ b/src/quick/items/qquickdroparea.cpp
@@ -400,7 +400,7 @@ QStringList QQuickDropEvent::keys() const
*/
/*!
- \qmlproperty real QtQuick2::DragEvent::accepted
+ \qmlproperty bool QtQuick2::DragEvent::accepted
This property holds whether the drag event was accepted by a handler.
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index dd7357822a..bfb0620688 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -422,12 +422,16 @@ void QQuickFlickablePrivate::fixupX_callback(void *data)
void QQuickFlickablePrivate::fixupX()
{
Q_Q(QQuickFlickable);
+ if (!q->isComponentComplete())
+ return; //Do not fixup from initialization values
fixup(hData, q->minXExtent(), q->maxXExtent());
}
void QQuickFlickablePrivate::fixupY()
{
Q_Q(QQuickFlickable);
+ if (!q->isComponentComplete())
+ return; //Do not fixup from initialization values
fixup(vData, q->minYExtent(), q->maxYExtent());
}
@@ -912,6 +916,18 @@ void QQuickFlickable::setFlickableDirection(FlickableDirection direction)
}
}
+/*!
+ \qmlproperty bool QtQuick2::Flickable::pixelAligned
+
+ This property sets the alignment of \l contentX and \l contentY to
+ pixels (\c true) or subpixels (\c false).
+
+ Enable pixelAligned to optimize for still content or moving content with
+ high constrast edges, such as one-pixel-wide lines, text or vector graphics.
+ Disable pixelAligned when optimizing for animation quality.
+
+ The default is \c false.
+*/
bool QQuickFlickable::pixelAligned() const
{
Q_D(const QQuickFlickable);
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 111e74eeff..58e1612e19 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -58,6 +58,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qnumeric.h>
+#include <QtGui/qpa/qplatformtheme.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlengine_p.h>
@@ -2034,6 +2035,44 @@ QQuickItem::~QQuickItem()
/*!
\internal
+*/
+bool QQuickItemPrivate::qt_tab_all_widgets()
+{
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
+ return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool();
+ return true;
+}
+
+/*!
+ \internal
+*/
+bool QQuickItemPrivate::canAcceptTabFocus(QQuickItem *item)
+{
+ bool result = true;
+
+ if (!item->window())
+ return false;
+
+ if (item == item->window()->contentItem())
+ return true;
+
+#ifndef QT_NO_ACCESSIBILITY
+ result = false;
+ if (QObject *acc = qmlAttachedPropertiesObject<QQuickAccessibleAttached>(item, false)) {
+ int role = acc->property("role").toInt();
+ if (role == QAccessible::EditableText
+ || role == QAccessible::Table
+ || role == QAccessible::List
+ || role == QAccessible::SpinBox)
+ result = true;
+ }
+#endif
+
+ return result;
+}
+
+/*!
+ \internal
\brief QQuickItemPrivate::focusNextPrev focuses the next/prev item in the tab-focus-chain
\param item The item that currently has the focus
\param forward The direction
@@ -2057,7 +2096,8 @@ bool QQuickItemPrivate::focusNextPrev(QQuickItem *item, bool forward)
QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, bool forward)
{
Q_ASSERT(item);
- Q_ASSERT(item->activeFocusOnTab());
+
+ bool all = QQuickItemPrivate::qt_tab_all_widgets();
QQuickItem *from = 0;
if (forward) {
@@ -2069,6 +2109,10 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
from = item->parentItem();
}
bool skip = false;
+ const QQuickItem * const contentItem = item->window()->contentItem();
+ const QQuickItem * const originalItem = item;
+ QQuickItem * startItem = item;
+ QQuickItem * firstFromItem = from;
QQuickItem *current = item;
do {
skip = false;
@@ -2119,9 +2163,27 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo
skip = true;
}
}
-
from = last;
- } while (skip || !current->activeFocusOnTab() || !current->isEnabled() || !current->isVisible());
+ if (current == startItem && from == firstFromItem) {
+ // wrapped around, avoid endless loops
+ if (originalItem == contentItem) {
+#ifdef FOCUS_DEBUG
+ qDebug() << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return contentItem";
+#endif
+ return item->window()->contentItem();
+ } else {
+#ifdef FOCUS_DEBUG
+ qDebug() << "QQuickItemPrivate::nextPrevItemInTabFocusChain: looped, return " << startItem;
+#endif
+ return startItem;
+ }
+ }
+ if (!firstFromItem) { //start from root
+ startItem = current;
+ firstFromItem = from;
+ }
+ } while (skip || !current->activeFocusOnTab() || !current->isEnabled() || !current->isVisible()
+ || !(all || QQuickItemPrivate::canAcceptTabFocus(current)));
return current;
}
@@ -2506,8 +2568,7 @@ void QQuickItemPrivate::derefWindow()
if (c->cursorItem == q)
c->cursorItem = 0;
#endif
- if ( hoverEnabled )
- c->hoverItems.removeAll(q);
+ c->hoverItems.removeAll(q);
if (itemNodeInstance)
c->cleanup(itemNodeInstance);
if (!parentItem)
@@ -2712,10 +2773,10 @@ void QQuickItemPrivate::data_append(QQmlListProperty<QObject> *prop, QObject *o)
QObject::connect(item, SIGNAL(windowChanged(QQuickWindow*)),
thisWindow, SLOT(setTransientParent_helper(QQuickWindow*)));
}
+ o->setParent(that);
}
- // XXX todo - do we really want this behavior?
- o->setParent(that);
+ resources_append(prop, o);
}
}
@@ -2793,30 +2854,38 @@ void QQuickItemPrivate::data_clear(QQmlListProperty<QObject> *property)
QObject *QQuickItemPrivate::resources_at(QQmlListProperty<QObject> *prop, int index)
{
- const QObjectList children = prop->object->children();
- if (index < children.count())
- return children.at(index);
- else
- return 0;
+ QQuickItemPrivate *quickItemPrivate = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object));
+ return quickItemPrivate->extra.isAllocated() ? quickItemPrivate->extra->resourcesList.value(index) : 0;
}
-void QQuickItemPrivate::resources_append(QQmlListProperty<QObject> *prop, QObject *o)
+void QQuickItemPrivate::resources_append(QQmlListProperty<QObject> *prop, QObject *object)
{
- // XXX todo - do we really want this behavior?
- o->setParent(prop->object);
+ QQuickItem *quickItem = static_cast<QQuickItem *>(prop->object);
+ QQuickItemPrivate *quickItemPrivate = QQuickItemPrivate::get(quickItem);
+ if (!quickItemPrivate->extra.value().resourcesList.contains(object)) {
+ quickItemPrivate->extra.value().resourcesList.append(object);
+ qmlobject_connect(object, QObject, SIGNAL(destroyed(QObject*)),
+ quickItem, QQuickItem, SLOT(_q_resourceObjectDeleted(QObject*)));
+ }
}
int QQuickItemPrivate::resources_count(QQmlListProperty<QObject> *prop)
{
- return prop->object->children().count();
+ QQuickItemPrivate *quickItemPrivate = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object));
+ return quickItemPrivate->extra.isAllocated() ? quickItemPrivate->extra->resourcesList.count() : 0;
}
void QQuickItemPrivate::resources_clear(QQmlListProperty<QObject> *prop)
{
- // XXX todo - do we really want this behavior?
- const QObjectList children = prop->object->children();
- for (int index = 0; index < children.count(); index++)
- children.at(index)->setParent(0);
+ QQuickItem *quickItem = static_cast<QQuickItem *>(prop->object);
+ QQuickItemPrivate *quickItemPrivate = QQuickItemPrivate::get(quickItem);
+ if (quickItemPrivate->extra.isAllocated()) {//If extra is not allocated resources is empty.
+ foreach (QObject *object, quickItemPrivate->extra->resourcesList) {
+ qmlobject_disconnect(object, QObject, SIGNAL(destroyed(QObject*)),
+ quickItem, QQuickItem, SLOT(_q_resourceObjectDeleted(QObject*)));
+ }
+ quickItemPrivate->extra->resourcesList.clear();
+ }
}
QQuickItem *QQuickItemPrivate::children_at(QQmlListProperty<QQuickItem> *prop, int index)
@@ -2963,6 +3032,12 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop)
p->dirty(QQuickItemPrivate::Transform);
}
+void QQuickItemPrivate::_q_resourceObjectDeleted(QObject *object)
+{
+ if (extra.isAllocated() && extra->resourcesList.contains(object))
+ extra->resourcesList.removeAll(object);
+}
+
/*!
\qmlproperty AnchorLine QtQuick2::Item::anchors.top
\qmlproperty AnchorLine QtQuick2::Item::anchors.bottom
@@ -4323,7 +4398,8 @@ void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e)
return;
//only care about KeyPress now
- if (q->activeFocusOnTab() && e->type() == QEvent::KeyPress) {
+ if ((q == q->window()->contentItem() || q->activeFocusOnTab())
+ && e->type() == QEvent::KeyPress) {
bool res = false;
if (!(e->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
if (e->key() == Qt::Key_Backtab
@@ -5539,7 +5615,7 @@ void QQuickItem::setActiveFocusOnTab(bool activeFocusOnTab)
return;
if (window()) {
- if ((this == window()->activeFocusItem()) && !activeFocusOnTab) {
+ if ((this == window()->activeFocusItem()) && this != window()->contentItem() && !activeFocusOnTab) {
qWarning("QQuickItem: Cannot set activeFocusOnTab to false once item is the active focus item.");
return;
}
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index 078df2ea84..84eafec1d7 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -432,6 +432,8 @@ protected:
QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent = 0);
private:
+ Q_PRIVATE_SLOT(d_func(), void _q_resourceObjectDeleted(QObject *))
+
friend class QQuickWindow;
friend class QQuickWindowPrivate;
friend class QSGRenderer;
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 3602b578e2..c71da3c330 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -293,6 +293,8 @@ public:
static QQuickTransform *transform_at(QQmlListProperty<QQuickTransform> *list, int);
static void transform_clear(QQmlListProperty<QQuickTransform> *list);
+ void _q_resourceObjectDeleted(QObject *);
+
enum ChangeType {
Geometry = 0x01,
SiblingOrder = 0x02,
@@ -363,6 +365,8 @@ public:
Qt::MouseButtons acceptedMouseButtons;
QQuickItem::TransformOrigin origin:5;
+
+ QObjectList resourcesList;
};
QLazilyAllocated<ExtraData> extra;
@@ -487,6 +491,9 @@ public:
static bool focusNextPrev(QQuickItem *item, bool forward);
static QQuickItem *nextPrevItemInTabFocusChain(QQuickItem *item, bool forward);
+ static bool qt_tab_all_widgets(); //todo: move to QGuiApplication?
+ static bool canAcceptTabFocus(QQuickItem *item);
+
qreal x;
qreal y;
qreal width;
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index f5bcf3596f..7f80697f3c 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -167,6 +167,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickKeyEvent>();
qmlRegisterType<QQuickMouseEvent>();
qmlRegisterType<QQuickWheelEvent>();
+ qmlRegisterType<QQuickCloseEvent>();
qmlRegisterType<QQuickTransform>();
qmlRegisterType<QQuickPathElement>();
qmlRegisterType<QQuickCurve>();
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index d774091ef5..a6dabee7ba 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -2259,8 +2259,10 @@ void QQuickItemView::destroyingItem(QObject *object)
{
Q_D(QQuickItemView);
QQuickItem* item = qmlobject_cast<QQuickItem*>(object);
- item->setParentItem(0);
- d->unrequestedItems.remove(item);
+ if (item) {
+ item->setParentItem(0);
+ d->unrequestedItems.remove(item);
+ }
}
bool QQuickItemViewPrivate::releaseItem(FxViewItem *item)
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index b99fba4e4c..c5e96a3122 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1659,7 +1659,7 @@ bool QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
A ListView displays data from models created from built-in QML types like ListModel
and XmlListModel, or custom model classes defined in C++ that inherit from
- QAbstractListModel.
+ QAbstractItemModel or QAbstractListModel.
A ListView has a \l model, which defines the data to be displayed, and
a \l delegate, which defines how the data should be displayed. Items in a
@@ -2185,7 +2185,7 @@ void QQuickListView::setOrientation(QQuickListView::Orientation orientation)
each section.
- \snippet quick/views/listview/sections.qml 0
+ \snippet views/listview/sections.qml 0
\image qml-listview-sections-example.png
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp
index 384c1c7ac8..d6b00cee14 100644
--- a/src/quick/items/qquickmultipointtoucharea.cpp
+++ b/src/quick/items/qquickmultipointtoucharea.cpp
@@ -47,6 +47,7 @@
#include <QMouseEvent>
#include <math.h>
#include <QDebug>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
@@ -322,6 +323,7 @@ void QQuickTouchPoint::setSceneY(qreal sceneY)
QQuickMultiPointTouchArea::QQuickMultiPointTouchArea(QQuickItem *parent)
: QQuickItem(parent),
+ _currentWindow(0),
_minimumTouchPoints(0),
_maximumTouchPoints(INT_MAX),
_stealMouse(false)
@@ -331,6 +333,9 @@ QQuickMultiPointTouchArea::QQuickMultiPointTouchArea(QQuickItem *parent)
if (qmlVisualTouchDebugging()) {
setFlag(QQuickItem::ItemHasContents);
}
+#ifdef Q_OS_MAC
+ connect(this, &QQuickItem::windowChanged, this, &QQuickMultiPointTouchArea::setTouchEventsEnabledForWindow);
+#endif
}
QQuickMultiPointTouchArea::~QQuickMultiPointTouchArea()
@@ -542,6 +547,29 @@ void QQuickMultiPointTouchArea::addTouchPoint(const QTouchEvent::TouchPoint *p)
_pressedTouchPoints.append(dtp);
}
+void QQuickMultiPointTouchArea::setTouchEventsEnabledForWindow(QWindow *window)
+{
+#ifdef Q_OS_MAC
+ // Resolve function for enabling touch events from the (cocoa) platform plugin.
+ typedef void (*RegisterTouchWindowFunction)(QWindow *, bool);
+ RegisterTouchWindowFunction registerTouchWindow = reinterpret_cast<RegisterTouchWindowFunction>(
+ QGuiApplication::platformNativeInterface()->nativeResourceFunctionForIntegration("registertouchwindow"));
+ if (!registerTouchWindow)
+ return; // Not necessarily an error, Qt migh be using a different platform plugin.
+
+ // Disable touch on the old window, enable on the new window.
+ if (_currentWindow)
+ registerTouchWindow(_currentWindow, false);
+ if (window)
+ registerTouchWindow(window, true);
+ // Save the current window, setTouchEventsEnabledForWindow will be called
+ // with a null window on disable.
+ _currentWindow = window;
+#else // Q_OS_MAC
+ Q_UNUSED(window)
+#endif
+}
+
void QQuickMultiPointTouchArea::addTouchPrototype(QQuickTouchPoint *prototype)
{
int id = _touchPrototypes.count();
diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h
index e2ae5ed24e..afe7d4b77b 100644
--- a/src/quick/items/qquickmultipointtoucharea_p.h
+++ b/src/quick/items/qquickmultipointtoucharea_p.h
@@ -251,6 +251,9 @@ protected:
void grabGesture();
virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
+protected slots:
+ void setTouchEventsEnabledForWindow(QWindow *window);
+
private:
void ungrab();
QMap<int,QQuickTouchPoint*> _touchPrototypes; //TouchPoints defined in QML
@@ -258,6 +261,7 @@ private:
QList<QObject*> _releasedTouchPoints;
QList<QObject*> _pressedTouchPoints;
QList<QObject*> _movedTouchPoints;
+ QWindow *_currentWindow;
int _minimumTouchPoints;
int _maximumTouchPoints;
bool _stealMouse;
diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp
index 0e47b61319..434eaa8723 100644
--- a/src/quick/items/qquickpincharea.cpp
+++ b/src/quick/items/qquickpincharea.cpp
@@ -45,6 +45,7 @@
#include <QtGui/qevent.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qstylehints.h>
+#include <qpa/qplatformnativeinterface.h>
#include <float.h>
#include <math.h>
@@ -246,11 +247,15 @@ QQuickPinchAreaPrivate::~QQuickPinchAreaPrivate()
QQuickPinchArea::QQuickPinchArea(QQuickItem *parent)
: QQuickItem(*(new QQuickPinchAreaPrivate), parent)
+ , _currentWindow(0)
{
Q_D(QQuickPinchArea);
d->init();
setAcceptedMouseButtons(Qt::LeftButton);
setFiltersChildMouseEvents(true);
+#ifdef Q_OS_MAC
+ connect(this, &QQuickItem::windowChanged, this, &QQuickPinchArea::setTouchEventsEnabledForWindow);
+#endif
}
QQuickPinchArea::~QQuickPinchArea()
@@ -539,6 +544,29 @@ QQuickPinch *QQuickPinchArea::pinch()
return d->pinch;
}
+void QQuickPinchArea::setTouchEventsEnabledForWindow(QWindow *window)
+{
+#ifdef Q_OS_MAC
+ // Resolve function for enabling touch events from the (cocoa) platform plugin.
+ typedef void (*RegisterTouchWindowFunction)(QWindow *, bool);
+ RegisterTouchWindowFunction registerTouchWindow = reinterpret_cast<RegisterTouchWindowFunction>(
+ QGuiApplication::platformNativeInterface()->nativeResourceFunctionForIntegration("registertouchwindow"));
+ if (!registerTouchWindow)
+ return; // Not necessarily an error, Qt migh be using a different platform plugin.
+
+ // Disable touch on the old window, enable on the new window.
+ if (_currentWindow)
+ registerTouchWindow(_currentWindow, false);
+ if (window)
+ registerTouchWindow(window, true);
+ // Save the current window, setTouchEventsEnabledForWindow will be called
+ // with a null window on disable.
+ _currentWindow = window;
+#else // Q_OS_MAC
+ Q_UNUSED(window)
+#endif
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickpincharea_p.h b/src/quick/items/qquickpincharea_p.h
index 4fc77d7f9c..60c2dc742e 100644
--- a/src/quick/items/qquickpincharea_p.h
+++ b/src/quick/items/qquickpincharea_p.h
@@ -283,12 +283,16 @@ protected:
const QRectF &oldGeometry);
virtual void itemChange(ItemChange change, const ItemChangeData& value);
+private slots:
+ void setTouchEventsEnabledForWindow(QWindow *window);
+
private:
void updatePinch();
void handlePress();
void handleRelease();
private:
+ QWindow *_currentWindow;
Q_DISABLE_COPY(QQuickPinchArea)
Q_DECLARE_PRIVATE(QQuickPinchArea)
};
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 66f4b44857..789d2e62aa 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -644,7 +644,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
\image verticalpositioner_transition.gif
- \sa Row, Grid, Flow, Positioner, {qml/positioners}{Positioners example}
+ \sa Row, Grid, Flow, Positioner, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Column::populate
@@ -657,7 +657,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \sa add, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Column::add
@@ -679,7 +679,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
\note This transition is not applied to the items that already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
- \sa populate, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa populate, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Column::move
@@ -704,7 +704,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
positioner at the time of its creation. From \l {Qt Quick}{Qt Quick 2} onwards, positioners apply the
\l populate transition to these items instead.
- \sa add, ViewTransition, {qml/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty real QtQuick2::Column::spacing
@@ -798,7 +798,7 @@ void QQuickColumn::reportConflictingAnchors()
\l{Item Layouts}.
- \sa Column, Grid, Flow, Positioner, {qml/positioners}{Positioners example}
+ \sa Column, Grid, Flow, Positioner, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Row::populate
@@ -811,7 +811,7 @@ void QQuickColumn::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \sa add, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Row::add
@@ -833,7 +833,7 @@ void QQuickColumn::reportConflictingAnchors()
\note This transition is not applied to the items that already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
- \sa populate, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa populate, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Row::move
@@ -858,7 +858,7 @@ void QQuickColumn::reportConflictingAnchors()
positioner at the time of its creation. From \l {Qt Quick}{QtQuick 2} onwards, positioners apply the
\l populate transition to these items instead.
- \sa add, ViewTransition, {qml/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty real QtQuick2::Row::spacing
@@ -887,7 +887,7 @@ QQuickRow::QQuickRow(QQuickItem *parent)
the right anchor remains to the right of the row.
\endlist
- \sa Grid::layoutDirection, Flow::layoutDirection, {qml/righttoleft/layoutdirection}{Layout directions example}
+ \sa Grid::layoutDirection, Flow::layoutDirection, {Qt Quick Examples - Right to Left}
*/
Qt::LayoutDirection QQuickRow::layoutDirection() const
@@ -1031,7 +1031,7 @@ void QQuickRow::reportConflictingAnchors()
\l{Item Layouts}.
- \sa Flow, Row, Column, Positioner, {qml/positioners}{Positioners example}
+ \sa Flow, Row, Column, Positioner, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Grid::populate
@@ -1044,7 +1044,7 @@ void QQuickRow::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \sa add, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Grid::add
@@ -1066,7 +1066,7 @@ void QQuickRow::reportConflictingAnchors()
\note This transition is not applied to the items that already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
- \sa populate, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa populate, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Grid::move
@@ -1091,7 +1091,7 @@ void QQuickRow::reportConflictingAnchors()
positioner at the time of its creation. From \l {Qt Quick}{QtQuick 2} onwards, positioners apply the
\l populate transition to these items instead.
- \sa add, ViewTransition, {qml/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty qreal QtQuick2::Grid::spacing
@@ -1248,7 +1248,7 @@ void QQuickGrid::setColumnSpacing(const qreal columnSpacing)
\l Grid::flow property.
\endlist
- \sa Flow::layoutDirection, Row::layoutDirection, {qml/righttoleft/layoutdirection}{Layout directions example}
+ \sa Flow::layoutDirection, Row::layoutDirection, {Qt Quick Examples - Right to Left}
*/
Qt::LayoutDirection QQuickGrid::layoutDirection() const
{
@@ -1572,7 +1572,7 @@ void QQuickGrid::reportConflictingAnchors()
For more information on using Flow and other related positioner-types, see
\l{Item Layouts}.
- \sa Column, Row, Grid, Positioner, {qml/positioners}{Positioners example}
+ \sa Column, Row, Grid, Positioner, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Flow::populate
@@ -1585,7 +1585,7 @@ void QQuickGrid::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \sa add, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Flow::add
@@ -1607,7 +1607,7 @@ void QQuickGrid::reportConflictingAnchors()
\note This transition is not applied to the items that already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
- \sa populate, ViewTransition, {declarative/positioners}{Positioners example}
+ \sa populate, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty Transition QtQuick2::Flow::move
@@ -1632,7 +1632,7 @@ void QQuickGrid::reportConflictingAnchors()
positioner at the time of its creation. From \l {Qt Quick}{QtQuick 2} onwards, positioners apply the
\l populate transition to these items instead.
- \sa add, ViewTransition, {qml/positioners}{Positioners example}
+ \sa add, ViewTransition, {Qt Quick Examples - Positioners}
*/
/*!
\qmlproperty real QtQuick2::Flow::spacing
@@ -1710,7 +1710,7 @@ void QQuickFlow::setFlow(Flow flow)
\l Flow::flow property.
\endlist
- \sa Grid::layoutDirection, Row::layoutDirection, {qml/righttoleft/layoutdirection}{Layout directions example}
+ \sa Grid::layoutDirection, Row::layoutDirection, {Qt Quick Examples - Right to Left}
*/
Qt::LayoutDirection QQuickFlow::layoutDirection() const
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index 3c3bd8897b..c9f37930e2 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -302,7 +302,7 @@ int QQuickRectanglePrivate::doUpdateSlotIdx = -1;
\clearfloat
\section1 Performance
- Using the \l antialiasing property improves the appearance of a rounded rectangle at
+ Using the \l Item::antialiasing property improves the appearance of a rounded rectangle at
the cost of rendering performance. You should consider unsetting this property
for rectangles in motion, and only set it when they are stationary.
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index 62ce78a644..d92b3b43d8 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -351,11 +351,12 @@ void QQuickRepeater::clear()
if (d->model) {
for (int i = 0; i < d->deletables.count(); ++i) {
- QQuickItem *item = d->deletables.at(i);
- if (complete)
- emit itemRemoved(i, item);
- item->setParentItem(0);
- d->model->release(item);
+ if (QQuickItem *item = d->deletables.at(i)) {
+ if (complete)
+ emit itemRemoved(i, item);
+ item->setParentItem(0);
+ d->model->release(item);
+ }
}
}
d->deletables.clear();
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp
index 91638d448e..80080d8b88 100644
--- a/src/quick/items/qquickscreen.cpp
+++ b/src/quick/items/qquickscreen.cpp
@@ -281,6 +281,8 @@ void QQuickScreenAttached::screenChanged(QScreen *screen)
emit widthChanged();
emit heightChanged();
}
+ if (!oldScreen || screen->name() != oldScreen->name())
+ emit nameChanged();
if (!oldScreen || screen->orientation() != oldScreen->orientation())
emit orientationChanged();
if (!oldScreen || screen->primaryOrientation() != oldScreen->primaryOrientation())
diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h
index 7ce035a93d..b35fd04e58 100644
--- a/src/quick/items/qquickscreen_p.h
+++ b/src/quick/items/qquickscreen_p.h
@@ -58,7 +58,7 @@ class Q_AUTOTEST_EXPORT QQuickScreenAttached : public QObject
{
Q_OBJECT
- Q_PROPERTY(QString name READ name CONSTANT REVISION 1);
+ Q_PROPERTY(QString name READ name NOTIFY nameChanged REVISION 1);
Q_PROPERTY(int width READ width NOTIFY widthChanged)
Q_PROPERTY(int height READ height NOTIFY heightChanged)
Q_PROPERTY(int desktopAvailableWidth READ desktopAvailableWidth NOTIFY desktopGeometryChanged REVISION 1)
@@ -85,6 +85,7 @@ public:
void windowChanged(QQuickWindow*);
Q_SIGNALS:
+ Q_REVISION(1) void nameChanged();
void widthChanged();
void heightChanged();
Q_REVISION(1) void desktopGeometryChanged();
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 5fe0b528fa..cf9cb4224f 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -1989,6 +1989,7 @@ void QQuickText::setTextFormat(TextFormat format)
d->rightToLeftText = d->extra->doc->toPlainText().isRightToLeft();
} else {
d->rightToLeftText = d->text.isRightToLeft();
+ d->textHasChanged = true;
}
d->determineHorizontalAlignment();
}
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 9625aa5d5e..e22c84879b 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -298,6 +298,8 @@ void QQuickTextControlPrivate::setContent(Qt::TextFormat format, const QString &
bool previousUndoRedoState = doc->isUndoRedoEnabled();
doc->setUndoRedoEnabled(false);
+ const int oldCursorPos = cursor.position();
+
// avoid multiple textChanged() signals being emitted
qmlobject_disconnect(doc, QTextDocument, SIGNAL(contentsChanged()), q, QQuickTextControl, SIGNAL(textChanged()));
@@ -341,7 +343,8 @@ void QQuickTextControlPrivate::setContent(Qt::TextFormat format, const QString &
doc->setModified(false);
q->updateCursorRectangle(true);
- emit q->cursorPositionChanged();
+ if (cursor.position() != oldCursorPos)
+ emit q->cursorPositionChanged();
}
void QQuickTextControlPrivate::setCursorPosition(const QPointF &pos)
@@ -698,6 +701,9 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
case QEvent::KeyPress:
d->keyPressEvent(static_cast<QKeyEvent *>(e));
break;
+ case QEvent::KeyRelease:
+ d->keyReleaseEvent(static_cast<QKeyEvent *>(e));
+ break;
case QEvent::MouseButtonPress: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
d->mousePressEvent(ev, matrix.map(ev->localPos()));
@@ -809,9 +815,25 @@ void QQuickTextControl::setHtml(const QString &text)
d->setContent(Qt::RichText, text);
}
+
+void QQuickTextControlPrivate::keyReleaseEvent(QKeyEvent *e)
+{
+ if (e->key() == Qt::Key_Back) {
+ e->ignore();
+ return;
+ }
+ return;
+}
+
void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
{
Q_Q(QQuickTextControl);
+
+ if (e->key() == Qt::Key_Back) {
+ e->ignore();
+ return;
+ }
+
#ifndef QT_NO_SHORTCUT
if (e == QKeySequence::SelectAll) {
e->accept();
diff --git a/src/quick/items/qquicktextcontrol_p_p.h b/src/quick/items/qquicktextcontrol_p_p.h
index fbb88bd255..da76de8ffe 100644
--- a/src/quick/items/qquicktextcontrol_p_p.h
+++ b/src/quick/items/qquicktextcontrol_p_p.h
@@ -108,6 +108,7 @@ public:
QRectF rectForPosition(int position) const;
void keyPressEvent(QKeyEvent *e);
+ void keyReleaseEvent(QKeyEvent *e);
void mousePressEvent(QMouseEvent *event, const QPointF &pos);
void mouseMoveEvent(QMouseEvent *event, const QPointF &pos);
void mouseReleaseEvent(QMouseEvent *event, const QPointF &pos);
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index f4934e2400..327b0867e6 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -55,6 +55,7 @@
#include <QtGui/qevent.h>
#include <QtGui/qpainter.h>
#include <QtGui/qtextobject.h>
+#include <QtGui/qtexttable.h>
#include <QtCore/qmath.h>
#include <QtCore/qalgorithms.h>
@@ -1710,6 +1711,13 @@ static bool comesBefore(TextNode* n1, TextNode* n2)
return n1->startPos() < n2->startPos();
}
+static inline void updateNodeTransform(QQuickTextNode* node, const QPointF &topLeft)
+{
+ QMatrix4x4 transformMatrix;
+ transformMatrix.translate(topLeft.x(), topLeft.y());
+ node->setMatrix(transformMatrix);
+}
+
QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)
{
Q_UNUSED(updatePaintNodeData);
@@ -1750,17 +1758,12 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
rootNode->removeChildNode(d->frameDecorationsNode);
delete d->frameDecorationsNode;
}
- d->frameDecorationsNode = new QQuickTextNode(QQuickItemPrivate::get(this)->sceneGraphContext(), this);
- d->frameDecorationsNode->initEngine(QColor(), QColor(), QColor());
+ d->frameDecorationsNode = d->createTextNode();
+ QQuickTextNode *node = 0;
- QQuickTextNode *node = new QQuickTextNode(QQuickItemPrivate::get(this)->sceneGraphContext(), this);
- node->setUseNativeRenderer(d->renderType == NativeRendering && d->window->devicePixelRatio() <= 1);
- node->initEngine(d->color, d->selectedTextColor, d->selectionColor);
-
-
- int sizeCounter = 0;
- int prevBlockStart = firstDirtyPos;
+ int currentNodeSize = 0;
+ int nodeStart = firstDirtyPos;
QPointF basePosition(d->xoff, d->yoff);
QPointF nodeOffset;
TextNode *firstCleanNode = (nodeIterator != d->textNodeMap.end()) ? *nodeIterator : 0;
@@ -1773,16 +1776,14 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
frames.append(textFrame->childFrames());
d->frameDecorationsNode->m_engine->addFrameDecorations(d->document, textFrame);
+
+ if (textFrame->lastPosition() < firstDirtyPos || (firstCleanNode && textFrame->firstPosition() >= firstCleanNode->startPos()))
+ continue;
+ node = d->createTextNode();
+
if (textFrame->firstPosition() > textFrame->lastPosition()
&& textFrame->frameFormat().position() != QTextFrameFormat::InFlow) {
- QRectF rect = d->document->documentLayout()->frameBoundingRect(textFrame);
-
- if (!node->m_engine->hasContents()) {
- nodeOffset = rect.topLeft();
- QMatrix4x4 transformMatrix;
- transformMatrix.translate(nodeOffset.x(), nodeOffset.y());
- node->setMatrix(transformMatrix);
- }
+ updateNodeTransform(node, d->document->documentLayout()->frameBoundingRect(textFrame).topLeft());
const int pos = textFrame->firstPosition() - 1;
ProtectedLayoutAccessor *a = static_cast<ProtectedLayoutAccessor *>(d->document->documentLayout());
QTextCharFormat format = a->formatAccessor(pos);
@@ -1790,10 +1791,23 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
node->m_engine->setCurrentLine(block.layout()->lineForTextPosition(pos - block.position()));
node->m_engine->addTextObject(QPointF(0, 0), format, QQuickTextNodeEngine::Unselected, d->document,
pos, textFrame->frameFormat().position());
+ nodeStart = pos;
+ } else if (qobject_cast<QTextTable*>(textFrame)) { // To keep things simple, map text tables as one text node
+ QTextFrame::iterator it = textFrame->begin();
+ nodeOffset = d->document->documentLayout()->frameBoundingRect(textFrame).topLeft();
+ updateNodeTransform(node, nodeOffset);
+ while (!it.atEnd())
+ node->m_engine->addTextBlock(d->document, (it++).currentBlock(), basePosition - nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
+ nodeStart = textFrame->firstPosition();
} else {
+ // Having nodes spanning across frame boundaries will break the current bookkeeping mechanism. We need to prevent that.
+ QList<int> frameBoundaries;
+ frameBoundaries.reserve(frames.size());
+ Q_FOREACH (QTextFrame *frame, frames)
+ frameBoundaries.append(frame->firstPosition());
+ std::sort(frameBoundaries.begin(), frameBoundaries.end());
QTextFrame::iterator it = textFrame->begin();
-
while (!it.atEnd()) {
QTextBlock block = it.currentBlock();
++it;
@@ -1802,34 +1816,27 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
if (!node->m_engine->hasContents()) {
nodeOffset = d->document->documentLayout()->blockBoundingRect(block).topLeft();
- QMatrix4x4 transformMatrix;
- transformMatrix.translate(nodeOffset.x(), nodeOffset.y());
- node->setMatrix(transformMatrix);
+ updateNodeTransform(node, nodeOffset);
+ nodeStart = block.position();
}
+
node->m_engine->addTextBlock(d->document, block, basePosition - nodeOffset, d->color, QColor(), selectionStart(), selectionEnd() - 1);
- sizeCounter += block.length();
+ currentNodeSize += block.length();
- if ((it.atEnd() && frames.isEmpty()) || (firstCleanNode && block.next().position() >= firstCleanNode->startPos())) // last node that needed replacing or last block of the last frame
+ if ((it.atEnd()) || (firstCleanNode && block.next().position() >= firstCleanNode->startPos())) // last node that needed replacing or last block of the frame
break;
- if (sizeCounter > nodeBreakingSize || it.atEnd()) { // text block grouping across text frames might not be a good idea, split it.
- sizeCounter = 0;
- node->m_engine->addToSceneGraph(node, QQuickText::Normal, QColor());
- nodeIterator = d->textNodeMap.insert(nodeIterator, new TextNode(prevBlockStart, node));
- ++nodeIterator;
- rootNode->appendChildNode(node);
- prevBlockStart = block.next().position();
- node = new QQuickTextNode(QQuickItemPrivate::get(this)->sceneGraphContext(), this);
- node->setUseNativeRenderer(d->renderType == NativeRendering && d->window->devicePixelRatio() <= 1);
- node->initEngine(d->color, d->selectedTextColor, d->selectionColor);
+ QList<int>::const_iterator lowerBound = qLowerBound(frameBoundaries, block.next().position());
+ if (currentNodeSize > nodeBreakingSize || *lowerBound > nodeStart) {
+ currentNodeSize = 0;
+ d->addCurrentTextNodeToRoot(rootNode, node, nodeIterator, nodeStart);
+ node = d->createTextNode();
+ nodeStart = block.next().position();
}
}
}
+ d->addCurrentTextNodeToRoot(rootNode, node, nodeIterator, nodeStart);
}
- node->m_engine->addToSceneGraph(node, QQuickText::Normal, QColor());
- nodeIterator = d->textNodeMap.insert(nodeIterator, new TextNode(prevBlockStart, node));
- ++nodeIterator;
- rootNode->appendChildNode(node);
d->frameDecorationsNode->m_engine->addToSceneGraph(d->frameDecorationsNode, QQuickText::Normal, QColor());
// Now prepend the frame decorations since we want them rendered first, with the text nodes and cursor in front.
rootNode->prependChildNode(d->frameDecorationsNode);
@@ -1998,11 +2005,16 @@ void QQuickTextEdit::markDirtyNodesForRange(int start, int end, int charDelta)
Q_D(QQuickTextEdit);
if (start == end)
return;
+
TextNode dummyNode(start, 0);
TextNodeIterator it = qLowerBound(d->textNodeMap.begin(), d->textNodeMap.end(), &dummyNode, &comesBefore);
- // qLowerBound gives us the first node past the start of the affected portion, rewind by one if we can.
- if (it != d->textNodeMap.begin())
+ // qLowerBound gives us the first node past the start of the affected portion, rewind to the first node
+ // that starts at the last position before the edit position. (there might be several because of images)
+ if (it != d->textNodeMap.begin()) {
--it;
+ TextNode otherDummy((*it)->startPos(), 0);
+ it = qLowerBound(d->textNodeMap.begin(), d->textNodeMap.end(), &otherDummy, &comesBefore);
+ }
// mark the affected nodes as dirty
while (it != d->textNodeMap.constEnd()) {
@@ -2152,8 +2164,10 @@ void QQuickTextEdit::updateSize()
if (d->inLayout) // probably the result of a binding loop, but by letting it
return; // get this far we'll get a warning to that effect.
}
- if (d->document->textWidth() != width())
+ if (d->document->textWidth() != width()) {
d->document->setTextWidth(width());
+ newWidth = d->document->idealWidth();
+ }
//### need to confirm cost of always setting these
} else if (d->wrapMode == NoWrap && d->document->textWidth() != newWidth) {
d->document->setTextWidth(newWidth); // ### Text does not align if width is not set or the idealWidth exceeds the textWidth (QTextDoc bug)
@@ -2309,6 +2323,23 @@ void QQuickTextEditPrivate::handleFocusEvent(QFocusEvent *event)
}
}
+void QQuickTextEditPrivate::addCurrentTextNodeToRoot(QSGTransformNode *root, QQuickTextNode *node, TextNodeIterator &it, int startPos)
+{
+ node->m_engine->addToSceneGraph(node, QQuickText::Normal, QColor());
+ it = textNodeMap.insert(it, new TextNode(startPos, node));
+ ++it;
+ root->appendChildNode(node);
+}
+
+QQuickTextNode *QQuickTextEditPrivate::createTextNode()
+{
+ Q_Q(QQuickTextEdit);
+ QQuickTextNode* node = new QQuickTextNode(QQuickItemPrivate::get(q)->sceneGraphContext(), q);
+ node->setUseNativeRenderer(renderType == QQuickTextEdit::NativeRendering && window->devicePixelRatio() <= 1);
+ node->initEngine(color, selectedTextColor, selectionColor);
+ return node;
+}
+
void QQuickTextEdit::q_canPasteChanged()
{
Q_D(QQuickTextEdit);
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h
index feb7e98873..4f0ab939f6 100644
--- a/src/quick/items/qquicktextedit_p_p.h
+++ b/src/quick/items/qquicktextedit_p_p.h
@@ -87,6 +87,7 @@ public:
QQuickTextNode* m_node;
bool m_dirty;
};
+ typedef QList<Node*>::iterator TextNodeIterator;
QQuickTextEditPrivate()
@@ -126,6 +127,8 @@ public:
void setNativeCursorEnabled(bool enabled) { control->setCursorWidth(enabled ? 1 : 0); }
void handleFocusEvent(QFocusEvent *event);
+ void addCurrentTextNodeToRoot(QSGTransformNode *, QQuickTextNode*, TextNodeIterator&, int startPos);
+ QQuickTextNode* createTextNode();
#ifndef QT_NO_IM
Qt::InputMethodHints effectiveInputMethodHints() const;
diff --git a/src/quick/items/qquicktextnode_p.h b/src/quick/items/qquicktextnode_p.h
index 2031669639..f5de6cc9b6 100644
--- a/src/quick/items/qquicktextnode_p.h
+++ b/src/quick/items/qquicktextnode_p.h
@@ -118,6 +118,7 @@ private:
QScopedPointer<QQuickTextNodeEngine> m_engine;
friend class QQuickTextEdit;
+ friend class QQuickTextEditPrivate;
};
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index a4dff969f4..4a34adabe8 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -411,7 +411,7 @@ static QMouseEvent *touchToMouseEvent(QEvent::Type type, const QTouchEvent::Touc
{
// The touch point local position and velocity are not yet transformed.
QMouseEvent *me = new QMouseEvent(type, transformNeeded ? item->mapFromScene(p.scenePos()) : p.pos(), p.scenePos(), p.screenPos(),
- Qt::LeftButton, Qt::LeftButton, event->modifiers());
+ Qt::LeftButton, (type == QEvent::MouseButtonRelease ? Qt::NoButton : Qt::LeftButton), event->modifiers());
me->setAccepted(true);
me->setTimestamp(event->timestamp());
QVector2D transformedVelocity = p.velocity();
@@ -840,6 +840,11 @@ void QQuickWindowPrivate::cleanup(QSGNode *n)
Alternatively you can set or bind \l x and \l y to position the Window
explicitly on the screen.
+
+ When the user attempts to close a window, the \a closing signal will be
+ emitted. You can force the window to stay open (for example to prompt the
+ user to save changes) by writing an onClosing handler and setting
+ close.accepted = false.
*/
/*!
\class QQuickWindow
@@ -1174,6 +1179,14 @@ bool QQuickWindow::event(QEvent *e)
case QEvent::WindowDeactivate:
contentItem()->windowDeactivateEvent();
break;
+ case QEvent::Close: {
+ // TOOD Qt 6 (binary incompatible)
+ // closeEvent(static_cast<QCloseEvent *>(e));
+ QQuickCloseEvent qev;
+ qev.setAccepted(e->isAccepted());
+ emit closing(&qev);
+ e->setAccepted(qev.isAccepted());
+ } break;
case QEvent::FocusAboutToChange:
#ifndef QT_NO_IM
if (d->activeFocusItem)
@@ -2558,6 +2571,57 @@ QOpenGLContext *QQuickWindow::openglContext() const
This signal will be emitted from the scene graph rendering thread.
*/
+/*!
+ \class QQuickCloseEvent
+ \internal
+ \since QtQuick 2.1
+
+ \inmodule QtQuick.Window
+
+ \brief Notification that a \l QQuickWindow is about to be closed
+*/
+/*!
+ \qmltype CloseEvent
+ \instantiates QQuickCloseEvent
+ \inqmlmodule QtQuick.Window 2
+ \ingroup qtquick-visual
+ \brief Notification that a \l Window is about to be closed
+ \since Qt 5.1
+
+ Notification that a window is about to be closed by the windowing system
+ (e.g. the user clicked the titlebar close button). The CloseEvent contains
+ an accepted property which can be set to false to abort closing the window.
+
+ \sa Window.closing()
+*/
+
+/*!
+ \qmlproperty bool QtQuick.Window2::CloseEvent::accepted
+
+ This property indicates whether the application will allow the user to
+ close the window. It is true by default.
+*/
+
+/*!
+ \fn void QQuickWindow::closing()
+ \since QtQuick 2.1
+
+ This signal is emitted when the window receives a QCloseEvent from the
+ windowing system.
+*/
+
+/*!
+ \qmlsignal QtQuick.Window2::closing(CloseEvent close)
+ \since Qt 5.1
+
+ This signal is emitted when the user tries to close the window.
+
+ This signal includes a closeEvent parameter. The \a close \l accepted
+ property is true by default so that the window is allowed to close; but you
+ can implement an onClosing() handler and set close.accepted = false if
+ you need to do something else before the window can be closed.
+ */
+
/*!
Sets the render target for this window to be \a fbo.
@@ -3082,6 +3146,22 @@ QColor QQuickWindow::color() const
no item with active focus.
*/
+/*!
+ \qmlproperty QtQuick.Window2::Window::active
+ \since Qt 5.1
+
+ The active status of the window.
+
+ \sa requestActivate()
+ */
+
+/*!
+ \qmlmethod QtQuick2::Window::requestActivate()
+ \since QtQuick 2.1
+
+ Requests the window to be activated, i.e. receive keyboard focus.
+ */
+
#include "moc_qquickwindow.cpp"
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index 3adc0be83b..fc148aabe6 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -57,6 +57,7 @@ class QQuickWindowPrivate;
class QOpenGLFramebufferObject;
class QQmlIncubationController;
class QInputMethodEvent;
+class QQuickCloseEvent;
class Q_QUICK_EXPORT QQuickWindow : public QWindow
{
@@ -129,6 +130,7 @@ Q_SIGNALS:
void beforeSynchronizing();
void beforeRendering();
void afterRendering();
+ Q_REVISION(1) void closing(QQuickCloseEvent *close);
void colorChanged(const QColor &);
Q_REVISION(1) void activeFocusItemChanged();
@@ -144,6 +146,7 @@ protected:
virtual void showEvent(QShowEvent *);
virtual void hideEvent(QHideEvent *);
+ // TODO Qt 6: reimplement QWindow::closeEvent to emit closing
virtual void focusInEvent(QFocusEvent *);
virtual void focusOutEvent(QFocusEvent *);
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index afcf4a995a..9e3251b240 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -231,9 +231,26 @@ private:
static void cleanupNodesOnShutdown(QQuickItem *);
};
+class Q_QUICK_PRIVATE_EXPORT QQuickCloseEvent : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
+
+public:
+ QQuickCloseEvent()
+ : _accepted(true) {}
+
+ bool isAccepted() { return _accepted; }
+ void setAccepted(bool accepted) { _accepted = accepted; }
+
+private:
+ bool _accepted;
+};
Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickWindowPrivate::FocusOptions)
QT_END_NAMESPACE
+QML_DECLARE_TYPE(QQuickCloseEvent)
+
#endif // QQUICKWINDOW_P_H
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index eedc71de92..6a2054af3f 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -14,8 +14,15 @@ exists("qqml_enable_gcov") {
QMAKE_DOCS = $$PWD/doc/qtquick.qdocconf
+ANDROID_LIB_DEPENDENCIES = \
+ lib/libQt5QuickParticles.so
ANDROID_LIB_DEPENDENCY_REPLACEMENTS = \
"plugins/platforms/android/libqtforandroid.so:plugins/platforms/android/libqtforandroidGL.so"
+MODULE_PLUGIN_TYPES = \
+ accessible
+ANDROID_BUNDLED_FILES += \
+ qml \
+ lib/libQt5QuickParticles.so
load(qt_module)
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp
index 818b9b26aa..7f09af4da3 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.cpp
+++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp
@@ -332,42 +332,42 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
/*!
\fn const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D() const
- Convenience function to access the vertex data as an immuatble
+ Convenience function to access the vertex data as an immutable
array of QSGGeometry::ColoredPoint2D.
*/
/*!
\fn QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D()
- Convenience function to access the vertex data as a muatble
+ Convenience function to access the vertex data as a mutable
array of QSGGeometry::ColoredPoint2D.
*/
/*!
\fn const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D() const
- Convenience function to access the vertex data as an immuatble
+ Convenience function to access the vertex data as an immutable
array of QSGGeometry::TexturedPoint2D.
*/
/*!
\fn QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D()
- Convenience function to access the vertex data as a muatble
+ Convenience function to access the vertex data as a mutable
array of QSGGeometry::TexturedPoint2D.
*/
/*!
\fn const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const
- Convenience function to access the vertex data as an immuatble
+ Convenience function to access the vertex data as an immutable
array of QSGGeometry::Point2D.
*/
/*!
\fn QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D()
- Convenience function to access the vertex data as a muatble
+ Convenience function to access the vertex data as a mutable
array of QSGGeometry::Point2D.
*/
@@ -705,7 +705,8 @@ void QSGGeometry::updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect,
The default is AlwaysUploadPattern. When set to anything other than
the default, the user must call markIndexDataDirty() after changing
- the index data.
+ the index data, in addition to calling QSGNode::markDirty() with
+ QSGNode::DirtyGeometry.
*/
void QSGGeometry::setIndexDataPattern(DataPattern p)
@@ -728,7 +729,8 @@ void QSGGeometry::setIndexDataPattern(DataPattern p)
The default is AlwaysUploadPattern. When set to anything other than
the default, the user must call markVertexDataDirty() after changing
- the vertex data.
+ the vertex data, in addition to calling QSGNode::markDirty() with
+ QSGNode::DirtyGeometry.
*/
void QSGGeometry::setVertexDataPattern(DataPattern p)
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
index c0794d0d69..9346236db9 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
@@ -556,6 +556,7 @@ static void qt_print_material_count()
QSGMaterial::QSGMaterial()
: m_flags(0)
+ , m_reserved(0)
{
#ifndef QT_NO_DEBUG
if (qsg_leak_check) {
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h
index ee8889deac..20ab21ad28 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.h
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.h
@@ -133,6 +133,7 @@ public:
void setFlag(Flags flags, bool on = true);
private:
+ friend class QSGContext;
Flags m_flags;
void *m_reserved;
Q_DISABLE_COPY(QSGMaterial)
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp
index 8bf9ae8e76..25f8f342c9 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.cpp
+++ b/src/quick/scenegraph/coreapi/qsgnode.cpp
@@ -129,12 +129,12 @@ static void qt_print_node_count()
before rendering starts.
\value OwnsGeometry Only valid for QSGGeometryNode and QSGClipNode.
The node has ownership over the QSGGeometry instance and will
- delete it when the node is destroyed.
+ delete it when the node is destroyed or a geometry is assigned.
\value OwnsMaterial Only valid for QSGGeometryNode. The node has ownership
- over the material and will delete it when the node is destroyed.
+ over the material and will delete it when the node is destroyed or a material is assigned.
\value OwnsOpaqueMaterial Only valid for QSGGeometryNode. The node has
ownership over the opaque material and will delete it when the node is
- destroyed.
+ destroyed or a material is assigned.
*/
/*!
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index b46d45be57..805cfaad0d 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -53,6 +53,8 @@
#include <qdatetime.h>
+#include <private/qqmlprofilerservice_p.h>
+
QT_BEGIN_NAMESPACE
//#define RENDERER_DEBUG
@@ -62,9 +64,9 @@ QT_BEGIN_NAMESPACE
#ifndef QSG_NO_RENDER_TIMING
static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
-static QTime frameTimer;
-static int preprocessTime;
-static int updatePassTime;
+static QElapsedTimer frameTimer;
+static qint64 preprocessTime;
+static qint64 updatePassTime;
#endif
void QSGBindable::clear(QSGRenderer::ClearMode mode) const
@@ -238,10 +240,11 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
+ bool profileFrames = qsg_render_timing || QQmlProfilerService::enabled;
+ if (profileFrames)
frameTimer.start();
- int bindTime = 0;
- int renderTime = 0;
+ qint64 bindTime = 0;
+ qint64 renderTime = 0;
#endif
m_bindable = &bindable;
@@ -249,8 +252,8 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
bindable.bind();
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- bindTime = frameTimer.elapsed();
+ if (profileFrames)
+ bindTime = frameTimer.nsecsElapsed();
#endif
#ifndef QT_NO_DEBUG
@@ -270,8 +273,8 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
render();
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- renderTime = frameTimer.elapsed();
+ if (profileFrames)
+ renderTime = frameTimer.nsecsElapsed();
#endif
glDisable(GL_SCISSOR_TEST);
@@ -292,12 +295,22 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - Breakdown of render time: preprocess=%d, updates=%d, binding=%d, render=%d, total=%d\n",
- preprocessTime,
- updatePassTime - preprocessTime,
- bindTime - updatePassTime,
- renderTime - bindTime,
- renderTime);
+ int(preprocessTime / 1000000),
+ int((updatePassTime - preprocessTime) / 1000000),
+ int((bindTime - updatePassTime) / 1000000),
+ int((renderTime - bindTime) / 1000000),
+ int(renderTime / 1000000));
+ }
+
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRendererFrame,
+ preprocessTime,
+ updatePassTime - preprocessTime,
+ bindTime - updatePassTime,
+ renderTime - bindTime);
}
+
#endif
}
@@ -380,16 +393,17 @@ void QSGRenderer::preprocess()
}
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- preprocessTime = frameTimer.elapsed();
+ bool profileFrames = qsg_render_timing || QQmlProfilerService::enabled;
+ if (profileFrames)
+ preprocessTime = frameTimer.nsecsElapsed();
#endif
nodeUpdater()->setToplevelOpacity(context()->renderAlpha());
nodeUpdater()->updateStates(m_root_node);
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- updatePassTime = frameTimer.elapsed();
+ if (profileFrames)
+ updatePassTime = frameTimer.nsecsElapsed();
#endif
}
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index 1d534e3563..3536975e94 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -48,6 +48,7 @@
#include <QtGui/qguiapplication.h>
#include <qdir.h>
+#include <private/qqmlprofilerservice_p.h>
#include <QElapsedTimer>
QT_BEGIN_NAMESPACE
@@ -162,7 +163,8 @@ void QSGDistanceFieldGlyphCache::update()
return;
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
+ bool profileFrames = qsg_render_timing || QQmlProfilerService::enabled;
+ if (profileFrames)
qsg_render_timer.start();
#endif
@@ -176,10 +178,10 @@ void QSGDistanceFieldGlyphCache::update()
}
#ifndef QSG_NO_RENDER_TIMING
- int renderTime = 0;
+ qint64 renderTime = 0;
int count = m_pendingGlyphs.size();
- if (qsg_render_timing)
- renderTime = qsg_render_timer.elapsed();
+ if (profileFrames)
+ renderTime = qsg_render_timer.nsecsElapsed();
#endif
m_pendingGlyphs.reset();
@@ -190,11 +192,18 @@ void QSGDistanceFieldGlyphCache::update()
if (qsg_render_timing) {
printf(" - glyphs: count=%d, render=%d, store=%d, total=%d\n",
count,
- renderTime,
- (int) qsg_render_timer.elapsed() - renderTime,
+ int(renderTime/1000000),
+ (int) qsg_render_timer.elapsed() - int(renderTime/1000000),
(int) qsg_render_timer.elapsed());
}
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphAdaptationLayerFrame,
+ count,
+ renderTime,
+ qsg_render_timer.nsecsElapsed() - renderTime);
+ }
#endif
}
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 5d894e5236..d3710c7bd5 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -67,6 +67,8 @@
#include <private/qobject_p.h>
#include <qmutex.h>
+#include <private/qqmlprofilerservice_p.h>
+
DEFINE_BOOL_CONFIG_OPTION(qmlFlashMode, QML_FLASH_MODE)
DEFINE_BOOL_CONFIG_OPTION(qmlTranslucentMode, QML_TRANSLUCENT_MODE)
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
@@ -476,17 +478,24 @@ QSGDepthStencilBufferManager *QSGContext::depthStencilBufferManager()
QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
{
Q_D(QSGContext);
+
+ if (material->m_reserved)
+ return reinterpret_cast<QSGMaterialShader *>(material->m_reserved);
+
QSGMaterialType *type = material->type();
QSGMaterialShader *shader = d->materials.value(type);
- if (shader)
+ if (shader) {
+ material->m_reserved = shader;
return shader;
+ }
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
+ if (qsg_render_timing || QQmlProfilerService::enabled)
qsg_renderer_timer.start();
#endif
shader = material->createShader();
+ material->m_reserved = shader;
shader->compile();
shader->initialize();
d->materials[type] = shader;
@@ -494,6 +503,12 @@ QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
printf(" - compiling material: %dms\n", (int) qsg_renderer_timer.elapsed());
+
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphContextFrame,
+ qsg_renderer_timer.nsecsElapsed());
+ }
#endif
return shader;
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index 3df11532e4..f5a461f19e 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -521,7 +521,7 @@ int QSGTextMaskMaterial::compare(const QSGMaterial *o) const
Q_ASSERT(o && type() == o->type());
const QSGTextMaskMaterial *other = static_cast<const QSGTextMaskMaterial *>(o);
if (m_glyphCache != other->m_glyphCache)
- return m_glyphCache - other->m_glyphCache;
+ return m_glyphCache.data() < other->m_glyphCache.data() ? -1 : 1;
QRgb c1 = m_color.rgba();
QRgb c2 = other->m_color.rgba();
return int(c2 < c1) - int(c1 < c2);
diff --git a/src/quick/scenegraph/qsgdefaultimagenode_p.h b/src/quick/scenegraph/qsgdefaultimagenode_p.h
index 7d299faee3..d7be5f7c14 100644
--- a/src/quick/scenegraph/qsgdefaultimagenode_p.h
+++ b/src/quick/scenegraph/qsgdefaultimagenode_p.h
@@ -60,7 +60,7 @@ protected:
virtual QSGMaterialShader *createShader() const;
};
-class QSGDefaultImageNode : public QSGImageNode
+class Q_QUICK_PRIVATE_EXPORT QSGDefaultImageNode : public QSGImageNode
{
public:
QSGDefaultImageNode();
diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h
index 24bdbb3d34..9ca8a96de5 100644
--- a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h
+++ b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h
@@ -63,7 +63,7 @@ protected:
virtual QSGMaterialShader *createShader() const;
};
-class QSGDefaultRectangleNode : public QSGRectangleNode
+class Q_QUICK_PRIVATE_EXPORT QSGDefaultRectangleNode : public QSGRectangleNode
{
public:
QSGDefaultRectangleNode();
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
index 86c3356d58..bdbce6165b 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
@@ -144,8 +144,7 @@ void QSGDistanceFieldTextMaterialShader::updateState(const RenderState &state, Q
if (oldMaterial == 0
|| material->color() != oldMaterial->color()
|| state.isOpacityDirty()) {
- QColor c = material->color();
- QVector4D color(c.redF(), c.greenF(), c.blueF(), c.alphaF());
+ QVector4D color = material->color();
color *= state.opacity();
program()->setUniformValue(m_color_id, color);
}
@@ -206,10 +205,10 @@ QSGMaterialType *QSGDistanceFieldTextMaterial::type() const
void QSGDistanceFieldTextMaterial::setColor(const QColor &color)
{
- m_color = QColor::fromRgbF(color.redF() * color.alphaF(),
- color.greenF() * color.alphaF(),
- color.blueF() * color.alphaF(),
- color.alphaF());
+ m_color = QVector4D(color.redF() * color.alphaF(),
+ color.greenF() * color.alphaF(),
+ color.blueF() * color.alphaF(),
+ color.alphaF());
}
QSGMaterialShader *QSGDistanceFieldTextMaterial::createShader() const
@@ -239,10 +238,8 @@ int QSGDistanceFieldTextMaterial::compare(const QSGMaterial *o) const
if (m_fontScale != other->m_fontScale) {
return int(other->m_fontScale < m_fontScale) - int(m_fontScale < other->m_fontScale);
}
- QRgb c1 = m_color.rgba();
- QRgb c2 = other->m_color.rgba();
- if (c1 != c2)
- return int(c2 < c1) - int(c1 < c2);
+ if (m_color != other->m_color)
+ return &m_color < &other->m_color ? -1 : 1;
int t0 = m_texture ? m_texture->textureId : -1;
int t1 = other->m_texture ? other->m_texture->textureId : -1;
return t0 - t1;
@@ -284,8 +281,7 @@ void DistanceFieldStyledTextMaterialShader::updateState(const RenderState &state
if (oldMaterial == 0
|| material->styleColor() != oldMaterial->styleColor()
|| (state.isOpacityDirty())) {
- QColor c = material->styleColor();
- QVector4D color(c.redF(), c.greenF(), c.blueF(), c.alphaF());
+ QVector4D color = material->styleColor();
color *= state.opacity();
program()->setUniformValue(m_styleColor_id, color);
}
@@ -302,21 +298,18 @@ QSGDistanceFieldStyledTextMaterial::~QSGDistanceFieldStyledTextMaterial()
void QSGDistanceFieldStyledTextMaterial::setStyleColor(const QColor &color)
{
- m_styleColor = QColor::fromRgbF(color.redF() * color.alphaF(),
- color.greenF() * color.alphaF(),
- color.blueF() * color.alphaF(),
- color.alphaF());
+ m_styleColor = QVector4D(color.redF() * color.alphaF(),
+ color.greenF() * color.alphaF(),
+ color.blueF() * color.alphaF(),
+ color.alphaF());
}
int QSGDistanceFieldStyledTextMaterial::compare(const QSGMaterial *o) const
{
Q_ASSERT(o && type() == o->type());
const QSGDistanceFieldStyledTextMaterial *other = static_cast<const QSGDistanceFieldStyledTextMaterial *>(o);
- if (m_styleColor != other->m_styleColor) {
- QRgb c1 = m_styleColor.rgba();
- QRgb c2 = other->m_styleColor.rgba();
- return int(c2 < c1) - int(c1 < c2);
- }
+ if (m_styleColor != other->m_color)
+ return &m_styleColor < &other->m_styleColor ? -1 : 1;
return QSGDistanceFieldTextMaterial::compare(o);
}
@@ -657,8 +650,8 @@ void QSGHiQSubPixelDistanceFieldTextMaterialShader::updateState(const RenderStat
QSGDistanceFieldTextMaterial *oldMaterial = static_cast<QSGDistanceFieldTextMaterial *>(oldEffect);
if (oldMaterial == 0 || material->color() != oldMaterial->color()) {
- QColor c = material->color();
- state.context()->functions()->glBlendColor(c.redF(), c.greenF(), c.blueF(), 1.0f);
+ QVector4D c = material->color();
+ state.context()->functions()->glBlendColor(c.x(), c.y(), c.z(), 1.0f);
}
if (oldMaterial == 0 || material->fontScale() != oldMaterial->fontScale())
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h
index 7fea8f65dc..54d4146ddb 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h
@@ -59,7 +59,7 @@ public:
virtual int compare(const QSGMaterial *other) const;
virtual void setColor(const QColor &color);
- const QColor &color() const { return m_color; }
+ const QVector4D &color() const { return m_color; }
void setGlyphCache(QSGDistanceFieldGlyphCache *a) { m_glyph_cache = a; }
QSGDistanceFieldGlyphCache *glyphCache() const { return m_glyph_cache; }
@@ -76,7 +76,7 @@ public:
protected:
QSize m_size;
- QColor m_color;
+ QVector4D m_color;
QSGDistanceFieldGlyphCache *m_glyph_cache;
const QSGDistanceFieldGlyphCache::Texture *m_texture;
qreal m_fontScale;
@@ -93,10 +93,10 @@ public:
virtual int compare(const QSGMaterial *other) const;
void setStyleColor(const QColor &color);
- const QColor &styleColor() const { return m_styleColor; }
+ const QVector4D &styleColor() const { return m_styleColor; }
protected:
- QColor m_styleColor;
+ QVector4D m_styleColor;
};
class Q_QUICK_PRIVATE_EXPORT QSGDistanceFieldOutlineTextMaterial : public QSGDistanceFieldStyledTextMaterial
@@ -130,7 +130,7 @@ class Q_QUICK_PRIVATE_EXPORT QSGHiQSubPixelDistanceFieldTextMaterial : public QS
public:
virtual QSGMaterialType *type() const;
virtual QSGMaterialShader *createShader() const;
- void setColor(const QColor &color) { m_color = color; }
+ void setColor(const QColor &color) { m_color = QVector4D(color.redF(), color.greenF(), color.blueF(), color.alphaF()); }
};
class Q_QUICK_PRIVATE_EXPORT QSGLoQSubPixelDistanceFieldTextMaterial : public QSGDistanceFieldTextMaterial
@@ -138,7 +138,7 @@ class Q_QUICK_PRIVATE_EXPORT QSGLoQSubPixelDistanceFieldTextMaterial : public QS
public:
virtual QSGMaterialType *type() const;
virtual QSGMaterialShader *createShader() const;
- void setColor(const QColor &color) { m_color = color; }
+ void setColor(const QColor &color) { m_color = QVector4D(color.redF(), color.greenF(), color.blueF(), color.alphaF()); }
};
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index f71ccea294..3a608a911d 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -56,6 +56,7 @@
#include <QtQuick/QQuickWindow>
#include <QtQuick/private/qquickwindow_p.h>
#include <QtQuick/private/qsgcontext_p.h>
+#include <private/qqmlprofilerservice_p.h>
QT_BEGIN_NAMESPACE
@@ -273,20 +274,21 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window);
cd->polishItems();
- int renderTime = 0, syncTime = 0;
- QTime renderTimer;
- if (qsg_render_timing())
+ qint64 renderTime = 0, syncTime = 0;
+ QElapsedTimer renderTimer;
+ bool profileFrames = qsg_render_timing() || QQmlProfilerService::enabled;
+ if (profileFrames)
renderTimer.start();
cd->syncSceneGraph();
- if (qsg_render_timing())
- syncTime = renderTimer.elapsed();
+ if (profileFrames)
+ syncTime = renderTimer.nsecsElapsed();
cd->renderSceneGraph(window->size());
- if (qsg_render_timing())
- renderTime = renderTimer.elapsed() - syncTime;
+ if (profileFrames)
+ renderTime = renderTimer.nsecsElapsed() - syncTime;
if (data.grabOnly) {
grabContent = qt_gl_read_framebuffer(window->size(), false, false);
@@ -298,17 +300,29 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
cd->fireFrameSwapped();
}
+ qint64 swapTime = 0;
+ if (profileFrames) {
+ swapTime = renderTimer.nsecsElapsed() - renderTime - syncTime;
+ }
+
if (qsg_render_timing()) {
static QTime lastFrameTime = QTime::currentTime();
- const int swapTime = renderTimer.elapsed() - renderTime - syncTime;
- qDebug() << "- Breakdown of frame time; sync:" << syncTime
- << "ms render:" << renderTime << "ms swap:" << swapTime
- << "ms total:" << swapTime + renderTime + syncTime
+ qDebug() << "- Breakdown of frame time; sync:" << syncTime/1000000
+ << "ms render:" << renderTime/1000000 << "ms swap:" << swapTime/1000000
+ << "ms total:" << (swapTime + renderTime + syncTime)/1000000
<< "ms time since last frame:" << (lastFrameTime.msecsTo(QTime::currentTime()))
<< "ms";
lastFrameTime = QTime::currentTime();
}
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRenderLoopFrame,
+ syncTime,
+ renderTime,
+ swapTime);
+ }
+
// Might have been set during syncSceneGraph()
if (data.updatePending)
maybeUpdate(window);
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index de1e2517db..bd69fd5464 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -55,6 +55,8 @@
#include "qsgthreadedrenderloop_p.h"
+#include <private/qqmlprofilerservice_p.h>
+
/*
Overall design:
@@ -138,10 +140,10 @@ static inline int qsgrl_animation_interval() {
#ifndef QSG_NO_RENDER_TIMING
static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
-static QTime threadTimer;
-static int syncTime;
-static int renderTime;
-static int sinceLastTime;
+static QElapsedTimer threadTimer;
+static qint64 syncTime;
+static qint64 renderTime;
+static qint64 sinceLastTime;
#endif
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
@@ -545,8 +547,11 @@ void QSGRenderThread::sync()
void QSGRenderThread::syncAndRender()
{
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- sinceLastTime = threadTimer.restart();
+ bool profileFrames = qsg_render_timing || QQmlProfilerService::enabled;
+ if (profileFrames) {
+ sinceLastTime = threadTimer.nsecsElapsed();
+ threadTimer.start();
+ }
#endif
QElapsedTimer waitTimer;
waitTimer.start();
@@ -573,8 +578,8 @@ void QSGRenderThread::syncAndRender()
}
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- syncTime = threadTimer.elapsed();
+ if (profileFrames)
+ syncTime = threadTimer.nsecsElapsed();
#endif
RLDEBUG(" Render: - rendering starting");
@@ -588,8 +593,8 @@ void QSGRenderThread::syncAndRender()
gl->makeCurrent(w.window);
d->renderSceneGraph(w.size);
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing && i == 0)
- renderTime = threadTimer.elapsed();
+ if (profileFrames && i == 0)
+ renderTime = threadTimer.nsecsElapsed();
#endif
gl->swapBuffers(w.window);
d->fireFrameSwapped();
@@ -599,10 +604,18 @@ void QSGRenderThread::syncAndRender()
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
qDebug("window Time: sinceLast=%d, sync=%d, first render=%d, after final swap=%d",
- sinceLastTime,
- syncTime,
- renderTime - syncTime,
- threadTimer.elapsed() - renderTime);
+ int(sinceLastTime/1000000),
+ int(syncTime/1000000),
+ int((renderTime - syncTime)/1000000),
+ int(threadTimer.elapsed() - renderTime/1000000));
+
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRenderLoopFrame,
+ syncTime,
+ renderTime - syncTime,
+ threadTimer.nsecsElapsed() - renderTime);
+ }
#endif
}
@@ -950,10 +963,11 @@ void QSGThreadedRenderLoop::polishAndSync()
#ifndef QSG_NO_RENDER_TIMING
QElapsedTimer timer;
- int polishTime = 0;
- int waitTime = 0;
- int syncTime;
- if (qsg_render_timing)
+ qint64 polishTime = 0;
+ qint64 waitTime = 0;
+ qint64 syncTime = 0;
+ bool profileFrames = qsg_render_timing || QQmlProfilerService::enabled;
+ if (profileFrames)
timer.start();
#endif
@@ -964,8 +978,8 @@ void QSGThreadedRenderLoop::polishAndSync()
d->polishItems();
}
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- polishTime = timer.elapsed();
+ if (profileFrames)
+ polishTime = timer.nsecsElapsed();
#endif
m_sync_triggered_update = false;
@@ -977,8 +991,8 @@ void QSGThreadedRenderLoop::polishAndSync()
RLDEBUG("GUI: - wait for sync...");
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- waitTime = timer.elapsed();
+ if (profileFrames)
+ waitTime = timer.nsecsElapsed();
#endif
m_thread->waitCondition.wait(&m_thread->mutex);
m_thread->guiIsLocked = false;
@@ -986,8 +1000,8 @@ void QSGThreadedRenderLoop::polishAndSync()
RLDEBUG("GUI: - unlocked after sync...");
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
- syncTime = timer.elapsed();
+ if (profileFrames)
+ syncTime = timer.nsecsElapsed();
#endif
killTimer(m_update_timer);
@@ -1006,7 +1020,20 @@ void QSGThreadedRenderLoop::polishAndSync()
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
- qDebug(" - polish=%d, wait=%d, sync=%d -- animations=%d", polishTime, waitTime - polishTime, syncTime - waitTime, int(timer.elapsed() - syncTime));
+ qDebug(" - polish=%d, wait=%d, sync=%d -- animations=%d",
+ int(polishTime/1000000),
+ int((waitTime - polishTime)/1000000),
+ int((syncTime - waitTime)/1000000),
+ int((timer.nsecsElapsed() - syncTime)/1000000));
+
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphPolishAndSync,
+ polishTime,
+ waitTime - polishTime,
+ syncTime - waitTime,
+ timer.nsecsElapsed() - syncTime);
+ }
#endif
}
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 3e21af6ac0..ce43ccf531 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -51,6 +51,8 @@
#include <QtQuick/QQuickWindow>
+#include <private/qqmlprofilerservice_p.h>
+
QT_BEGIN_NAMESPACE
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
@@ -67,7 +69,7 @@ static QElapsedTimer qsg_debug_timer;
#ifndef QSG_NO_RENDER_TIMING
static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
static QElapsedTimer qsg_render_timer;
-#define QSG_RENDER_TIMING_SAMPLE(sampleName) int sampleName = 0; if (qsg_render_timing) sampleName = qsg_render_timer.elapsed()
+#define QSG_RENDER_TIMING_SAMPLE(sampleName) qint64 sampleName = 0; if (qsg_render_timing || QQmlProfilerService::enabled) sampleName = qsg_render_timer.nsecsElapsed()
#else
#define QSG_RENDER_TIMING_SAMPLE(sampleName)
#endif
@@ -174,9 +176,16 @@ void QSGWindowsRenderLoop::show(QQuickWindow *window)
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
qDebug("WindowsRenderLoop: GL=%d ms, makeCurrent=%d ms, SG=%d ms",
- int(time_created - time_start),
- int(time_current - time_created),
- int(qsg_render_timer.elapsed() - time_current));
+ int((time_created - time_start)/1000000),
+ int((time_current - time_created)/1000000),
+ int((qsg_render_timer.nsecsElapsed() - time_current)/1000000));
+ }
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphWindowsRenderShow,
+ time_created - time_start,
+ time_current - time_created,
+ qsg_render_timer.nsecsElapsed() - time_current);
}
#endif
@@ -368,7 +377,12 @@ void QSGWindowsRenderLoop::render()
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
qDebug("WindowsRenderLoop: animations=%d ms",
- int(qsg_render_timer.elapsed() - time_start));
+ int((qsg_render_timer.nsecsElapsed() - time_start)/1000000));
+ }
+ if (QQmlProfilerService::Enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphWindowsAnimations,
+ qsg_render_timer.nsecsElapsed() - time_start);
}
#endif
@@ -424,10 +438,23 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window)
qDebug("WindowsRenderLoop(t=%d): window=%p, polish=%d ms, sync=%d ms, render=%d ms, swap=%d ms",
int(qsg_render_timer.elapsed()),
window,
- int(time_polished - time_start),
- int(time_synced - time_polished),
- int(time_rendered - time_synced),
- int(time_swapped - time_rendered));
+ int((time_polished - time_start)/1000000),
+ int((time_synced - time_polished)/1000000),
+ int((time_rendered - time_synced)/1000000),
+ int((time_swapped - time_rendered)/1000000));
+ }
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphWindowsPolishFrame,
+ time_polished - time_start
+ );
+
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRenderLoopFrame,
+ time_synced - time_polished,
+ time_rendered - time_synced,
+ time_swapped - time_rendered
+ );
}
#endif
}
diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp
index 307201277c..09e2a7da27 100644
--- a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp
+++ b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp
@@ -74,11 +74,11 @@ void FlatColorMaterialShader::updateState(const RenderState &state, QSGMaterial
const QColor &c = newMaterial->color();
if (oldMaterial == 0 || c != oldMaterial->color() || state.isOpacityDirty()) {
- float opacity = state.opacity();
- QVector4D v(c.redF() * c.alphaF() * opacity,
- c.greenF() * c.alphaF() * opacity,
- c.blueF() * c.alphaF() * opacity,
- c.alphaF() * opacity);
+ float opacity = state.opacity() * c.alphaF();
+ QVector4D v(c.redF() * opacity,
+ c.greenF() * opacity,
+ c.blueF() * opacity,
+ opacity);
program()->setUniformValue(m_color_id, v);
}
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index ad98fe9d47..a104e4af2f 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -614,7 +614,8 @@ void QSGPlainTexture::bind()
m_dirty_texture = false;
#ifndef QSG_NO_RENDER_TIMING
- if (qsg_render_timing)
+ bool profileFrames = qsg_render_timing || QQmlProfilerService::enabled;
+ if (profileFrames)
qsg_renderer_timer.start();
#endif
@@ -628,6 +629,11 @@ void QSGPlainTexture::bind()
m_texture_size.width(),
m_texture_size.height());
}
+ if (QQmlProfilerService::enabled) {
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphTextureDeletion,
+ qsg_renderer_timer.nsecsElapsed());
+ }
#endif
}
m_texture_id = 0;
@@ -645,9 +651,9 @@ void QSGPlainTexture::bind()
glBindTexture(GL_TEXTURE_2D, m_texture_id);
#ifndef QSG_NO_RENDER_TIMING
- int bindTime = 0;
- if (qsg_render_timing)
- bindTime = qsg_renderer_timer.elapsed();
+ qint64 bindTime = 0;
+ if (profileFrames)
+ bindTime = qsg_renderer_timer.nsecsElapsed();
#endif
// ### TODO: check for out-of-memory situations...
@@ -659,9 +665,9 @@ void QSGPlainTexture::bind()
: m_image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
#ifndef QSG_NO_RENDER_TIMING
- int convertTime = 0;
- if (qsg_render_timing)
- convertTime = qsg_renderer_timer.elapsed();
+ qint64 convertTime = 0;
+ if (profileFrames)
+ convertTime = qsg_renderer_timer.nsecsElapsed();
#endif
updateBindOptions(m_dirty_bind_options);
@@ -684,16 +690,16 @@ void QSGPlainTexture::bind()
}
#ifndef QSG_NO_RENDER_TIMING
- int swizzleTime = 0;
- if (qsg_render_timing)
- swizzleTime = qsg_renderer_timer.elapsed();
+ qint64 swizzleTime = 0;
+ if (profileFrames)
+ swizzleTime = qsg_renderer_timer.nsecsElapsed();
#endif
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, externalFormat, GL_UNSIGNED_BYTE, tmp.constBits());
#ifndef QSG_NO_RENDER_TIMING
- int uploadTime = 0;
- if (qsg_render_timing)
- uploadTime = qsg_renderer_timer.elapsed();
+ qint64 uploadTime = 0;
+ if (profileFrames)
+ uploadTime = qsg_renderer_timer.nsecsElapsed();
#endif
@@ -704,23 +710,35 @@ void QSGPlainTexture::bind()
}
#ifndef QSG_NO_RENDER_TIMING
- int mipmapTime = 0;
+ qint64 mipmapTime = 0;
if (qsg_render_timing) {
- mipmapTime = qsg_renderer_timer.elapsed();
+ mipmapTime = qsg_renderer_timer.nsecsElapsed();
printf(" - plaintexture(%dx%d) bind=%d, convert=%d, swizzle=%d (%s->%s), upload=%d, mipmap=%d, total=%d\n",
m_texture_size.width(), m_texture_size.height(),
- bindTime,
- convertTime - bindTime,
- swizzleTime - convertTime,
+ int(bindTime/1000000),
+ int((convertTime - bindTime)/1000000),
+ int((swizzleTime - convertTime)/1000000),
externalFormat == GL_BGRA ? "BGRA" : "RGBA",
internalFormat == GL_BGRA ? "BGRA" : "RGBA",
- uploadTime - swizzleTime,
- mipmapTime - uploadTime,
+ int((uploadTime - swizzleTime)/1000000),
+ int((mipmapTime - uploadTime)/1000000),
(int) qsg_renderer_timer.elapsed());
}
+ if (QQmlProfilerService::enabled) {
+ mipmapTime = qsg_renderer_timer.nsecsElapsed();
+
+ QQmlProfilerService::sceneGraphFrame(
+ QQmlProfilerService::SceneGraphTexturePrepare,
+ bindTime,
+ convertTime - bindTime,
+ swizzleTime - convertTime,
+ uploadTime - swizzleTime,
+ mipmapTime - uploadTime);
+ }
+
#endif
diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp
index ff91109a2a..87414766e3 100644
--- a/src/quick/scenegraph/util/qsgtexturematerial.cpp
+++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp
@@ -145,7 +145,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa
tuple. The QSGGeometry::defaultAttributes_TexturedPoint2D returns an
attribute set compatible with this material.
- The texture to be rendered is can be set using setTexture(). How the
+ The texture to be rendered can be set using setTexture(). How the
texture should be rendered can be specified using setMipmapFiltering(),
setFiltering(), setHorizontalWrapMode() and setVerticalWrapMode().
The rendering state is set on the texture instance just before it
@@ -208,7 +208,7 @@ QSGMaterialShader *QSGOpaqueTextureMaterial::createShader() const
/*!
Sets the texture of this material to \a texture.
- The material does not take ownership over the texture.
+ The material does not take ownership of the texture.
*/
void QSGOpaqueTextureMaterial::setTexture(QSGTexture *texture)
@@ -337,7 +337,7 @@ int QSGOpaqueTextureMaterial::compare(const QSGMaterial *o) const
tuple. The QSGGeometry::defaultAttributes_TexturedPoint2D returns an
attribute set compatible with this material.
- The texture to be rendered is set using setTexture(). How the
+ The texture to be rendered can be set using setTexture(). How the
texture should be rendered can be specified using setMipmapFiltering(),
setFiltering(), setHorizontalWrapMode() and setVerticalWrapMode().
The rendering state is set on the texture instance just before it
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index 2f9ca7409f..c05b254b51 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -1975,7 +1975,7 @@ void QQuickPropertyAnimation::setDuration(int duration)
}
/*!
- \qmlproperty real QtQuick2::PropertyAnimation::from
+ \qmlproperty variant QtQuick2::PropertyAnimation::from
This property holds the starting value for the animation.
If the PropertyAnimation is defined within a \l Transition or \l Behavior,
@@ -2002,7 +2002,7 @@ void QQuickPropertyAnimation::setFrom(const QVariant &f)
}
/*!
- \qmlproperty real QtQuick2::PropertyAnimation::to
+ \qmlproperty variant QtQuick2::PropertyAnimation::to
This property holds the end value for the animation.
If the PropertyAnimation is defined within a \l Transition or \l Behavior,
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 4906645f6c..6fbba8ca2f 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -169,7 +169,7 @@ QImage QQuickTextureFactory::image() const
an image provider named "colors", and the images to be loaded are "yellow"
and "red", respectively:
- \snippet quick/imageprovider/imageprovider-example.qml 0
+ \snippet imageprovider/imageprovider-example.qml 0
When these images are loaded by QML, it looks for a matching image provider
and calls its requestImage() or requestPixmap() method (depending on its
@@ -180,9 +180,9 @@ QImage QQuickTextureFactory::image() const
requested by the above QML. This implementation dynamically
generates QPixmap images that are filled with the requested color:
- \snippet quick/imageprovider/imageprovider.cpp 0
+ \snippet imageprovider/imageprovider.cpp 0
\codeline
- \snippet quick/imageprovider/imageprovider.cpp 1
+ \snippet imageprovider/imageprovider.cpp 1
To make this provider accessible to QML, it is registered with the QML engine
with a "colors" identifier:
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index fc33f8f1f8..2278fd25ba 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -1546,7 +1546,7 @@ void QQuickPathCatmullRomCurve::addToPath(QPainterPath &path, const QQuickPathDa
nextData.curves = data.curves;
next = positionForCurve(nextData, point);
} else {
- if (point == QPointF(path.elementAt(0)) && qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(0))) {
+ if (point == QPointF(path.elementAt(0)) && qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(0)) && path.elementCount() >= 3) {
//this is a closed path starting and ending with catmull-rom segments.
//we try to smooth the join point
next = QPointF(path.elementAt(3)); //the first catmull-rom point
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index c5968c2bc1..9cf8c5812d 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -71,6 +71,8 @@
#include <QQmlFile>
#include <QMetaMethod>
+#include <private/qqmlprofilerservice_p.h>
+
#define IMAGEREQUEST_MAX_REQUEST_COUNT 8
#define IMAGEREQUEST_MAX_REDIRECT_RECURSION 16
#define CACHE_EXPIRE_TIME 30
@@ -890,11 +892,15 @@ bool QQuickPixmapReply::event(QEvent *event)
if (data) {
Event *de = static_cast<Event *>(event);
data->pixmapStatus = (de->error == NoError) ? QQuickPixmap::Ready : QQuickPixmap::Error;
-
+ QQmlPixmapProfiler pixmapProfiler;
if (data->pixmapStatus == QQuickPixmap::Ready) {
+ pixmapProfiler.finishLoading(data->url);
data->textureFactory = de->textureFactory;
data->implicitSize = de->implicitSize;
+ if (data->implicitSize.width() > 0)
+ pixmapProfiler.setSize(url, data->implicitSize.width(), data->implicitSize.height());
} else {
+ pixmapProfiler.errorLoading(data->url);
data->errorString = de->errorString;
data->removeFromCache(); // We don't continue to cache error'd pixmaps
}
@@ -920,6 +926,7 @@ int QQuickPixmapData::cost() const
void QQuickPixmapData::addref()
{
++refCount;
+ QQmlPixmapProfiler().referenceCountChanged(url, refCount);
if (prevUnreferencedPtr)
pixmapStore()->referencePixmap(this);
}
@@ -928,6 +935,7 @@ void QQuickPixmapData::release()
{
Q_ASSERT(refCount > 0);
--refCount;
+ QQmlPixmapProfiler().referenceCountChanged(url, refCount);
if (refCount == 0) {
if (reply) {
QQuickPixmapReply *cancelReply = reply;
@@ -958,6 +966,10 @@ void QQuickPixmapData::addToCache()
QQuickPixmapKey key = { &url, &requestSize };
pixmapStore()->m_cache.insert(key, this);
inCache = true;
+ QQmlPixmapProfiler pixmapProfiler;
+ pixmapProfiler.cacheCountChanged(url, pixmapStore()->m_cache.count());
+ if (implicitSize.width() > 0)
+ pixmapProfiler.setSize(url, implicitSize.width(), implicitSize.height());
}
}
@@ -965,6 +977,7 @@ void QQuickPixmapData::removeFromCache()
{
if (inCache) {
QQuickPixmapKey key = { &url, &requestSize };
+ QQmlPixmapProfiler().cacheCountChanged(url, pixmapStore()->m_cache.count());
pixmapStore()->m_cache.remove(key);
inCache = false;
}
@@ -1238,14 +1251,21 @@ void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &reques
if (!(options & QQuickPixmap::Asynchronous)) {
bool ok = false;
+ QQmlPixmapProfiler pixmapProfiler;
+ pixmapProfiler.startLoading(url);
d = createPixmapDataSync(this, engine, url, requestSize, &ok);
if (ok) {
+ pixmapProfiler.finishLoading(url);
+ if (d->implicitSize.width() > 0)
+ QQmlPixmapProfiler().setSize(url, d->implicitSize.width(), d->implicitSize.height());
if (options & QQuickPixmap::Cache)
d->addToCache();
return;
}
- if (d) // loadable, but encountered error while loading
+ if (d) { // loadable, but encountered error while loading
+ pixmapProfiler.errorLoading(url);
return;
+ }
}
if (!engine)
diff --git a/sync.profile b/sync.profile
index 61d25bafa5..3efcbca8e1 100644
--- a/sync.profile
+++ b/sync.profile
@@ -15,9 +15,10 @@
# Each of the module version specifiers can take one of the following values:
# - A specific Git revision.
# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
+# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch)
#
%dependencies = (
- "qtbase" => "refs/heads/dev",
- "qtxmlpatterns" => "refs/heads/dev",
- "qtjsbackend" => "refs/heads/dev",
+ "qtbase" => "",
+ "qtxmlpatterns" => "",
+ "qtjsbackend" => "",
);
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/TestImage_2x2.png b/tests/auto/qml/debugger/qqmlprofilerservice/data/TestImage_2x2.png
new file mode 100644
index 0000000000..30228cbbdc
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/TestImage_2x2.png
Binary files differ
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/pixmapCacheTest.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/pixmapCacheTest.qml
new file mode 100644
index 0000000000..d56786bfae
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/pixmapCacheTest.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+
+Rectangle {
+ Image {
+ source: "TestImage_2x2.png"
+ onStatusChanged: switch (status) {
+ case 0: console.log("no image"); break;
+ case 1: console.log("image loaded"); break;
+ case 2: console.log("image loading"); break;
+ case 3: console.log("image error"); break;
+ }
+ }
+}
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/scenegraphTest.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/scenegraphTest.qml
new file mode 100644
index 0000000000..dd9d053296
--- /dev/null
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/scenegraphTest.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+
+Rectangle {
+ Rectangle {
+ width: 10
+ height: 10
+ color: "blue"
+ }
+
+ Component.onCompleted: timer.start();
+
+ Timer {
+ id: timer
+ interval: 100 // 100 ms, enough for at least one frame
+ running: false
+ onTriggered: console.log("tick")
+ }
+}
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
index 5bff33dd25..b2b325dc72 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
@@ -12,3 +12,6 @@ TESTDATA = data/*
QT += core qml testlib gui-private
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+OTHER_FILES += \
+ data/pixmapCacheTest.qml
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 9982e5d629..e4f886f7ce 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -77,6 +77,8 @@ public:
RangeLocation,
RangeEnd,
Complete, // end of transmission
+ PixmapCacheEvent,
+ SceneGraphFrame,
MaximumMessage
};
@@ -102,6 +104,32 @@ public:
MaximumRangeType
};
+ enum PixmapEventType {
+ PixmapSizeKnown,
+ PixmapReferenceCountChanged,
+ PixmapCacheCountChanged,
+ PixmapLoadingStarted,
+ PixmapLoadingFinished,
+ PixmapLoadingError,
+
+ MaximumPixmapEventType
+ };
+
+ enum SceneGraphFrameType {
+ SceneGraphRendererFrame,
+ SceneGraphAdaptationLayerFrame,
+ SceneGraphContextFrame,
+ SceneGraphRenderLoopFrame,
+ SceneGraphTexturePrepare,
+ SceneGraphTextureDeletion,
+ SceneGraphPolishAndSync,
+ SceneGraphWindowsRenderShow,
+ SceneGraphWindowsAnimations,
+ SceneGraphWindowsPolishFrame,
+
+ MaximumSceneGraphFrameType
+ };
+
QQmlProfilerClient(QQmlDebugConnection *connection)
: QQmlDebugClient(QLatin1String("CanvasFrameRate"), connection)
{
@@ -135,6 +163,7 @@ public:
{
}
+
private:
QQmlDebugProcess *m_process;
QQmlDebugConnection *m_connection;
@@ -148,6 +177,8 @@ private slots:
void blockingConnectWithTraceEnabled();
void blockingConnectWithTraceDisabled();
void nonBlockingConnect();
+ void pixmapCacheData();
+ void scenegraphData();
void profileOnExit();
};
@@ -219,6 +250,44 @@ void QQmlProfilerClient::messageReceived(const QByteArray &message)
QVERIFY(data.line >= -2);
break;
}
+ case QQmlProfilerClient::PixmapCacheEvent: {
+ stream >> data.detailType >> data.detailData;
+ if (data.detailType == QQmlProfilerClient::PixmapSizeKnown)
+ stream >> data.line >> data.column;
+ if (data.detailType == QQmlProfilerClient::PixmapReferenceCountChanged)
+ stream >> data.animationcount;
+ if (data.detailType == QQmlProfilerClient::PixmapCacheCountChanged)
+ stream >> data.animationcount;
+ break;
+ }
+ case QQmlProfilerClient::SceneGraphFrame: {
+ stream >> data.detailType;
+ qint64 subtime_1, subtime_2, subtime_3, subtime_4, subtime_5;
+ int glyphCount;
+ switch (data.detailType) {
+ // RendererFrame: preprocessTime, updateTime, bindingTime, renderTime
+ case QQmlProfilerClient::SceneGraphRendererFrame: stream >> subtime_1 >> subtime_2 >> subtime_3 >> subtime_4; break;
+ // AdaptationLayerFrame: glyphCount, glyphRenderTime, glyphStoreTime
+ case QQmlProfilerClient::SceneGraphAdaptationLayerFrame: stream >> glyphCount >> subtime_2 >> subtime_3; break;
+ // ContextFrame: compiling material time
+ case QQmlProfilerClient::SceneGraphContextFrame: stream >> subtime_1; break;
+ // RenderLoop: syncTime, renderTime, swapTime
+ case QQmlProfilerClient::SceneGraphRenderLoopFrame: stream >> subtime_1 >> subtime_2 >> subtime_3; break;
+ // TexturePrepare: bind, convert, swizzle, upload, mipmap
+ case QQmlProfilerClient::SceneGraphTexturePrepare: stream >> subtime_1 >> subtime_2 >> subtime_3 >> subtime_4 >> subtime_5; break;
+ // TextureDeletion: deletionTime
+ case QQmlProfilerClient::SceneGraphTextureDeletion: stream >> subtime_1; break;
+ // PolishAndSync: polishTime, waitTime, syncTime, animationsTime,
+ case QQmlProfilerClient::SceneGraphPolishAndSync: stream >> subtime_1 >> subtime_2 >> subtime_3 >> subtime_4; break;
+ // WindowsRenderLoop: GL time, make current time, SceneGraph time
+ case QQmlProfilerClient::SceneGraphWindowsRenderShow: stream >> subtime_1 >> subtime_2 >> subtime_3; break;
+ // WindowsAnimations: update time
+ case QQmlProfilerClient::SceneGraphWindowsAnimations: stream >> subtime_1; break;
+ // WindowsRenderWindow: polish time
+ case QQmlProfilerClient::SceneGraphWindowsPolishFrame: stream >> subtime_1; break;
+ }
+ break;
+ }
default:
QString failMsg = QString("Unknown message type:") + data.messageType;
QFAIL(qPrintable(failMsg));
@@ -320,6 +389,84 @@ void tst_QQmlProfilerService::nonBlockingConnect()
QCOMPARE(m_client->traceMessages.last().detailType, (int)QQmlProfilerClient::EndTrace);
}
+void tst_QQmlProfilerService::pixmapCacheData()
+{
+ connect(true, "pixmapCacheTest.qml");
+ QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
+
+ m_client->setTraceState(true);
+ QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput())));
+
+ QVERIFY(m_process->output().indexOf(QLatin1String("image loaded")) != -1 ||
+ m_process->output().indexOf(QLatin1String("image error")) != -1 );
+
+
+ m_client->setTraceState(false);
+
+ QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time.");
+ QVERIFY(m_client->traceMessages.count());
+
+ // must start with "StartTrace"
+ QCOMPARE(m_client->traceMessages.first().messageType, (int)QQmlProfilerClient::Event);
+ QCOMPARE(m_client->traceMessages.first().detailType, (int)QQmlProfilerClient::StartTrace);
+
+ // image starting to load
+ QCOMPARE(m_client->traceMessages[8].messageType, (int)QQmlProfilerClient::PixmapCacheEvent);
+ QCOMPARE(m_client->traceMessages[8].detailType, (int)QQmlProfilerClient::PixmapLoadingStarted);
+
+ // image loaded
+ QCOMPARE(m_client->traceMessages[9].messageType, (int)QQmlProfilerClient::PixmapCacheEvent);
+ QCOMPARE(m_client->traceMessages[9].detailType, (int)QQmlProfilerClient::PixmapLoadingFinished);
+
+ // image size
+ QCOMPARE(m_client->traceMessages[10].messageType, (int)QQmlProfilerClient::PixmapCacheEvent);
+ QCOMPARE(m_client->traceMessages[10].detailType, (int)QQmlProfilerClient::PixmapSizeKnown);
+ QCOMPARE(m_client->traceMessages[10].line, 2); // width
+ QCOMPARE(m_client->traceMessages[10].column, 2); // height
+
+ // cache size
+ QCOMPARE(m_client->traceMessages[11].messageType, (int)QQmlProfilerClient::PixmapCacheEvent);
+ QCOMPARE(m_client->traceMessages[11].detailType, (int)QQmlProfilerClient::PixmapCacheCountChanged);
+
+ // must end with "EndTrace"
+ QCOMPARE(m_client->traceMessages.last().messageType, (int)QQmlProfilerClient::Event);
+ QCOMPARE(m_client->traceMessages.last().detailType, (int)QQmlProfilerClient::EndTrace);
+
+}
+
+void tst_QQmlProfilerService::scenegraphData()
+{
+ connect(true, "scenegraphTest.qml");
+ QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
+
+ m_client->setTraceState(true);
+ QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput())));
+ QVERIFY(m_process->output().indexOf(QLatin1String("tick")) != -1);
+ m_client->setTraceState(false);
+
+ QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time.");
+ QVERIFY(m_client->traceMessages.count());
+
+ // check that at least one frame was rendered
+ // there should be a SGPolishAndSync + SGRendererFrame + SGRenderLoopFrame sequence
+ // since the rendering happens in a different thread, there could be other unrelated events interleaved
+ int loopcheck = 0;
+ foreach (const QQmlProfilerData &msg, m_client->traceMessages) {
+ if (msg.messageType == QQmlProfilerClient::SceneGraphFrame) {
+ if (loopcheck == 0 && msg.detailType == QQmlProfilerClient::SceneGraphContextFrame)
+ loopcheck = 1;
+ else
+ if (loopcheck == 1 && msg.detailType == QQmlProfilerClient::SceneGraphRendererFrame)
+ loopcheck = 2;
+ else
+ if (loopcheck == 2 && msg.detailType == QQmlProfilerClient::SceneGraphRenderLoopFrame)
+ loopcheck = 3;
+ }
+ }
+
+ QCOMPARE(loopcheck, 3);
+}
+
void tst_QQmlProfilerService::profileOnExit()
{
connect(true, "exit.qml");
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp
index 6585f7eca2..ff3140f520 100644
--- a/tests/auto/qml/debugger/shared/debugutil.cpp
+++ b/tests/auto/qml/debugger/shared/debugutil.cpp
@@ -182,6 +182,8 @@ void QQmlDebugProcess::processAppOutput()
{
m_mutex.lock();
+ bool outputFromAppItself = false;
+
QString newOutput = m_process.readAll();
m_output.append(newOutput);
m_outputBuffer.append(newOutput);
@@ -208,7 +210,13 @@ void QQmlDebugProcess::processAppOutput()
m_eventLoop.quit();
continue;
}
+ } else {
+ // set to true if there is output not coming from the debugger
+ outputFromAppItself = true;
}
}
m_mutex.unlock();
+
+ if (outputFromAppItself)
+ emit readyReadStandardOutput();
}
diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h
index 363aabbf39..11b16a1fb8 100644
--- a/tests/auto/qml/debugger/shared/debugutil_p.h
+++ b/tests/auto/qml/debugger/shared/debugutil_p.h
@@ -98,6 +98,9 @@ public:
QString output() const;
void stop();
+signals:
+ void readyReadStandardOutput();
+
private slots:
void timeout();
void processAppOutput();
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index b973d44012..ed828dfb4d 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -69,3 +69,7 @@ SUBDIRS += debugger
contains(QT_CONFIG, private_tests) {
SUBDIRS += $$PRIVATETESTS
}
+
+qtNomakeTools( \
+ qmlplugindump \
+)
diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
index 6aca47656b..d9a370b200 100644
--- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
+++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
@@ -68,9 +68,7 @@ void tst_qmlplugindump::initTestCase()
{
qmlplugindumpPath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
-#if defined(Q_OS_MAC)
- qmlplugindumpPath += QLatin1String("/qmlplugindump.app/Contents/MacOS/qmlplugindump");
-#elif defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
qmlplugindumpPath += QLatin1String("/qmlplugindump.exe");
#else
qmlplugindumpPath += QLatin1String("/qmlplugindump");
diff --git a/tests/auto/qml/qqmlcomponent/data/createWindow.qml b/tests/auto/qml/qqmlcomponent/data/createWindow.qml
new file mode 100644
index 0000000000..af0b7edeb2
--- /dev/null
+++ b/tests/auto/qml/qqmlcomponent/data/createWindow.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.1
+import QtQuick.Window 2.1
+
+Window {
+ id: window1;
+ objectName: "window1";
+ color: "#00FF00";
+ width: 100; height: 100;
+ Item {
+ objectName: "item1"
+ width: 100; height: 100;
+ MouseArea {
+ objectName: "mousearea"
+ anchors.fill: parent;
+ onPressed: window2.requestActivate();
+ }
+ Component.onCompleted: window2.show();
+ }
+
+ Window {
+ id: window2;
+ objectName: "window2";
+ color: "#FF0000";
+ width: 100; height: 100;
+ Item {
+ width: 100; height: 100;
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 697c8103b0..9eeff66e7a 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -105,6 +105,7 @@ public:
private slots:
void null();
void loadEmptyUrl();
+ void qmlCreateWindow();
void qmlCreateObject();
void qmlCreateObjectWithProperties();
void qmlIncubateObject();
@@ -163,6 +164,15 @@ void tst_qqmlcomponent::qmlIncubateObject()
delete object;
}
+void tst_qqmlcomponent::qmlCreateWindow()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("createWindow.qml"));
+ QQuickWindow* window = qobject_cast<QQuickWindow *>(component.create());
+ QVERIFY(window);
+}
+
void tst_qqmlcomponent::qmlCreateObject()
{
QQmlEngine engine;
diff --git a/tests/auto/qml/qqmlecmascript/data/MyDeferredComponent.qml b/tests/auto/qml/qqmlecmascript/data/MyDeferredComponent.qml
new file mode 100644
index 0000000000..1432e7da55
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/MyDeferredComponent.qml
@@ -0,0 +1,10 @@
+import Qt.test 1.0
+import QtQml 2.0
+
+MyDeferredObject {
+ id: root
+ property QtObject target: null
+ objectProperty: MyQmlObject {
+ value: target.value
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/data/MyDeferredComponent2.qml b/tests/auto/qml/qqmlecmascript/data/MyDeferredComponent2.qml
new file mode 100644
index 0000000000..de73629f7a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/MyDeferredComponent2.qml
@@ -0,0 +1,3 @@
+import Qt.test 1.0
+
+MyDeferredObject {}
diff --git a/tests/auto/qml/qqmlecmascript/data/deferredPropertiesInComponents.qml b/tests/auto/qml/qqmlecmascript/data/deferredPropertiesInComponents.qml
new file mode 100644
index 0000000000..868b7b1908
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/deferredPropertiesInComponents.qml
@@ -0,0 +1,15 @@
+import Qt.test 1.0
+import QtQml 2.0
+
+QtObject {
+ id: root
+ property int value: 10
+ property QtObject deferredInside: MyDeferredComponent {
+ target: root
+ }
+ property QtObject deferredOutside: MyDeferredComponent2 {
+ objectProperty: MyQmlObject {
+ value: root.value
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 06590f0ad6..c417879d3c 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -88,6 +88,7 @@ private slots:
void objectPropertiesTriggerReeval();
void deferredProperties();
void deferredPropertiesErrors();
+ void deferredPropertiesInComponents();
void extensionObjects();
void overrideExtensionProperties();
void attachedProperties();
@@ -865,6 +866,37 @@ void tst_qqmlecmascript::deferredPropertiesErrors()
delete object;
}
+void tst_qqmlecmascript::deferredPropertiesInComponents()
+{
+ // Test that it works when the property is set inside and outside component
+ QQmlComponent component(&engine, testFileUrl("deferredPropertiesInComponents.qml"));
+ QObject *object = component.create();
+ if (!object)
+ qDebug() << component.errorString();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("value").value<int>(), 10);
+
+ MyDeferredObject *defObjectA =
+ qobject_cast<MyDeferredObject *>(object->property("deferredInside").value<QObject*>());
+ QVERIFY(defObjectA != 0);
+ QVERIFY(defObjectA->objectProperty() == 0);
+
+ qmlExecuteDeferred(defObjectA);
+ QVERIFY(defObjectA->objectProperty() != 0);
+ QCOMPARE(defObjectA->objectProperty()->property("value").value<int>(), 10);
+
+ MyDeferredObject *defObjectB =
+ qobject_cast<MyDeferredObject *>(object->property("deferredOutside").value<QObject*>());
+ QVERIFY(defObjectB != 0);
+ QVERIFY(defObjectB->objectProperty() == 0);
+
+ qmlExecuteDeferred(defObjectB);
+ QVERIFY(defObjectB->objectProperty() != 0);
+ QCOMPARE(defObjectB->objectProperty()->property("value").value<int>(), 10);
+
+ delete object;
+}
+
void tst_qqmlecmascript::extensionObjects()
{
QQmlComponent component(&engine, testFileUrl("extensionObjects.qml"));
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml
new file mode 100644
index 0000000000..0331a01ad4
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/Intercepted.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js
new file mode 100644
index 0000000000..6f54ebcdc5
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted.js
@@ -0,0 +1 @@
+var myStr = "base file"
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml
new file mode 100644
index 0000000000..ef5c28f87b
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted.qml
@@ -0,0 +1,6 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+ property Intercepted2 compilationIsTest: Intercepted2{}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml
new file mode 100644
index 0000000000..0331a01ad4
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/Intercepted2.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js
new file mode 100644
index 0000000000..6eeee6e72f
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/intercepted.js
@@ -0,0 +1 @@
+var myStr = "intercepted"
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml
new file mode 100644
index 0000000000..bd4aee056a
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/intercepted/urlInterceptor.qml
@@ -0,0 +1,11 @@
+import QtQml 2.0
+import "intercepted.js" as Script
+
+QtObject {
+ property url filePath: "FailsTest"
+ property url resolvedUrl: Qt.resolvedUrl("FailsTest");
+ property url absoluteUrl: Qt.resolvedUrl("file:///FailsTest");
+ property string childString: child.myStr
+ property string scriptString: Script.myStr
+ property Intercepted child: Intercepted {}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml
new file mode 100644
index 0000000000..22a09e5522
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/qmldir/urlInterceptor.qml
@@ -0,0 +1,12 @@
+import QtQml 2.0
+import "."
+import "intercepted.js" as Script
+
+QtObject {
+ property url filePath: "doesNotExist.file"
+ property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file");
+ property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file");
+ property string childString: child.myStr
+ property string scriptString: Script.myStr
+ property Intercepted child: Intercepted {}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml
new file mode 100644
index 0000000000..449207e0e3
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/strings/Intercepted.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "base file"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js
new file mode 100644
index 0000000000..6f54ebcdc5
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted.js
@@ -0,0 +1 @@
+var myStr = "base file"
diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml
new file mode 100644
index 0000000000..0331a01ad4
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/Intercepted.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js
new file mode 100644
index 0000000000..6eeee6e72f
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/intercepted.js
@@ -0,0 +1 @@
+var myStr = "intercepted"
diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml
new file mode 100644
index 0000000000..bd4aee056a
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/strings/intercepted/urlInterceptor.qml
@@ -0,0 +1,11 @@
+import QtQml 2.0
+import "intercepted.js" as Script
+
+QtObject {
+ property url filePath: "FailsTest"
+ property url resolvedUrl: Qt.resolvedUrl("FailsTest");
+ property url absoluteUrl: Qt.resolvedUrl("file:///FailsTest");
+ property string childString: child.myStr
+ property string scriptString: Script.myStr
+ property Intercepted child: Intercepted {}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml
new file mode 100644
index 0000000000..be86195bd8
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/strings/urlInterceptor.qml
@@ -0,0 +1,11 @@
+import QtQml 2.0
+import "intercepted.js" as Script
+
+QtObject {
+ property url filePath: "doesNotExist.file"
+ property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file");
+ property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file");
+ property string childString: child.myStr
+ property string scriptString: Script.myStr
+ property Intercepted child: Intercepted {}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml
new file mode 100644
index 0000000000..449207e0e3
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "base file"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml
new file mode 100644
index 0000000000..0331a01ad4
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/Intercepted2.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/types/intercepted.js
new file mode 100644
index 0000000000..6f54ebcdc5
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted.js
@@ -0,0 +1 @@
+var myStr = "base file"
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml
new file mode 100644
index 0000000000..ef5c28f87b
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted.qml
@@ -0,0 +1,6 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+ property Intercepted2 compilationIsTest: Intercepted2{}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml
new file mode 100644
index 0000000000..0331a01ad4
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/Intercepted2.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property string myStr: "intercepted"
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js
new file mode 100644
index 0000000000..6eeee6e72f
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/intercepted.js
@@ -0,0 +1 @@
+var myStr = "intercepted"
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml
new file mode 100644
index 0000000000..be86195bd8
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/intercepted/urlInterceptor.qml
@@ -0,0 +1,11 @@
+import QtQml 2.0
+import "intercepted.js" as Script
+
+QtObject {
+ property url filePath: "doesNotExist.file"
+ property url resolvedUrl: Qt.resolvedUrl("doesNotExist.file");
+ property url absoluteUrl: Qt.resolvedUrl("file:///doesNotExist.file");
+ property string childString: child.myStr
+ property string scriptString: Script.myStr
+ property Intercepted child: Intercepted {}
+}
diff --git a/tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml b/tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml
new file mode 100644
index 0000000000..bd4aee056a
--- /dev/null
+++ b/tests/auto/qml/qqmlengine/data/interception/types/urlInterceptor.qml
@@ -0,0 +1,11 @@
+import QtQml 2.0
+import "intercepted.js" as Script
+
+QtObject {
+ property url filePath: "FailsTest"
+ property url resolvedUrl: Qt.resolvedUrl("FailsTest");
+ property url absoluteUrl: Qt.resolvedUrl("file:///FailsTest");
+ property string childString: child.myStr
+ property string scriptString: Script.myStr
+ property Intercepted child: Intercepted {}
+}
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 9177ff58f7..d604118b58 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -54,6 +54,7 @@
#include <QQmlExpression>
#include <QQmlIncubationController>
#include <private/qqmlengine_p.h>
+#include <private/qqmlabstracturlinterceptor_p.h>
class tst_qqmlengine : public QQmlDataTest
{
@@ -79,6 +80,8 @@ private slots:
void multipleEngines();
void qtqmlModule_data();
void qtqmlModule();
+ void urlInterceptor_data();
+ void urlInterceptor();
public slots:
QObject *createAQObjectForOwnershipTest ()
@@ -674,6 +677,99 @@ void tst_qqmlengine::qtqmlModule()
}
}
+class CustomSelector : public QQmlAbstractUrlInterceptor
+{
+public:
+ virtual QUrl intercept(const QUrl &url, QQmlAbstractUrlInterceptor::DataType d)
+ {
+ if (url.scheme() != QStringLiteral("file"))
+ return url;
+ if (!m_interceptionPoints.contains(d))
+ return url;
+
+ QString alteredPath = url.path();
+ int a = alteredPath.lastIndexOf('/');
+ if (a < 0)
+ a = 0;
+ alteredPath.insert(a, QStringLiteral("/intercepted"));
+
+ QUrl ret = url;
+ ret.setPath(alteredPath);
+ return ret;
+ }
+ QList<QQmlAbstractUrlInterceptor::DataType> m_interceptionPoints;
+};
+
+Q_DECLARE_METATYPE(QList<QQmlAbstractUrlInterceptor::DataType>);
+void tst_qqmlengine::urlInterceptor_data()
+{
+ QTest::addColumn<QUrl>("testFile");
+ QTest::addColumn<QList<QQmlAbstractUrlInterceptor::DataType> >("interceptionPoint");
+ QTest::addColumn<QString>("expectedFilePath");
+ QTest::addColumn<QString>("expectedChildString");
+ QTest::addColumn<QString>("expectedScriptString");
+ QTest::addColumn<QString>("expectedResolvedUrl");
+ QTest::addColumn<QString>("expectedAbsoluteUrl");
+
+ QTest::newRow("InterceptTypes")
+ << testFileUrl("interception/types/urlInterceptor.qml")
+ << (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::QmlFile << QQmlAbstractUrlInterceptor::JavaScriptFile << QQmlAbstractUrlInterceptor::UrlString)
+ << testFileUrl("interception/types/intercepted/doesNotExist.file").toString()
+ << QStringLiteral("intercepted")
+ << QStringLiteral("intercepted")
+ << testFileUrl("interception/types/intercepted/doesNotExist.file").toString()
+ << QStringLiteral("file:///intercepted/doesNotExist.file");
+
+ QTest::newRow("InterceptQmlDir")
+ << testFileUrl("interception/qmldir/urlInterceptor.qml")
+ << (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::QmldirFile << QQmlAbstractUrlInterceptor::UrlString)
+ << testFileUrl("interception/qmldir/intercepted/doesNotExist.file").toString()
+ << QStringLiteral("intercepted")
+ << QStringLiteral("base file")
+ << testFileUrl("interception/qmldir/intercepted/doesNotExist.file").toString()
+ << QStringLiteral("file:///intercepted/doesNotExist.file");
+
+ QTest::newRow("InterceptStrings")
+ << testFileUrl("interception/strings/urlInterceptor.qml")
+ << (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::UrlString)
+ << testFileUrl("interception/strings/intercepted/doesNotExist.file").toString()
+ << QStringLiteral("base file")
+ << QStringLiteral("base file")
+ << testFileUrl("interception/strings/intercepted/doesNotExist.file").toString()
+ << QStringLiteral("file:///intercepted/doesNotExist.file");
+}
+
+void tst_qqmlengine::urlInterceptor()
+{
+
+ QFETCH(QUrl, testFile);
+ QFETCH(QList<QQmlAbstractUrlInterceptor::DataType>, interceptionPoint);
+ QFETCH(QString, expectedFilePath);
+ QFETCH(QString, expectedChildString);
+ QFETCH(QString, expectedScriptString);
+ QFETCH(QString, expectedResolvedUrl);
+ QFETCH(QString, expectedAbsoluteUrl);
+
+ QQmlEngine e;
+ CustomSelector cs;
+ cs.m_interceptionPoints = interceptionPoint;
+ e.setUrlInterceptor(&cs);
+ QQmlComponent c(&e, testFile); //Note that this can get intercepted too
+ QObject *o = c.create();
+ if (!o)
+ qDebug() << c.errorString();
+ QVERIFY(o);
+ //Test a URL as a property initialization
+ QCOMPARE(o->property("filePath").toString(), expectedFilePath);
+ //Test a URL as a Type location
+ QCOMPARE(o->property("childString").toString(), expectedChildString);
+ //Test a URL as a Script location
+ QCOMPARE(o->property("scriptString").toString(), expectedScriptString);
+ //Test a URL as a resolveUrl() call
+ QCOMPARE(o->property("resolvedUrl").toString(), expectedResolvedUrl);
+ QCOMPARE(o->property("absoluteUrl").toString(), expectedAbsoluteUrl);
+}
+
QTEST_MAIN(tst_qqmlengine)
#include "tst_qqmlengine.moc"
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 5a924a901a..47a9f3927b 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -242,6 +242,7 @@ private:
void tst_qqmllanguage::cleanupTestCase()
{
QVERIFY(QFile::remove(testFile(QString::fromUtf8("I18nType\303\201\303\242\303\243\303\244\303\245.qml"))));
+ qmlClearTypeRegistrations(); // Should not crash
}
void tst_qqmllanguage::insertedSemicolon_data()
diff --git a/tests/auto/qmldevtools/compile/compile.pro b/tests/auto/qmldevtools/compile/compile.pro
index 1c65daf909..0ed113a031 100644
--- a/tests/auto/qmldevtools/compile/compile.pro
+++ b/tests/auto/qmldevtools/compile/compile.pro
@@ -1,9 +1,12 @@
option(host_build)
TARGET = tst_compile
-force_bootstrap: \
+force_bootstrap {
QT = bootstrap-private
-else: \
+ !build_pass: CONFIG += release
+} else {
QT = core
+ !build_pass:contains(QT_CONFIG, build_all): CONFIG += release
+}
QT += qmldevtools-private
macx:CONFIG -= app_bundle
diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml
index 4d79a170f3..33307a3702 100644
--- a/tests/auto/qmltest/fontloader/tst_fontloader.qml
+++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
import QtTest 1.0
Item {
@@ -63,34 +63,37 @@ Item {
name: "FontLoader"
function test_fontloading() {
+ if (Qt.platform.os === "mac")
+ skip("Skipped for QTBUG-25306")
+
compare(fontloader.status, FontLoader.Null)
compare(testinput.font.family, "")
fontloader.source = "tarzeau_ocr_a.ttf";
- tryCompare(fontloader.status, FontLoader.Loading)
- tryCompare(fontloader.status, FontLoader.Ready)
+ tryCompare(fontloader, 'status', FontLoader.Ready)
compare(testinput.font.family, "OCRA")
fontloader.source = "dummy.ttf";
- tryCompare(fontloader.status, FontLoader.Error)
+ tryCompare(fontloader, 'status', FontLoader.Error)
compare(testinput.font.family, "")
fontloader.source = "";
fontloader.name = "Courier";
- tryCompare(fontloader.status, FontLoader.Ready)
+ tryCompare(fontloader, 'status', FontLoader.Ready)
compare(testinput.font.family, "Courier")
}
function test_fontswitching() {
+ if (Qt.platform.os === "mac")
+ skip("Skipped for QTBUG-25306")
+
compare(fontswitch.status, FontLoader.Null)
fontswitch.source = "tarzeau_ocr_a.ttf";
- tryCompare(fontswitch.status, FontLoader.Loading)
- tryCompare(fontswitch.status, FontLoader.Ready)
- tryCompare(fontswitch.name, "OCRA")
+ tryCompare(fontswitch, 'status', FontLoader.Ready)
+ compare(fontswitch.name, "OCRA")
fontswitch.source = "";
fontswitch.name = "Courier";
- tryCompare(fontswitch.status, FontLoader.Ready)
- tryCompare(fontswitch.name, "Courier")
+ tryCompare(fontswitch, 'status', FontLoader.Ready)
+ compare(fontswitch.name, "Courier")
fontswitch.source = "tarzeau_ocr_a.ttf";
- tryCompare(fontswitch.status, FontLoader.Loading)
- tryCompare(fontswitch.status, FontLoader.Ready)
+ tryCompare(fontswitch, 'status', FontLoader.Ready)
compare(fontswitch.name, "OCRA")
}
}
diff --git a/tests/auto/qmltest/listmodel/tst_listmodel.qml b/tests/auto/qmltest/listmodel/tst_listmodel.qml
index a975691462..603993a092 100644
--- a/tests/auto/qmltest/listmodel/tst_listmodel.qml
+++ b/tests/auto/qmltest/listmodel/tst_listmodel.qml
@@ -95,28 +95,28 @@ Item {
}
function test_altermodeled() {
- tryCompare(altermodel.count, 2)
+ tryCompare(altermodel, 'count', 2)
compare(altermodel.get(0).name, "AlterModelElement0")
compare(altermodel.get(1).name, "AlterModelElement1")
altermodel.append({"name":"AlterModelElement2"})
- tryCompare(altermodel.count, 3)
+ tryCompare(altermodel, 'count', 3)
compare(altermodel.get(0).name, "AlterModelElement0")
compare(altermodel.get(1).name, "AlterModelElement1")
compare(altermodel.get(2).name, "AlterModelElement2")
altermodel.insert(2,{"name":"AlterModelElement1.5"})
- tryCompare(altermodel.count, 4)
+ tryCompare(altermodel, 'count', 4)
compare(altermodel.get(0).name, "AlterModelElement0")
compare(altermodel.get(1).name, "AlterModelElement1")
compare(altermodel.get(2).name, "AlterModelElement1.5")
compare(altermodel.get(3).name, "AlterModelElement2")
- tryCompare(altermodel.count, 4)
+ tryCompare(altermodel, 'count', 4)
altermodel.move(2,1,1);
compare(altermodel.get(0).name, "AlterModelElement0")
compare(altermodel.get(1).name, "AlterModelElement1.5")
compare(altermodel.get(2).name, "AlterModelElement1")
compare(altermodel.get(3).name, "AlterModelElement2")
altermodel.remove(1,2)
- tryCompare(altermodel.count, 2)
+ tryCompare(altermodel, 'count', 2)
compare(altermodel.get(0).name, "AlterModelElement0")
compare(altermodel.get(1).name, "AlterModelElement2")
altermodel.set(1,{"name":"AlterModelElement1"})
@@ -125,7 +125,7 @@ Item {
altermodel.setProperty(0, "name", "AlteredProperty")
compare(altermodel.get(0).name, "AlteredProperty")
altermodel.clear()
- tryCompare(altermodel.count, 0)
+ tryCompare(altermodel, 'count', 0)
compare(altermodel.get(0), undefined)
}
}
diff --git a/src/quick/doc/snippets/qml/usecases/styling-text.qml b/tests/auto/qmltest/listview/data/asynclistviewloader.qml
index 0c68a11ad6..f7a55ff055 100644
--- a/src/quick/doc/snippets/qml/usecases/styling-text.qml
+++ b/tests/auto/qmltest/listview/data/asynclistviewloader.qml
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -38,36 +38,42 @@
**
****************************************************************************/
-//![0]
import QtQuick 2.0
-Item {
+ListView {
id: root
- width: 480
- height: 320
-
- Rectangle {
- color: "#272822"
- width: 480
- height: 320
+ width: 360
+ height: 360
+ cacheBuffer: 100000
+ model: ListModel {
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
+ ListElement { component: "asyncloadercurrentindex.qml" }
}
-//![texts]
- Column {
- spacing: 20
-
- MyText { text: 'I am the very model of a modern major general!' }
+ interactive: false
+ orientation: ListView.Horizontal
- MyText { text: 'I\'ve information vegetable, animal and mineral.' }
+ currentIndex: 0
- MyText {
- width: root.width
- wrapMode: Text.WordWrap
- text: 'I know the kings of England and I quote the fights historical:'
- }
+ delegate: Loader {
+ width: root.width
+ height: root.height
- MyText { text: 'From Marathon to Waterloo in order categorical.' }
+ source: component
+ asynchronous: true
}
-//![texts]
}
-//![0]
diff --git a/src/qml/doc/snippets/qml/folderlistmodel.qml b/tests/auto/qmltest/listview/data/asyncloadercurrentindex.qml
index b43949c487..a721f85eb9 100644
--- a/src/qml/doc/snippets/qml/folderlistmodel.qml
+++ b/tests/auto/qmltest/listview/data/asyncloadercurrentindex.qml
@@ -3,7 +3,7 @@
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -38,24 +38,27 @@
**
****************************************************************************/
-//![0]
import QtQuick 2.0
-import Qt.labs.folderlistmodel 1.0
-ListView {
- width: 200; height: 400
+Rectangle {
+ color: "black"
- FolderListModel {
- id: folderModel
- nameFilters: ["*.qml"]
- }
+ Rectangle {
+ color: "red"
- Component {
- id: fileDelegate
- Text { text: fileName }
- }
+ height: 150
+ width: 150
- model: folderModel
- delegate: fileDelegate
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ verticalCenter: parent.verticalCenter
+ }
+
+ NumberAnimation on rotation {
+ from: 0
+ to: 360
+ duration: 5000
+ loops: Animation.Infinite
+ }
+ }
}
-//![0]
diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml
index 52384fe242..0589e7c46b 100644
--- a/tests/auto/qmltest/listview/tst_listview.qml
+++ b/tests/auto/qmltest/listview/tst_listview.qml
@@ -53,6 +53,7 @@ Item {
ListView {
id: viewmanyitems
model: manyitems
+ delegate: Text { text: model.name }
}
ListView {
@@ -67,14 +68,66 @@ Item {
delegate: Text { text: model.name }
}
+ ListView {
+ id: asyncLoaderCurrentIndexListView
+ width: 360
+ height: 360
+ model: asyncLoaderCurrentIndexListModel
+
+ currentIndex: 0
+
+ delegate: Loader {
+ width: asyncLoaderCurrentIndexListView.width
+ height: asyncLoaderCurrentIndexListView.height
+
+ source: component
+ asynchronous: true
+ }
+ }
+
+ ListView {
+ id: asyncListViewLoaderView
+ width: 360
+ height: 360
+ model: asyncListViewLoaderModel
+
+ currentIndex: 0
+
+ delegate: Loader {
+ width: asyncListViewLoaderView.width
+ height: asyncListViewLoaderView.height
+
+ source: component
+ asynchronous: true
+ }
+ }
+
ListModel { id: emptymodel }
ListModel { id: manyitems }
ListModel { id: firstmodel; ListElement { name: "FirstModelElement0" } }
ListModel { id: secondmodel; ListElement { name: "SecondModelElement0" } ListElement { name: "SecondModelElement1" } }
ListModel { id: altermodel; ListElement { name: "AlterModelElement0" } ListElement { name: "AlterModelElement1" } }
+ ListModel {
+ id: asyncLoaderCurrentIndexListModel
+ ListElement { component: "data/asyncloadercurrentindex.qml" }
+ ListElement { component: "data/asyncloadercurrentindex.qml" }
+ ListElement { component: "data/asyncloadercurrentindex.qml" }
+ ListElement { component: "data/asyncloadercurrentindex.qml" }
+ ListElement { component: "data/asyncloadercurrentindex.qml" }
+ ListElement { component: "data/asyncloadercurrentindex.qml" }
+ }
+ ListModel {
+ id: asyncListViewLoaderModel
+ ListElement { component: "data/asynclistviewloader.qml" }
+ ListElement { component: "data/asynclistviewloader.qml" }
+ ListElement { component: "data/asynclistviewloader.qml" }
+ ListElement { component: "data/asynclistviewloader.qml" }
+ ListElement { component: "data/asynclistviewloader.qml" }
+ }
TestCase {
name: "ListView"
+ when: windowShown
function test_empty() {
compare(emptylist.count, 0)
@@ -107,15 +160,16 @@ Item {
manyitems.append({"name":"Item"+i})
}
compare(manyitems.count, row.numitems)
- tryCompare(viewmanyitems.count, row.numitems)
+ tryCompare(viewmanyitems, 'count', row.numitems)
+
}
function test_modelchange() {
- tryCompare(modelchange.count, 1)
+ tryCompare(modelchange, 'count', 1)
modelchange.currentIndex = 0;
compare(modelchange.currentItem.text, "FirstModelElement0")
modelchange.model = secondmodel;
- tryCompare(modelchange.count, 2)
+ tryCompare(modelchange, 'count', 2)
modelchange.currentIndex = 0;
compare(modelchange.currentItem.text, "SecondModelElement0")
modelchange.currentIndex = 1;
@@ -123,13 +177,13 @@ Item {
}
function test_modelaltered() {
- tryCompare(modelalter.count, 2)
+ tryCompare(modelalter, 'count', 2)
modelalter.currentIndex = 0;
compare(modelalter.currentItem.text, "AlterModelElement0")
modelalter.currentIndex = 1;
compare(modelalter.currentItem.text, "AlterModelElement1")
altermodel.append({"name":"AlterModelElement2"})
- tryCompare(modelalter.count, 3)
+ tryCompare(modelalter, 'count', 3)
modelalter.currentIndex = 0;
compare(modelalter.currentItem.text, "AlterModelElement0")
modelalter.currentIndex = 1;
@@ -137,7 +191,7 @@ Item {
modelalter.currentIndex = 2;
compare(modelalter.currentItem.text, "AlterModelElement2")
altermodel.insert(2,{"name":"AlterModelElement1.5"})
- tryCompare(modelalter.count, 4)
+ tryCompare(modelalter, 'count', 4)
modelalter.currentIndex = 0;
compare(modelalter.currentItem.text, "AlterModelElement0")
modelalter.currentIndex = 1;
@@ -147,7 +201,7 @@ Item {
modelalter.currentIndex = 3;
compare(modelalter.currentItem.text, "AlterModelElement2")
altermodel.move(2,1,1);
- tryCompare(modelalter.count, 4)
+ tryCompare(modelalter, 'count', 4)
modelalter.currentIndex = 0;
compare(modelalter.currentItem.text, "AlterModelElement0")
modelalter.currentIndex = 1;
@@ -157,7 +211,7 @@ Item {
modelalter.currentIndex = 3;
compare(modelalter.currentItem.text, "AlterModelElement2")
altermodel.remove(1,2)
- tryCompare(modelalter.count, 2)
+ tryCompare(modelalter, 'count', 2)
modelalter.currentIndex = 0;
compare(modelalter.currentItem.text, "AlterModelElement0")
modelalter.currentIndex = 1;
@@ -169,8 +223,31 @@ Item {
compare(modelalter.currentItem.text, "AlterModelElement1")
altermodel.clear()
modelalter.forceLayout()
- tryCompare(modelalter.count, 0)
+ tryCompare(modelalter, 'count', 0)
compare(modelalter.currentItem, null)
}
+
+ function test_asyncLoaderCurrentIndexChange() {
+ for (var i = 0; i < 500; i++) {
+ asyncLoaderCurrentIndexListView.currentIndex = 0;
+ asyncLoaderCurrentIndexListView.currentIndex = 1;
+ asyncLoaderCurrentIndexListView.currentIndex = 2;
+ asyncLoaderCurrentIndexListView.currentIndex = 3;
+ asyncLoaderCurrentIndexListView.currentIndex = 4;
+ asyncLoaderCurrentIndexListView.currentIndex = 5;
+ }
+ wait(1000)
+ }
+
+ function test_asyncListViewLoader() {
+ for (var i = 0; i < 50; i++) {
+ wait(10);
+ asyncListViewLoaderView.currentIndex = 0;
+ asyncListViewLoaderView.currentIndex = 1;
+ asyncListViewLoaderView.currentIndex = 2;
+ asyncListViewLoaderView.currentIndex = 3;
+ asyncListViewLoaderView.currentIndex = 4;
+ }
+ }
}
}
diff --git a/tests/auto/qmltest/qmltest.pro b/tests/auto/qmltest/qmltest.pro
index 0a7967654c..b1c29226e6 100644
--- a/tests/auto/qmltest/qmltest.pro
+++ b/tests/auto/qmltest/qmltest.pro
@@ -9,5 +9,4 @@ importFiles.files = borderimage buttonclick createbenchmark events qqmlbindi
importFiles.path = .
DEPLOYMENT += importFiles
-mac:CONFIG+=insignificant_test # QTBUG-25306
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qmltest/textedit/tst_textedit.qml b/tests/auto/qmltest/textedit/tst_textedit.qml
index edfa127c59..6e5124253c 100644
--- a/tests/auto/qmltest/textedit/tst_textedit.qml
+++ b/tests/auto/qmltest/textedit/tst_textedit.qml
@@ -179,11 +179,12 @@ Item {
compare(txtlines.lineCount, 3)
txtlines.text = txtlines.styledtextvalue;
compare(txtlines.text, "Line 1<br>Line 2<br>Line 3")
- tryCompare(txtlines.lineCount, 1)
+ tryCompare(txtlines, 'lineCount', 1)
txtlines.textFormat = Text.StyledText;
- tryCompare(txtlines.lineCount, 3)
+ expectFail("", "QTBUG-31191")
+ tryCompare(txtlines, 'lineCount', 3)
txtlines.textFormat = Text.RichText;
- tryCompare(txtlines.lineCount, 3)
+ tryCompare(txtlines, 'lineCount', 3)
}
}
}
diff --git a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
index 201287b2a8..73474afbd7 100644
--- a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
+++ b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
@@ -190,6 +190,9 @@ void tst_qquickanimatedimage::mirror_running()
QImage frame0_expected = frame0.transformed(transform);
QImage frame1_expected = frame1.transformed(transform);
+#ifdef Q_OS_MAC
+ QSKIP("QTBUG-31370 - sometimes fails on Mac");
+#endif
QCOMPARE(frame0_flipped, frame0_expected);
QCOMPARE(frame1_flipped, frame1_expected);
@@ -221,6 +224,9 @@ void tst_qquickanimatedimage::mirror_notRunning()
anim->setProperty("mirror", true);
screenshot = QPixmap::fromImage(window.grabWindow());
+#ifdef Q_OS_MAC
+ QSKIP("QTBUG-31370 - sometimes fails on Mac");
+#endif
QCOMPARE(screenshot, expected);
// mirroring should not change the current frame or playing status
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab6.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab6.qml
new file mode 100644
index 0000000000..22b4d249f0
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab6.qml
@@ -0,0 +1,144 @@
+import QtQuick 2.1
+
+Item {
+ id: main
+ objectName: "main"
+ width: 800
+ height: 600
+ focus: true
+ Component.onCompleted: button12.focus = true
+ Item {
+ id: sub1
+ objectName: "sub1"
+ width: 230
+ height: 600
+ anchors.top: parent.top
+ anchors.left: parent.left
+ Item {
+ id: button11
+ objectName: "button11"
+ width: 100
+ height: 50
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Table
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+
+ anchors.top: parent.top
+ anchors.topMargin: 100
+ }
+ Item {
+ id: button12
+ objectName: "button12"
+ activeFocusOnTab: true
+ Accessible.role: Accessible.List
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ width: 100
+ height: 50
+
+ anchors.top: button11.bottom
+ anchors.bottomMargin: 100
+ }
+ Item {
+ id: button13
+ objectName: "button13"
+ enabled: false
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Table
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ width: 100
+ height: 50
+
+ anchors.top: button12.bottom
+ anchors.bottomMargin: 100
+ }
+ Item {
+ id: button14
+ objectName: "button14"
+ visible: false
+ activeFocusOnTab: true
+ Accessible.role: Accessible.List
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ width: 100
+ height: 50
+
+ anchors.top: button12.bottom
+ anchors.bottomMargin: 100
+ }
+ }
+ Item {
+ id: sub2
+ objectName: "sub2"
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Row
+ width: 230
+ height: 600
+ anchors.top: parent.top
+ anchors.left: sub1.right
+ Item {
+ id: button21
+ objectName: "button21"
+ width: 100
+ height: 50
+ activeFocusOnTab: true
+ Accessible.role: Accessible.PushButton
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+
+ anchors.top: parent.top
+ anchors.topMargin: 100
+ }
+ Item {
+ id: button22
+ objectName: "button22"
+ width: 100
+ height: 50
+ activeFocusOnTab: true
+ Accessible.role: Accessible.RadioButton
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+
+ anchors.top: button21.bottom
+ anchors.bottomMargin: 100
+ }
+ }
+ Item {
+ id: sub3
+ objectName: "sub3"
+ width: 230
+ height: 600
+ anchors.top: parent.top
+ anchors.left: sub2.right
+ TextEdit {
+ id: edit
+ objectName: "edit"
+ width: 230
+ height: 400
+ readOnly: false
+ activeFocusOnTab: true
+ Accessible.role: Accessible.EditableText
+ wrapMode: TextEdit.Wrap
+ textFormat: TextEdit.RichText
+
+ text: "aaa\n"
+ +"bbb\n"
+ +"ccc\n"
+ +"ddd\n"
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab7.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab7.qml
new file mode 100644
index 0000000000..e81d9be950
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab7.qml
@@ -0,0 +1,36 @@
+import QtQuick 2.1
+
+Item {
+ id: main
+ objectName: "main"
+ width: 300
+ height: 300
+ Item {
+ id: button1
+ objectName: "button1"
+ width: 300
+ height: 150
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Button
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ anchors.top: parent.top
+ anchors.left: parent.left
+ }
+ Item {
+ id: button2
+ objectName: "button2"
+ width: 300
+ height: 150
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Button
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab8.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab8.qml
new file mode 100644
index 0000000000..641a39c1fa
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab8.qml
@@ -0,0 +1,36 @@
+import QtQuick 2.1
+
+Item {
+ id: main
+ objectName: "main"
+ width: 300
+ height: 300
+ Item {
+ id: button1
+ objectName: "button1"
+ width: 300
+ height: 150
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Table
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ anchors.top: parent.top
+ anchors.left: parent.left
+ }
+ Item {
+ id: button2
+ objectName: "button2"
+ width: 300
+ height: 150
+ activeFocusOnTab: true
+ Accessible.role: Accessible.Table
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/data/resourcesProperty.qml b/tests/auto/quick/qquickitem2/data/resourcesProperty.qml
index b8f18bb375..2c4c0aa5c1 100644
--- a/tests/auto/quick/qquickitem2/data/resourcesProperty.qml
+++ b/tests/auto/quick/qquickitem2/data/resourcesProperty.qml
@@ -8,14 +8,27 @@ Item {
property bool test3
property bool test4
property bool test5
+ property bool test6
Component.onCompleted: {
- test1 = (root.resources.length >= 3)
- test2 = root.resources[0] == item1
- test3 = root.resources[1] == item2
- test4 = root.resources[2] == item3
- test5 = root.resources[10] == null
+ test1 = (root.resources.length === 4)
+ test2 = root.resources[0] === item1
+ test3 = root.resources[1] === item2
+ test4 = root.resources[2] === item3
+ test5 = root.resources[3] === otherObject
+ test6 = root.resources[10] == null
}
+ //Resources can be used explicitly
resources: [ Item { id: item1 }, Item { id: item2 }, Item { id: item3 } ]
+
+ Item {
+ //Item in Data go the children property.
+ }
+
+ QtObject {
+ //Objects in Data which are not items are put in resources.
+ id: otherObject
+ objectName: "subObject";
+ }
}
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 3ec77ce950..992e81aa64 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -47,6 +47,7 @@
#include <QtGui/private/qinputmethod_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/private/qquicktextinput_p.h>
+#include <QtGui/qpa/qplatformtheme.h>
#include <private/qquickitem_p.h>
#include "../../shared/util.h"
#include "../shared/visualtestutil.h"
@@ -69,8 +70,12 @@ private slots:
void activeFocusOnTab3();
void activeFocusOnTab4();
void activeFocusOnTab5();
+ void activeFocusOnTab6();
+ void activeFocusOnTab7();
+ void activeFocusOnTab8();
void nextItemInFocusChain();
+ void nextItemInFocusChain2();
void keys();
void keysProcessingOrder();
@@ -110,6 +115,11 @@ private slots:
private:
QQmlEngine engine;
+ bool qt_tab_all_widgets() {
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
+ return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool();
+ return true;
+ }
};
class KeysTestObject : public QObject
@@ -283,6 +293,9 @@ void tst_QQuickItem::cleanup()
void tst_QQuickItem::activeFocusOnTab()
{
+ if (!qt_tab_all_widgets())
+ QSKIP("This function doesn't support NOT iterating all.");
+
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(800,600));
@@ -392,6 +405,9 @@ void tst_QQuickItem::activeFocusOnTab()
void tst_QQuickItem::activeFocusOnTab2()
{
+ if (!qt_tab_all_widgets())
+ QSKIP("This function doesn't support NOT iterating all.");
+
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(800,600));
@@ -429,6 +445,9 @@ void tst_QQuickItem::activeFocusOnTab2()
void tst_QQuickItem::activeFocusOnTab3()
{
+ if (!qt_tab_all_widgets())
+ QSKIP("This function doesn't support NOT iterating all.");
+
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(800,600));
@@ -608,6 +627,9 @@ void tst_QQuickItem::activeFocusOnTab3()
void tst_QQuickItem::activeFocusOnTab4()
{
+ if (!qt_tab_all_widgets())
+ QSKIP("This function doesn't support NOT iterating all.");
+
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(800,600));
@@ -637,6 +659,9 @@ void tst_QQuickItem::activeFocusOnTab4()
void tst_QQuickItem::activeFocusOnTab5()
{
+ if (!qt_tab_all_widgets())
+ QSKIP("This function doesn't support NOT iterating all.");
+
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(800,600));
@@ -666,8 +691,154 @@ void tst_QQuickItem::activeFocusOnTab5()
delete window;
}
+void tst_QQuickItem::activeFocusOnTab6()
+{
+ if (qt_tab_all_widgets())
+ QSKIP("This function doesn't support iterating all.");
+
+ QQuickView *window = new QQuickView(0);
+ window->setBaseSize(QSize(800,600));
+
+ window->setSource(testFileUrl("activeFocusOnTab6.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QGuiApplication::focusWindow() == window);
+
+ // original: button12
+ QQuickItem *item = findItem<QQuickItem>(window->rootObject(), "button12");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // Tab: button12->edit
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QQuickItem>(window->rootObject(), "edit");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // BackTab: edit->button12
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QQuickItem>(window->rootObject(), "button12");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // BackTab: button12->button11
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QQuickItem>(window->rootObject(), "button11");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // BackTab: button11->edit
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QQuickItem>(window->rootObject(), "edit");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete window;
+}
+
+void tst_QQuickItem::activeFocusOnTab7()
+{
+ if (qt_tab_all_widgets())
+ QSKIP("This function doesn't support iterating all.");
+
+ QQuickView *window = new QQuickView(0);
+ window->setBaseSize(QSize(300,300));
+
+ window->setSource(testFileUrl("activeFocusOnTab7.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QGuiApplication::focusWindow() == window);
+
+ QQuickItem *item = findItem<QQuickItem>(window->rootObject(), "button1");
+ QVERIFY(item);
+ item->forceActiveFocus();
+ QVERIFY(item->hasActiveFocus());
+
+ // Tab: button1->button1
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(!key.isAccepted());
+
+ QVERIFY(item->hasActiveFocus());
+
+ // BackTab: button1->button1
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(!key.isAccepted());
+
+ QVERIFY(item->hasActiveFocus());
+
+ delete window;
+}
+
+void tst_QQuickItem::activeFocusOnTab8()
+{
+ QQuickView *window = new QQuickView(0);
+ window->setBaseSize(QSize(300,300));
+
+ window->setSource(testFileUrl("activeFocusOnTab8.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QGuiApplication::focusWindow() == window);
+
+ QQuickItem *content = window->contentItem();
+ QVERIFY(content);
+ QVERIFY(content->hasActiveFocus());
+
+ QQuickItem *button1 = findItem<QQuickItem>(window->rootObject(), "button1");
+ QVERIFY(button1);
+ QVERIFY(!button1->hasActiveFocus());
+
+ QQuickItem *button2 = findItem<QQuickItem>(window->rootObject(), "button2");
+ QVERIFY(button2);
+ QVERIFY(!button2->hasActiveFocus());
+
+ // Tab: contentItem->button1
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ QVERIFY(button1->hasActiveFocus());
+
+ // Tab: button1->button2
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ QVERIFY(button2->hasActiveFocus());
+ QVERIFY(!button1->hasActiveFocus());
+
+ // BackTab: button2->button1
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ QVERIFY(button1->hasActiveFocus());
+ QVERIFY(!button2->hasActiveFocus());
+
+ delete window;
+}
+
void tst_QQuickItem::nextItemInFocusChain()
{
+ if (!qt_tab_all_widgets())
+ QSKIP("This function doesn't support NOT iterating all.");
+
QQuickView *window = new QQuickView(0);
window->setBaseSize(QSize(800,600));
@@ -739,6 +910,54 @@ void tst_QQuickItem::nextItemInFocusChain()
delete window;
}
+void tst_QQuickItem::nextItemInFocusChain2()
+{
+ if (qt_tab_all_widgets())
+ QSKIP("This function doesn't support iterating all.");
+
+ QQuickView *window = new QQuickView(0);
+ window->setBaseSize(QSize(800,600));
+
+ window->setSource(testFileUrl("activeFocusOnTab6.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QGuiApplication::focusWindow() == window);
+
+ QQuickItem *button11 = findItem<QQuickItem>(window->rootObject(), "button11");
+ QVERIFY(button11);
+ QQuickItem *button12 = findItem<QQuickItem>(window->rootObject(), "button12");
+ QVERIFY(button12);
+
+ QQuickItem *edit = findItem<QQuickItem>(window->rootObject(), "edit");
+ QVERIFY(edit);
+
+ QQuickItem *next, *prev;
+
+ next = button11->nextItemInFocusChain(true);
+ QVERIFY(next);
+ QCOMPARE(next, button12);
+ prev = button11->nextItemInFocusChain(false);
+ QVERIFY(prev);
+ QCOMPARE(prev, edit);
+
+ next = button12->nextItemInFocusChain();
+ QVERIFY(next);
+ QCOMPARE(next, edit);
+ prev = button12->nextItemInFocusChain(false);
+ QVERIFY(prev);
+ QCOMPARE(prev, button11);
+
+ next = edit->nextItemInFocusChain();
+ QVERIFY(next);
+ QCOMPARE(next, button11);
+ prev = edit->nextItemInFocusChain(false);
+ QVERIFY(prev);
+ QCOMPARE(prev, button12);
+
+ delete window;
+}
+
void tst_QQuickItem::keys()
{
QQuickView *window = new QQuickView(0);
@@ -1708,15 +1927,35 @@ void tst_QQuickItem::resourcesProperty()
{
QQmlComponent component(&engine, testFileUrl("resourcesProperty.qml"));
- QObject *o = component.create();
- QVERIFY(o != 0);
+ QObject *object = component.create();
+ QVERIFY(object != 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;
+ QQmlProperty property(object, "resources", component.creationContext());
+
+ QVERIFY(property.isValid());
+ QQmlListReference list = qvariant_cast<QQmlListReference>(property.read());
+ QVERIFY(list.isValid());
+
+ QCOMPARE(list.count(), 4);
+
+ QCOMPARE(object->property("test1").toBool(), true);
+ QCOMPARE(object->property("test2").toBool(), true);
+ QCOMPARE(object->property("test3").toBool(), true);
+ QCOMPARE(object->property("test4").toBool(), true);
+ QCOMPARE(object->property("test5").toBool(), true);
+ QCOMPARE(object->property("test6").toBool(), true);
+
+ QObject *subObject = object->findChild<QObject *>("subObject");
+
+ QVERIFY(subObject);
+
+ QCOMPARE(object, subObject->parent());
+
+ delete subObject;
+
+ QCOMPARE(list.count(), 3);
+
+ delete object;
}
void tst_QQuickItem::propertyChanges()
diff --git a/tests/auto/quick/qquickwindow/data/active.qml b/tests/auto/quick/qquickwindow/data/active.qml
new file mode 100644
index 0000000000..af0b7edeb2
--- /dev/null
+++ b/tests/auto/quick/qquickwindow/data/active.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.1
+import QtQuick.Window 2.1
+
+Window {
+ id: window1;
+ objectName: "window1";
+ color: "#00FF00";
+ width: 100; height: 100;
+ Item {
+ objectName: "item1"
+ width: 100; height: 100;
+ MouseArea {
+ objectName: "mousearea"
+ anchors.fill: parent;
+ onPressed: window2.requestActivate();
+ }
+ Component.onCompleted: window2.show();
+ }
+
+ Window {
+ id: window2;
+ objectName: "window2";
+ color: "#FF0000";
+ width: 100; height: 100;
+ Item {
+ width: 100; height: 100;
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickwindow/data/ucantclosethis.qml b/tests/auto/quick/qquickwindow/data/ucantclosethis.qml
new file mode 100644
index 0000000000..aa68cf5105
--- /dev/null
+++ b/tests/auto/quick/qquickwindow/data/ucantclosethis.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.1
+import QtQuick.Window 2.1
+
+Window {
+ width: 240
+ height: 75
+ title: "Hammer sez"
+ color: "#e0c31e"
+ property bool canCloseThis: false;
+ Rectangle {
+ color: "#14148c"
+ width: parent.width * 0.85
+ height: parent.height * 0.7
+ anchors.horizontalCenter: parent.horizontalCenter
+ Text {
+ id: text
+ anchors.centerIn: parent
+ color: "white"
+ textFormat: Text.StyledText
+ text: "whoa-oa-oa-oh<br/>U can't <font color='#b40000' size='+1'>close</font> this"
+ }
+ }
+ onClosing: {
+ if (canCloseThis) {
+ text.text = "uncle! I give up"
+ // the event is accepted by default
+ } else {
+ close.accepted = false
+ text.text = "...but you still can't close this"
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickwindow/qquickwindow.pro b/tests/auto/quick/qquickwindow/qquickwindow.pro
index b1fc5cd4f2..917e3a5196 100644
--- a/tests/auto/quick/qquickwindow/qquickwindow.pro
+++ b/tests/auto/quick/qquickwindow/qquickwindow.pro
@@ -11,6 +11,7 @@ QT += core-private gui-private qml-private quick-private v8-private testlib
TESTDATA = data/*
OTHER_FILES += \
+ data/active.qml \
data/AnimationsWhileHidden.qml \
data/Headless.qml \
data/showHideAnimate.qml
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index dbf0086a3e..e2bb6b431c 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -48,6 +48,7 @@
#include <QtQml/QQmlComponent>
#include <QtQuick/private/qquickrectangle_p.h>
#include "../../shared/util.h"
+#include "../shared/visualtestutil.h"
#include <QSignalSpy>
#include <qpa/qwindowsysteminterface.h>
#include <private/qquickwindow_p.h>
@@ -323,6 +324,10 @@ private slots:
void testExpose();
+ void requestActivate();
+
+ void blockClosing();
+
#ifndef QT_NO_CURSOR
void cursor();
#endif
@@ -1414,6 +1419,74 @@ void tst_qquickwindow::testExpose()
QTRY_COMPARE(swapSpy.size(), 1);
}
+void tst_qquickwindow::requestActivate()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("active.qml"));
+ QQuickWindow* window1 = qobject_cast<QQuickWindow *>(component.create());
+ QVERIFY(window1);
+
+ QWindowList windows = QGuiApplication::topLevelWindows();
+ QVERIFY(windows.size() == 2);
+
+ for (int i = 0; i < windows.size(); ++i) {
+ if (windows.at(i)->objectName() == window1->objectName()) {
+ windows.removeAt(i);
+ break;
+ }
+ }
+ QVERIFY(windows.size() == 1);
+ QVERIFY(windows.at(0)->objectName() == "window2");
+
+ window1->show();
+ window1->requestActivate();
+
+ QTRY_VERIFY(QGuiApplication::focusWindow() == window1);
+ QVERIFY(window1->isActive() == true);
+
+ QQuickItem *item = QQuickVisualTestUtil::findItem<QQuickItem>(window1->contentItem(), "item1");
+ QVERIFY(item);
+
+ //copied from src/qmltest/quicktestevent.cpp
+ QPoint pos = item->mapToScene(QPointF(item->width()/2, item->height()/2)).toPoint();
+
+ QMouseEvent me(QEvent::MouseButtonPress, pos, window1->mapToGlobal(pos), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
+ QSpontaneKeyEvent::setSpontaneous(&me);
+ if (!qApp->notify(window1, &me)) {
+ QString warning = QString::fromLatin1("Mouse event MousePress not accepted by receiving window");
+ QWARN(warning.toLatin1().data());
+ }
+ me = QMouseEvent(QEvent::MouseButtonPress, pos, window1->mapToGlobal(pos), Qt::LeftButton, 0, Qt::NoModifier);
+ QSpontaneKeyEvent::setSpontaneous(&me);
+ if (!qApp->notify(window1, &me)) {
+ QString warning = QString::fromLatin1("Mouse event MouseRelease not accepted by receiving window");
+ QWARN(warning.toLatin1().data());
+ }
+
+ QTRY_VERIFY(QGuiApplication::focusWindow() == windows.at(0));
+ QVERIFY(windows.at(0)->isActive());
+}
+
+void tst_qquickwindow::blockClosing()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("ucantclosethis.qml"));
+ QQuickWindow* window = qobject_cast<QQuickWindow *>(component.create());
+ QVERIFY(window);
+ window->show();
+ QTest::qWaitForWindowExposed(window);
+ QVERIFY(window->isVisible());
+ QWindowSystemInterface::handleCloseEvent(window);
+ QVERIFY(window->isVisible());
+ QWindowSystemInterface::handleCloseEvent(window);
+ QVERIFY(window->isVisible());
+ window->setProperty("canCloseThis", true);
+ QWindowSystemInterface::handleCloseEvent(window);
+ QTRY_VERIFY(!window->isVisible());
+}
+
QTEST_MAIN(tst_qquickwindow)
#include "tst_qquickwindow.moc"
diff --git a/tests/manual/qmltypememory/README b/tests/manual/qmltypememory/README
new file mode 100644
index 0000000000..b1237a1fc7
--- /dev/null
+++ b/tests/manual/qmltypememory/README
@@ -0,0 +1,3 @@
+This test just continually builds up and tears down a QML scene. Watch over a long period to see if the memory usage goes up.
+
+This test specifically is targeting the QQmlType cache which is a global static.
diff --git a/src/quick/doc/snippets/qml/usecases/userinput.qml b/tests/manual/qmltypememory/TestPlugin/plugin.cpp
index 5aabcde18e..40c2af20f5 100644
--- a/src/quick/doc/snippets/qml/usecases/userinput.qml
+++ b/tests/manual/qmltypememory/TestPlugin/plugin.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Research In Motion.
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
@@ -38,33 +38,26 @@
**
****************************************************************************/
-//![0]
-import QtQuick 2.0
+#include <QtQml/QQmlExtensionPlugin>
+#include <QtQml/qqml.h>
+#include <qdebug.h>
-Item {
- id: root
+class TestType : public QObject
+{
+ Q_OBJECT
+};
- width: 320
- height: 480
+class TestPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
- Rectangle {
- color: "#272822"
- width: 320
- height: 480
+public:
+ void registerTypes(const char *uri)
+ {
+ Q_ASSERT(uri == QLatin1String("TestPlugin"));
+ qmlRegisterType<TestType>(uri, 1, 0, "TestTypePlugin");
}
+};
- Rectangle {
- id: rectangle
- x: 40
- y: 20
- width: 120
- height: 120
- color: "red"
-
- MouseArea {
- anchors.fill: parent
- onClicked: rectangle.width += 10
- }
- }
-}
-//![0]
+#include "plugin.moc"
diff --git a/tests/manual/qmltypememory/TestPlugin/plugin.pro b/tests/manual/qmltypememory/TestPlugin/plugin.pro
new file mode 100644
index 0000000000..7575442800
--- /dev/null
+++ b/tests/manual/qmltypememory/TestPlugin/plugin.pro
@@ -0,0 +1,7 @@
+TEMPLATE = lib
+CONFIG += plugin
+QT += qml
+
+TARGET = testplugin
+
+SOURCES += plugin.cpp
diff --git a/tests/manual/qmltypememory/TestPlugin/qmldir b/tests/manual/qmltypememory/TestPlugin/qmldir
new file mode 100644
index 0000000000..f0624dfd82
--- /dev/null
+++ b/tests/manual/qmltypememory/TestPlugin/qmldir
@@ -0,0 +1,2 @@
+module TestPlugin
+plugin testplugin
diff --git a/tests/manual/qmltypememory/TestType.qml b/tests/manual/qmltypememory/TestType.qml
new file mode 100644
index 0000000000..59e0bcf477
--- /dev/null
+++ b/tests/manual/qmltypememory/TestType.qml
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQml 2.0
+QtObject{property int notJustAStandardQtObject: 10 }
diff --git a/tests/manual/qmltypememory/main.cpp b/tests/manual/qmltypememory/main.cpp
new file mode 100644
index 0000000000..da086ec9f7
--- /dev/null
+++ b/tests/manual/qmltypememory/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQml>
+#include <QGuiApplication>
+#include "testdriver.h"
+
+int main (int argc, char* argv[])
+{
+ QGuiApplication app(argc, argv);
+ int i = -1;
+ if (argc > 1)
+ i = atoi(argv[1]);
+ if (i < 1)
+ i = -1;
+ TestDriver td(QUrl::fromLocalFile("main.qml"), i);
+ return app.exec();
+}
diff --git a/tests/manual/qmltypememory/main.qml b/tests/manual/qmltypememory/main.qml
new file mode 100644
index 0000000000..7bc9006aec
--- /dev/null
+++ b/tests/manual/qmltypememory/main.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQml 2.0
+import QtQuick 2.0
+import QtQuick.Window 2.0
+import QtQuick.LocalStorage 2.0
+import Test 2.0
+import TestPlugin 1.0
+import "."
+
+QtObject {
+ property TestType tt //No object, although it should be properly parented if there were one
+ property TestTypeCpp tt2 //No object, although it should be properly parented if there were one
+ property TestTypePlugin tt3
+}
diff --git a/tests/manual/qmltypememory/qmldir b/tests/manual/qmltypememory/qmldir
new file mode 100644
index 0000000000..edb8c894c4
--- /dev/null
+++ b/tests/manual/qmltypememory/qmldir
@@ -0,0 +1,2 @@
+TestFromDir 2.0 TestType.qml
+internal TestFromDirInt TestType.qml
diff --git a/tests/manual/qmltypememory/qmltypememory.pro b/tests/manual/qmltypememory/qmltypememory.pro
new file mode 100644
index 0000000000..2bd873d554
--- /dev/null
+++ b/tests/manual/qmltypememory/qmltypememory.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = qmltypememory
+INCLUDEPATH += .
+QT += qml
+
+# Input
+HEADERS += testdriver.h
+SOURCES += main.cpp testdriver.cpp
diff --git a/tests/manual/qmltypememory/testdriver.cpp b/tests/manual/qmltypememory/testdriver.cpp
new file mode 100644
index 0000000000..42de18c4d4
--- /dev/null
+++ b/tests/manual/qmltypememory/testdriver.cpp
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "testdriver.h"
+#include <QCoreApplication>
+const int interval = 0;
+
+QObject* singleFactory(QQmlEngine *, QJSEngine*)
+{
+ QObject* ret = new QObject; //NOTE: No parent - but also shouldn't need to be created
+ return ret;
+}
+
+TestDriver::TestDriver(const QUrl &componentUrl, int maxIter)
+ : QObject(0), e(0), c(0), i(maxIter)
+{
+ testFile = componentUrl;
+ QTimer::singleShot(interval, this, SLOT(setUp()));
+}
+
+void TestDriver::setUp()
+{
+ qmlRegisterType<TestType>("Test", 2, 0, "TestTypeCpp");
+ for (int j=2; j<1000; j++) {
+ qmlRegisterType<TestType>("Test", j, 0, "TestType");
+ qmlRegisterType<TestType>("Test", j, 1, "TestType");
+ qmlRegisterType<TestType>("Test", j, 2, "TestType");
+ qmlRegisterType<TestType>("Test", j, 3, "TestType");
+ qmlRegisterType<TestType>("Test", j, 4, "TestType");
+ qmlRegisterType<TestType>("Test", j, 5, "TestType");
+ qmlRegisterType<TestType>("Test", j, 6, "TestType");
+ qmlRegisterType<TestType>("Test", j, 7, "TestType");
+ qmlRegisterType<TestType>("Test", j, 8, "TestType");
+ qmlRegisterType<TestType>("Test", j, 9, "TestType");
+ }
+ qmlRegisterType<TestType>("Test2", 1, 0, "TestType");
+ qmlRegisterType<TestType>("Test2", 3, 0, "TestType");
+ qmlRegisterType<TestType>("Test3", 9, 0, "TestType");
+ qmlRegisterType(QUrl::fromLocalFile(QDir::currentPath() + QLatin1String("TestType.qml")), "Test", 2, 0, "TestType2");
+ qmlRegisterUncreatableType<TestType2>("Test", 2, 0, "CannotDoThis", QLatin1String("Just don't"));
+ qmlRegisterType<TestType3>();
+ qmlRegisterSingletonType<QObject>("Test", 2, 0, "Singlet", singleFactory);
+
+ e = new QQmlEngine(this);
+ c = new QQmlComponent(e, testFile);
+ QObject* unused = c->create();
+ if (!unused) {
+ qDebug() << "Creation failure" << c->errorString();
+ exit(1);
+ }
+ unused->setParent(c); //Not testing leaky objects in the tree
+ QTimer::singleShot(interval, this, SLOT(tearDown()));
+}
+
+void TestDriver::tearDown()
+{
+ delete c;
+ e->collectGarbage();
+ delete e;
+ qmlClearTypeRegistrations();
+ //Note that i < 0 will effectively never terminate. This is deliberate as a prime use is to run indefinitely and watch the memory *not* grow
+ i--;
+ if (!i)
+ qApp->quit();
+ else
+ QTimer::singleShot(interval, this, SLOT(setUp()));
+}
diff --git a/tests/manual/qmltypememory/testdriver.h b/tests/manual/qmltypememory/testdriver.h
new file mode 100644
index 0000000000..711a725aa1
--- /dev/null
+++ b/tests/manual/qmltypememory/testdriver.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Research In Motion.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the manual tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** 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, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TESTDRIVER_H
+#define TESTDRIVER_H
+#include <QtCore>
+#include <QtQml>
+
+class TestDriver : public QObject
+{
+ Q_OBJECT
+public:
+ TestDriver(const QUrl &componentUrl, int maxIter = -1);
+public slots:
+ void setUp();
+ void tearDown();
+private:
+ QUrl testFile;
+ QQmlEngine* e;
+ QQmlComponent* c;
+ signed long int i;
+};
+
+class TestType : public QObject { Q_OBJECT };
+class TestType2 : public QObject { Q_OBJECT };
+class TestType3 : public QObject { Q_OBJECT };
+#endif
diff --git a/tools/qmlplugindump/qmlplugindump.pro b/tools/qmlplugindump/qmlplugindump.pro
index b777e0da75..0829173abe 100644
--- a/tools/qmlplugindump/qmlplugindump.pro
+++ b/tools/qmlplugindump/qmlplugindump.pro
@@ -9,7 +9,12 @@ SOURCES += \
HEADERS += \
qmlstreamwriter.h
-OTHER_FILES += Info.plist
-macx: QMAKE_INFO_PLIST = Info.plist
+mac {
+ # Prevent qmlplugindump from popping up in the dock when launched.
+ # We embed the Info.plist file, so the application doesn't need to
+ # be a bundle.
+ QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$shell_quote($$PWD/Info.plist)
+ CONFIG -= app_bundle
+}
load(qt_tool)
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index afc4be875c..d572487218 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -491,7 +491,6 @@ int main(int argc, char ** argv)
// Set window default properties; the qml can still override them
QString oname = contentItem->objectName();
window->setTitle(oname.isEmpty() ? QString::fromLatin1("qmlscene") : QString::fromLatin1("qmlscene: ") + oname);
- window->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint);
if (options.resizeViewToRootItem)
qxView->setResizeMode(QQuickView::SizeViewToRootObject);
else
@@ -512,11 +511,14 @@ int main(int argc, char ** argv)
}
window->setFormat(surfaceFormat);
+ if (window->flags() == Qt::Window) // Fix window flags unless set by QML.
+ window->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowFullscreenButtonHint);
+
if (options.fullscreen)
window->showFullScreen();
else if (options.maximized)
window->showMaximized();
- else
+ else if (!window->isVisible())
window->show();
}
diff --git a/tools/tools.pro b/tools/tools.pro
index 86e2f3804f..eda9e85c8c 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -6,3 +6,14 @@ SUBDIRS += \
qmlprofiler \
qmlbundle
qtHaveModule(quick):qtHaveModule(widgets): SUBDIRS += qmleasing
+
+# qmlmin & qmlbundle are build tools.
+# qmlscene is needed by the autotests.
+# qmltestrunner may be useful for manual testing.
+# qmlplugindump cannot be a build tool, because it loads target plugins.
+# The other apps are mostly "desktop" tools and are thus excluded.
+qtNomakeTools( \
+ qmlprofiler \
+ qmlplugindump \
+ qmleasing \
+)