aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2012-05-28 11:56:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-31 10:40:41 +0200
commit4c671c046e8140bfb8372aab2c38aabe82b102b0 (patch)
tree7a70a75a553dcc806372a6b43ea39da05191db8a
parent0c7669b241aae96fca97acae0b628e627d5bfc4e (diff)
Fix doc snippets paths and parsing errors
qtqml.qdocconf and qtquick.qdocconf now refer to the correct snippets and source directories. Snippet paths in .qdoc and .cpp files have been updated to refer to the new shortened path references, e.g. \snippet qml/file.cpp instead of \snippet doc/src/snippets/qml/file.cpp. This also deletes snippets from src/qml/doc/snippets that belonged under src/quick/doc/snippets (and were already duplicated there anyway) and restores some snippet files that shouldn't have been deleted. Also fixes some inline snippets to use \code .. \endcode instead of \qml .. \endqml as they contained javascript or partial QML snippets that were causing parsing errors from qdoc. There are still snippet errors arising from qmlintro.qdoc as the qmlintro snippets directory that it refers to cannot be located. There are also two references to a removed snippet identifier in examples/qml/cppextensions/plugins/plugin.cpp that need to be fixed in conjunction with the related docs in a later commit as the relevant code has changed and the docs are now invalid. Task-number: QTBUG-25721 Change-Id: I50c665245a74c140470c58a32546591d187dfe4b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
-rw-r--r--doc/src/examples/advtutorial.qdoc74
-rw-r--r--doc/src/examples/dynamicview-tutorial.qdoc66
-rw-r--r--doc/src/examples/example-slideswitch.qdoc20
-rw-r--r--doc/src/examples/example-textballoons.qdoc10
-rw-r--r--examples/tutorials/ui-components/dialcontrol/dialcontrol.qml2
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp2
-rw-r--r--src/imports/localstorage/plugin.cpp2
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp6
-rw-r--r--src/qml/doc/qtqml.qdocconf3
-rw-r--r--src/qml/doc/snippets/qml/DynamicText.qml52
-rw-r--r--src/qml/doc/snippets/qml/anchorchanges.qml68
-rw-r--r--src/qml/doc/snippets/qml/animatedimage.qml61
-rw-r--r--src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml81
-rw-r--r--src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml81
-rw-r--r--src/qml/doc/snippets/qml/borderimage/normal-image.qml77
-rw-r--r--src/qml/doc/snippets/qml/column/column-transitions.qml58
-rw-r--r--src/qml/doc/snippets/qml/column/vertical-positioner.qml51
-rw-r--r--src/qml/doc/snippets/qml/drag.qml75
-rw-r--r--src/qml/doc/snippets/qml/flickableScrollbar.qml66
-rw-r--r--src/qml/doc/snippets/qml/flipable/flipable.qml78
-rw-r--r--src/qml/doc/snippets/qml/flow.qml64
-rw-r--r--src/qml/doc/snippets/qml/gradient.qml52
-rw-r--r--src/qml/doc/snippets/qml/grid/grid.qml53
-rw-r--r--src/qml/doc/snippets/qml/gridview/ContactModel.qml63
-rw-r--r--src/qml/doc/snippets/qml/gridview/gridview.qml163
-rw-r--r--src/qml/doc/snippets/qml/keynavigation.qml84
-rw-r--r--src/qml/doc/snippets/qml/keys/keys-handler.qml60
-rw-r--r--src/qml/doc/snippets/qml/keys/keys-pressed.qml65
-rw-r--r--src/qml/doc/snippets/qml/layoutmirroring.qml71
-rw-r--r--src/qml/doc/snippets/qml/listmodel/listelements.qml (renamed from src/qml/doc/snippets/qml/qml-data-models/listelements.qml)0
-rw-r--r--src/qml/doc/snippets/qml/listmodel/listmodel-modify.qml (renamed from src/qml/doc/snippets/qml/listmodel-modify.qml)0
-rw-r--r--src/qml/doc/snippets/qml/listmodel/listmodel-nested.qml (renamed from src/qml/doc/snippets/qml/listmodel-nested.qml)0
-rw-r--r--src/qml/doc/snippets/qml/listmodel/listmodel-simple.qml (renamed from src/qml/doc/snippets/qml/listmodel-simple.qml)0
-rw-r--r--src/qml/doc/snippets/qml/listmodel/listmodel.qml (renamed from src/qml/doc/snippets/qml/listmodel.qml)0
-rw-r--r--src/qml/doc/snippets/qml/listview/ContactModel.qml58
-rw-r--r--src/qml/doc/snippets/qml/listview/listview.qml149
-rw-r--r--src/qml/doc/snippets/qml/loader/KeyReader.qml53
-rw-r--r--src/qml/doc/snippets/qml/loader/MyItem.qml55
-rw-r--r--src/qml/doc/snippets/qml/loader/connections.qml57
-rw-r--r--src/qml/doc/snippets/qml/loader/focus.qml62
-rw-r--r--src/qml/doc/snippets/qml/loader/simple.qml54
-rw-r--r--src/qml/doc/snippets/qml/loader/sizeitem.qml62
-rw-r--r--src/qml/doc/snippets/qml/loader/sizeloader.qml62
-rw-r--r--src/qml/doc/snippets/qml/mousearea/mousearea.qml117
-rw-r--r--src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml72
-rw-r--r--src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml67
-rw-r--r--src/qml/doc/snippets/qml/parentanimation.qml73
-rw-r--r--src/qml/doc/snippets/qml/path/arcradius.qml63
-rw-r--r--src/qml/doc/snippets/qml/path/basiccurve.qml63
-rw-r--r--src/qml/doc/snippets/qml/path/largearc.qml51
-rw-r--r--src/qml/doc/snippets/qml/pathinterpolator.qml74
-rw-r--r--src/qml/doc/snippets/qml/pathview/ContactModel.qml58
-rw-r--r--src/qml/doc/snippets/qml/pathview/pathattributes.qml79
-rw-r--r--src/qml/doc/snippets/qml/pathview/pathview.qml80
-rw-r--r--src/qml/doc/snippets/qml/propertyaction-sequential.qml72
-rw-r--r--src/qml/doc/snippets/qml/propertyaction.qml83
-rw-r--r--src/qml/doc/snippets/qml/propertyanimation.qml100
-rw-r--r--src/qml/doc/snippets/qml/propertychanges.qml91
-rw-r--r--src/qml/doc/snippets/qml/qtBinding.1.qml (renamed from src/qml/doc/snippets/qml/sequentialanimation.qml)19
-rw-r--r--src/qml/doc/snippets/qml/qtBinding.2.qml (renamed from src/qml/doc/snippets/qml/anchoranimation.qml)26
-rw-r--r--src/qml/doc/snippets/qml/qtBinding.3.qml (renamed from src/qml/doc/snippets/qml/parentchange.qml)32
-rw-r--r--src/qml/doc/snippets/qml/qtBinding.4.qml (renamed from src/qml/doc/snippets/qml/parallelanimation.qml)18
-rw-r--r--src/qml/doc/snippets/qml/qtbinding/resources/example.qrc10
-rw-r--r--src/qml/doc/snippets/qml/qtbinding/resources/resources.pro4
-rw-r--r--src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml62
-rw-r--r--src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml74
-rw-r--r--src/qml/doc/snippets/qml/repeaters/repeater.qml89
-rw-r--r--src/qml/doc/snippets/qml/righttoleft.qml149
-rw-r--r--src/qml/doc/snippets/qml/righttoleft/Child.qml51
-rw-r--r--src/qml/doc/snippets/qml/rotationanimation.qml66
-rw-r--r--src/qml/doc/snippets/qml/row/row.qml50
-rw-r--r--src/qml/doc/snippets/qml/smoothedanimation.qml69
-rw-r--r--src/qml/doc/snippets/qml/springanimation.qml65
-rw-r--r--src/qml/doc/snippets/qml/state-when.qml54
-rw-r--r--src/qml/doc/snippets/qml/state.qml61
-rw-r--r--src/qml/doc/snippets/qml/states/statechangescript.qml63
-rw-r--r--src/qml/doc/snippets/qml/text/onLinkActivated.qml54
-rw-r--r--src/qml/doc/snippets/qml/transition-from-to-modified.qml60
-rw-r--r--src/qml/doc/snippets/qml/transition-from-to.qml59
-rw-r--r--src/qml/doc/snippets/qml/transition-reversible.qml66
-rw-r--r--src/qml/doc/snippets/qml/transition.qml63
-rw-r--r--src/qml/doc/snippets/qml/transitions-list.qml89
-rw-r--r--src/qml/doc/snippets/qml/visualdatagroup.qml81
-rw-r--r--src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp62
-rw-r--r--src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml65
-rw-r--r--src/qml/doc/snippets/qml/workerscript/script.js4
-rw-r--r--src/qml/doc/snippets/qml/workerscript/workerscript.qml (renamed from src/qml/doc/snippets/qml/workerscript.qml)0
-rw-r--r--src/qml/doc/src/bindings/c++models.qdoc30
-rw-r--r--src/qml/doc/src/bindings/properties-methods-signals.qdoc40
-rw-r--r--src/qml/doc/src/bindings/qmlplugins.qdoc10
-rw-r--r--src/qml/doc/src/bindings/qmltypes.qdoc28
-rw-r--r--src/qml/doc/src/bindings/qtbinding.qdoc94
-rw-r--r--src/qml/doc/src/debugging.qdoc8
-rw-r--r--src/qml/doc/src/engine/qmlengine.qdoc68
-rw-r--r--src/qml/doc/src/engine/qtjavascript.qdoc6
-rw-r--r--src/qml/doc/src/qml/basictypes.qdoc3
-rw-r--r--src/qml/doc/src/qml/codingconventions.qdoc20
-rw-r--r--src/qml/doc/src/qml/dynamicobjects.qdoc30
-rw-r--r--src/qml/doc/src/qml/javascriptblocks.qdoc38
-rw-r--r--src/qml/doc/src/qml/network.qdoc2
-rw-r--r--src/qml/doc/src/qml/propertybinding.qdoc54
-rw-r--r--src/qml/doc/src/qml/qmlcomponents.qdoc40
-rw-r--r--src/qml/doc/src/qml/qmldocument.qdoc8
-rw-r--r--src/qml/doc/src/qml/qmllanguage-modules.qdoc18
-rw-r--r--src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc16
-rw-r--r--src/qml/doc/src/qmlsyntax.qdoc2
-rw-r--r--src/qml/doc/src/tutorials/extending-tutorial.qdoc100
-rw-r--r--src/qml/qml/ftw/qintrusivelist.cpp2
-rw-r--r--src/qml/qml/qqmlcomponent.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp4
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp4
-rw-r--r--src/qml/qml/qquicklistmodel.cpp20
-rw-r--r--src/qml/qml/qquickworkerscript.cpp4
-rw-r--r--src/qml/qml/v8/qjsengine.cpp12
-rw-r--r--src/qml/qml/v8/qjsvalue.cpp2
-rw-r--r--src/qml/qml/v8/qjsvalueiterator.cpp4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp14
-rw-r--r--src/quick/doc/qtquick.qdocconf8
-rw-r--r--src/quick/doc/snippets/qml/animatedimage.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml (renamed from src/qml/doc/snippets/qml/rectangle/rectangle.qml)17
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/components/application.qml49
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml (renamed from src/qml/doc/snippets/qml/behavior.qml)11
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml (renamed from src/qml/doc/snippets/qml/flickable.qml)14
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml (renamed from src/qml/doc/snippets/qml/numberanimation.qml)9
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml (renamed from src/qml/doc/snippets/qml/image.qml)14
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml (renamed from src/qml/doc/snippets/qml/path/basicarc.qml)18
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml54
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml (renamed from src/qml/doc/snippets/qml/path/arcdirection.qml)15
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml49
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml (renamed from src/qml/doc/snippets/qml/rectangle/rect-border-width.qml)16
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml55
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml (renamed from src/qml/doc/snippets/qml/visualdatamodel.qml)33
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml (renamed from src/qml/doc/snippets/qml/systempalette.qml)18
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml (renamed from src/qml/doc/snippets/qml/coloranimation.qml)8
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml50
-rw-r--r--src/quick/doc/snippets/qml/texteditor.qml (renamed from src/qml/doc/snippets/qml/rotation.qml)55
-rw-r--r--src/quick/doc/src/animation.qdoc27
-rw-r--r--src/quick/doc/src/focus.qdoc20
-rw-r--r--src/quick/doc/src/localstorage/localstorage.qdoc4
-rw-r--r--src/quick/doc/src/modelview.qdoc30
-rw-r--r--src/quick/doc/src/mouseevents.qdoc6
-rw-r--r--src/quick/doc/src/positioners.qdoc8
-rw-r--r--src/quick/doc/src/qmlintro.qdoc80
-rw-r--r--src/quick/doc/src/qmltexthandling.qdoc4
-rw-r--r--src/quick/doc/src/qtquick-intro.qdoc2
-rw-r--r--src/quick/doc/src/righttoleft.qdoc12
-rw-r--r--src/quick/doc/src/states.qdoc6
-rw-r--r--src/quick/doc/src/writingcomponents.qdoc32
-rw-r--r--src/quick/items/qquickaccessibleattached.cpp7
-rw-r--r--src/quick/items/qquickanimatedimage.cpp2
-rw-r--r--src/quick/items/qquickborderimage.cpp6
-rw-r--r--src/quick/items/qquickdrag.cpp2
-rw-r--r--src/quick/items/qquickflickable.cpp8
-rw-r--r--src/quick/items/qquickflipable.cpp2
-rw-r--r--src/quick/items/qquickgridview.cpp16
-rw-r--r--src/quick/items/qquickimage.cpp2
-rw-r--r--src/quick/items/qquickitem.cpp10
-rw-r--r--src/quick/items/qquickitemanimation.cpp4
-rw-r--r--src/quick/items/qquickitemviewtransition.cpp16
-rw-r--r--src/quick/items/qquicklistview.cpp18
-rw-r--r--src/quick/items/qquickloader.cpp14
-rw-r--r--src/quick/items/qquickmousearea.cpp12
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp2
-rw-r--r--src/quick/items/qquickpathview.cpp10
-rw-r--r--src/quick/items/qquickpositioners.cpp10
-rw-r--r--src/quick/items/qquickrectangle.cpp10
-rw-r--r--src/quick/items/qquickrepeater.cpp10
-rw-r--r--src/quick/items/qquickstateoperations.cpp4
-rw-r--r--src/quick/items/qquicktext.cpp2
-rw-r--r--src/quick/items/qquicktextedit.cpp4
-rw-r--r--src/quick/items/qquickvisualdatamodel.cpp8
-rw-r--r--src/quick/util/qquickanimation.cpp26
-rw-r--r--src/quick/util/qquickbehavior.cpp2
-rw-r--r--src/quick/util/qquickbind.cpp8
-rw-r--r--src/quick/util/qquickimageprovider.cpp8
-rw-r--r--src/quick/util/qquickpackage.cpp4
-rw-r--r--src/quick/util/qquickpath.cpp14
-rw-r--r--src/quick/util/qquickpathinterpolator.cpp2
-rw-r--r--src/quick/util/qquickpropertychanges.cpp6
-rw-r--r--src/quick/util/qquicksmoothedanimation.cpp2
-rw-r--r--src/quick/util/qquickspringanimation.cpp2
-rw-r--r--src/quick/util/qquickstate.cpp4
-rw-r--r--src/quick/util/qquickstatechangescript.cpp2
-rw-r--r--src/quick/util/qquicksystempalette.cpp2
-rw-r--r--src/quick/util/qquicktransition.cpp31
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp2
186 files changed, 1178 insertions, 5453 deletions
diff --git a/doc/src/examples/advtutorial.qdoc b/doc/src/examples/advtutorial.qdoc
index fb5134ddf4..bcf819aef1 100644
--- a/doc/src/examples/advtutorial.qdoc
+++ b/doc/src/examples/advtutorial.qdoc
@@ -53,13 +53,13 @@ control QML elements.
Tutorial chapters:
\list 1
-\li \l {declarative/tutorials/samegame/samegame1}{Creating the Game Canvas and Blocks}
-\li \l {declarative/tutorials/samegame/samegame2}{Populating the Game Canvas}
-\li \l {declarative/tutorials/samegame/samegame3}{Implementing the Game Logic}
-\li \l {declarative/tutorials/samegame/samegame4}{Finishing Touches}
+\li \l {examples/tutorials/samegame/samegame1}{Creating the Game Canvas and Blocks}
+\li \l {examples/tutorials/samegame/samegame2}{Populating the Game Canvas}
+\li \l {examples/tutorials/samegame/samegame3}{Implementing the Game Logic}
+\li \l {examples/tutorials/samegame/samegame4}{Finishing Touches}
\endlist
-All the code in this tutorial can be found in Qt's \c examples/declarative/tutorials/samegame
+All the code in this tutorial can be found in Qt's \c examples/examples/tutorials/samegame
directory.
*/
@@ -71,7 +71,7 @@ directory.
\previouspage QML Advanced Tutorial
\nextpage QML Advanced Tutorial 2 - Populating the Game Canvas
-\example declarative/tutorials/samegame/samegame1
+\example examples/tutorials/samegame/samegame1
\section2 Creating the application screen
@@ -83,7 +83,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 declarative/tutorials/samegame/samegame1/samegame.qml 0
+\snippet examples/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.
@@ -101,7 +101,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 elements \l Text and \l MouseArea inside a \l Rectangle.
Here is the \c Button.qml code:
-\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
+\snippet examples/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
@@ -111,7 +111,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 declarative/tutorials/samegame/samegame1/Block.qml 0
+\snippet examples/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.
@@ -141,7 +141,7 @@ elements to get started. Next, we will populate the game canvas with some blocks
\previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
\nextpage QML Advanced Tutorial 3 - Implementing the Game Logic
-\example declarative/tutorials/samegame/samegame2
+\example examples/tutorials/samegame/samegame2
\section2 Generating the blocks in JavaScript
@@ -156,7 +156,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 declarative/tutorials/samegame/samegame2/samegame.js 0
+\snippet examples/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.
@@ -192,14 +192,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{Modules#QML Modules}{module}:
-\snippet declarative/tutorials/samegame/samegame2/samegame.qml 2
+\snippet examples/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 declarative/tutorials/samegame/samegame2/samegame.qml 1
+\snippet examples/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:
@@ -217,7 +217,7 @@ Now, we have a screen of blocks, and we can begin to add the game mechanics.
\previouspage QML Advanced Tutorial 2 - Populating the Game Canvas
\nextpage QML Advanced Tutorial 4 - Finishing Touches
-\example declarative/tutorials/samegame/samegame3
+\example examples/tutorials/samegame/samegame3
\section2 Making a playable game
@@ -241,7 +241,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 elements, 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 declarative/tutorials/samegame/samegame3/samegame.qml 1
+\snippet examples/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
@@ -251,7 +251,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 declarative/tutorials/samegame/samegame3/samegame.js 1
+\snippet examples/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.
@@ -259,17 +259,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 declarative/tutorials/samegame/samegame3/samegame.js 2
+\snippet examples/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 element 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 declarative/tutorials/samegame/samegame3/Dialog.qml 0
+\snippet examples/tutorials/samegame/samegame3/Dialog.qml 0
And this is how it is used in the main \c samegame.qml file:
-\snippet declarative/tutorials/samegame/samegame3/samegame.qml 2
+\snippet examples/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.
@@ -278,7 +278,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 declarative/tutorials/samegame/samegame3/Block.qml 0
+\snippet examples/tutorials/samegame/samegame3/Block.qml 0
\section2 A working game
@@ -290,7 +290,7 @@ Here is a screenshot of what has been accomplished so far:
This is what \c samegame.qml looks like now:
-\snippet declarative/tutorials/samegame/samegame3/samegame.qml 0
+\snippet examples/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
@@ -305,7 +305,7 @@ until the next chapter - where your application becomes alive!
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 3 - Implementing the Game Logic
-\example declarative/tutorials/samegame/samegame4
+\example examples/tutorials/samegame/samegame4
\section2 Adding some flair
@@ -324,7 +324,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 declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 1
+\snippet examples/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.
@@ -341,7 +341,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
element in \c BoomBlock.qml:
-\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 2
+\snippet examples/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,
@@ -367,14 +367,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 Particles element in
\c BoomBlock.qml, like so:
-\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 3
+\snippet examples/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 emissionRate 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 element. The code for the states now look
like this:
-\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 4
+\snippet examples/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:
@@ -391,32 +391,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 element, it now has a
\c TextInput child item for receiving keyboard text input:
-\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet examples/tutorials/samegame/samegame4/content/Dialog.qml 0
\dots 4
-\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 2
+\snippet examples/tutorials/samegame/samegame4/content/Dialog.qml 2
\dots 4
-\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+\snippet examples/tutorials/samegame/samegame4/content/Dialog.qml 3
We'll also add a \c showWithInput() function. The text input will only be visible if this function
is called instead of \c show(). When the dialog is closed, it emits a \c closed() signal, and
other elements can retrieve the text entered by the user through an \c inputText property:
-\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 0
-\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 1
+\snippet examples/tutorials/samegame/samegame4/content/Dialog.qml 0
+\snippet examples/tutorials/samegame/samegame4/content/Dialog.qml 1
\dots 4
-\snippet declarative/tutorials/samegame/samegame4/content/Dialog.qml 3
+\snippet examples/tutorials/samegame/samegame4/content/Dialog.qml 3
Now the dialog can be used in \c samegame.qml:
-\snippet declarative/tutorials/samegame/samegame4/samegame.qml 0
+\snippet examples/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 declarative/tutorials/samegame/samegame4/content/samegame.js 3
+\snippet examples/tutorials/samegame/samegame4/content/samegame.js 3
\dots 4
-\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 4
+\snippet examples/tutorials/samegame/samegame4/content/samegame.js 4
\section3 Storing high scores offline
@@ -424,7 +424,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 declarative/tutorials/samegame/samegame4/content/samegame.js 2
+\snippet examples/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.
@@ -443,7 +443,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 declarative/tutorials/samegame/samegame4/content/samegame.js 1
+\snippet examples/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/doc/src/examples/dynamicview-tutorial.qdoc b/doc/src/examples/dynamicview-tutorial.qdoc
index 210a762442..b50dc1e39e 100644
--- a/doc/src/examples/dynamicview-tutorial.qdoc
+++ b/doc/src/examples/dynamicview-tutorial.qdoc
@@ -39,13 +39,13 @@ data to dynamically sort all items in a view.
Tutorial chapters:
\list 1
-\li \l {declarative/tutorials/dynamicview/dynamicview1}{A Simple ListView and Delegate}
-\li \l {declarative/tutorials/dynamicview/dynamicview2}{Dragging View Items}
-\li \l {declarative/tutorials/dynamicview/dynamicview3}{Moving Dragged Items}
-\li \l {declarative/tutorials/dynamicview/dynamicview4}{Sorting Items}
+\li \l {examples/tutorials/dynamicview/dynamicview1}{A Simple ListView and Delegate}
+\li \l {examples/tutorials/dynamicview/dynamicview2}{Dragging View Items}
+\li \l {examples/tutorials/dynamicview/dynamicview3}{Moving Dragged Items}
+\li \l {examples/tutorials/dynamicview/dynamicview4}{Sorting Items}
\endlist
-All the code in this tutorial can be found in Qt's \c examples/declarative/tutorials/dynamicview
+All the code in this tutorial can be found in Qt's \c examples/examples/tutorials/dynamicview
directory.
*/
@@ -57,19 +57,19 @@ directory.
\previouspage QML Dynamic View Ordering Tutorial
\nextpage QML Dynamic View Ordering Tutorial 2 - Dragging View Items
-\example declarative/tutorials/dynamicview/dynamicview1
+\example examples/tutorials/dynamicview/dynamicview1
We begin our application by defining a ListView, a model which will provide data to the view, and a
delegate which provides a template for constructing items in the view.
The code for the ListView and delegate looks like this:
-\snippet declarative/tutorials/dynamicview/dynamicview1/dynamicview.qml 0
+\snippet examples/tutorials/dynamicview/dynamicview1/dynamicview.qml 0
The model is defined in a separate QML file which looks like this:
-\snippet declarative/tutorials/dynamicview/dynamicview1/PetsModel.qml 0
-\snippet declarative/tutorials/dynamicview/dynamicview1/PetsModel.qml 1
+\snippet examples/tutorials/dynamicview/dynamicview1/PetsModel.qml 0
+\snippet examples/tutorials/dynamicview/dynamicview1/PetsModel.qml 1
\section2 Walkthrough
@@ -79,11 +79,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 declarative/tutorials/dynamicview/dynamicview1/dynamicview.qml 1
+\snippet examples/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 declarative/tutorials/dynamicview/dynamicview1/dynamicview.qml 2
+\snippet examples/tutorials/dynamicview/dynamicview1/dynamicview.qml 2
*/
/*!
@@ -94,13 +94,13 @@ The second part of the application is the ListView itself to which we bind the m
\previouspage QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
\nextpage QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
-\example declarative/tutorials/dynamicview/dynamicview2
+\example examples/tutorials/dynamicview/dynamicview2
Now that we have a visible list of items we want to be able to interact with them. We'll start
by extending the delegate so the visible content can be dragged up and down the screen. The
updated delegate looks like this:
-\snippet declarative/tutorials/dynamicview/dynamicview2/dynamicview.qml 0
+\snippet examples/tutorials/dynamicview/dynamicview2/dynamicview.qml 0
\section2 Walkthrough
@@ -109,8 +109,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 declarative/tutorials/dynamicview/dynamicview2/dynamicview.qml 1
-\snippet declarative/tutorials/dynamicview/dynamicview2/dynamicview.qml 2
+\snippet examples/tutorials/dynamicview/dynamicview2/dynamicview.qml 1
+\snippet examples/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
@@ -120,14 +120,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 declarative/tutorials/dynamicview/dynamicview2/dynamicview.qml 3
+\snippet examples/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 declarative/tutorials/dynamicview/dynamicview2/dynamicview.qml 4
+\snippet examples/tutorials/dynamicview/dynamicview2/dynamicview.qml 4
*/
@@ -139,16 +139,16 @@ so that is above other items in the stacking order and isn't obscured as it is d
\previouspage QML Dynamic View Ordering Tutorial 2 - Dragging View Items
\nextpage QML Dynamic View Ordering Tutorial 4 - Sorting Items
-\example declarative/tutorials/dynamicview/dynamicview3
+\example examples/tutorials/dynamicview/dynamicview3
The next step in our application to move items within the list as they're dragged so that we
can re-order the list. To achieve this we introduce three new elements to our application;
VisualDataModel, \l Drag and DropArea.
-\snippet declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 0
-\snippet declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 1
-\snippet declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 2
-\snippet declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 5
+\snippet examples/tutorials/dynamicview/dynamicview3/dynamicview.qml 0
+\snippet examples/tutorials/dynamicview/dynamicview3/dynamicview.qml 1
+\snippet examples/tutorials/dynamicview/dynamicview3/dynamicview.qml 2
+\snippet examples/tutorials/dynamicview/dynamicview3/dynamicview.qml 5
\section2 Walkthrough
@@ -156,7 +156,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 declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 1
+\snippet examples/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
@@ -167,7 +167,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 declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 3
+\snippet examples/tutorials/dynamicview/dynamicview3/dynamicview.qml 3
To move the items within the view we use a VisualDataModel. The VisualDataModel element is used by
the view elements to instantiate delegate items from model data and when constructed explicitly can
@@ -181,7 +181,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 declarative/tutorials/dynamicview/dynamicview3/dynamicview.qml 4
+\snippet examples/tutorials/dynamicview/dynamicview3/dynamicview.qml 4
*/
@@ -192,13 +192,13 @@ property of the view and bind the \l {QtQuick2::VisualDataModel::model}{model} a
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
-\example declarative/tutorials/dynamicview/dynamicview4
+\example examples/tutorials/dynamicview/dynamicview4
Drag and drop isn't the only way items in a view can be re-ordered, using a VisualDataModel it is
also possible to sort items based on model data. To do that we extend our VisualDataModel instance
like this:
-\snippet declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 0
+\snippet examples/tutorials/dynamicview/dynamicview4/dynamicview.qml 0
\section2 Walkthrough
@@ -209,8 +209,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 declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 1
-\snippet declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 2
+\snippet examples/tutorials/dynamicview/dynamicview4/dynamicview.qml 1
+\snippet examples/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
@@ -221,19 +221,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 declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 3
+\snippet examples/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 declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 4
+\snippet examples/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 declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 5
+\snippet examples/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
@@ -241,6 +241,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 declarative/tutorials/dynamicview/dynamicview4/dynamicview.qml 6
+\snippet examples/tutorials/dynamicview/dynamicview4/dynamicview.qml 6
*/
diff --git a/doc/src/examples/example-slideswitch.qdoc b/doc/src/examples/example-slideswitch.qdoc
index 61300c9e47..1c8f4d25bb 100644
--- a/doc/src/examples/example-slideswitch.qdoc
+++ b/doc/src/examples/example-slideswitch.qdoc
@@ -32,7 +32,7 @@
\brief A reusable switch component made in QML
This example shows how to create a reusable switch component in QML.
-The code for this example can be found in the \c examples/declarative/ui-components/slideswitch directory.
+The code for this example can be found in the \c examples/tutorials/ui-components/slideswitch directory.
The elements that compose the switch are:
@@ -46,12 +46,12 @@ The elements that compose the switch are:
\endlist
\section1 Switch.qml
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 0
+\snippet examples/tutorials/ui-components/slideswitch/content/Switch.qml 0
\section1 Walkthrough
\section2 Interface
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 1
+\snippet examples/tutorials/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.
@@ -74,14 +74,14 @@ Item {
the text will only be visible when the switch is on.
\section2 Images and user interaction
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 4
+\snippet examples/tutorials/ui-components/slideswitch/content/Switch.qml 4
First, we create the background image of the switch.
In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image.
A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
\c toggle() function. We will see what this function does in a moment.
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 5
+\snippet examples/tutorials/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
@@ -89,7 +89,7 @@ property of the \c MouseArea is for. We also want to toggle the switch if the kn
in the \c dorelease() function that is called in the \c onReleased property.
\section2 States
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 6
+\snippet examples/tutorials/ui-components/slideswitch/content/Switch.qml 6
We define the two states of the switch:
\list
@@ -103,13 +103,13 @@ For more information on states see \l{States}.
We add two JavaScript functions to our switch:
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 2
+\snippet examples/tutorials/ui-components/slideswitch/content/Switch.qml 2
This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
states (\e on and \e off).
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 3
+\snippet examples/tutorials/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.
@@ -117,7 +117,7 @@ This second function is called when the knob is released and we want to make sur
For more information on scripts see \l{JavaScript Expressions in QML}.
\section2 Transition
-\snippet examples/declarative/ui-components/slideswitch/content/Switch.qml 7
+\snippet examples/tutorials/ui-components/slideswitch/content/Switch.qml 7
At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
In order for the the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
@@ -126,5 +126,5 @@ For more information on transitions see \l{QML Animation and Transitions}.
\section1 Usage
The switch can be used in a QML file, like this:
-\snippet examples/declarative/ui-components/slideswitch/slideswitch.qml 0
+\snippet examples/tutorials/ui-components/slideswitch/slideswitch.qml 0
*/
diff --git a/doc/src/examples/example-textballoons.qdoc b/doc/src/examples/example-textballoons.qdoc
index 299ceeb808..eeb88154b6 100644
--- a/doc/src/examples/example-textballoons.qdoc
+++ b/doc/src/examples/example-textballoons.qdoc
@@ -56,7 +56,7 @@
is the base class for all QPainter based items in the QML Scene Graph
framework.
- \snippet examples/declarative/painteditem/textballoons/textballoon.h 0
+ \snippet examples/quick/painteditem/textballoons/textballoon.h 0
To implement a QQuickPaintedItem you must implement QQuickPaintedIem's pure
virtual function \l {QQuickPaintedItem::}{paint()} which implements the
@@ -67,13 +67,13 @@
We have to be sure to initialize the rightAligned property for a
TextBalloon item.
- \snippet examples/declarative/painteditem/textballoons/textballoon.cpp 0
+ \snippet examples/quick/painteditem/textballoons/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
paints the item in local coordinates.
- \snippet examples/declarative/painteditem/textballoons/textballoon.cpp 1
+ \snippet examples/quick/painteditem/textballoons/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()}
@@ -88,7 +88,7 @@
\section2 BalloonView
- \snippet examples/declarative/painteditem/textballoons/textballoons.qml 0
+ \snippet examples/quick/painteditem/textballoons/textballoons.qml 0
The balloonModel contains two elements at application start which will be
displayed by the balloonView. The balloonView alernates the TextBalloon
@@ -96,7 +96,7 @@
\section2 Controls
- \snippet examples/declarative/painteditem/textballoons/textballoons.qml 1
+ \snippet examples/quick/painteditem/textballoons/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/tutorials/ui-components/dialcontrol/dialcontrol.qml b/examples/tutorials/ui-components/dialcontrol/dialcontrol.qml
index d645b34aa4..467a558696 100644
--- a/examples/tutorials/ui-components/dialcontrol/dialcontrol.qml
+++ b/examples/tutorials/ui-components/dialcontrol/dialcontrol.qml
@@ -48,12 +48,14 @@ Rectangle {
color: "#545454"
width: 300; height: 300
+ //! [the dial in use]
// Dial with a slider to adjust it
Dial {
id: dial
anchors.centerIn: parent
value: slider.x * 100 / (container.width - 34)
}
+ //! [the dial in use]
Rectangle {
id: container
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 218d7955e1..de3baf1d17 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -250,7 +250,7 @@ void QQuickFolderListModelPrivate::_q_sortFinished(const QList<FileProperty> &li
The following example shows a FolderListModel being used to provide a list
of QML files in a \l ListView:
- \snippet doc/src/snippets/qml/folderlistmodel.qml 0
+ \snippet qml/folderlistmodel.qml 0
\section1 Path Separators
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index e3e9fa4cd3..b1466a1a73 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -466,7 +466,7 @@ Database connections are automatically closed during Javascript garbage collecti
The API can be used from JavaScript functions in your QML:
-\snippet declarative/sqllocalstorage/hello.qml 0
+\snippet qml/sqllocalstorage/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/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index 221fdaea42..7ae94bb5af 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -111,12 +111,12 @@ typedef QPair<int, int> QQuickXmlListRange;
For example, if there is an XML document like this:
- \quotefile doc/src/snippets/qml/xmlrole.xml
+ \quotefile qml/xmlrole.xml
Here are some valid XPath expressions for XmlRole queries on this document:
- \snippet doc/src/snippets/qml/xmlrole.qml 0
+ \snippet qml/xmlrole.qml 0
\dots 4
- \snippet doc/src/snippets/qml/xmlrole.qml 1
+ \snippet qml/xmlrole.qml 1
See the \l{http://www.w3.org/TR/xpath20/}{W3C XPath 2.0 specification} for more information.
*/
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index fdba644349..80f7cefb91 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -83,7 +83,8 @@ headerdirs += ..
sourcedirs += ..
-exampledirs += ../../../examples \
+exampledirs += ../../../ \
+ ../../../examples \
../ \
snippets
diff --git a/src/qml/doc/snippets/qml/DynamicText.qml b/src/qml/doc/snippets/qml/DynamicText.qml
new file mode 100644
index 0000000000..9711702037
--- /dev/null
+++ b/src/qml/doc/snippets/qml/DynamicText.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import QtQuick 2.0
+
+Text {
+ id: textElement
+ width: 200
+ height: 200
+ text: "Default text"
+ property string dynamicText: "Dynamic text"
+ onTextChanged: console.log(text)
+}
+//![0]
diff --git a/src/qml/doc/snippets/qml/anchorchanges.qml b/src/qml/doc/snippets/qml/anchorchanges.qml
deleted file mode 100644
index 9cc9d15221..0000000000
--- a/src/qml/doc/snippets/qml/anchorchanges.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- id: window
- width: 120; height: 120
- color: "black"
-
- Rectangle { id: myRect; width: 50; height: 50; color: "red" }
-
- states: State {
- name: "reanchored"
-
- AnchorChanges {
- target: myRect
- anchors.top: window.top
- anchors.bottom: window.bottom
- }
- PropertyChanges {
- target: myRect
- anchors.topMargin: 10
- anchors.bottomMargin: 10
- }
- }
-
- MouseArea { anchors.fill: parent; onClicked: window.state = "reanchored" }
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/animatedimage.qml b/src/qml/doc/snippets/qml/animatedimage.qml
deleted file mode 100644
index a483619e11..0000000000
--- a/src/qml/doc/snippets/qml/animatedimage.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This snippet should be turned into an example and put in
-// examples/declarative/imageelements/animatedimage
-
-//! [document]
-import QtQuick 2.0
-
-Rectangle {
- width: animation.width; height: animation.height + 8
-
- AnimatedImage { id: animation; source: "animation.gif" }
-
- Rectangle {
- property int frames: animation.frameCount
-
- width: 4; height: 8
- x: (animation.width - width) * animation.currentFrame / frames
- y: animation.height
- color: "red"
- }
-}
-//! [document]
diff --git a/src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml b/src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml
deleted file mode 100644
index 468aa24eab..0000000000
--- a/src/qml/doc/snippets/qml/borderimage/borderimage-scaled.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: page
- color: "white"
- width: 180; height: 180
-
-//! [scaled border image]
-BorderImage {
- width: 180; height: 180
- border { left: 30; top: 30; right: 30; bottom: 30 }
- horizontalTileMode: BorderImage.Stretch
- verticalTileMode: BorderImage.Stretch
- source: "pics/borderframe.png"
-}
-//! [scaled border image]
-
- Rectangle {
- x: 30; y: 0
- width: 1; height: 180
- color: "gray"
- }
-
- Rectangle {
- x: 150; y: 0
- width: 1; height: 180
- color: "gray"
- }
-
- Rectangle {
- x: 0; y: 30
- width: 180; height: 1
- color: "gray"
- }
-
- Rectangle {
- x: 0; y: 150
- width: 180; height: 1
- color: "gray"
- }
-}
diff --git a/src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml b/src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml
deleted file mode 100644
index 69297378bf..0000000000
--- a/src/qml/doc/snippets/qml/borderimage/borderimage-tiled.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: page
- color: "white"
- width: 180; height: 180
-
-//! [tiled border image]
-BorderImage {
- width: 180; height: 180
- border { left: 30; top: 30; right: 30; bottom: 30 }
- horizontalTileMode: BorderImage.Repeat
- verticalTileMode: BorderImage.Repeat
- source: "pics/borderframe.png"
-}
-//! [tiled border image]
-
- Rectangle {
- x: 30; y: 0
- width: 1; height: 180
- color: "gray"
- }
-
- Rectangle {
- x: 150; y: 0
- width: 1; height: 180
- color: "gray"
- }
-
- Rectangle {
- x: 0; y: 30
- width: 180; height: 1
- color: "gray"
- }
-
- Rectangle {
- x: 0; y: 150
- width: 180; height: 1
- color: "gray"
- }
-}
diff --git a/src/qml/doc/snippets/qml/borderimage/normal-image.qml b/src/qml/doc/snippets/qml/borderimage/normal-image.qml
deleted file mode 100644
index 3bd34e3933..0000000000
--- a/src/qml/doc/snippets/qml/borderimage/normal-image.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: page
- color: "white"
- width: 120; height: 120
-
-//! [normal image]
-Image {
- source: "pics/borderframe.png"
-}
-//! [normal image]
-
- Rectangle {
- x: 30; y: 0
- width: 1; height: 120
- color: "gray"
- }
-
- Rectangle {
- x: 90; y: 0
- width: 1; height: 120
- color: "gray"
- }
-
- Rectangle {
- x: 0; y: 30
- width: 200; height: 1
- color: "gray"
- }
-
- Rectangle {
- x: 0; y: 90
- width: 200; height: 1
- color: "gray"
- }
-}
diff --git a/src/qml/doc/snippets/qml/column/column-transitions.qml b/src/qml/doc/snippets/qml/column/column-transitions.qml
deleted file mode 100644
index 8e291b12c8..0000000000
--- a/src/qml/doc/snippets/qml/column/column-transitions.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//! [document]
-Column {
- spacing: 2
-
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { id: greenRect; color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
-
- move: Transition {
- NumberAnimation { properties: "x,y"; duration: 1000 }
- }
-
- focus: true
- Keys.onSpacePressed: greenRect.visible = !greenRect.visible
-}
-//! [document]
diff --git a/src/qml/doc/snippets/qml/column/vertical-positioner.qml b/src/qml/doc/snippets/qml/column/vertical-positioner.qml
deleted file mode 100644
index 1661c46ba8..0000000000
--- a/src/qml/doc/snippets/qml/column/vertical-positioner.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//! [document]
-Column {
- spacing: 2
-
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
-}
-//! [document]
diff --git a/src/qml/doc/snippets/qml/drag.qml b/src/qml/doc/snippets/qml/drag.qml
deleted file mode 100644
index 286fcfc52b..0000000000
--- a/src/qml/doc/snippets/qml/drag.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 200; height: 200
-
- DropArea {
- x: 75; y: 75
- width: 50; height: 50
-
- Rectangle {
- anchors.fill: parent
- color: "green"
-
- visible: parent.containsDrag
- }
- }
-
- Rectangle {
- x: 10; y: 10
- width: 20; height: 20
- color: "red"
-
- Drag.active: dragArea.drag.active
- Drag.hotSpot.x: 10
- Drag.hotSpot.y: 10
-
- MouseArea {
- id: dragArea
- anchors.fill: parent
-
- drag.target: parent
- }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/flickableScrollbar.qml b/src/qml/doc/snippets/qml/flickableScrollbar.qml
deleted file mode 100644
index fd0aee3fc1..0000000000
--- a/src/qml/doc/snippets/qml/flickableScrollbar.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//![0]
-Rectangle {
- width: 200; height: 200
-
- Flickable {
- id: flickable
-//![0]
- anchors.fill: parent
- contentWidth: image.width; contentHeight: image.height
-
- Image { id: image; source: "pics/qt.png" }
-//![1]
- }
-
- Rectangle {
- id: scrollbar
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: 10
- height: flickable.visibleArea.heightRatio * flickable.height
- color: "black"
- }
-}
-//![1]
diff --git a/src/qml/doc/snippets/qml/flipable/flipable.qml b/src/qml/doc/snippets/qml/flipable/flipable.qml
deleted file mode 100644
index 4e451204d4..0000000000
--- a/src/qml/doc/snippets/qml/flipable/flipable.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-import QtQuick 2.0
-
-Flipable {
- id: flipable
- width: 240
- height: 240
-
- property bool flipped: false
-
- front: Image { source: "front.png"; anchors.centerIn: parent }
- back: Image { source: "back.png"; anchors.centerIn: parent }
-
- transform: Rotation {
- id: rotation
- origin.x: flipable.width/2
- origin.y: flipable.height/2
- axis.x: 0; axis.y: 1; axis.z: 0 // set axis.y to 1 to rotate around y-axis
- angle: 0 // the default angle
- }
-
- states: State {
- name: "back"
- PropertyChanges { target: rotation; angle: 180 }
- when: flipable.flipped
- }
-
- transitions: Transition {
- NumberAnimation { target: rotation; property: "angle"; duration: 4000 }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: flipable.flipped = !flipable.flipped
- }
-}
-//! [0]
-
diff --git a/src/qml/doc/snippets/qml/flow.qml b/src/qml/doc/snippets/qml/flow.qml
deleted file mode 100644
index 1141269986..0000000000
--- a/src/qml/doc/snippets/qml/flow.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [document]
-import QtQuick 2.0
-
-Rectangle {
- color: "lightblue"
- width: 300; height: 200
-
-//! [flow item]
- Flow {
- anchors.fill: parent
- anchors.margins: 4
- spacing: 10
-
- Text { text: "Text"; font.pixelSize: 40 }
- Text { text: "items"; font.pixelSize: 40 }
- Text { text: "flowing"; font.pixelSize: 40 }
- Text { text: "inside"; font.pixelSize: 40 }
- Text { text: "a"; font.pixelSize: 40 }
- Text { text: "Flow"; font.pixelSize: 40 }
- Text { text: "item"; font.pixelSize: 40 }
- }
-//! [flow item]
-}
-//! [document]
diff --git a/src/qml/doc/snippets/qml/gradient.qml b/src/qml/doc/snippets/qml/gradient.qml
deleted file mode 100644
index a5af6a7930..0000000000
--- a/src/qml/doc/snippets/qml/gradient.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-//![code]
-Rectangle {
- width: 100; height: 100
- gradient: Gradient {
- GradientStop { position: 0.0; color: "red" }
- GradientStop { position: 0.33; color: "yellow" }
- GradientStop { position: 1.0; color: "green" }
- }
-}
-//![code]
diff --git a/src/qml/doc/snippets/qml/grid/grid.qml b/src/qml/doc/snippets/qml/grid/grid.qml
deleted file mode 100644
index 7fb1bb6f5a..0000000000
--- a/src/qml/doc/snippets/qml/grid/grid.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [document]
-import QtQuick 2.0
-
-Grid {
- columns: 3
- spacing: 2
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
- Rectangle { color: "cyan"; width: 50; height: 50 }
- Rectangle { color: "magenta"; width: 10; height: 10 }
-}
-//! [document]
diff --git a/src/qml/doc/snippets/qml/gridview/ContactModel.qml b/src/qml/doc/snippets/qml/gridview/ContactModel.qml
deleted file mode 100644
index f744c1e73f..0000000000
--- a/src/qml/doc/snippets/qml/gridview/ContactModel.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-ListModel {
-
- ListElement {
- name: "Jim Williams"
- portrait: "pics/portrait.png"
- }
- ListElement {
- name: "John Brown"
- portrait: "pics/portrait.png"
- }
- ListElement {
- name: "Bill Smyth"
- portrait: "pics/portrait.png"
- }
- ListElement {
- name: "Sam Wise"
- portrait: "pics/portrait.png"
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/gridview/gridview.qml b/src/qml/doc/snippets/qml/gridview/gridview.qml
deleted file mode 100644
index d3b37d1338..0000000000
--- a/src/qml/doc/snippets/qml/gridview/gridview.qml
+++ /dev/null
@@ -1,163 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![import]
-import QtQuick 2.0
-//![import]
-
-Rectangle {
- width: childrenRect.width; height: childrenRect.height
-
-Row {
-
-//![classdocs simple]
-GridView {
- width: 300; height: 200
-
- model: ContactModel {}
- delegate: Column {
- Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
- Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
- }
-}
-//![classdocs simple]
-
-
-//![classdocs advanced]
-Rectangle {
- width: 300; height: 200
-
- Component {
- id: contactDelegate
- Item {
- width: grid.cellWidth; height: grid.cellHeight
- Column {
- anchors.fill: parent
- Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
- Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
- }
- }
- }
-
- GridView {
- id: grid
- anchors.fill: parent
- cellWidth: 80; cellHeight: 80
-
- model: ContactModel {}
- delegate: contactDelegate
- highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
- focus: true
- }
-}
-//![classdocs advanced]
-
-//![delayRemove]
-Component {
- id: delegate
- Item {
- GridView.onRemove: SequentialAnimation {
- PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
- NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
- PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
- }
- }
-}
-//![delayRemove]
-
-//![highlightFollowsCurrentItem]
-Component {
- id: highlight
- Rectangle {
- width: view.cellWidth; height: view.cellHeight
- color: "lightsteelblue"; radius: 5
- x: view.currentItem.x
- y: view.currentItem.y
- Behavior on x { SpringAnimation { spring: 3; damping: 0.2 } }
- Behavior on y { SpringAnimation { spring: 3; damping: 0.2 } }
- }
-}
-
-GridView {
- id: view
- width: 300; height: 200
- cellWidth: 80; cellHeight: 80
-
- model: ContactModel {}
- delegate: Column {
- Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
- Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
- }
-
- highlight: highlight
- highlightFollowsCurrentItem: false
- focus: true
-}
-//![highlightFollowsCurrentItem]
-
-//![isCurrentItem]
-GridView {
- width: 300; height: 200
- cellWidth: 80; cellHeight: 80
-
- Component {
- id: contactsDelegate
- Rectangle {
- id: wrapper
- width: 80
- height: 80
- color: GridView.isCurrentItem ? "black" : "red"
- Text {
- id: contactInfo
- text: name + ": " + number
- color: wrapper.GridView.isCurrentItem ? "red" : "black"
- }
- }
- }
-
- model: ContactModel {}
- delegate: contactsDelegate
- focus: true
-}
-//![isCurrentItem]
-
-}
-
-}
diff --git a/src/qml/doc/snippets/qml/keynavigation.qml b/src/qml/doc/snippets/qml/keynavigation.qml
deleted file mode 100644
index 4854ecd0ed..0000000000
--- a/src/qml/doc/snippets/qml/keynavigation.qml
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Grid {
- width: 100; height: 100
- columns: 2
-
- Rectangle {
- id: topLeft
- width: 50; height: 50
- color: focus ? "red" : "lightgray"
- focus: true
-
- KeyNavigation.right: topRight
- KeyNavigation.down: bottomLeft
- }
-
- Rectangle {
- id: topRight
- width: 50; height: 50
- color: focus ? "red" : "lightgray"
-
- KeyNavigation.left: topLeft
- KeyNavigation.down: bottomRight
- }
-
- Rectangle {
- id: bottomLeft
- width: 50; height: 50
- color: focus ? "red" : "lightgray"
-
- KeyNavigation.right: bottomRight
- KeyNavigation.up: topLeft
- }
-
- Rectangle {
- id: bottomRight
- width: 50; height: 50
- color: focus ? "red" : "lightgray"
-
- KeyNavigation.left: bottomLeft
- KeyNavigation.up: topRight
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/keys/keys-handler.qml b/src/qml/doc/snippets/qml/keys/keys-handler.qml
deleted file mode 100644
index 21fc98e23d..0000000000
--- a/src/qml/doc/snippets/qml/keys/keys-handler.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
- width: 400; height: 400
-
-//! [key item]
-Item {
- anchors.fill: parent
- focus: true
- Keys.onLeftPressed: console.log("move left")
-}
-//! [key item]
-
-Text {
- anchors.fill: parent
- text: "Press a cursor key"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-}
-}
diff --git a/src/qml/doc/snippets/qml/keys/keys-pressed.qml b/src/qml/doc/snippets/qml/keys/keys-pressed.qml
deleted file mode 100644
index 3c9a2d9dce..0000000000
--- a/src/qml/doc/snippets/qml/keys/keys-pressed.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
- width: 400; height: 400
-
-//! [key item]
-Item {
- anchors.fill: parent
- focus: true
- Keys.onPressed: {
- if (event.key == Qt.Key_Left) {
- console.log("move left");
- event.accepted = true;
- }
- }
-}
-//! [key item]
-
-Text {
- anchors.fill: parent
- text: "Press a cursor key"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-}
-}
diff --git a/src/qml/doc/snippets/qml/layoutmirroring.qml b/src/qml/doc/snippets/qml/layoutmirroring.qml
deleted file mode 100644
index 5daf3f58b3..0000000000
--- a/src/qml/doc/snippets/qml/layoutmirroring.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- LayoutMirroring.enabled: true
- LayoutMirroring.childrenInherit: true
-
- width: 300; height: 50
- color: "yellow"
- border.width: 1
-
- Row {
- anchors { left: parent.left; margins: 5 }
- y: 5; spacing: 5
-
- Repeater {
- model: 5
-
- Rectangle {
- color: "red"
- opacity: (5 - index) / 5
- width: 40; height: 40
-
- Text {
- text: index + 1
- anchors.centerIn: parent
- }
- }
- }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/qml-data-models/listelements.qml b/src/qml/doc/snippets/qml/listmodel/listelements.qml
index 0097423142..0097423142 100644
--- a/src/qml/doc/snippets/qml/qml-data-models/listelements.qml
+++ b/src/qml/doc/snippets/qml/listmodel/listelements.qml
diff --git a/src/qml/doc/snippets/qml/listmodel-modify.qml b/src/qml/doc/snippets/qml/listmodel/listmodel-modify.qml
index 308453b393..308453b393 100644
--- a/src/qml/doc/snippets/qml/listmodel-modify.qml
+++ b/src/qml/doc/snippets/qml/listmodel/listmodel-modify.qml
diff --git a/src/qml/doc/snippets/qml/listmodel-nested.qml b/src/qml/doc/snippets/qml/listmodel/listmodel-nested.qml
index bac95608e1..bac95608e1 100644
--- a/src/qml/doc/snippets/qml/listmodel-nested.qml
+++ b/src/qml/doc/snippets/qml/listmodel/listmodel-nested.qml
diff --git a/src/qml/doc/snippets/qml/listmodel-simple.qml b/src/qml/doc/snippets/qml/listmodel/listmodel-simple.qml
index e8c4cea68e..e8c4cea68e 100644
--- a/src/qml/doc/snippets/qml/listmodel-simple.qml
+++ b/src/qml/doc/snippets/qml/listmodel/listmodel-simple.qml
diff --git a/src/qml/doc/snippets/qml/listmodel.qml b/src/qml/doc/snippets/qml/listmodel/listmodel.qml
index e93732e2ee..e93732e2ee 100644
--- a/src/qml/doc/snippets/qml/listmodel.qml
+++ b/src/qml/doc/snippets/qml/listmodel/listmodel.qml
diff --git a/src/qml/doc/snippets/qml/listview/ContactModel.qml b/src/qml/doc/snippets/qml/listview/ContactModel.qml
deleted file mode 100644
index 395c637b6a..0000000000
--- a/src/qml/doc/snippets/qml/listview/ContactModel.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-ListModel {
- ListElement {
- name: "Bill Smith"
- number: "555 3264"
- }
- ListElement {
- name: "John Brown"
- number: "555 8426"
- }
- ListElement {
- name: "Sam Wise"
- number: "555 0473"
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/listview/listview.qml b/src/qml/doc/snippets/qml/listview/listview.qml
deleted file mode 100644
index 689e6d2c45..0000000000
--- a/src/qml/doc/snippets/qml/listview/listview.qml
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![import]
-import QtQuick 2.0
-//![import]
-
-Item {
-
-//![classdocs simple]
-ListView {
- width: 180; height: 200
-
- model: ContactModel {}
- delegate: Text {
- text: name + ": " + number
- }
-}
-//![classdocs simple]
-
-//![classdocs advanced]
-Rectangle {
- width: 180; height: 200
-
- Component {
- id: contactDelegate
- Item {
- width: 180; height: 40
- Column {
- Text { text: '<b>Name:</b> ' + name }
- Text { text: '<b>Number:</b> ' + number }
- }
- }
- }
-
- ListView {
- anchors.fill: parent
- model: ContactModel {}
- delegate: contactDelegate
- highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
- focus: true
- }
-}
-//![classdocs advanced]
-
-//![delayRemove]
-Component {
- id: delegate
- Item {
- ListView.onRemove: SequentialAnimation {
- PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
- NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
- PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false }
- }
- }
-}
-//![delayRemove]
-
-//![highlightFollowsCurrentItem]
-Component {
- id: highlight
- Rectangle {
- width: 180; height: 40
- color: "lightsteelblue"; radius: 5
- y: list.currentItem.y
- Behavior on y {
- SpringAnimation {
- spring: 3
- damping: 0.2
- }
- }
- }
-}
-
-ListView {
- id: list
- width: 180; height: 200
- model: ContactModel {}
- delegate: Text { text: name }
-
- highlight: highlight
- highlightFollowsCurrentItem: false
- focus: true
-}
-//![highlightFollowsCurrentItem]
-
-//![isCurrentItem]
-ListView {
- width: 180; height: 200
-
- Component {
- id: contactsDelegate
- Rectangle {
- id: wrapper
- width: 180
- height: contactInfo.height
- color: ListView.isCurrentItem ? "black" : "red"
- Text {
- id: contactInfo
- text: name + ": " + number
- color: wrapper.ListView.isCurrentItem ? "red" : "black"
- }
- }
- }
-
- model: ContactModel {}
- delegate: contactsDelegate
- focus: true
-}
-//![isCurrentItem]
-
-}
diff --git a/src/qml/doc/snippets/qml/loader/KeyReader.qml b/src/qml/doc/snippets/qml/loader/KeyReader.qml
deleted file mode 100644
index ef15a01bb1..0000000000
--- a/src/qml/doc/snippets/qml/loader/KeyReader.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- Item {
- focus: true
- Keys.onPressed: {
- console.log("Loaded item captured:", event.text);
- event.accepted = true;
- }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/loader/MyItem.qml b/src/qml/doc/snippets/qml/loader/MyItem.qml
deleted file mode 100644
index 2879e7ae23..0000000000
--- a/src/qml/doc/snippets/qml/loader/MyItem.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- id: myItem
- signal message(string msg)
-
- width: 100; height: 100
-
- MouseArea {
- anchors.fill: parent
- onClicked: myItem.message("clicked!")
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/loader/connections.qml b/src/qml/doc/snippets/qml/loader/connections.qml
deleted file mode 100644
index 82d770b2cb..0000000000
--- a/src/qml/doc/snippets/qml/loader/connections.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 100; height: 100
-
- Loader {
- id: myLoader
- source: "MyItem.qml"
- }
-
- Connections {
- target: myLoader.item
- onMessage: console.log(msg)
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/loader/focus.qml b/src/qml/doc/snippets/qml/loader/focus.qml
deleted file mode 100644
index 4447c62905..0000000000
--- a/src/qml/doc/snippets/qml/loader/focus.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- width: 200; height: 200
-
- Loader {
- id: loader
- focus: true
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: loader.source = "KeyReader.qml"
- }
-
- Keys.onPressed: {
- console.log("Captured:", event.text);
- }
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/loader/simple.qml b/src/qml/doc/snippets/qml/loader/simple.qml
deleted file mode 100644
index a4408c2231..0000000000
--- a/src/qml/doc/snippets/qml/loader/simple.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 200; height: 200
-
- Loader { id: pageLoader }
-
- MouseArea {
- anchors.fill: parent
- onClicked: pageLoader.source = "Page1.qml"
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/loader/sizeitem.qml b/src/qml/doc/snippets/qml/loader/sizeitem.qml
deleted file mode 100644
index d673d82817..0000000000
--- a/src/qml/doc/snippets/qml/loader/sizeitem.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 200; height: 200
-
- Loader {
- // position the Loader in the center of the parent
- anchors.centerIn: parent
- sourceComponent: rect
- }
-
- Component {
- id: rect
- Rectangle {
- width: 50
- height: 50
- color: "red"
- }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/loader/sizeloader.qml b/src/qml/doc/snippets/qml/loader/sizeloader.qml
deleted file mode 100644
index 551324598c..0000000000
--- a/src/qml/doc/snippets/qml/loader/sizeloader.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 200; height: 200
-
- Loader {
- // Explicitly set the size of the Loader to the parent item's size
- anchors.fill: parent
- sourceComponent: rect
- }
-
- Component {
- id: rect
- Rectangle {
- width: 50
- height: 50
- color: "red"
- }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/mousearea/mousearea.qml b/src/qml/doc/snippets/qml/mousearea/mousearea.qml
deleted file mode 100644
index 1f35cd8b5f..0000000000
--- a/src/qml/doc/snippets/qml/mousearea/mousearea.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [import]
-import QtQuick 2.0
-//! [import]
-
-Rectangle {
- width: childrenRect.width
- height: childrenRect.height
-
- Row {
- //! [intro]
- Rectangle {
- width: 100; height: 100
- color: "green"
-
- MouseArea {
- anchors.fill: parent
- onClicked: { parent.color = 'red' }
- }
- }
- //! [intro]
-
- //! [intro-extended]
- Rectangle {
- width: 100; height: 100
- color: "green"
-
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- onClicked: {
- if (mouse.button == Qt.RightButton)
- parent.color = 'blue';
- else
- parent.color = 'red';
- }
- }
- }
- //! [intro-extended]
-
- //! [drag]
- Rectangle {
- id: container
- width: 600; height: 200
-
- Rectangle {
- id: rect
- width: 50; height: 50
- color: "red"
- opacity: (600.0 - rect.x) / 600
-
- MouseArea {
- anchors.fill: parent
- drag.target: rect
- drag.axis: Drag.XAxis
- drag.minimumX: 0
- drag.maximumX: container.width - rect.width
- }
- }
- }
- //! [drag]
-
- //! [mousebuttons]
- Text {
- text: mouseArea.pressedButtons & Qt.RightButton ? "right" : ""
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- }
- }
- //! [mousebuttons]
-
- }
-}
diff --git a/src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml b/src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml
deleted file mode 100644
index 922bfea636..0000000000
--- a/src/qml/doc/snippets/qml/mousearea/mouseareadragfilter.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [dragfilter]
-import QtQuick 2.0
-
-Rectangle {
- width: 480
- height: 320
- Rectangle {
- x: 30; y: 30
- width: 300; height: 240
- color: "lightsteelblue"
-
- MouseArea {
- anchors.fill: parent
- drag.target: parent;
- drag.axis: "XAxis"
- drag.minimumX: 30
- drag.maximumX: 150
- drag.filterChildren: true
-
- Rectangle {
- color: "yellow"
- x: 50; y : 50
- width: 100; height: 100
- MouseArea {
- anchors.fill: parent
- onClicked: console.log("Clicked")
- }
- }
- }
- }
-}
-//! [dragfilter]
diff --git a/src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml b/src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml
deleted file mode 100644
index e4c2ffb039..0000000000
--- a/src/qml/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- width: 400; height: 400
- MultiPointTouchArea {
- anchors.fill: parent
- touchPoints: [
- TouchPoint { id: point1 },
- TouchPoint { id: point2 }
- ]
- }
-
- Rectangle {
- width: 30; height: 30
- color: "green"
- x: point1.x
- y: point1.y
- }
-
- Rectangle {
- width: 30; height: 30
- color: "yellow"
- x: point2.x
- y: point2.y
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/parentanimation.qml b/src/qml/doc/snippets/qml/parentanimation.qml
deleted file mode 100644
index 60429ed61c..0000000000
--- a/src/qml/doc/snippets/qml/parentanimation.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 200; height: 100
-
- Rectangle {
- id: redRect
- width: 100; height: 100
- color: "red"
- }
-
- Rectangle {
- id: blueRect
- x: redRect.width
- width: 50; height: 50
- color: "blue"
-
- states: State {
- name: "reparented"
- ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
- }
-
- transitions: Transition {
- ParentAnimation {
- NumberAnimation { properties: "x,y"; duration: 1000 }
- }
- }
-
- MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
- }
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/path/arcradius.qml b/src/qml/doc/snippets/qml/path/arcradius.qml
deleted file mode 100644
index 04f2919270..0000000000
--- a/src/qml/doc/snippets/qml/path/arcradius.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-//![0]
-Path {
- startX: 0; startY: 100
-
- PathArc {
- relativeX: 50; y: 100
- radiusX: 25; radiusY: 15
- }
- PathArc {
- relativeX: 50; y: 100
- radiusX: 25; radiusY: 25
- }
- PathArc {
- relativeX: 50; y: 100
- radiusX: 25; radiusY: 50
- }
- PathArc {
- relativeX: 50; y: 100
- radiusX: 50; radiusY: 100
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/path/basiccurve.qml b/src/qml/doc/snippets/qml/path/basiccurve.qml
deleted file mode 100644
index feb783cb01..0000000000
--- a/src/qml/doc/snippets/qml/path/basiccurve.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Canvas {
- width: 400; height: 200
-
- Path {
- id: myPath
- startX: 0; startY: 100
-
- PathCurve { x: 75; y: 75 }
- PathCurve { x: 200; y: 150 }
- PathCurve { x: 325; y: 25 }
- PathCurve { x: 400; y: 100 }
- }
-
- onPaint: {
- context.strokeStyle = Qt.rgba(.4,.6,.8);
- context.path = myPath;
- context.stroke();
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/path/largearc.qml b/src/qml/doc/snippets/qml/path/largearc.qml
deleted file mode 100644
index 69ce953c92..0000000000
--- a/src/qml/doc/snippets/qml/path/largearc.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-//![0]
-Path {
- startX: 0; startY: 100
- PathArc {
- x: 100; y: 200
- radiusX: 100; radiusY: 100
- direction: PathArc.Clockwise
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/pathinterpolator.qml b/src/qml/doc/snippets/qml/pathinterpolator.qml
deleted file mode 100644
index 77cc664e27..0000000000
--- a/src/qml/doc/snippets/qml/pathinterpolator.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- width: 400
- height: 400
-
- PathInterpolator {
- id: motionPath
-
- path: Path {
- startX: 0; startY: 0
-
- PathCubic {
- x: 350; y: 350
-
- control1X: 350; control1Y: 0
- control2X: 0; control2Y: 350
- }
- }
-
- NumberAnimation on progress { from: 0; to: 1; duration: 2000 }
- }
-
- Rectangle {
- width: 50; height: 50
- color: "green"
-
- //bind our attributes to follow the path as progress changes
- x: motionPath.x
- y: motionPath.y
- rotation: motionPath.angle
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/pathview/ContactModel.qml b/src/qml/doc/snippets/qml/pathview/ContactModel.qml
deleted file mode 100644
index d191413f27..0000000000
--- a/src/qml/doc/snippets/qml/pathview/ContactModel.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-ListModel {
- ListElement {
- name: "Bill Jones"
- icon: "pics/qtlogo.png"
- }
- ListElement {
- name: "Jane Doe"
- icon: "pics/qtlogo.png"
- }
- ListElement {
- name: "John Smith"
- icon: "pics/qtlogo.png"
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/pathview/pathattributes.qml b/src/qml/doc/snippets/qml/pathview/pathattributes.qml
deleted file mode 100644
index d555998650..0000000000
--- a/src/qml/doc/snippets/qml/pathview/pathattributes.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-import QtQuick 2.0
-
-Rectangle {
- width: 240; height: 200
-
-//! [1]
- Component {
- id: delegate
- Item {
- width: 80; height: 80
- scale: PathView.iconScale
- opacity: PathView.iconOpacity
- Column {
- Image { anchors.horizontalCenter: nameText.horizontalCenter; width: 64; height: 64; source: icon }
- Text { id: nameText; text: name; font.pointSize: 16 }
- }
- }
- }
-//! [1]
-
-//! [2]
- PathView {
- anchors.fill: parent
- model: ContactModel {}
- delegate: delegate
- path: Path {
- startX: 120; startY: 100
- PathAttribute { name: "iconScale"; value: 1.0 }
- PathAttribute { name: "iconOpacity"; value: 1.0 }
- PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
- PathAttribute { name: "iconScale"; value: 0.3 }
- PathAttribute { name: "iconOpacity"; value: 0.5 }
- PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
- }
- }
-//! [2]
-}
-//! [0]
diff --git a/src/qml/doc/snippets/qml/pathview/pathview.qml b/src/qml/doc/snippets/qml/pathview/pathview.qml
deleted file mode 100644
index e5249d4cb6..0000000000
--- a/src/qml/doc/snippets/qml/pathview/pathview.qml
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-import QtQuick 2.0
-
-Rectangle {
- width: 240; height: 200
-
-//! [1]
- Component {
- id: delegate
- Column {
- id: wrapper
- Image {
- anchors.horizontalCenter: nameText.horizontalCenter
- width: 64; height: 64
- source: icon
- }
- Text {
- id: nameText
- text: name
- font.pointSize: 16
- color: wrapper.PathView.isCurrentItem ? "red" : "black"
- }
- }
- }
-//! [1]
-
-//! [2]
- PathView {
- anchors.fill: parent
- model: ContactModel {}
- delegate: delegate
- path: Path {
- startX: 120; startY: 100
- PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
- PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
- }
- }
-//! [2]
-}
-//! [0]
diff --git a/src/qml/doc/snippets/qml/propertyaction-sequential.qml b/src/qml/doc/snippets/qml/propertyaction-sequential.qml
deleted file mode 100644
index 77d6ec194e..0000000000
--- a/src/qml/doc/snippets/qml/propertyaction-sequential.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-
-Row {
-
- Item {
- width: 400; height: 400
-
- Rectangle {
- id: rect
- width: 200; height: 100
- color: "red"
-
- states: State {
- name: "rotated"
- PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
- }
-
- //! [sequential]
- transitions: Transition {
- SequentialAnimation {
- PropertyAction { target: rect; property: "transformOrigin" }
- RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
- }
- }
- //! [sequential]
-
- MouseArea {
- anchors.fill: parent
- onClicked: rect.state = "rotated"
- }
- }
- }
-}
diff --git a/src/qml/doc/snippets/qml/propertyaction.qml b/src/qml/doc/snippets/qml/propertyaction.qml
deleted file mode 100644
index 5ddef30177..0000000000
--- a/src/qml/doc/snippets/qml/propertyaction.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-
-Row {
-
- //![transition]
- Item {
- width: 400; height: 400
-
- Rectangle {
- id: rect
- width: 200; height: 100
- color: "red"
-
- states: State {
- name: "rotated"
- PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
- }
-
- transitions: Transition {
- RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: rect.state = "rotated"
- }
- }
- }
- //![transition]
-
- Item {
- width: 300; height: 300
-
- Image { id: img; source: "pics/qt.png" }
-
- //![standalone]
- SequentialAnimation {
- PropertyAction { target: img; property: "smooth"; value: "true" }
- NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 }
- PropertyAction { target: img; property: "smooth"; value: "false" }
- }
- //![standalone]
- }
-}
diff --git a/src/qml/doc/snippets/qml/propertyanimation.qml b/src/qml/doc/snippets/qml/propertyanimation.qml
deleted file mode 100644
index b5781af94a..0000000000
--- a/src/qml/doc/snippets/qml/propertyanimation.qml
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Row {
-
-//![transition]
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
-
- //! [single state]
- states: State {
- name: "moved"
- PropertyChanges { target: rect; x: 50 }
- }
- //! [single state]
-
- transitions: Transition {
- PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
- }
-}
-//![transition]
-
-//![behavior]
-Rectangle {
- width: 100; height: 100
- color: "red"
-
- Behavior on x { PropertyAnimation {} }
-
- MouseArea { anchors.fill: parent; onClicked: parent.x = 50 }
-}
-//![behavior]
-
-//![propertyvaluesource]
-Rectangle {
- width: 100; height: 100
- color: "red"
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- PropertyAnimation { to: 50 }
- PropertyAnimation { to: 0 }
- }
-}
-//![propertyvaluesource]
-
- //![standalone]
- Rectangle {
- id: theRect
- width: 100; height: 100
- color: "red"
-
- // this is a standalone animation, it's not running by default
- PropertyAnimation { id: animation; target: theRect; property: "width"; to: 30; duration: 500 }
-
- MouseArea { anchors.fill: parent; onClicked: animation.running = true }
- }
- //![standalone]
-}
diff --git a/src/qml/doc/snippets/qml/propertychanges.qml b/src/qml/doc/snippets/qml/propertychanges.qml
deleted file mode 100644
index 3be13f7861..0000000000
--- a/src/qml/doc/snippets/qml/propertychanges.qml
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![import]
-import QtQuick 2.0
-//![import]
-
-Column {
-
-//![0]
-Item {
- id: container
- width: 300; height: 300
-
- Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- }
-
- states: State {
- name: "resized"; when: mouseArea.pressed
- PropertyChanges { target: rect; color: "blue"; height: container.height }
- }
- }
-}
-//![0]
-
-//![reset]
-Rectangle {
- width: 300; height: 200
-
- Text {
- id: myText
- width: 50
- wrapMode: Text.WordWrap
- text: "a text string that is longer than 50 pixels"
-
- states: State {
- name: "widerText"
- PropertyChanges { target: myText; width: undefined }
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: myText.state = "widerText"
- }
-}
-//![reset]
-}
diff --git a/src/qml/doc/snippets/qml/sequentialanimation.qml b/src/qml/doc/snippets/qml/qtBinding.1.qml
index 73923e4ea0..acec88a47f 100644
--- a/src/qml/doc/snippets/qml/sequentialanimation.qml
+++ b/src/qml/doc/snippets/qml/qtBinding.1.qml
@@ -38,19 +38,18 @@
**
****************************************************************************/
-//![0]
import QtQuick 2.0
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
+//![0]
+Item {
+ property bool someCondition: true
+ property int edgePosition
- SequentialAnimation {
- running: true
- NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
- NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+ Component.onCompleted: {
+ if (someCondition == true) {
+ // bind to the result of the binding expression passed to Qt.binding()
+ edgePosition = Qt.binding(function() { return x + width })
+ }
}
}
//![0]
-
diff --git a/src/qml/doc/snippets/qml/anchoranimation.qml b/src/qml/doc/snippets/qml/qtBinding.2.qml
index 8f0603fab8..9b78bc395a 100644
--- a/src/qml/doc/snippets/qml/anchoranimation.qml
+++ b/src/qml/doc/snippets/qml/qtBinding.2.qml
@@ -38,29 +38,21 @@
**
****************************************************************************/
-//![0]
import QtQuick 2.0
+//![0]
Item {
- id: container
- width: 200; height: 200
+ id: root
+ property string dynamicText: "Root text"
- Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
- }
+ Component.onCompleted: {
+ var c = Qt.createComponent("DynamicText.qml")
- states: State {
- name: "reanchored"
- AnchorChanges { target: myRect; anchors.right: container.right }
- }
+ var obj1 = c.createObject(root, { 'text': Qt.binding(function() { return dynamicText + ' extra text' }) })
+ root.dynamicText = "Modified root text"
- transitions: Transition {
- // smoothly reanchor myRect and move into new position
- AnchorAnimation { duration: 1000 }
+ var obj2 = c.createObject(root, { 'text': Qt.binding(function() { return this.dynamicText + ' extra text' }) })
+ obj2.dynamicText = "Modified text element text"
}
-
- Component.onCompleted: container.state = "reanchored"
}
//![0]
diff --git a/src/qml/doc/snippets/qml/parentchange.qml b/src/qml/doc/snippets/qml/qtBinding.3.qml
index 4ae4476e13..a27914cc15 100644
--- a/src/qml/doc/snippets/qml/parentchange.qml
+++ b/src/qml/doc/snippets/qml/qtBinding.3.qml
@@ -37,31 +37,27 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
+
import QtQuick 2.0
+//![0]
Item {
- width: 200; height: 100
+ id: root
+ property string dynamicText: "Root text"
- Rectangle {
- id: redRect
- width: 100; height: 100
- color: "red"
+ Loader {
+ id: loaderOne
+ onLoaded: root.dynamicText = "Modified root text"
}
- Rectangle {
- id: blueRect
- x: redRect.width
- width: 50; height: 50
- color: "blue"
-
- states: State {
- name: "reparented"
- ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
- }
+ Loader {
+ id: loaderTwo
+ onLoaded: item.dynamicText = "Modified dynamic text"
+ }
- MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
+ Component.onCompleted: {
+ loaderOne.setSource("DynamicText.qml", { 'text': Qt.binding(function() { return dynamicText + ' extra text' }) })
+ loaderTwo.setSource("DynamicText.qml", { 'text': Qt.binding(function() { return this.dynamicText + ' extra text' }) })
}
}
//![0]
-
diff --git a/src/qml/doc/snippets/qml/parallelanimation.qml b/src/qml/doc/snippets/qml/qtBinding.4.qml
index 20f6ccc1df..0155957a59 100644
--- a/src/qml/doc/snippets/qml/parallelanimation.qml
+++ b/src/qml/doc/snippets/qml/qtBinding.4.qml
@@ -38,19 +38,17 @@
**
****************************************************************************/
-//![0]
import QtQuick 2.0
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
+//![0]
+Item {
+ width: 50
+ property var storedBindings: [ Qt.binding(function() { return x + width }) ] // stored
+ property int a: Qt.binding(function() { return x + width }) // error!
+ property int b
- ParallelAnimation {
- running: true
- NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
- NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+ Component.onCompleted: {
+ b = storedBindings[0] // causes binding assignment
}
}
//![0]
-
diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/example.qrc b/src/qml/doc/snippets/qml/qtbinding/resources/example.qrc
new file mode 100644
index 0000000000..5e4941512b
--- /dev/null
+++ b/src/qml/doc/snippets/qml/qtbinding/resources/example.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+
+<qresource prefix="/">
+ <file>main.qml</file>
+ <file>images/background.png</file>
+</qresource>
+
+</RCC>
+
diff --git a/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro b/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro
new file mode 100644
index 0000000000..5aee288a6e
--- /dev/null
+++ b/src/qml/doc/snippets/qml/qtbinding/resources/resources.pro
@@ -0,0 +1,4 @@
+QT += qml
+
+SOURCES += main.cpp
+RESOURCES += example.qrc
diff --git a/src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml b/src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml
deleted file mode 100644
index 70f7a203f4..0000000000
--- a/src/qml/doc/snippets/qml/rectangle/rectangle-colors.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
- width: 100; height: 200
-
-Item {
- x: 10; y: 10
- width: 80; height: 180
-
-//! [rectangles]
-Rectangle {
- color: "#00B000"
- width: 80; height: 80
-}
-
-Rectangle {
- color: "steelblue"
- y: 100; width: 80; height: 80
-}
-//! [rectangles]
-}
-}
diff --git a/src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml b/src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml
deleted file mode 100644
index e8146a6467..0000000000
--- a/src/qml/doc/snippets/qml/rectangle/rectangle-gradient.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
- width: 100; height: 300
-
-Item {
- x: 10; y: 10
- width: 80; height: 280
-
-//! [rectangles]
-Rectangle {
- y: 0; width: 80; height: 80
- color: "lightsteelblue"
-}
-
-Rectangle {
- y: 100; width: 80; height: 80
- gradient: Gradient {
- GradientStop { position: 0.0; color: "lightsteelblue" }
- GradientStop { position: 1.0; color: "blue" }
- }
-}
-
-Rectangle {
- y: 200; width: 80; height: 80
- rotation: 90
- gradient: Gradient {
- GradientStop { position: 0.0; color: "lightsteelblue" }
- GradientStop { position: 1.0; color: "blue" }
- }
-}
-//! [rectangles]
-}
-}
diff --git a/src/qml/doc/snippets/qml/repeaters/repeater.qml b/src/qml/doc/snippets/qml/repeaters/repeater.qml
deleted file mode 100644
index 856b038a04..0000000000
--- a/src/qml/doc/snippets/qml/repeaters/repeater.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [import]
-import QtQuick 2.0
-//! [import]
-
-Row {
-
-//! [simple]
-Row {
- Repeater {
- model: 3
- Rectangle {
- width: 100; height: 40
- border.width: 1
- color: "yellow"
- }
- }
-}
-//! [simple]
-
-//! [index]
-Column {
- Repeater {
- model: 10
- Text { text: "I'm item " + index }
- }
-}
-//! [index]
-
-//! [modeldata]
-Column {
- Repeater {
- model: ["apples", "oranges", "pears"]
- Text { text: "Data: " + modelData }
- }
-}
-//! [modeldata]
-
-//! [layout]
-Row {
- Rectangle { width: 10; height: 20; color: "red" }
- Repeater {
- model: 10
- Rectangle { width: 20; height: 20; radius: 10; color: "green" }
- }
- Rectangle { width: 10; height: 20; color: "blue" }
-}
-//! [layout]
-
-}
diff --git a/src/qml/doc/snippets/qml/righttoleft.qml b/src/qml/doc/snippets/qml/righttoleft.qml
deleted file mode 100644
index 0566be2f67..0000000000
--- a/src/qml/doc/snippets/qml/righttoleft.qml
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import "righttoleft"
-
-Column {
- width: 200
-//![0]
-// automatically aligned to the left
-Text {
- text: "Phone"
- width: 200
-}
-
-// automatically aligned to the right
-Text {
- text: "خامل"
- width: 200
-}
-
-// aligned to the left
-Text {
- text: "خامل"
- horizontalAlignment: Text.AlignLeft
- width: 200
-}
-
-// aligned to the right
-Text {
- text: "خامل"
- horizontalAlignment: Text.AlignLeft
- LayoutMirroring.enabled: true
- width: 200
-}
-//![0]
-
-//![1]
-// by default child items are positioned from left to right
-Row {
- Child {}
- Child {}
-}
-
-// position child items from right to left
-Row {
- layoutDirection: Qt.RightToLeft
- Child {}
- Child {}
-}
-
-// position child items from left to right
-Row {
- LayoutMirroring.enabled: true
- layoutDirection: Qt.RightToLeft
- Child {}
- Child {}
-}
-//![1]
-
-//![2]
-Item {
- height: 50; width: 150
-
- LayoutMirroring.enabled: true
- anchors.left: parent.left // anchor left becomes right
-
- Row {
- // items flow from left to right (as per default)
- Child {}
- Child {}
- Child {}
- }
-}
-//![2]
-
-//![3]
-Item {
- height: 50; width: 150
-
- LayoutMirroring.enabled: true
- LayoutMirroring.childrenInherit: true
- anchors.left: parent.left // anchor left becomes right
-
- Row {
- // setting childrenInherit in the parent causes these
- // items to flow from right to left instead
- Child {}
- Child {}
- Child {}
- }
-}
-//![3]
-
-//![4]
-Rectangle {
- color: "black"
- height: 50; width: 50
- x: mirror(10)
- function mirror(value) {
- return LayoutMirroring.enabled ? (parent.width - width - value) : value;
- }
-}
-//![4]
-
-//![5]
-Image {
- source: "arrow.png"
- mirror: true
-}
-//![5]
-}
diff --git a/src/qml/doc/snippets/qml/righttoleft/Child.qml b/src/qml/doc/snippets/qml/righttoleft/Child.qml
deleted file mode 100644
index 50068540cb..0000000000
--- a/src/qml/doc/snippets/qml/righttoleft/Child.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- width: 50; height: 50
- color: "black"
- Text {
- color: "white"
- text: String.fromCharCode(65 + Math.floor(26*Math.random()))
- anchors.centerIn: parent
- }
-}
diff --git a/src/qml/doc/snippets/qml/rotationanimation.qml b/src/qml/doc/snippets/qml/rotationanimation.qml
deleted file mode 100644
index caa1ce8207..0000000000
--- a/src/qml/doc/snippets/qml/rotationanimation.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 300; height: 300
-
- Rectangle {
- id: rect
- width: 150; height: 100; anchors.centerIn: parent
- color: "red"
- smooth: true
-
- states: State {
- name: "rotated"
- PropertyChanges { target: rect; rotation: 180 }
- }
-
- transitions: Transition {
- RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
- }
- }
-
- MouseArea { anchors.fill: parent; onClicked: rect.state = "rotated" }
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/row/row.qml b/src/qml/doc/snippets/qml/row/row.qml
deleted file mode 100644
index 465baa577b..0000000000
--- a/src/qml/doc/snippets/qml/row/row.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [document]
-import QtQuick 2.0
-
-Row {
- spacing: 2
- Rectangle { color: "red"; width: 50; height: 50 }
- Rectangle { color: "green"; width: 20; height: 50 }
- Rectangle { color: "blue"; width: 50; height: 20 }
-}
-//! [document]
diff --git a/src/qml/doc/snippets/qml/smoothedanimation.qml b/src/qml/doc/snippets/qml/smoothedanimation.qml
deleted file mode 100644
index ba6f505976..0000000000
--- a/src/qml/doc/snippets/qml/smoothedanimation.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- width: 800; height: 600
- color: "blue"
-
- Rectangle {
- width: 60; height: 60
- x: rect1.x - 5; y: rect1.y - 5
- color: "green"
-
- Behavior on x { SmoothedAnimation { velocity: 200 } }
- Behavior on y { SmoothedAnimation { velocity: 200 } }
- }
-
- Rectangle {
- id: rect1
- width: 50; height: 50
- color: "red"
- }
-
- focus: true
- Keys.onRightPressed: rect1.x = rect1.x + 100
- Keys.onLeftPressed: rect1.x = rect1.x - 100
- Keys.onUpPressed: rect1.y = rect1.y - 100
- Keys.onDownPressed: rect1.y = rect1.y + 100
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/springanimation.qml b/src/qml/doc/snippets/qml/springanimation.qml
deleted file mode 100644
index e04c483405..0000000000
--- a/src/qml/doc/snippets/qml/springanimation.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//![0]
-import QtQuick 2.0
-
-Item {
- width: 300; height: 300
-
- Rectangle {
- id: rect
- width: 50; height: 50
- color: "red"
-
- Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } }
- Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- rect.x = mouse.x - rect.width/2
- rect.y = mouse.y - rect.height/2
- }
- }
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/state-when.qml b/src/qml/doc/snippets/qml/state-when.qml
deleted file mode 100644
index de9fb39cef..0000000000
--- a/src/qml/doc/snippets/qml/state-when.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-//![0]
-Rectangle {
- id: myRect
- width: 100; height: 100
- color: "red"
-
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "hidden"; when: mouseArea.pressed
- PropertyChanges { target: myRect; opacity: 0 }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/state.qml b/src/qml/doc/snippets/qml/state.qml
deleted file mode 100644
index 5948cba770..0000000000
--- a/src/qml/doc/snippets/qml/state.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- id: myRect
- width: 100; height: 100
- color: "black"
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: myRect.state == 'clicked' ? myRect.state = "" : myRect.state = 'clicked';
- }
-
- states: [
- State {
- name: "clicked"
- PropertyChanges { target: myRect; color: "red" }
- }
- ]
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/states/statechangescript.qml b/src/qml/doc/snippets/qml/states/statechangescript.qml
deleted file mode 100644
index 262938fc9c..0000000000
--- a/src/qml/doc/snippets/qml/states/statechangescript.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Item {
-//! [state and transition]
-State {
- name: "state1"
- StateChangeScript {
- name: "myScript"
- script: doStateStuff();
- }
- // ...
-}
-// ...
-Transition {
- to: "state1"
- SequentialAnimation {
- NumberAnimation { /* ... */ }
- ScriptAction { scriptName: "myScript" }
- NumberAnimation { /* ... */ }
- }
-}
-//! [state and transition]
-}
diff --git a/src/qml/doc/snippets/qml/text/onLinkActivated.qml b/src/qml/doc/snippets/qml/text/onLinkActivated.qml
deleted file mode 100644
index 03641d989e..0000000000
--- a/src/qml/doc/snippets/qml/text/onLinkActivated.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-
-Rectangle {
- width: 700; height: 400
-
-//![0]
- Text {
- textFormat: Text.RichText
- text: "The main website is at <a href=\"http://qt.nokia.com\">Nokia Qt DF</a>."
- onLinkActivated: console.log(link + " link activated")
- }
-//![0]
-
-}
-
diff --git a/src/qml/doc/snippets/qml/transition-from-to-modified.qml b/src/qml/doc/snippets/qml/transition-from-to-modified.qml
deleted file mode 100644
index 184e95afe2..0000000000
--- a/src/qml/doc/snippets/qml/transition-from-to-modified.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
-
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "brighter"; when: mouseArea.pressed
- PropertyChanges { target: rect; color: "yellow" }
- }
-
- //! [modified transition]
- transitions: Transition {
- to: "brighter"
- ColorAnimation { duration: 1000 }
- }
- //! [modified transition]
-}
diff --git a/src/qml/doc/snippets/qml/transition-from-to.qml b/src/qml/doc/snippets/qml/transition-from-to.qml
deleted file mode 100644
index c876f5cb9c..0000000000
--- a/src/qml/doc/snippets/qml/transition-from-to.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-
-//![0]
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
-
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "brighter"; when: mouseArea.pressed
- PropertyChanges { target: rect; color: "yellow" }
- }
-
- transitions: Transition {
- ColorAnimation { duration: 1000 }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/transition-reversible.qml b/src/qml/doc/snippets/qml/transition-reversible.qml
deleted file mode 100644
index 4f7ae83468..0000000000
--- a/src/qml/doc/snippets/qml/transition-reversible.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 2.0
-
-//![0]
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
-
- MouseArea { id: mouseArea; anchors.fill: parent }
-
- states: State {
- name: "brighter"
- when: mouseArea.pressed
- PropertyChanges { target: rect; color: "yellow"; x: 50 }
- }
-
- //! [sequential animations]
- transitions: Transition {
- SequentialAnimation {
- PropertyAnimation { property: "x"; duration: 1000 }
- ColorAnimation { duration: 1000 }
- }
- }
- //! [sequential animations]
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/transition.qml b/src/qml/doc/snippets/qml/transition.qml
deleted file mode 100644
index 614c5d364f..0000000000
--- a/src/qml/doc/snippets/qml/transition.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- id: rect
- width: 100; height: 100
- color: "red"
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- }
-
- states: State {
- name: "moved"; when: mouseArea.pressed
- PropertyChanges { target: rect; x: 50; y: 50 }
- }
-
- transitions: Transition {
- NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad }
- }
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/transitions-list.qml b/src/qml/doc/snippets/qml/transitions-list.qml
deleted file mode 100644
index f2ba768559..0000000000
--- a/src/qml/doc/snippets/qml/transitions-list.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- width: 150; height: 250
-
- Rectangle {
- id: stopLight
- x: 25; y: 15; width: 100; height: 100
- }
- Rectangle {
- id: goLight
- x: 25; y: 135; width: 100; height: 100
- }
-
- states: [
- State {
- name: "stop"
- PropertyChanges { target: stopLight; color: "red" }
- PropertyChanges { target: goLight; color: "black" }
- },
- State {
- name: "go"
- PropertyChanges { target: stopLight; color: "black" }
- PropertyChanges { target: goLight; color: "green" }
- }
- ]
-
- state: "stop"
-
- MouseArea {
- anchors.fill: parent
- onClicked: parent.state == "stop" ?
- parent.state = "go" : parent.state = "stop"
- }
-
- //! [list of transitions]
- transitions: [
- Transition {
- from: "stop"; to: "go"
- PropertyAnimation { target: stopLight
- properties: "color"; duration: 1000 }
- },
- Transition {
- from: "go"; to: "stop"
- PropertyAnimation { target: goLight
- properties: "color"; duration: 1000 }
- } ]
- //! [list of transitions]
-}
diff --git a/src/qml/doc/snippets/qml/visualdatagroup.qml b/src/qml/doc/snippets/qml/visualdatagroup.qml
deleted file mode 100644
index 46ac9a3d7a..0000000000
--- a/src/qml/doc/snippets/qml/visualdatagroup.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-Rectangle {
- width: 200; height: 100
-
- VisualDataModel {
- id: visualModel
- model: ListModel {
- ListElement { name: "Apple" }
- ListElement { name: "Orange" }
- }
-
- groups: [
- VisualDataGroup { name: "selected" }
- ]
-
- delegate: Rectangle {
- id: item
- height: 25
- width: 200
- Text {
- text: {
- var text = "Name: " + name
- if (item.VisualDataModel.inSelected)
- text += " (" + item.VisualDataModel.selectedIndex + ")"
- return text;
- }
- }
- MouseArea {
- anchors.fill: parent
- onClicked: item.VisualDataModel.inSelected = !item.VisualDataModel.inSelected
- }
- }
- }
-
- ListView {
- anchors.fill: parent
- model: visualModel
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp b/src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp
deleted file mode 100644
index 4468d06db4..0000000000
--- a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/main.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QQuickView>
-#include <QQmlContext>
-
-#include <QApplication>
-#include <QDirModel>
-
-//![0]
-int main(int argc, char ** argv)
-{
- QApplication app(argc, argv);
-
- QQuickView view;
-
- QDirModel model;
- view.rootContext()->setContextProperty("dirModel", &model);
-
- view.setSource(QUrl::fromLocalFile("view.qml"));
- view.show();
-
- return app.exec();
-}
-//![0]
-
diff --git a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml b/src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml
deleted file mode 100644
index 24d6b47f8d..0000000000
--- a/src/qml/doc/snippets/qml/visualdatamodel_rootindex/view.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-//![0]
-import QtQuick 2.0
-
-ListView {
- id: view
- width: 300
- height: 400
-
- model: VisualDataModel {
- model: dirModel
-
- delegate: Rectangle {
- width: 200; height: 25
- Text { text: filePath }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (model.hasModelChildren)
- view.model.rootIndex = view.model.modelIndex(index)
- }
- }
- }
- }
-}
-//![0]
diff --git a/src/qml/doc/snippets/qml/workerscript/script.js b/src/qml/doc/snippets/qml/workerscript/script.js
new file mode 100644
index 0000000000..f55dee3507
--- /dev/null
+++ b/src/qml/doc/snippets/qml/workerscript/script.js
@@ -0,0 +1,4 @@
+WorkerScript.onMessage = function(message) {
+ // ... long-running operations and calculations are done here
+ WorkerScript.sendMessage({ 'reply': 'Mouse is at ' + message.x + ',' + message.y })
+}
diff --git a/src/qml/doc/snippets/qml/workerscript.qml b/src/qml/doc/snippets/qml/workerscript/workerscript.qml
index 6af6b47766..6af6b47766 100644
--- a/src/qml/doc/snippets/qml/workerscript.qml
+++ b/src/qml/doc/snippets/qml/workerscript/workerscript.qml
diff --git a/src/qml/doc/src/bindings/c++models.qdoc b/src/qml/doc/src/bindings/c++models.qdoc
index e2f2f32b5c..3db813b857 100644
--- a/src/qml/doc/src/bindings/c++models.qdoc
+++ b/src/qml/doc/src/bindings/c++models.qdoc
@@ -46,14 +46,14 @@ models.
Here is a ListView with a delegate that references its model item's
value using the \c modelData role:
- \snippet examples/declarative/modelviews/stringlistmodel/view.qml 0
+ \snippet examples/quick/modelviews/stringlistmodel/view.qml 0
A Qt application can load this QML document and set the value of \c myModel
to a QStringList:
- \snippet examples/declarative/modelviews/stringlistmodel/main.cpp 0
+ \snippet examples/quick/modelviews/stringlistmodel/main.cpp 0
- The complete example is available in Qt's \l {declarative/modelviews/stringlistmodel}{examples/declarative/modelviews/stringlistmodel} directory.
+ The complete example is available in Qt's \l {declarative/modelviews/stringlistmodel}{examples/quick/modelviews/stringlistmodel} directory.
\b{Note:} There is no way for the view to know that the contents of a QStringList
have changed. If the QStringList changes, it will be necessary to reset
@@ -69,11 +69,11 @@ models.
Q_PROPERTY values that will be accessible as named roles when a
QList<DataObject*> is exposed to QML:
- \snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 0
+ \snippet examples/quick/modelviews/objectlistmodel/dataobject.h 0
\dots 4
- \snippet examples/declarative/modelviews/objectlistmodel/dataobject.h 1
+ \snippet examples/quick/modelviews/objectlistmodel/dataobject.h 1
\codeline
- \snippet examples/declarative/modelviews/objectlistmodel/main.cpp 0
+ \snippet examples/quick/modelviews/objectlistmodel/main.cpp 0
\dots
The QObject* is available as the \c modelData property. As a convenience,
@@ -81,14 +81,14 @@ models.
delegate's context. Here, \c view.qml references the \c DataModel properties in
the ListView delegate:
- \snippet examples/declarative/modelviews/objectlistmodel/view.qml 0
+ \snippet examples/quick/modelviews/objectlistmodel/view.qml 0
Note the use of the fully qualified access to the \c color property.
The properties of the object are not replicated in the \c model
object, since they are easily available via the \c modelData
object.
- The complete example is available in Qt's \l {declarative/modelviews/objectlistmodel}{examples/declarative/modelviews/objectlistmodel} directory.
+ The complete example is available in Qt's \l {declarative/modelviews/objectlistmodel}{examples/quick/modelviews/objectlistmodel} directory.
Note: There is no way for the view to know that the contents of a QList
have changed. If the QList changes, it will be necessary to reset
@@ -121,21 +121,21 @@ models.
that has \e type and \e size roles. It calls QAbstractItemModel::setRoleNames() to set the
role names for accessing the properties via QML:
- \snippet examples/declarative/modelviews/abstractitemmodel/model.h 0
+ \snippet examples/quick/modelviews/abstractitemmodel/model.h 0
\dots
- \snippet examples/declarative/modelviews/abstractitemmodel/model.h 1
+ \snippet examples/quick/modelviews/abstractitemmodel/model.h 1
\dots
- \snippet examples/declarative/modelviews/abstractitemmodel/model.h 2
+ \snippet examples/quick/modelviews/abstractitemmodel/model.h 2
\codeline
- \snippet examples/declarative/modelviews/abstractitemmodel/model.cpp 0
+ \snippet examples/quick/modelviews/abstractitemmodel/model.cpp 0
\codeline
- \snippet examples/declarative/modelviews/abstractitemmodel/main.cpp 0
+ \snippet examples/quick/modelviews/abstractitemmodel/main.cpp 0
\dots
This model is displayed by a ListView delegate that accesses the \e type and \e size
roles:
- \snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0
+ \snippet examples/quick/modelviews/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
@@ -143,7 +143,7 @@ models.
QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for
more information.
- The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory.
+ The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/quick/modelviews/abstractitemmodel} directory.
QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML
can only display list data.
diff --git a/src/qml/doc/src/bindings/properties-methods-signals.qdoc b/src/qml/doc/src/bindings/properties-methods-signals.qdoc
index 2aa11e9a50..b88324e567 100644
--- a/src/qml/doc/src/bindings/properties-methods-signals.qdoc
+++ b/src/qml/doc/src/bindings/properties-methods-signals.qdoc
@@ -120,15 +120,15 @@ Q_PROPERTY(int size READ size CONSTANT)
<group>.<property> notation. For example, shoe.color is the way to access
the \c color property in the \c shoe property group .
- \snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml ungrouped
+ \snippet examples/qml/cppextensions/referenceexamples/grouped/example.qml ungrouped
Alternatively, the group can be accessed as a set.
- \snippet examples/declarative/cppextensions/referenceexamples/grouped/example.qml grouped
+ \snippet examples/qml/cppextensions/referenceexamples/grouped/example.qml grouped
A grouped property block is implemented as a read-only object property. The
\c shoe property shown is declared like this:
- \snippet examples/declarative/cppextensions/referenceexamples/grouped/person.h 1
+ \snippet examples/qml/cppextensions/referenceexamples/grouped/person.h 1
The \c ShoeDescription type declares the properties available to the grouped
property block - in this case the \c size, \c color, \c brand and \c price properties.
@@ -150,7 +150,7 @@ Q_PROPERTY(int size READ size CONSTANT)
attaching type are those that become available for use as attached
properties.
- \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml 1
+ \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml 1
The \c BirthdayParty is called the attaching type and the
\c Boy instance the attachee object instance. The property \c rsvp is the
@@ -171,12 +171,12 @@ Q_PROPERTY(int size READ size CONSTANT)
The \l {Extending QML - Attached Properties Example}{Birthday}
class has \c BirthdayPartyAttached attached properties.
- \snippet examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h static attached
+ \snippet examples/qml/cppextensions/referenceexamples/attached/birthdayparty.h static attached
The QML_DECLARE_TYPEINFO() macro can notify the runtime that the type has
attached properties with the QML_HAS_ATTACHED_PROPERTIES argument.
- \snippet examples/declarative/cppextensions/referenceexamples/attached/birthdayparty.h declare attached
+ \snippet examples/qml/cppextensions/referenceexamples/attached/birthdayparty.h declare attached
The qmlAttachedProperties method will be called at most once for each
attachee object instance. The QML engine will cache the returned instance
@@ -186,9 +186,9 @@ Q_PROPERTY(int size READ size CONSTANT)
A common usage scenario is for a type to enhance the properties
available to its children in order to gather instance specific data.
- \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml begin
- \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml rsvp
- \snippet examples/declarative/cppextensions/referenceexamples/attached/example.qml end
+ \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml begin
+ \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml rsvp
+ \snippet examples/qml/cppextensions/referenceexamples/attached/example.qml end
However, as a QML type cannot limit the instances to which the attachment
object must attach, the following is also allowed, even though adding a
@@ -218,7 +218,7 @@ Q_PROPERTY(int size READ size CONSTANT)
The \c rsvp properties of each guest in the \c Birthday party is accessible
through the \c qmlAttachedPropertiesObject function.
- \snippet examples/declarative/cppextensions/referenceexamples/attached/main.cpp query rsvp
+ \snippet examples/qml/cppextensions/referenceexamples/attached/main.cpp query rsvp
The
\l {Extending QML - Attached Properties Example}{Attached Properties Example}
@@ -237,7 +237,7 @@ Q_PROPERTY(int size READ size CONSTANT)
Q_PROPERTY() macro, just like other properties. The \c host property
declaration looks like this:
- \snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+ \snippet examples/qml/cppextensions/referenceexamples/properties/birthdayparty.h 1
As long as the property type, in this case \c Person, is registered with QML the
property can be assigned.
@@ -259,7 +259,7 @@ Q_PROPERTY(int size READ size CONSTANT)
for assignment to appropriately typed properties.
- \snippet examples/declarative/cppextensions/referenceexamples/properties/example.qml 0
+ \snippet examples/qml/cppextensions/referenceexamples/properties/example.qml 0
The \c guests property is a \e{list property} of \c Person objects. A list
of \c Person objects are bound to the \c BirthdayParty's \c host property,
@@ -269,12 +269,12 @@ Q_PROPERTY(int size READ size CONSTANT)
the Q_PROPERTY() macro. However, list properties must have the type
\l{QQmlListProperty}{QQmlListProperty<T>}.
- \snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 2
+ \snippet examples/qml/cppextensions/referenceexamples/properties/birthdayparty.h 2
As with the other property types, the type of list content, \a T, must be
\l{register-c++-type}{registered} into the runtime.
- \snippet examples/declarative/cppextensions/referenceexamples/properties/main.cpp register list
+ \snippet examples/qml/cppextensions/referenceexamples/properties/main.cpp register list
\l {Extending QML - Object and List Property Types Example} shows the
complete code used to create the \c BirthdayParty type. For more
@@ -352,7 +352,7 @@ Q_PROPERTY(int size READ size CONSTANT)
Here is the \c host property declaration:
- \snippet examples/declarative/cppextensions/referenceexamples/binding/birthdayparty.h 0
+ \snippet examples/qml/cppextensions/referenceexamples/binding/birthdayparty.h 0
The NOTIFY attribute is followed by a signal name. It is the responsibility
of the class implementer to ensure that whenever the property's value
@@ -393,7 +393,7 @@ Q_PROPERTY(int size READ size CONSTANT)
attribute may be added to the property declaration instead of a NOTIFY
signal.
- \snippet examples/declarative/cppextensions/referenceexamples/binding/person.h 0
+ \snippet examples/qml/cppextensions/referenceexamples/binding/person.h 0
Extreme care must be taken here or applications using your type may misbehave.
The CONSTANT attribute should only be used for properties whose value is set,
@@ -412,10 +412,10 @@ Q_PROPERTY(int size READ size CONSTANT)
character of the signal is uppercased for the signal handler. The
signal parameter is also availabe to the QML signal.
- \snippet examples/declarative/cppextensions/referenceexamples/signal/birthdayparty.h 0
+ \snippet examples/qml/cppextensions/referenceexamples/signal/birthdayparty.h 0
The QML engine will create a handler for the \c partyStarted signal
called \c onPartyStarted.
- \snippet examples/declarative/cppextensions/referenceexamples/signal/example.qml 0
+ \snippet examples/qml/cppextensions/referenceexamples/signal/example.qml 0
Classes may have multiple signals with the same name, but only the final
signal is accessible as a QML signal. Note that signals with the same name
@@ -442,11 +442,11 @@ Q_PROPERTY(int size READ size CONSTANT)
The Q_INVOKABLE macro exposes any Qt C++ method as a QML method.
- \snippet examples/declarative/cppextensions/referenceexamples/methods/birthdayparty.h 0
+ \snippet examples/qml/cppextensions/referenceexamples/methods/birthdayparty.h 0
In a QML file, we can invoke the method as we would a
\l{JavaScript Expressions in QML}{JavaScript expression}.
- \snippet examples/declarative/cppextensions/referenceexamples/methods/example.qml 0
+ \snippet examples/qml/cppextensions/referenceexamples/methods/example.qml 0
\l {Extending QML - Methods Example}{Methods example} uses the Q_INVOKABLE
method to expose methods and demonstrates some usages of the method in
diff --git a/src/qml/doc/src/bindings/qmlplugins.qdoc b/src/qml/doc/src/bindings/qmlplugins.qdoc
index 08704ac9a9..ec0d608b32 100644
--- a/src/qml/doc/src/bindings/qmlplugins.qdoc
+++ b/src/qml/doc/src/bindings/qmlplugins.qdoc
@@ -63,7 +63,7 @@
as a new QML element. It provides the current time through \c hour and \c minute
properties.
- \snippet examples/declarative/cppextensions/plugins/plugin.cpp 0
+ \snippet examples/qml/cppextensions/plugins/plugin.cpp 0
\dots
A plugin class, \c QExampleQMLPlugin, is a subclass of
@@ -75,9 +75,9 @@
runtime with the qmlRegisterType() function. The Q_EXPORT_PLUGIN2() macro has
two parameters, the generated plugin name and the class name.
- \snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin
+ \snippet examples/qml/cppextensions/plugins/plugin.cpp plugin
\codeline
- \snippet examples/declarative/cppextensions/plugins/plugin.cpp export
+ \snippet examples/qml/cppextensions/plugins/plugin.cpp export
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 module is
@@ -108,13 +108,13 @@
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 examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
+ \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir
Once the project is built and installed, the new \c Time component is
accessible by any QML component that imports the \c com.nokia.TimeExample
module
- \snippet examples/declarative/cppextensions/plugins/plugins.qml 0
+ \snippet examples/qml/cppextensions/plugins/plugins.qml 0
The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}.
diff --git a/src/qml/doc/src/bindings/qmltypes.qdoc b/src/qml/doc/src/bindings/qmltypes.qdoc
index b4c52988cb..c5f4ee8f8b 100644
--- a/src/qml/doc/src/bindings/qmltypes.qdoc
+++ b/src/qml/doc/src/bindings/qmltypes.qdoc
@@ -53,16 +53,16 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
QML context. The class must be a subclass of \l{QObject} and have a default
constructor. The \l{The Property System}{properties} created with the
Q_PROPERTY macro are visible in the QML context as well.
- \snippet declarative/cppextensions/referenceexamples/adding/person.h 0
+ \snippet examples/qml/cppextensions/referenceexamples/adding/person.h 0
The application registers the class to the runtime with the
\l{qmlRegisterType()}.
- \snippet declarative/cppextensions/referenceexamples/adding/main.cpp 0
+ \snippet examples/qml/cppextensions/referenceexamples/adding/main.cpp 0
The Person type is then imported with the \c "People 1.0" module and its
properties are accessible in a QML file.
-\snippet declarative/cppextensions/referenceexamples/adding/example.qml 0
+ \snippet examples/qml/cppextensions/referenceexamples/adding/example.qml 0
The \l {Extending QML - Adding Types Example}{Adding Types} example
demonstrates as usage of the \l qmlRegisterType().
@@ -91,7 +91,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
way as regular properties. Thus, the lists or pointers are created as
properties using the Q_PROPERTY() macro.
- \snippet examples/declarative/cppextensions/referenceexamples/properties/birthdayparty.h 1
+ \snippet examples/qml/cppextensions/referenceexamples/properties/birthdayparty.h 1
The \c host is an \l{qml-expose-properties}{exposed property} that can bind
to objects or lists of objects. The property type, in this case \c Person,
@@ -216,7 +216,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
that allow the assignment of specialized classes to object or list
properties.
- \snippet examples/declarative/cppextensions/referenceexamples/coercion/example.qml 0
+ \snippet examples/qml/cppextensions/referenceexamples/coercion/example.qml 0
The QML snippet shown above assigns a \c Boy object to the \c
BirthdayParty's \c host property, and assigns three other objects to the \c
@@ -240,8 +240,8 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
define a mapping between the C++ class and a QML element name, so the type
is not instantiable from QML, but it is available for type coercion.
- \snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp 0
- \snippet examples/declarative/cppextensions/referenceexamples/coercion/main.cpp register boy girl
+ \snippet examples/qml/cppextensions/referenceexamples/coercion/main.cpp 0
+ \snippet examples/qml/cppextensions/referenceexamples/coercion/main.cpp register boy girl
The \c Person class is registered withouth the parameters. Both the
\c Boy and \c Girl class derive from the \c Person class.
@@ -258,7 +258,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
\target qml-c++-extension
\section1 Extension Objects
- \snippet examples/declarative/cppextensions/referenceexamples/extended/example.qml 0
+ \snippet examples/qml/cppextensions/referenceexamples/extended/example.qml 0
The \c leftMargin property is a new property to an existing C++ type,
\l QLineEdit, without modifying its source code.
@@ -303,8 +303,8 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
\section1 Property Value Sources
-\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 0
-\snippet examples/declarative/cppextensions/referenceexamples/valuesource/example.qml 1
+\snippet examples/qml/cppextensions/referenceexamples/valuesource/example.qml 0
+\snippet examples/qml/cppextensions/referenceexamples/valuesource/example.qml 1
The QML snippet shown above applies a property value source to the \c announcement property.
A property value source generates a value for a property that changes over time.
@@ -319,7 +319,7 @@ The example shown here is rather contrived: the \c announcement property of the
the \c HappyBirthdaySong value source generates the lyrics of the song
"Happy Birthday".
-\snippet examples/declarative/cppextensions/referenceexamples/valuesource/birthdayparty.h 0
+\snippet examples/qml/cppextensions/referenceexamples/valuesource/birthdayparty.h 0
Normally, assigning an object to a string property would not be allowed. In
the case of a property value source, rather than assigning the object instance
@@ -332,9 +332,9 @@ QQmlPropertyValueSource::setTarget(), that the QML engine invokes when
associating the property value source with a property. The relevant part of
the \c HappyBirthdaySong type declaration looks like this:
-\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0
-\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1
-\snippet examples/declarative/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2
+\snippet examples/qml/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 0
+\snippet examples/qml/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 1
+\snippet examples/qml/cppextensions/referenceexamples/valuesource/happybirthdaysong.h 2
In all other respects, property value sources are regular QML types. They must
be registered with the QML engine using the same macros as other types, and can
diff --git a/src/qml/doc/src/bindings/qtbinding.qdoc b/src/qml/doc/src/bindings/qtbinding.qdoc
index 49a856527c..f5a4feeec6 100644
--- a/src/qml/doc/src/bindings/qtbinding.qdoc
+++ b/src/qml/doc/src/bindings/qtbinding.qdoc
@@ -115,8 +115,8 @@ a displayable QML component into a QWidget-based application.
For example, suppose there is a \c MyItem.qml file that looks like this:
-\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start
-\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end
+\snippet qml/qtbinding/loading/MyItem.qml start
+\snippet qml/qtbinding/loading/MyItem.qml end
This QML document can be loaded with QQmlComponent or QQuickView with the following
C++ code. Using a QQmlComponent requires calling QQmlComponent::create() to create
@@ -126,23 +126,23 @@ component, which is accessible via QQuickView::rootObject():
\table
\row
\li
-\snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-a
+\snippet qml/qtbinding/loading/main.cpp QQmlComponent-a
\dots 0
-\snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-b
+\snippet qml/qtbinding/loading/main.cpp QQmlComponent-b
\li
-\snippet doc/snippets/qml/qtbinding/loading/main.cpp QQuickView
+\snippet qml/qtbinding/loading/main.cpp QQuickView
\endtable
This \c object is the instance of the \c MyItem.qml component that has been created. You can now
modify the item's properties using QObject::setProperty() or QQmlProperty:
-\snippet doc/snippets/qml/qtbinding/loading/main.cpp properties
+\snippet qml/qtbinding/loading/main.cpp properties
Alternatively, you can cast the object to its actual type and call functions with compile-time
safety. In this case the base object of \c MyItem.qml is an \l Item, which is defined by the
QQuickItem class:
-\snippet doc/snippets/qml/qtbinding/loading/main.cpp cast
+\snippet qml/qtbinding/loading/main.cpp cast
You can also connect to any signals or call functions defined in the component using
QMetaObject::invokeMethod() and QObject::connect(). See \l {Exchanging data between QML and C++}
@@ -154,14 +154,14 @@ QML components are essentially object trees with children that have siblings and
Child objects of QML components can be located using the QObject::objectName property with
QObject::findChild(). For example, if the root item in \c MyItem.qml had a child \l Rectangle item:
-\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start
+\snippet qml/qtbinding/loading/MyItem.qml start
\codeline
-\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml child
-\snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end
+\snippet qml/qtbinding/loading/MyItem.qml child
+\snippet qml/qtbinding/loading/MyItem.qml end
The child could be located like this:
-\snippet doc/snippets/qml/qtbinding/loading/main.cpp findChild
+\snippet qml/qtbinding/loading/main.cpp findChild
If \c objectName is used inside a delegate of a ListView, \l Repeater or some other
element that creates multiple instances of its delegates, there will be multiple children with
@@ -187,12 +187,12 @@ component, allowing data to be injected from C++ into QML.
For example, here is a QML item that refers to a \c currentDateTime value that does not exist in
the current scope:
-\snippet doc/snippets/qml/qtbinding/context/MyItem.qml 0
+\snippet qml/qtbinding/context/MyItem.qml 0
This \c currentDateTime value can be set directly by the C++ application that loads the QML
component, using QQmlContext::setContextProperty():
-\snippet doc/snippets/qml/qtbinding/context/main.cpp 0
+\snippet qml/qtbinding/context/main.cpp 0
Context properties can hold either QVariant or QObject* values. This means custom C++ objects can
also be injected using this approach, and these objects can be modified and read directly in QML.
@@ -202,11 +202,11 @@ invokes a method on the object instance:
\table
\row
\li
-\snippet doc/snippets/qml/qtbinding/context-advanced/applicationdata.h 0
+\snippet qml/qtbinding/context-advanced/applicationdata.h 0
\codeline
-\snippet doc/snippets/qml/qtbinding/context-advanced/main.cpp 0
+\snippet qml/qtbinding/context-advanced/main.cpp 0
\li
-\snippet doc/snippets/qml/qtbinding/context-advanced/MyItem.qml 0
+\snippet qml/qtbinding/context-advanced/MyItem.qml 0
\endtable
(Note that date/time values returned from C++ to QML can be formatted through
@@ -217,7 +217,7 @@ If the QML item needs to receive signals from the context property, it can conne
dataChanged(), this signal can be connected to using an \c onDataChanged handler within
a \l Connections object:
-\snippet doc/snippets/qml/qtbinding/context-advanced/connections.qml 0
+\snippet qml/qtbinding/context-advanced/connections.qml 0
Context properties can be useful for using C++ based data models in a QML view. See the
\l {declarative/modelviews/stringlistmodel}{String ListModel},
@@ -242,17 +242,17 @@ it does not paint anything; you will need to clear this if your item is supposed
For example, here is an \c ImageViewer class with an \c image URL property:
-\snippet doc/snippets/qml/qtbinding/newelements/imageviewer.h 0
+\snippet qml/qtbinding/newelements/imageviewer.h 0
Aside from the fact that it inherits QQuickItem, this is an ordinary class that could
exist outside of QML. However, once it is registered with the QML engine using qmlRegisterType():
-\snippet doc/snippets/qml/qtbinding/newelements/main.cpp register
+\snippet qml/qtbinding/newelements/main.cpp register
Then, any QML code loaded by your C++ application or \l{QQmlExtensionPlugin}{plugin} can create and manipulate
\c ImageViewer objects:
-\snippet doc/snippets/qml/qtbinding/newelements/standalone.qml 0
+\snippet qml/qtbinding/newelements/standalone.qml 0
It is advised that you avoid using QGraphicsItem functionality beyond the properties documented in QQuickItem.
@@ -286,8 +286,8 @@ QMetaObject::invokeMethod(). Here is a C++ application that uses this to call a
\table
\row
-\li \snippet doc/snippets/qml/qtbinding/functions-qml/MyItem.qml 0
-\li \snippet doc/snippets/qml/qtbinding/functions-qml/main.cpp 0
+\li \snippet qml/qtbinding/functions-qml/MyItem.qml 0
+\li \snippet qml/qtbinding/functions-qml/main.cpp 0
\endtable
Notice the Q_RETURN_ARG() and Q_ARG() arguments for QMetaObject::invokeMethod() must be specified as
@@ -300,11 +300,11 @@ methods on the \c myObject object, which has been set using QQmlContext::setCont
\table
\row
\li
-\snippet doc/snippets/qml/qtbinding/functions-cpp/MyItem.qml 0
+\snippet qml/qtbinding/functions-cpp/MyItem.qml 0
\li
-\snippet doc/snippets/qml/qtbinding/functions-cpp/myclass.h 0
+\snippet qml/qtbinding/functions-cpp/myclass.h 0
\codeline
-\snippet doc/snippets/qml/qtbinding/functions-cpp/main.cpp 0
+\snippet qml/qtbinding/functions-cpp/main.cpp 0
\endtable
QML supports the calling of overloaded C++ functions. If there are multiple C++ functions with the
@@ -325,11 +325,11 @@ is emitted:
\table
\row
\li
-\snippet doc/snippets/qml/qtbinding/signals-qml/MyItem.qml 0
+\snippet qml/qtbinding/signals-qml/MyItem.qml 0
\li
-\snippet doc/snippets/qml/qtbinding/signals-qml/myclass.h 0
+\snippet qml/qtbinding/signals-qml/myclass.h 0
\codeline
-\snippet doc/snippets/qml/qtbinding/signals-qml/main.cpp 0
+\snippet qml/qtbinding/signals-qml/main.cpp 0
\endtable
To connect to Qt C++ signals from within QML, use a signal handler with the \c on<SignalName> syntax.
@@ -342,12 +342,12 @@ C++ object are connected to through \c onImagedChanged and \c onLoadingError sig
\row
\li
-\snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h start
+\snippet qml/qtbinding/signals-cpp/imageviewer.h start
\dots 4
-\snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h end
+\snippet qml/qtbinding/signals-cpp/imageviewer.h end
\li
-\snippet doc/snippets/qml/qtbinding/signals-cpp/standalone.qml 0
+\snippet qml/qtbinding/signals-cpp/standalone.qml 0
\endtable
(Note that if a signal has been declared as the NOTIFY signal for a property, QML allows it to be
@@ -362,8 +362,8 @@ instead to create the signal handler:
\table
\row
-\li \snippet doc/snippets/qml/qtbinding/signals-cpp/main.cpp connections
-\li \snippet doc/snippets/qml/qtbinding/signals-cpp/MyItem.qml 0
+\li \snippet qml/qtbinding/signals-cpp/main.cpp connections
+\li \snippet qml/qtbinding/signals-cpp/MyItem.qml 0
\endtable
C++ signals can use enum values as parameters provided that the enum is declared in the
@@ -376,12 +376,12 @@ See \l {Using enumerations of a custom type} below for details.
Any properties declared in a QML object are automatically accessible from C++. Given a QML item
like this:
-\snippet doc/snippets/qml/qtbinding/properties-qml/MyItem.qml 0
+\snippet qml/qtbinding/properties-qml/MyItem.qml 0
The value of the \c someNumber property can be set and read using QQmlProperty, or
QObject::setProperty() and QObject::property():
-\snippet doc/snippets/qml/qtbinding/properties-qml/main.cpp 0
+\snippet qml/qtbinding/properties-qml/main.cpp 0
You should always use QObject::setProperty(), QQmlProperty or QMetaProperty::write() to
change a QML property value, to ensure the QML engine is made aware of the property change. For example,
@@ -410,8 +410,8 @@ property. This property can be written to and read from QML:
\table
\row
-\li \snippet doc/snippets/qml/qtbinding/properties-cpp/applicationdata.h 0
-\li \snippet doc/snippets/qml/qtbinding/properties-cpp/MyItem.qml 0
+\li \snippet qml/qtbinding/properties-cpp/applicationdata.h 0
+\li \snippet qml/qtbinding/properties-cpp/MyItem.qml 0
\endtable
Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal for the
@@ -468,8 +468,8 @@ converted to JavaScript array and object values, repectively:
\li String format
\li Example
\row
-\li \snippet doc/snippets/qml/qtbinding/variantlistmap/MyItem.qml 0
-\li \snippet doc/snippets/qml/qtbinding/variantlistmap/main.cpp 0
+\li \snippet qml/qtbinding/variantlistmap/MyItem.qml 0
+\li \snippet qml/qtbinding/variantlistmap/main.cpp 0
\endtable
This produces output like:
@@ -492,13 +492,13 @@ side, and is automatically converted to a QVariantList or QVariantMap when it is
To use an enumeration from a custom C++ component, the enumeration must be declared with Q_ENUMS() to
register it with Qt's meta object system. For example, the following C++ type has a \c Status enum:
-\snippet doc/snippets/qml/qtbinding/enums/imageviewer.h start
-\snippet doc/snippets/qml/qtbinding/enums/imageviewer.h end
+\snippet qml/qtbinding/enums/imageviewer.h start
+\snippet qml/qtbinding/enums/imageviewer.h end
Providing the \c ImageViewer class has been registered using qmlRegisterType(), its \c Status enum can
now be used from QML:
-\snippet doc/snippets/qml/qtbinding/enums/standalone.qml 0
+\snippet qml/qtbinding/enums/standalone.qml 0
The C++ type must be registered with QML to use its enums. If your C++ type is not instantiable, it
can be registered using qmlRegisterUncreatableType(). To be accessible from QML, the names of enum values
@@ -525,7 +525,7 @@ function, the enum type must be registered using qRegisterMetaType().
For QML signals, enum values may be used as signal parameters using the \c int type:
-\snippet doc/snippets/qml/qtbinding/enums/standalone.qml 1
+\snippet qml/qtbinding/enums/standalone.qml 1
\section2 Automatic Type Conversion from Strings
@@ -643,22 +643,22 @@ project
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:
-\quotefile doc/src/snippets/qml/qtbinding/resources/example.qrc
+\quotefile qml/qtbinding/resources/example.qrc
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 doc/snippets/qml/qtbinding/resources/main.qml 0
+\snippet 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 doc/snippets/qml/qtbinding/resources/main.cpp 0
+\snippet 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 doc/src/snippets/qml/qtbinding/resources/resources.pro
+\quotefile qml/qtbinding/resources/resources.pro
See \l {The Qt Resource System} for more information.
diff --git a/src/qml/doc/src/debugging.qdoc b/src/qml/doc/src/debugging.qdoc
index 462b2feb4c..11bd82c272 100644
--- a/src/qml/doc/src/debugging.qdoc
+++ b/src/qml/doc/src/debugging.qdoc
@@ -55,13 +55,13 @@ code location of the call.
\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.
-\qml
+\code
function f() {
var x = 12
console.assert(x == 12, "This will pass");
console.assert(x > 12, "This will fail");
}
-\endqml
+\endcode
\section2 Timer
@@ -90,11 +90,11 @@ and column number. The stack trace is limited to last 10 stack frames.
\c console.count prints the current number of times a particular piece of code has been executed,
along with a message. That is,
-\qml
+\code
function f() {
console.count("f called");
}
-\endqml
+\endcode
will print \c{f called: 1}, \c{f called: 2} ... whenever \c{f()} is executed.
diff --git a/src/qml/doc/src/engine/qmlengine.qdoc b/src/qml/doc/src/engine/qmlengine.qdoc
index fca3b984ff..07bce90b0f 100644
--- a/src/qml/doc/src/engine/qmlengine.qdoc
+++ b/src/qml/doc/src/engine/qmlengine.qdoc
@@ -98,8 +98,8 @@ specified in QML files, plugins, or applications.
For example, suppose there is a \c MyItem.qml file that looks like this:
- \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start
- \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end
+ \snippet qml/qtbinding/loading/MyItem.qml start
+ \snippet qml/qtbinding/loading/MyItem.qml end
This QML document can be loaded with QQmlComponent or
QQuickView with the following C++ code. Using a QQmlComponent
@@ -110,24 +110,24 @@ specified in QML files, plugins, or applications.
\table
\row
\li
- \snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-a
+ \snippet qml/qtbinding/loading/main.cpp QQmlComponent-a
\dots 0
- \snippet doc/snippets/qml/qtbinding/loading/main.cpp QQmlComponent-b
+ \snippet qml/qtbinding/loading/main.cpp QQmlComponent-b
\li
- \snippet doc/snippets/qml/qtbinding/loading/main.cpp QQuickView
+ \snippet qml/qtbinding/loading/main.cpp QQuickView
\endtable
This \c object is the instance of the \c MyItem.qml component that has been
created. You can now modify the item's properties using
QObject::setProperty() or QQmlProperty:
- \snippet doc/snippets/qml/qtbinding/loading/main.cpp properties
+ \snippet qml/qtbinding/loading/main.cpp properties
Alternatively, you can cast the object to its actual type and call functions
with compile-time safety. In this case the base object of \c MyItem.qml is
an \l Item, which is defined by the QQuickItem class:
- \snippet doc/snippets/qml/qtbinding/loading/main.cpp cast
+ \snippet qml/qtbinding/loading/main.cpp cast
You can also connect to any signals or call functions defined in the
component using QMetaObject::invokeMethod() and QObject::connect(). See \l
@@ -140,14 +140,14 @@ specified in QML files, plugins, or applications.
the QObject::objectName property with QObject::findChild(). For example, if
the root item in \c MyItem.qml had a child \l Rectangle item:
- \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml start
+ \snippet qml/qtbinding/loading/MyItem.qml start
\codeline
- \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml child
- \snippet doc/snippets/qml/qtbinding/loading/MyItem.qml end
+ \snippet qml/qtbinding/loading/MyItem.qml child
+ \snippet qml/qtbinding/loading/MyItem.qml end
The child could be located like this:
- \snippet doc/snippets/qml/qtbinding/loading/main.cpp findChild
+ \snippet qml/qtbinding/loading/main.cpp findChild
If \c objectName is used inside a delegate of a ListView, \l Repeater or
some other element that creates multiple instances of its delegates, there
@@ -178,13 +178,13 @@ specified in QML files, plugins, or applications.
For example, here is a QML item that refers to a \c currentDateTime value
that does not exist in the current scope:
- \snippet doc/snippets/qml/qtbinding/context/MyItem.qml 0
+ \snippet qml/qtbinding/context/MyItem.qml 0
This \c currentDateTime value can be set directly by the C++ application
that loads the QML component, using
QQmlContext::setContextProperty():
- \snippet doc/snippets/qml/qtbinding/context/main.cpp 0
+ \snippet qml/qtbinding/context/main.cpp 0
Context properties can hold either QVariant or QObject* values. This means
custom C++ objects can also be injected using this approach, and these
@@ -195,11 +195,11 @@ specified in QML files, plugins, or applications.
\table
\row
\li
- \snippet doc/snippets/qml/qtbinding/context-advanced/applicationdata.h 0
+ \snippet qml/qtbinding/context-advanced/applicationdata.h 0
\codeline
- \snippet doc/snippets/qml/qtbinding/context-advanced/main.cpp 0
+ \snippet qml/qtbinding/context-advanced/main.cpp 0
\li
- \snippet doc/snippets/qml/qtbinding/context-advanced/MyItem.qml 0
+ \snippet qml/qtbinding/context-advanced/MyItem.qml 0
\endtable
(Note that date/time values returned from C++ to QML can be formatted through
@@ -211,7 +211,7 @@ specified in QML files, plugins, or applications.
connected to using an \c onDataChanged handler within a \l Connections
object:
- \snippet doc/snippets/qml/qtbinding/context-advanced/connections.qml 0
+ \snippet qml/qtbinding/context-advanced/connections.qml 0
Context properties can be useful for using C++ based data models in a QML view. See the
\l {declarative/modelviews/stringlistmodel}{String ListModel},
@@ -245,8 +245,8 @@ specified in QML files, plugins, or applications.
\table
\row
- \li \snippet doc/snippets/qml/qtbinding/functions-qml/MyItem.qml 0
- \li \snippet doc/snippets/qml/qtbinding/functions-qml/main.cpp 0
+ \li \snippet qml/qtbinding/functions-qml/MyItem.qml 0
+ \li \snippet qml/qtbinding/functions-qml/main.cpp 0
\endtable
Notice the Q_RETURN_ARG() and Q_ARG() arguments for
@@ -261,11 +261,11 @@ specified in QML files, plugins, or applications.
\table
\row
\li
- \snippet doc/snippets/qml/qtbinding/functions-cpp/MyItem.qml 0
+ \snippet qml/qtbinding/functions-cpp/MyItem.qml 0
\li
- \snippet doc/snippets/qml/qtbinding/functions-cpp/myclass.h 0
+ \snippet qml/qtbinding/functions-cpp/myclass.h 0
\codeline
- \snippet doc/snippets/qml/qtbinding/functions-cpp/main.cpp 0
+ \snippet qml/qtbinding/functions-cpp/main.cpp 0
\endtable
QML supports the calling of overloaded C++ functions. If there are multiple
@@ -288,11 +288,11 @@ specified in QML files, plugins, or applications.
\table
\row
\li
- \snippet doc/snippets/qml/qtbinding/signals-qml/MyItem.qml 0
+ \snippet qml/qtbinding/signals-qml/MyItem.qml 0
\li
- \snippet doc/snippets/qml/qtbinding/signals-qml/myclass.h 0
+ \snippet qml/qtbinding/signals-qml/myclass.h 0
\codeline
- \snippet doc/snippets/qml/qtbinding/signals-qml/main.cpp 0
+ \snippet qml/qtbinding/signals-qml/main.cpp 0
\endtable
To connect to Qt C++ signals from within QML, use a signal handler with the
@@ -307,12 +307,12 @@ specified in QML files, plugins, or applications.
\row
\li
- \snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h start
+ \snippet qml/qtbinding/signals-cpp/imageviewer.h start
\dots 4
- \snippet doc/snippets/qml/qtbinding/signals-cpp/imageviewer.h end
+ \snippet qml/qtbinding/signals-cpp/imageviewer.h end
\li
- \snippet doc/snippets/qml/qtbinding/signals-cpp/standalone.qml 0
+ \snippet qml/qtbinding/signals-cpp/standalone.qml 0
\endtable
(Note that if a signal has been declared as the NOTIFY signal for a
@@ -330,8 +330,8 @@ specified in QML files, plugins, or applications.
\table
\row
- \li \snippet doc/snippets/qml/qtbinding/signals-cpp/main.cpp connections
- \li \snippet doc/snippets/qml/qtbinding/signals-cpp/MyItem.qml 0
+ \li \snippet qml/qtbinding/signals-cpp/main.cpp connections
+ \li \snippet qml/qtbinding/signals-cpp/MyItem.qml 0
\endtable
C++ signals can use enum values as parameters provided that the enum is
@@ -345,12 +345,12 @@ specified in QML files, plugins, or applications.
Any properties declared in a QML object are automatically accessible from
C++. Given a QML item like this:
- \snippet doc/snippets/qml/qtbinding/properties-qml/MyItem.qml 0
+ \snippet qml/qtbinding/properties-qml/MyItem.qml 0
The value of the \c someNumber property can be set and read using
QQmlProperty, or QObject::setProperty() and QObject::property():
- \snippet doc/snippets/qml/qtbinding/properties-qml/main.cpp 0
+ \snippet qml/qtbinding/properties-qml/main.cpp 0
You should always use QObject::setProperty(), QQmlProperty or
QMetaProperty::write() to change a QML property value, to ensure the QML
@@ -380,8 +380,8 @@ specified in QML files, plugins, or applications.
\table
\row
- \li \snippet doc/snippets/qml/qtbinding/properties-cpp/applicationdata.h 0
- \li \snippet doc/snippets/qml/qtbinding/properties-cpp/MyItem.qml 0
+ \li \snippet qml/qtbinding/properties-cpp/applicationdata.h 0
+ \li \snippet qml/qtbinding/properties-cpp/MyItem.qml 0
\endtable
Notice the \c backgroundColorChanged signal is declared as the NOTIFY signal
diff --git a/src/qml/doc/src/engine/qtjavascript.qdoc b/src/qml/doc/src/engine/qtjavascript.qdoc
index a7ffc8550a..2521e8d91f 100644
--- a/src/qml/doc/src/engine/qtjavascript.qdoc
+++ b/src/qml/doc/src/engine/qtjavascript.qdoc
@@ -56,7 +56,7 @@
evaluate() function, passing the script code (text) to evaluate
as argument.
- \snippet doc/snippets/qtjavascript/evaluation/main.cpp 0
+ \snippet qtjavascript/evaluation/main.cpp 0
The return value will be the result of the evaluation (represented
as a QJSValue object); this can be converted to standard C++
@@ -66,7 +66,7 @@
them with the script engine. This is most easily done by setting
properties of the script engine's \e{Global Object}:
- \snippet doc/snippets/qtjavascript/registeringvalues/main.cpp 0
+ \snippet qtjavascript/registeringvalues/main.cpp 0
This places the properties in the script environment, thus making them
available to script code.
@@ -83,7 +83,7 @@
Here's an example of making an instance of a QObject subclass
available to script code under the name \c{"myObject"}:
- \snippet doc/snippets/qtjavascript/registeringobjects/main.cpp 0
+ \snippet qtjavascript/registeringobjects/main.cpp 0
This will create a global variable called \c{myObject} in the
script environment. The variable serves as a proxy to the
diff --git a/src/qml/doc/src/qml/basictypes.qdoc b/src/qml/doc/src/qml/basictypes.qdoc
index 8ba7cc460e..1177a12e94 100644
--- a/src/qml/doc/src/qml/basictypes.qdoc
+++ b/src/qml/doc/src/qml/basictypes.qdoc
@@ -180,7 +180,8 @@
\div{float-right}
\inlineimage declarative-colors.png
\enddiv
- \snippet doc/snippets/qml/colors.qml colors
+
+ \snippet qml/colors.qml colors
Or with 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:
diff --git a/src/qml/doc/src/qml/codingconventions.qdoc b/src/qml/doc/src/qml/codingconventions.qdoc
index 04af57012a..89a1bd8cb3 100644
--- a/src/qml/doc/src/qml/codingconventions.qdoc
+++ b/src/qml/doc/src/qml/codingconventions.qdoc
@@ -52,7 +52,7 @@ 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 doc/snippets/qml/codingconventions/photo.qml 0
+\snippet qml/codingconventions/photo.qml 0
\section1 Grouped Properties
@@ -62,11 +62,11 @@ we use the \e {group notation} rather than the \e {dot notation} to improve read
For example, this:
-\snippet doc/snippets/qml/codingconventions/dotproperties.qml 0
+\snippet qml/codingconventions/dotproperties.qml 0
can be written like this:
-\snippet doc/snippets/qml/codingconventions/dotproperties.qml 1
+\snippet qml/codingconventions/dotproperties.qml 1
\section1 Private Properties
@@ -78,7 +78,7 @@ the implementation. As a convention, private properties begin with two
accessible but is not meant for public use. Note that QML and JavaScript will
grant the user access to these properties.
-\snippet doc/snippets/qml/codingconventions/private.qml 0
+\snippet qml/codingconventions/private.qml 0
\section1 Lists
@@ -89,30 +89,30 @@ For example, it is very common for a component to only have one state.
In this case, instead of:
-\snippet doc/snippets/qml/codingconventions/lists.qml 0
+\snippet qml/codingconventions/lists.qml 0
we will write this:
-\snippet doc/snippets/qml/codingconventions/lists.qml 1
+\snippet qml/codingconventions/lists.qml 1
\section1 JavaScript Code
If the script is a single expression, we recommend writing it inline:
-\snippet doc/snippets/qml/codingconventions/javascript.qml 0
+\snippet qml/codingconventions/javascript.qml 0
If the script is only a couple of lines long, we generally use a block:
-\snippet doc/snippets/qml/codingconventions/javascript.qml 1
+\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 doc/snippets/qml/codingconventions/javascript.qml 2
+\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 doc/snippets/qml/codingconventions/javascript-imports.qml 0
+\snippet qml/codingconventions/javascript-imports.qml 0
*/
diff --git a/src/qml/doc/src/qml/dynamicobjects.qdoc b/src/qml/doc/src/qml/dynamicobjects.qdoc
index caa4e63744..f5a47b8915 100644
--- a/src/qml/doc/src/qml/dynamicobjects.qdoc
+++ b/src/qml/doc/src/qml/dynamicobjects.qdoc
@@ -80,31 +80,31 @@ the component. This function can take one or two arguments:
Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
-\snippet doc/snippets/qml/Sprite.qml 0
+\snippet qml/Sprite.qml 0
Our main application file, \c main.qml, imports a \c componentCreation.js JavaScript file
that will create \c Sprite objects:
-\snippet doc/snippets/qml/createComponent.qml 0
+\snippet qml/createComponent.qml 0
Here is \c componentCreation.js. Notice it checks whether the component \l{Component::status}{status} is
\c Component.Ready before calling \l {Component::createObject()}{createObject()}
in case the QML file is loaded over a network and thus is not ready immediately.
-\snippet doc/snippets/qml/componentCreation.js vars
+\snippet qml/componentCreation.js vars
\codeline
-\snippet doc/snippets/qml/componentCreation.js func
-\snippet doc/snippets/qml/componentCreation.js remote
-\snippet doc/snippets/qml/componentCreation.js func-end
+\snippet qml/componentCreation.js func
+\snippet qml/componentCreation.js remote
+\snippet qml/componentCreation.js func-end
\codeline
-\snippet doc/snippets/qml/componentCreation.js finishCreation
+\snippet qml/componentCreation.js finishCreation
If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation()
function and call \l {Component::createObject()}{createObject()} immediately:
-\snippet doc/snippets/qml/componentCreation.js func
-\snippet doc/snippets/qml/componentCreation.js local
-\snippet doc/snippets/qml/componentCreation.js func-end
+\snippet qml/componentCreation.js func
+\snippet qml/componentCreation.js local
+\snippet qml/componentCreation.js func-end
Notice in both instances, \l {Component::createObject()}{createObject()} is called with
\c appWindow passed as an argument so that the created object will become a child of the
@@ -126,7 +126,7 @@ It is also possible to instantiate components without blocking via the
If the QML is not defined until runtime, you can create a QML item from
a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
-\snippet doc/snippets/qml/createQmlObject.qml 0
+\snippet qml/createQmlObject.qml 0
The first argument is the string of QML to create. Just like in a new file, you will need to
import any types you wish to use. The second argument is the parent item for the new item;
@@ -184,8 +184,8 @@ component. Each instance runs a NumberAnimation, and when the animation has fini
\li \c SelfDestroyingRect.qml
\row
-\li \snippet doc/snippets/qml/dynamicObjects-destroy.qml 0
-\li \snippet doc/snippets/qml/SelfDestroyingRect.qml 0
+\li \snippet qml/dynamicObjects-destroy.qml 0
+\li \snippet qml/SelfDestroyingRect.qml 0
\endtable
@@ -212,6 +212,6 @@ destroyed if they were dynamically created.
Objects created with \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
can similarly be destroyed using \c destroy():
-\snippet doc/snippets/qml/createQmlObject.qml 0
-\snippet doc/snippets/qml/createQmlObject.qml destroy
+\snippet qml/createQmlObject.qml 0
+\snippet qml/createQmlObject.qml destroy
*/
diff --git a/src/qml/doc/src/qml/javascriptblocks.qdoc b/src/qml/doc/src/qml/javascriptblocks.qdoc
index 886289d9b7..f5bcca3a5a 100644
--- a/src/qml/doc/src/qml/javascriptblocks.qdoc
+++ b/src/qml/doc/src/qml/javascriptblocks.qdoc
@@ -200,8 +200,8 @@ in \c script.js:
\table
\row
-\li \snippet doc/snippets/qml/integrating-javascript/connectjs.qml 0
-\li \snippet doc/snippets/qml/integrating-javascript/script.js 0
+\li \snippet qml/integrating-javascript/connectjs.qml 0
+\li \snippet qml/integrating-javascript/script.js 0
\endtable
The \c jsFunction() will now be called whenever MouseArea's \c clicked signal is emitted.
@@ -243,10 +243,10 @@ which in turn can call \c factorial() in \c factorial.js, as it has included
\table
\row
-\li {1,2} \snippet doc/snippets/qml/integrating-javascript/includejs/app.qml 0
-\li \snippet doc/snippets/qml/integrating-javascript/includejs/script.js 0
+\li {1,2} \snippet qml/integrating-javascript/includejs/app.qml 0
+\li \snippet qml/integrating-javascript/includejs/script.js 0
\row
-\li \snippet doc/snippets/qml/integrating-javascript/includejs/factorial.js 0
+\li \snippet qml/integrating-javascript/includejs/factorial.js 0
\endtable
Notice that calling \l {QML:Qt::include()}{Qt.include()} imports all functions from
@@ -488,11 +488,11 @@ themselves.
For the following examples, imagine that we have defined the following class:
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.h 0
+\snippet qml/integrating-javascript/scarceresources/avatarExample.h 0
and that we have registered it with the QML type-system as follows:
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 0
+\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 0
The AvatarExample class has a property which is a pixmap. When the property
is accessed in JavaScript scope, a copy of the resource will be created and
@@ -507,9 +507,9 @@ unless the client explicitly preserves it.
In the following example, the scarce resource will be automatically released
after the binding evaluation is complete.
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleOne.qml 0
+\snippet qml/integrating-javascript/scarceresources/exampleOne.qml 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 1
+\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 1
\section2 Example Two: Automatic Release Prevented By Reference
@@ -518,9 +518,9 @@ released after the binding expression evaluation is
complete, because there is a property var referencing the
scarce resource.
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleTwo.qml 0
+\snippet qml/integrating-javascript/scarceresources/exampleTwo.qml 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 2
+\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 2
\section2 Example Three: Explicit Preservation
@@ -528,11 +528,11 @@ In this example, the resource must be explicitly preserved in order
to prevent the declarative engine from automatically releasing the
resource after evaluation of the imported script.
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleThree.js 0
+\snippet qml/integrating-javascript/scarceresources/exampleThree.js 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleThree.qml 0
+\snippet qml/integrating-javascript/scarceresources/exampleThree.qml 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 3
+\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 3
\section2 Example Four: Explicit Destruction
@@ -541,11 +541,11 @@ scarce resource variant. This example shows how a client may free system
resources by releasing the scarce resource held in a JavaScript object, if
required, during evaluation of a JavaScript expression.
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleFour.js 0
+\snippet qml/integrating-javascript/scarceresources/exampleFour.js 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleFour.qml 0
+\snippet qml/integrating-javascript/scarceresources/exampleFour.qml 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 4
+\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 4
\section2 Example Five: Explicit Destruction And JavaScript References
@@ -555,8 +555,8 @@ to one scarce resource is held, and the client calls destroy() on one
of those references (to explicitly release the scarce resource), all of
the references will be affected.
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/exampleFive.qml 0
+\snippet qml/integrating-javascript/scarceresources/exampleFive.qml 0
-\snippet doc/snippets/qml/integrating-javascript/scarceresources/avatarExample.cpp 5
+\snippet qml/integrating-javascript/scarceresources/avatarExample.cpp 5
*/
diff --git a/src/qml/doc/src/qml/network.qdoc b/src/qml/doc/src/qml/network.qdoc
index 049bdddf5a..1df6f51202 100644
--- a/src/qml/doc/src/qml/network.qdoc
+++ b/src/qml/doc/src/qml/network.qdoc
@@ -113,7 +113,7 @@ content by URLs that can then be used directly in QML. For example, using these
to access an on-line photography service would provide the QML application with URLs to
photographs, which can be directly set on an \l Image \c source property.
-See the \tt examples/declarative/flickr for a real demonstration of this.
+See the \tt examples/quick/flickr for a real demonstration of this.
\section1 Configuring the Network Access Manager
diff --git a/src/qml/doc/src/qml/propertybinding.qdoc b/src/qml/doc/src/qml/propertybinding.qdoc
index 3c764c4df3..219bb240ba 100644
--- a/src/qml/doc/src/qml/propertybinding.qdoc
+++ b/src/qml/doc/src/qml/propertybinding.qdoc
@@ -44,10 +44,10 @@ The syntax for properties is:
Elements already possess useful properties but, to create custom properties,
precede the property name with the keyword \c property.
-\snippet doc/snippets/qml/properties.qml parent begin
-\snippet doc/snippets/qml/properties.qml inherited properties
-\snippet doc/snippets/qml/properties.qml custom properties
-\snippet doc/snippets/qml/properties.qml parent end
+\snippet qml/properties.qml parent begin
+\snippet qml/properties.qml inherited properties
+\snippet qml/properties.qml custom properties
+\snippet qml/properties.qml parent end
QML property rules coincide with many of JavaScript's property rules, for example,
property names must begin with a lowercase letter.
@@ -62,14 +62,14 @@ to other property values or data accessible in the application. The property val
automatically kept up to date if the other properties or data values change.
Property bindings are created in QML using the colon "\c {:}" before the value:
-\snippet doc/snippets/qml/properties.qml property binding
+\snippet qml/properties.qml property binding
The property binding causes the width of the \c Rectangle to update whenever the
\c {parent}'s width changes.
QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be
used as a property binding. Bindings can access object properties, make function calls and even
use built-in JavaScript objects such as \c {Date} and \c {Math}.
-\snippet doc/snippets/qml/properties.qml JavaScript sample
+\snippet qml/properties.qml JavaScript sample
While syntactically bindings can be of arbitrary complexity, if a binding starts to become
overly complex - such as involving multiple lines, or imperative loops - it may be better
@@ -82,13 +82,13 @@ function.
When working with both QML and JavaScript, it is important to differentiate between
QML property binding and JavaScript value assignment. In QML, a property
binding is created using the colon "\c {:}".
-\snippet doc/snippets/qml/properties.qml property binding
+\snippet qml/properties.qml property binding
The property binding causes the width of the \c Rectangle to update whenever the
\c {parent}'s width changes.
Assigning a property value (using the equals sign "\c {=}") does not create a
property binding (unless explicitly assigned, see below).
-\snippet doc/snippets/qml/properties.qml property assignment
+\snippet qml/properties.qml property assignment
Instead of creating a property binding, the assignment simply sets the \c Rectangle
\c width value to a number when the \c Component.onCompleted code is invoked.
@@ -185,7 +185,7 @@ Care must be taken when referring to the parent of an object property binding.
Elements and components that are bound to properties are not necessarily set
as children of the properties' component.
-\snippet doc/snippets/qml/properties.qml object binding
+\snippet qml/properties.qml object binding
The code snippet has a \l Gradient element that attempts to print its parent's
\c width value. However, the \c Gradient element is bound to the \c gradient
property, not the \c children property of the \c Rectangle. As a result, the
@@ -204,7 +204,7 @@ Certain objects provide additional properties by \e attaching properties to othe
objects. For example, the \l Keys element have properties that can \e attach to other QML
objects to provide keyboard handling.
-\snippet doc/snippets/qml/properties.qml list attached property
+\snippet qml/properties.qml list attached property
The element \l ListView provides the delegate, \c listdelegate, the property
\c isCurrentItem as an attached property. The \c ListView.isCurrentItem
\e{attached property} provides highlight information to the delegate.
@@ -220,7 +220,7 @@ to provide additional functionality to objects. Two prominent elements,
\l Component and \l Keys element provide
\l{QML Signal and Handler Event System}{signal handlers} as attached signal
handlers.
-\snippet doc/snippets/qml/properties.qml attached signal handler
+\snippet qml/properties.qml attached signal handler
Read the \l{QML Signal and Handler Event System} and the \l{Keyboard Focus in QML}
articles for more information.
@@ -231,14 +231,14 @@ Some properties may accept a binding to a list property, where more than one
component can bind to the property. List properties allow multiple
\l {State}{States}, \l {Gradient}{Gradients}, and other components to bind to a
single property.
-\snippet doc/snippets/qml/properties.qml list property
+\snippet qml/properties.qml list property
The list is enclosed in square brackets, with a comma separating the
list elements. In cases where you are only assigning a single item to a
list, you may omit the square brackets.
-\snippet doc/snippets/qml/properties.qml single property
+\snippet qml/properties.qml single property
To access the list, use the \c index property.
-\snippet doc/snippets/qml/properties.qml print list property
+\snippet qml/properties.qml print list property
The snippet code simply prints the name of the first state, \c FETCH.
See the \l{list}{list type} documentation
@@ -251,7 +251,7 @@ In some cases properties form a logical group and use either the \e dot notation
or \e group notation.
Grouped properties may be written both ways:
-\snippet doc/snippets/qml/properties.qml grouped properties
+\snippet qml/properties.qml grouped properties
In the element documentation grouped properties are shown using the dot notation.
@@ -274,18 +274,18 @@ Accessing the aliasing property is similar to accessing a regular property. In
addition, the optional \c default keyword indicates that the aliasing property
is a \l{Default Properties}{default property}.
-\snippet doc/snippets/qml/Button.qml property alias
+\snippet qml/Button.qml property alias
When importing the component as a \c Button, the \c buttonlabel is directly
accessible through the \c label property.
-\snippet doc/snippets/qml/properties.qml alias usage
+\snippet qml/properties.qml alias usage
In addition, the \c id property may also be aliased and referred outside the
component.
-\snippet doc/snippets/qml/Button.qml parent begin
-\snippet doc/snippets/qml/Button.qml id alias
-\snippet doc/snippets/qml/Button.qml parent end
+\snippet qml/Button.qml parent begin
+\snippet qml/Button.qml id alias
+\snippet qml/Button.qml parent end
The \c imagebutton component has the ability to modify the child \l Image object
and its properties.
-\snippet doc/snippets/qml/properties.qml image alias
+\snippet qml/properties.qml image alias
Using aliases, properties may be exposed to the
\l{qml-top-level-component}{top level component}. Exposing properties to the
@@ -298,7 +298,7 @@ Aliases are only activated once the component
when an uninitialized alias is referenced. Likewise, aliasing an aliasing
property will also result in an error.
-\snippet doc/snippets/qml/properties.qml alias complete
+\snippet qml/properties.qml alias complete
When importing the component, however, aliasing properties appear as regular Qt
properties and consequently can be used in alias references.
@@ -308,7 +308,7 @@ property, effectively overwriting the existing property. For example,
the following component has a \c color alias property, named the same as the built-in
\l {Rectangle::color} property:
-\snippet doc/snippets/qml/properties.qml alias overwrite
+\snippet qml/properties.qml alias overwrite
Any object that use this component and refer to its \c color property will be
referring to the alias rather than the ordinary \l {Rectangle::color} property.
@@ -327,13 +327,13 @@ as the \e {default property}. For example, the State element's default property
is its \l{State::changes}{changes} property. \l PropertyChanges elements
may simply be placed as the \c{State}'s children and they will be bound to the
\c changes property.
-\snippet doc/snippets/qml/properties.qml state default
+\snippet qml/properties.qml state default
Similarly, the \l Item element's default property is its
\l{Item::data}{data} property. The \c data property manages Item's
\c children and \c resources properties. This way, different data types may be
placed as direct children of the \c Item.
-\snippet doc/snippets/qml/properties.qml default property
+\snippet qml/properties.qml default property
Reassigning a default property is useful when a component is reused. For
example, the \l{declarative/ui-components/tabwidget}{TabWidget} example uses
@@ -349,14 +349,14 @@ For example, to bind a property exposed from the \l{The QML Engine}{declarative
runtime} or \l{QmlGlobalQtObject}{Qt object}, such as the \c system.brightness
property, to a value written in QML, you could use the \l Binding element as
follows:
-\snippet doc/snippets/qml/properties.qml binding element
+\snippet qml/properties.qml binding element
\section1 Changing Property Values in States
The \l PropertyChanges element is for setting property bindings within a
\l State element to set a property binding.
-\snippet doc/snippets/qml/properties.qml PropertyChanges element
+\snippet qml/properties.qml PropertyChanges element
The rectangle's \c color property will bind to the \c warning component's
\c color property when its \c state is set to the \c WARNING state.
*/
diff --git a/src/qml/doc/src/qml/qmlcomponents.qdoc b/src/qml/doc/src/qml/qmlcomponents.qdoc
index bf95aba72f..9d0da72646 100644
--- a/src/qml/doc/src/qml/qmlcomponents.qdoc
+++ b/src/qml/doc/src/qml/qmlcomponents.qdoc
@@ -50,7 +50,7 @@ is the emphasis in QML.
Any snippet of QML code may become a component, by placing the code in a QML
file, whose file extension is \c .qml). A complete Button component that
responds to user input may be in a Button.qml file.
-\snippet doc/snippets/qml/reusablecomponents/Button.qml document
+\snippet qml/reusablecomponents/Button.qml document
The component name, \c Button, matches the QML filename, \c Button.qml.
Also, the first character is in upper case. Matching the names allow
@@ -60,9 +60,9 @@ naming components with different filenames.
Alternatively, a \l Component element may encapsulate a QML object to form a
component.
-\snippet doc/snippets/qml/reusablecomponents/component.qml parent begin
-\snippet doc/snippets/qml/reusablecomponents/component.qml define inline component
-\snippet doc/snippets/qml/reusablecomponents/component.qml parent end
+\snippet qml/reusablecomponents/component.qml parent begin
+\snippet qml/reusablecomponents/component.qml define inline component
+\snippet qml/reusablecomponents/component.qml parent end
Components may incorporate any \l{Qt Quick}{QML feature} such as:
@@ -89,7 +89,7 @@ A component defined in a \c .qml file is directly usable by declaring the name
of the component. For example, a button defined in \c Button.qml is created by
declaring a \c Button. The button is defined in the
\l {qml-define-components}{Defining New Components} section.
-\snippet doc/snippets/qml/reusablecomponents/application.qml document
+\snippet qml/reusablecomponents/application.qml document
Note that the component name, \c Button, matches the QML filename, \c Button.qml.
Also, the first character is in upper case. Matching the names allow
@@ -100,7 +100,7 @@ For flexibility, a \c qmldir file is for dictating which additional components,
plugins, or directories should be imported. By using a \c qmldir file, component
names do not need to match the filenames. The \c qmldir file should, however, be
in an imported path.
-\snippet doc/snippets/qml/reusablecomponents/qmldir document
+\snippet qml/reusablecomponents/qmldir document
\section2 Loading an Inline Component
@@ -109,8 +109,8 @@ delayed. A component may be created during a MouseArea event or by using a
\l Loader element. The component can create an object, which is addressable in a
similar way as an \l {qml-id}{identifier}. Thus, the created object may
have its bindings set and read like a normal QML object.
-\snippet doc/snippets/qml/reusablecomponents/component.qml define inline component
-\snippet doc/snippets/qml/reusablecomponents/component.qml create inline component
+\snippet qml/reusablecomponents/component.qml define inline component
+\snippet qml/reusablecomponents/component.qml create inline component
\keyword qml-component-properties
\section1 Component Properties
@@ -140,11 +140,11 @@ Consider the Button component from the
object is a \l Rectangle. When imported, the Button component will possess the
Rectangle's properties, methods, signals, and any custom properties.
-\snippet doc/snippets/qml/reusablecomponents/Button.qml parent begin
-\snippet doc/snippets/qml/reusablecomponents/Button.qml ellipses
-\snippet doc/snippets/qml/reusablecomponents/Button.qml properties
-\snippet doc/snippets/qml/reusablecomponents/Button.qml ellipses
-\snippet doc/snippets/qml/reusablecomponents/Button.qml parent end
+\snippet qml/reusablecomponents/Button.qml parent begin
+\snippet qml/reusablecomponents/Button.qml ellipses
+\snippet qml/reusablecomponents/Button.qml properties
+\snippet qml/reusablecomponents/Button.qml ellipses
+\snippet qml/reusablecomponents/Button.qml parent end
The Button's \c text alias is accessible from outside the component as well as
the Rectangle's visual properties and signals such as \c x, \c y, \c anchors,
@@ -156,7 +156,7 @@ children which is beneficial for certain types of interfaces. However, since
\c FocusScopes are not visual elements, the visual properties of its child need
to be exposed.
-\snippet doc/snippets/qml/reusablecomponents/focusbutton.qml document
+\snippet qml/reusablecomponents/focusbutton.qml document
\keyword qml-id
\section2 The Object Identifier
@@ -165,7 +165,7 @@ Each QML object may be given a special unique identifier called an \c id.
No other object within the same QML component (see \l{QML Documents}) can have
the same \c id value. QML objects may then access an object using the \c id
property.
-\snippet doc/snippets/qml/properties.qml id property
+\snippet qml/properties.qml id property
A component may readily access its parent's properties by using the \c parent
property.
@@ -178,15 +178,15 @@ Note that an \c id must begin with a lower-case letter or an underscore. The
Objects or Items declared within a component can be made accessible by binding their id to a
property alias.
-\snippet doc/snippets/qml/reusablecomponents/Button.qml parent begin
-\snippet doc/snippets/qml/reusablecomponents/Button.qml object alias
-\snippet doc/snippets/qml/reusablecomponents/Button.qml text
-\snippet doc/snippets/qml/reusablecomponents/Button.qml parent end
+\snippet qml/reusablecomponents/Button.qml parent begin
+\snippet qml/reusablecomponents/Button.qml object alias
+\snippet qml/reusablecomponents/Button.qml text
+\snippet qml/reusablecomponents/Button.qml parent end
The advantage of using an alias instead a property of type of the object is that the value of
the alias cannot be overridden, and members of the object can be used in property bindings when
declaring an instance of the component.
-\snippet doc/snippets/qml/reusablecomponents/application.qml grouped property
+\snippet qml/reusablecomponents/application.qml grouped property
If a property of type \c Text was used instead of an alias in this instance there would be no
guarantee that \c label would be initialized before the binding was attempted which would cause
the binding to fail.
diff --git a/src/qml/doc/src/qml/qmldocument.qdoc b/src/qml/doc/src/qml/qmldocument.qdoc
index 89a5bbd57b..d1d4cc0524 100644
--- a/src/qml/doc/src/qml/qmldocument.qdoc
+++ b/src/qml/doc/src/qml/qmldocument.qdoc
@@ -36,7 +36,7 @@ from text data.
Here is a simple QML document:
-\snippet doc/snippets/qml/qml-documents/non-trivial.qml document
+\snippet qml/qml-documents/non-trivial.qml document
QML documents are always encoded in UTF-8 format.
@@ -79,7 +79,7 @@ text property:
\li application.qml
\row
-\li \snippet doc/snippets/qml/qml-documents/qmldocuments.qml document
+\li \snippet qml/qml-documents/qmldocuments.qml document
\li
\qml
import QtQuick 2.0
@@ -138,9 +138,9 @@ These final two examples perform identically to the original document.
\table
\row
\li
-\snippet doc/snippets/qml/qml-documents/inline-component.qml document
+\snippet qml/qml-documents/inline-component.qml document
\li
-\snippet doc/snippets/qml/qml-documents/inline-text-component.qml document
+\snippet qml/qml-documents/inline-text-component.qml document
\endtable
diff --git a/src/qml/doc/src/qml/qmllanguage-modules.qdoc b/src/qml/doc/src/qml/qmllanguage-modules.qdoc
index d32ce10b65..b5c17a4e22 100644
--- a/src/qml/doc/src/qml/qmllanguage-modules.qdoc
+++ b/src/qml/doc/src/qml/qmllanguage-modules.qdoc
@@ -52,7 +52,7 @@ example, an \c import statement is required to use:
An \c import statement includes the module name, and possibly a version number.
This can be seen in the snippet commonly found at the top of QML files:
-\snippet doc/snippets/qml/imports/qtquick-1.0.qml import
+\snippet qml/imports/qtquick-1.0.qml import
This imports version 1.0 of the "QtQuick" module into the global namespace. (The QML
library itself must be imported to use any of the \l {QML Elements}, as they
@@ -111,7 +111,7 @@ Window {
Similarly, if the directory resided on a network source, it could
be imported like this:
-\snippet doc/snippets/qml/imports/network-imports.qml imports
+\snippet qml/imports/network-imports.qml imports
A located module can also be imported as a network resource if it has a
\l{Writing a qmldir file}{qmldir file} in the directory that specifies the QML files
@@ -161,7 +161,7 @@ path or network resource URL.
When importing an installed module, an un-quoted URI is
used, with a mandatory version number:
-\snippet doc/snippets/qml/imports/installed-module.qml imports
+\snippet qml/imports/installed-module.qml imports
When a module is imported, the QML engine searches the QML import path for a matching
module. The root directory of the module must contain a
@@ -244,7 +244,7 @@ qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
This allows the application's QML files to use the \c PieChart type by importing the declared
\c Charts module:
-\snippet doc/snippets/qml/imports/chart.qml import
+\snippet qml/imports/chart.qml import
For \l{QQmlExtensionPlugin}{QML plugins}, the
module URI is automatically passed to QQmlExtensionPlugin::registerTypes(). This method
@@ -252,12 +252,12 @@ can be reimplemented by the developer to register the necessary types for the mo
\c registerTypes() implementation from the \l{declarative/cppextensions/plugins}{QML plugins}
example:
-\snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin
+\snippet examples/qml/cppextensions/plugins/plugin.cpp plugin
Once the plugin is built and installed, and includes a \l{Writing a qmldir file}{qmldir file},
the module can be imported from QML, like this:
-\snippet doc/snippets/qml/imports/timeexample.qml import
+\snippet qml/imports/timeexample.qml import
Unlike QML types defined by QML files, a QML type defined in a C++ extension plugin cannot be loaded by
a module that is imported as a network resource.
@@ -271,15 +271,15 @@ By default, when a module is imported, its contents are imported into the global
To import a module into a specific namespace, use the \e as keyword:
-\snippet doc/snippets/qml/imports/named-imports.qml imports
+\snippet qml/imports/named-imports.qml imports
Types from these modules can then only be used when qualified by the namespace:
-\snippet doc/snippets/qml/imports/named-imports.qml imported items
+\snippet qml/imports/named-imports.qml imported items
Multiple modules can be imported into the same namespace in the same way that multiple modules can be imported into the global namespace:
-\snippet doc/snippets/qml/imports/merged-named-imports.qml imports
+\snippet qml/imports/merged-named-imports.qml imports
\section2 JavaScript Files
diff --git a/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc b/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc
index 59efab867f..a23dc129aa 100644
--- a/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc
+++ b/src/qml/doc/src/qml/qmllanguage-signal-handler.qdoc
@@ -58,9 +58,9 @@ Attempting to declare two signals or methods with the same name in the same type
block generates an error. However, a new signal may reuse the name of an existing signal on the type. (This should be done with caution, as the existing signal may be hidden and become inaccessible.)
Here are various examples of signal declarations:
-\snippet doc/snippets/qml/events.qml parent begin
-\snippet doc/snippets/qml/events.qml signal declaration
-\snippet doc/snippets/qml/events.qml parent end
+\snippet qml/events.qml parent begin
+\snippet qml/events.qml signal declaration
+\snippet qml/events.qml parent end
If the signal has no parameters, the "\c{()}" brackets are optional. If
parameters are used, the parameter types must be declared, as for the \c string
@@ -69,17 +69,17 @@ and \c variant arguments of the \c perform signal.
Adding a signal to an item automatically adds a \e{signal handler} as well. The
signal hander is named \c on<SignalName>, with the first letter of the signal in
uppercase. The previous signals have the following signal handlers:
-\snippet doc/snippets/qml/events.qml signal handler declaration
+\snippet qml/events.qml signal handler declaration
Further, each QML properties have a \c{<property_name>Changed} signal and its
corresponding \c{on<property_name>Changed} signal handler. As a result, property
changes may notify other components for any changes.
-\snippet doc/snippets/qml/events.qml automatic signals
+\snippet qml/events.qml automatic signals
To emit a signal, invoke it as a method. The signal handler binding is similar
to a property binding and it is invoked when the signal is emitted. Use the
defined argument names to access the respective arguments.
-\snippet doc/snippets/qml/events.qml signal emit
+\snippet qml/events.qml signal emit
Note that the \c Component.onCompleted is an
\l{attached-signalhandlers}{attached signal handler}; it is invoked when the
\l Component initialization is complete.
@@ -93,7 +93,7 @@ automatically invoked whenever the signal is emitted. This mechanism enables a
signal to be received by a method instead of a
\l {Signal Handlers}{signal handler}.
-\snippet doc/snippets/qml/events.qml connect method
+\snippet qml/events.qml connect method
The \c {connect()} method is appropriate when connecting a JavaScript method to
a signal.
@@ -104,7 +104,7 @@ signals.
By connecting signals to other signals, the \c connect() method can form different
signal chains.
-\snippet doc/snippets/qml/events.qml forward signal
+\snippet qml/events.qml forward signal
Whenever the \l MouseArea \c clicked signal is emitted, the \c send
diff --git a/src/qml/doc/src/qmlsyntax.qdoc b/src/qml/doc/src/qmlsyntax.qdoc
index 1814b16078..b6b9051c5c 100644
--- a/src/qml/doc/src/qmlsyntax.qdoc
+++ b/src/qml/doc/src/qmlsyntax.qdoc
@@ -133,7 +133,7 @@ Commenting in QML is similar to JavaScript.
\li Multiline comments start with /* and finish with *\/
\endlist
-\snippet doc/snippets/qml/comments.qml 0
+\snippet qml/comments.qml 0
Comments are ignored by the engine. They are useful for explaining what you
are doing; for referring back to at a later date, or for others reading
diff --git a/src/qml/doc/src/tutorials/extending-tutorial.qdoc b/src/qml/doc/src/tutorials/extending-tutorial.qdoc
index b5958d9d43..31f3299479 100644
--- a/src/qml/doc/src/tutorials/extending-tutorial.qdoc
+++ b/src/qml/doc/src/tutorials/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/declarative/tutorials/extending directory.
+examples/quick/tutorials/extending directory.
Tutorial chapters:
\list 1
-\li \l{declarative/tutorials/extending/chapter1-basics}{Creating a New Type}
-\li \l{declarative/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
-\li \l{declarative/tutorials/extending/chapter3-bindings}{Property Binding}
-\li \l{declarative/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
-\li \l{declarative/tutorials/extending/chapter5-listproperties}{Using List Property Types}
-\li \l{declarative/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
+\li \l{examples/tutorials/extending/chapter1-basics}{Creating a New Type}
+\li \l{examples/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
+\li \l{examples/tutorials/extending/chapter3-bindings}{Property Binding}
+\li \l{examples/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
+\li \l{examples/tutorials/extending/chapter5-listproperties}{Using List Property Types}
+\li \l{examples/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
\li \l{qml-extending-tutorial7.html}{In Summary}
\endlist
@@ -58,7 +58,7 @@ Tutorial chapters:
/*!
\title Chapter 1: Creating a New Type
-\example declarative/tutorials/extending/chapter1-basics
+\example examples/tutorials/extending/chapter1-basics
A common task when extending QML is to provide a new QML type that supports some
custom functionality beyond what is provided by the built-in \l {QML Elements}.
@@ -98,7 +98,7 @@ this new class must:
Here is our \c PieChart class, defined in \c piechart.h:
-\snippet declarative/tutorials/extending/chapter1-basics/piechart.h 0
+\snippet examples/tutorials/extending/chapter1-basics/piechart.h 0
The class inherits from QQuickItem because we want to override
QQuickItem::paint() in order to draw. If the class just represented some
@@ -112,15 +112,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 declarative/tutorials/extending/chapter1-basics/piechart.cpp 0
+\snippet examples/tutorials/extending/chapter1-basics/piechart.cpp 0
\dots 0
-\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 1
+\snippet examples/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 declarative/tutorials/extending/chapter1-basics/app.qml 0
+\snippet examples/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
@@ -134,14 +134,14 @@ 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 declarative/tutorials/extending/chapter1-basics/main.cpp 0
+\snippet examples/tutorials/extending/chapter1-basics/main.cpp 0
This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart", in a module named "Charts",
with a module version of 1.0.
Lastly, we write a \c .pro project file that includes the files and the \c declarative library:
-\quotefile declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
+\quotefile examples/tutorials/extending/chapter1-basics/chapter1-basics.pro
Now we can build and run the application:
@@ -160,26 +160,26 @@ Later on, we'll show how to create a plugin so that you can run \c app.qml using
/*!
\title Chapter 2: Connecting to C++ Methods and Signals
-\example declarative/tutorials/extending/chapter2-methods
+\example examples/tutorials/extending/chapter2-methods
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 declarative/tutorials/extending/chapter2-methods/app.qml 0
+\snippet examples/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 declarative/tutorials/extending/chapter2-methods/piechart.h 0
+\snippet examples/tutorials/extending/chapter2-methods/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 1
+\snippet examples/tutorials/extending/chapter2-methods/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 2
+\snippet examples/tutorials/extending/chapter2-methods/piechart.h 2
\dots
-\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 3
+\snippet examples/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
@@ -189,7 +189,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 declarative/tutorials/extending/chapter2-methods/piechart.cpp 0
+\snippet examples/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:
@@ -205,7 +205,7 @@ Try out the example yourself with the updated code in Qt's \c examples/tutorials
/*!
\title Chapter 3: Adding Property Bindings
-\example declarative/tutorials/extending/chapter3-bindings
+\example examples/tutorials/extending/chapter3-bindings
Property binding is a powerful feature of QML that allows values of different
elements to be synchronized automatically. It uses signals to notify and update
@@ -214,7 +214,7 @@ other elements' 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 declarative/tutorials/extending/chapter3-bindings/app.qml 0
+\snippet examples/tutorials/extending/chapter3-bindings/app.qml 0
\image extending-tutorial-chapter3.png
@@ -229,17 +229,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 declarative/tutorials/extending/chapter3-bindings/piechart.h 0
+\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 1
+\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 2
+\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 2
\dots
-\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 3
+\snippet examples/tutorials/extending/chapter3-bindings/piechart.h 3
Then, we emit this signal in \c setPieSlice():
-\snippet declarative/tutorials/extending/chapter3-bindings/piechart.cpp 0
+\snippet examples/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
@@ -257,7 +257,7 @@ custom QML types may see unexpected behavior if bindings are not implemented.
/*!
\title Chapter 4: Using Custom Property Types
-\example declarative/tutorials/extending/chapter4-customPropertyTypes
+\example examples/tutorials/extending/chapter4-customPropertyTypes
The \c PieChart type currently has a string-type property and a color-type property.
It could have many other types of properties. For example, it could have an
@@ -304,41 +304,41 @@ 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 declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
Like \c PieChart, this new \c PieSlice type inherits from QQuickItem and declares
its properties with Q_PROPERTY():
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
+\snippet examples/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 declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3
+\snippet examples/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 declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
+\snippet examples/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" module, version 1.0:
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 1
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp 1
\dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 2
+\snippet examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp 2
Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-customPropertyTypes directory.
@@ -348,13 +348,13 @@ Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-custom
/*!
\title Chapter 5: Using List Property Types
-\example declarative/tutorials/extending/chapter5-listproperties
+\example examples/tutorials/extending/chapter5-listproperties
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 declarative/tutorials/extending/chapter5-listproperties/app.qml 0
+\snippet examples/tutorials/extending/chapter5-listproperties/app.qml 0
\image extending-tutorial-chapter5.png
@@ -365,11 +365,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 declarative/tutorials/extending/chapter5-listproperties/piechart.h 0
+\snippet examples/tutorials/extending/chapter5-listproperties/piechart.h 0
\dots
-\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 1
+\snippet examples/tutorials/extending/chapter5-listproperties/piechart.h 1
\dots
-\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 2
+\snippet examples/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.
@@ -378,7 +378,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 declarative/tutorials/extending/chapter5-listproperties/piechart.cpp 0
+\snippet examples/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
@@ -397,7 +397,7 @@ The complete code can be seen in the updated \c examples/tutorials/extending/cha
/*!
\title Chapter 6: Writing an Extension Plugin
-\example declarative/tutorials/extending/chapter6-plugins
+\example examples/tutorials/extending/chapter6-plugins
Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
which is displayed using a QQuickView in a C++ application. An alternative
@@ -420,22 +420,22 @@ Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}.
Here is the \c ChartsPlugin definition in \c chartsplugin.h:
-\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.h 0
+\snippet examples/tutorials/extending/chapter6-plugins/chartsplugin.h 0
And its implementation in \c chartsplugin.cpp:
-\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
+\snippet examples/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 declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+\quotefile examples/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
Finally, we add a \l{Writing a qmldir file}{qmldir} file that is automatically 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 declarative/tutorials/extending/chapter6-plugins/qmldir
+\quotefile examples/tutorials/extending/chapter6-plugins/ChartsPlugin/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 in the \l {QML Viewer}:
diff --git a/src/qml/qml/ftw/qintrusivelist.cpp b/src/qml/qml/ftw/qintrusivelist.cpp
index 5a1624f1f4..4a4b131c9c 100644
--- a/src/qml/qml/ftw/qintrusivelist.cpp
+++ b/src/qml/qml/ftw/qintrusivelist.cpp
@@ -147,7 +147,7 @@ Returns an STL-style iterator pointing to the imaginary item after the last item
*/
/*!
-iterator &QInplacelist::iterator::erase()
+\fn iterator &QInplacelist::iterator::erase()
Remove the current object from the list, and return an iterator to the next element.
*/
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 1ade6988f7..d31b4d4773 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -205,7 +205,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
For example, here is a component that is used by multiple \l Loader objects.
It contains a single item, a \l Rectangle:
- \snippet doc/snippets/qml/component.qml 0
+ \snippet qml/component.qml 0
Notice that while a \l Rectangle by itself would be automatically
rendered and displayed, this is not the case for the above rectangle
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index beaa6d78dc..6b1c869ee8 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -120,7 +120,7 @@ void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor)
It can be useful to create a QtObject if you need an extremely
lightweight element to enclose a set of custom properties:
- \snippet doc/snippets/qml/qtobject.qml 0
+ \snippet qml/qtobject.qml 0
It can also be useful for C++ integration, as it is just a plain
QObject. See the QObject documentation for further details.
@@ -360,7 +360,7 @@ The following functions are also on the Qt object.
The following example uses the \c application object to indicate
whether the application is currently active:
- \snippet doc/snippets/qml/application.qml document
+ \snippet qml/application.qml document
*/
/*!
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index 73d74f9e21..667e50a6bf 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -110,12 +110,12 @@ QT_BEGIN_NAMESPACE
should be bundled with the plugin, so it needs to be specified in the \c qmldir
file:
- \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
+ \quotefile examples/qml/cppextensions/plugins/com/nokia/TimeExample/qmldir
Once the project is built and installed, the new \c Time element can be
used by any QML component that imports the \c com.nokia.TimeExample module:
- \snippet examples/declarative/cppextensions/plugins/plugins.qml 0
+ \snippet examples/qml/cppextensions/plugins/plugins.qml 0
The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}.
diff --git a/src/qml/qml/qquicklistmodel.cpp b/src/qml/qml/qquicklistmodel.cpp
index 389394652a..8e1155bae8 100644
--- a/src/qml/qml/qquicklistmodel.cpp
+++ b/src/qml/qml/qquicklistmodel.cpp
@@ -1380,7 +1380,7 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
\inlineimage listmodel.png
\enddiv
- \snippet doc/snippets/qml/listmodel.qml 0
+ \snippet qml/listmodel/listmodel.qml 0
Roles (properties) in each element must begin with a lower-case letter and
should be common to all elements in a model. The ListElement documentation
@@ -1389,14 +1389,14 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
Since the example model contains an \c id property, it can be referenced
by views, such as the ListView in this example:
- \snippet doc/snippets/qml/listmodel-simple.qml 0
+ \snippet qml/listmodel/listmodel-simple.qml 0
\dots 8
- \snippet doc/snippets/qml/listmodel-simple.qml 1
+ \snippet qml/listmodel/listmodel-simple.qml 1
It is possible for roles to contain list data. In the following example we
create a list of fruit attributes:
- \snippet doc/snippets/qml/listmodel-nested.qml model
+ \snippet qml/listmodel/listmodel-nested.qml model
The delegate displays all the fruit attributes:
@@ -1404,14 +1404,14 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
\inlineimage listmodel-nested.png
\enddiv
- \snippet doc/snippets/qml/listmodel-nested.qml delegate
+ \snippet qml/listmodel/listmodel-nested.qml delegate
\section1 Modifying List Models
The content of a ListModel may be created and modified using the clear(),
append(), set(), insert() and setProperty() methods. For example:
- \snippet doc/snippets/qml/listmodel-modify.qml delegate
+ \snippet qml/listmodel/listmodel-modify.qml delegate
Note that when creating content dynamically the set of available properties
cannot be changed once set. Whatever properties are first added to the model
@@ -1427,11 +1427,11 @@ QQuickListModelParser::ListInstruction *QQuickListModelParser::ListModelData::in
Here is an example that uses WorkerScript to periodically append the
current time to a list model:
- \snippet examples/declarative/threading/threadedlistmodel/timedisplay.qml 0
+ \snippet examples/quick/threading/threadedlistmodel/timedisplay.qml 0
The included file, \tt dataloader.js, looks like this:
- \snippet examples/declarative/threading/threadedlistmodel/dataloader.js 0
+ \snippet examples/quick/threading/threadedlistmodel/dataloader.js 0
The timer in the main example sends messages to the worker script by calling
\l WorkerScript::sendMessage(). When this message is received,
@@ -2456,12 +2456,12 @@ bool QQuickListModelParser::definesEmptyList(const QString &s)
The following model defines a series of list elements, each of which
contain "name" and "cost" roles and their associated values.
- \snippet doc/snippets/qml/qml-data-models/listelements.qml model
+ \snippet qml/listmodel/listelements.qml model
The delegate obtains the name and cost for each element by simply referring
to \c name and \c cost:
- \snippet doc/snippets/qml/qml-data-models/listelements.qml view
+ \snippet qml/listmodel/listelements.qml view
\sa ListModel
*/
diff --git a/src/qml/qml/qquickworkerscript.cpp b/src/qml/qml/qquickworkerscript.cpp
index 81ebb1fed4..53eb60eab3 100644
--- a/src/qml/qml/qquickworkerscript.cpp
+++ b/src/qml/qml/qquickworkerscript.cpp
@@ -574,12 +574,12 @@ void QQuickWorkerScriptEngine::run()
An example:
- \snippet doc/snippets/qml/workerscript.qml 0
+ \snippet qml/workerscript/workerscript.qml 0
The above worker script specifies a JavaScript file, "script.js", that handles
the operations to be performed in the new thread. Here is \c script.js:
- \quotefile doc/src/snippets/qml/script.js
+ \quotefile qml/workerscript/script.js
When the user clicks anywhere within the rectangle, \c sendMessage() is
called, triggering the \tt WorkerScript.onMessage() handler in
diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp
index 03cd51eab9..080540eeef 100644
--- a/src/qml/qml/v8/qjsengine.cpp
+++ b/src/qml/qml/v8/qjsengine.cpp
@@ -84,7 +84,7 @@ Q_DECLARE_METATYPE(QList<int>)
Use evaluate() to evaluate script code.
- \snippet doc/snippets/code/src_script_qjsengine.cpp 0
+ \snippet code/src_script_qjsengine.cpp 0
evaluate() returns a QJSValue that holds the result of the
evaluation. The QJSValue class provides functions for converting
@@ -94,13 +94,13 @@ Q_DECLARE_METATYPE(QList<int>)
The following code snippet shows how a script function can be
defined and then invoked from C++ using QJSValue::call():
- \snippet doc/snippets/code/src_script_qjsengine.cpp 1
+ \snippet code/src_script_qjsengine.cpp 1
As can be seen from the above snippets, a script is provided to the
engine in the form of a string. One common way of loading scripts is
by reading the contents of a file and passing it to evaluate():
- \snippet doc/snippets/code/src_script_qjsengine.cpp 2
+ \snippet code/src_script_qjsengine.cpp 2
Here we pass the name of the file as the second argument to
evaluate(). This does not affect evaluation in any way; the second
@@ -116,7 +116,7 @@ Q_DECLARE_METATYPE(QList<int>)
want to configure a script engine by adding one or more properties
to the Global Object:
- \snippet doc/snippets/code/src_script_qjsengine.cpp 3
+ \snippet code/src_script_qjsengine.cpp 3
Adding custom properties to the scripting environment is one of the
standard means of providing a scripting API that is specific to your
@@ -132,7 +132,7 @@ Q_DECLARE_METATYPE(QList<int>)
value. If isError() returns true, you can call toString() on the
error object to obtain an error message.
- \snippet doc/snippets/code/src_script_qjsengine.cpp 4
+ \snippet code/src_script_qjsengine.cpp 4
\section1 Script Object Creation
@@ -150,7 +150,7 @@ Q_DECLARE_METATYPE(QList<int>)
properties of the proxy object. No binding code is needed because it
is done dynamically using the Qt meta object system.
- \snippet doc/snippets/code/src_script_qjsengine.cpp 5
+ \snippet code/src_script_qjsengine.cpp 5
\sa QJSValue, {Making Applications Scriptable}
diff --git a/src/qml/qml/v8/qjsvalue.cpp b/src/qml/qml/v8/qjsvalue.cpp
index 58732f2df8..514572ca71 100644
--- a/src/qml/qml/v8/qjsvalue.cpp
+++ b/src/qml/qml/v8/qjsvalue.cpp
@@ -77,7 +77,7 @@
QJSValues. Use setProperty() to set a property of an object, and
call property() to retrieve the value of a property.
- \snippet doc/snippets/code/src_script_qjsvalue.cpp 0
+ \snippet code/src_script_qjsvalue.cpp 0
If you want to iterate over the properties of a script object, use
the QJSValueIterator class.
diff --git a/src/qml/qml/v8/qjsvalueiterator.cpp b/src/qml/qml/v8/qjsvalueiterator.cpp
index 921d359f4e..6be892a40e 100644
--- a/src/qml/qml/v8/qjsvalueiterator.cpp
+++ b/src/qml/qml/v8/qjsvalueiterator.cpp
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
beginning of the sequence of properties. Here's how to iterate over
all the properties of a QJSValue:
- \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 0
+ \snippet code/src_script_qjsvalueiterator.cpp 0
The next() advances the iterator. The name() and value()
functions return the name and value of the last item that was
@@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE
own properties; i.e. it does not follow the prototype chain. You can
use a loop like this to follow the prototype chain:
- \snippet doc/snippets/code/src_script_qjsvalueiterator.cpp 1
+ \snippet code/src_script_qjsvalueiterator.cpp 1
\sa QJSValue::property()
*/
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index f6c7a5969d..787197d1d7 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -978,7 +978,7 @@ If \a filepath is specified, it will be used for error reporting for the created
Example (where \c parentItem is the id of an existing QML item):
-\snippet doc/snippets/qml/createQmlObject.qml 0
+\snippet qml/createQmlObject.qml 0
In the case of an error, a QtScript Error object is thrown. This object has an additional property,
\c qmlErrors, which is an array of the errors encountered.
@@ -1109,7 +1109,7 @@ component to create an object instance of the component.
For example:
-\snippet doc/snippets/qml/createComponent-simple.qml 0
+\snippet qml/createComponent-simple.qml 0
See \l {Dynamic Object Management in QML} for more information on using this function.
@@ -1329,20 +1329,20 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args)
There are two main use-cases for the function: firstly, in imperative
JavaScript code to cause a binding assignment:
- \snippet doc/snippets/declarative/qtBinding.1.qml 0
+ \snippet qml/qtBinding.1.qml 0
and secondly, when defining initial property values of dynamically
constructed objects (via Component.createObject() or
Loader.setSource()) as being bound to the result of an expression.
For example, assuming the existence of a DynamicText component:
- \snippet doc/snippets/declarative/DynamicText.qml 0
+ \snippet qml/DynamicText.qml 0
the output from:
- \snippet doc/snippets/declarative/qtBinding.2.qml 0
+ \snippet qml/qtBinding.2.qml 0
and from:
- \snippet doc/snippets/declarative/qtBinding.3.qml 0
+ \snippet qml/qtBinding.3.qml 0
should both be:
\code
@@ -1357,7 +1357,7 @@ v8::Handle<v8::Value> locale(const v8::Arguments &args)
declarations and binding assignments}) except when the result is
stored in an array bound to a var property.
- \snippet doc/snippets/declarative/qtBinding.4.qml 0
+ \snippet qml/qtBinding.4.qml 0
Note: in QtQuick 1.x, all function assignment was treated as
binding assignment, so the Qt.binding() function is new in
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 8b0f9a43b3..452fe46ffc 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -83,7 +83,8 @@ headerdirs += ..
sourcedirs += ..
-exampledirs += ../../../examples \
+exampledirs += ../../../ \
+ ../../../examples \
../ \
snippets
@@ -91,10 +92,7 @@ imagedirs += images
#add qml sources because of dependencies
headerdirs += ../../qml
-sourcedirs += ../../qml
-exampledirs += ../../qml/snippets \
- ../../qml
-
+exampledirs += ../../qml
imagedirs += ../../qml
#add particles sources
diff --git a/src/quick/doc/snippets/qml/animatedimage.qml b/src/quick/doc/snippets/qml/animatedimage.qml
index a483619e11..ab768442c8 100644
--- a/src/quick/doc/snippets/qml/animatedimage.qml
+++ b/src/quick/doc/snippets/qml/animatedimage.qml
@@ -39,7 +39,7 @@
****************************************************************************/
// This snippet should be turned into an example and put in
-// examples/declarative/imageelements/animatedimage
+// examples/quick/imageelements/animatedimage
//! [document]
import QtQuick 2.0
diff --git a/src/qml/doc/snippets/qml/rectangle/rectangle.qml b/src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml
index c315a27da0..7cdd4b4d0c 100644
--- a/src/qml/doc/snippets/qml/rectangle/rectangle.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml
@@ -37,16 +37,17 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-//! [document]
+//![0]
+// Button.qml
import QtQuick 2.0
Rectangle {
- width: 100
- height: 100
+ width: 100; height: 100
color: "red"
- border.color: "black"
- border.width: 5
- radius: 10
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: console.log("Button clicked!")
+ }
}
-//! [document]
+//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml b/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml
new file mode 100644
index 0000000000..a01c74b668
--- /dev/null
+++ b/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// application.qml
+import QtQuick 2.0
+
+Column {
+ Button { width: 50; height: 50 }
+ Button { x: 50; width: 100; height: 50; color: "blue" }
+ Button { width: 50; height: 50; radius: 8 }
+}
+//![0]
diff --git a/src/qml/doc/snippets/qml/behavior.qml b/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml
index 4776e09a54..ef6e9220d2 100644
--- a/src/qml/doc/snippets/qml/behavior.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml
@@ -37,22 +37,19 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-//![0]
import QtQuick 2.0
-
+//![0]
Rectangle {
id: rect
width: 100; height: 100
- color: "red"
- Behavior on width {
- NumberAnimation { duration: 1000 }
+ function say(text) {
+ console.log("You said: " + text);
}
MouseArea {
anchors.fill: parent
- onClicked: rect.width = 50
+ onClicked: rect.say("Mouse clicked")
}
}
//![0]
diff --git a/src/qml/doc/snippets/qml/flickable.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml
index fda2615e14..513a4e5c81 100644
--- a/src/qml/doc/snippets/qml/flickable.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml
@@ -37,14 +37,16 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-//! [document]
+//![0]
+// ImageViewer.qml
import QtQuick 2.0
-Flickable {
+Item {
+ id: item
width: 200; height: 200
- contentWidth: image.width; contentHeight: image.height
- Image { id: image; source: "bigImage.png" }
+ property string currentImage: "default-image.png"
+
+ Image { source: item.currentImage }
}
-//! [document]
+//![0]
diff --git a/src/qml/doc/snippets/qml/numberanimation.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml
index 404381863d..0826a12e3c 100644
--- a/src/qml/doc/snippets/qml/numberanimation.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml
@@ -37,15 +37,12 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-//![0]
import QtQuick 2.0
-
+//![0]
Rectangle {
- width: 100; height: 100
+ property alias color: childRect.color
color: "red"
- NumberAnimation on x { to: 50; duration: 1000 }
+ Rectangle { id: childRect }
}
//![0]
-
diff --git a/src/qml/doc/snippets/qml/image.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml
index 61724ffeea..d3cc08b180 100644
--- a/src/qml/doc/snippets/qml/image.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml
@@ -37,11 +37,15 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-//! [document]
+//![0]
+// Button.qml
import QtQuick 2.0
-Image {
- source: "pics/qtlogo.png"
+Item {
+ property alias buttonText: textItem.text
+
+ width: 200; height: 50
+
+ Text { id: textItem }
}
-//! [document]
+//![0]
diff --git a/src/qml/doc/snippets/qml/path/basicarc.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml
index 562f2a0adf..4f78b20669 100644
--- a/src/qml/doc/snippets/qml/path/basicarc.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml
@@ -37,16 +37,16 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-import QtQuick 2.0
//![0]
-Path {
- startX: 100; startY: 0
+// ImageViewer.qml
+import QtQuick 2.0
+
+Item {
+ id: item
+ width: 200; height: 200
+
+ property alias currentImage: image
- PathArc {
- x: 0; y: 100
- radiusX: 100; radiusY: 100
- useLargeArc: true
- }
+ Image { id: image }
}
//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml
new file mode 100644
index 0000000000..95b644cd07
--- /dev/null
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// application.qml
+import QtQuick 2.0
+
+ImageViewer {
+ id: viewer
+
+ currentImage.source: "http://qt.nokia.com/logo.png"
+ currentImage.width: width
+ currentImage.height: height
+ currentImage.fillMode: Image.Tile
+
+ Text { text: currentImage.source }
+}
+//![0]
diff --git a/src/qml/doc/snippets/qml/path/arcdirection.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml
index 7522649607..b78da54c10 100644
--- a/src/qml/doc/snippets/qml/path/arcdirection.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml
@@ -37,15 +37,14 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-import QtQuick 2.0
//![0]
-Path {
- startX: 50; startY: 50
+import QtQuick 2.0
+
+ImageViewer {
+ id: viewer
+
+ currentImage: "http://qt.nokia.com/logo.png"
- PathArc {
- x: 150; y: 50
- radiusX: 75; radiusY: 50
- }
+ Text { text: viewer.currentImage }
}
//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml
new file mode 100644
index 0000000000..a3d6433955
--- /dev/null
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+//![0]
+Item {
+ property int myNumber
+
+ onMyNumberChanged: { console.log("myNumber has changed:", myNumber); }
+
+ Component.onCompleted: myNumber = 100
+}
+//![0]
diff --git a/src/qml/doc/snippets/qml/rectangle/rect-border-width.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
index 6dd4dbe739..2e1855842e 100644
--- a/src/qml/doc/snippets/qml/rectangle/rect-border-width.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
@@ -37,23 +37,19 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
import QtQuick 2.0
//![0]
+// Button.qml
Rectangle {
+ id: rect
width: 100; height: 100
- color: "lightblue"
- Rectangle {
- anchors.fill: parent
- anchors.margins: 10
- clip: true
+ signal buttonClicked(int xPos, int yPos)
- Rectangle {
- anchors.fill: parent
- border.width: 1
- }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.buttonClicked(mouse.x, mouse.y)
}
}
//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml
new file mode 100644
index 0000000000..0454c869f5
--- /dev/null
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+// Button.qml
+import QtQuick 2.0
+
+Rectangle {
+ id: rect
+ width: 100; height: 100
+
+ signal buttonClicked
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: rect.buttonClicked()
+ }
+}
+//![0]
diff --git a/src/qml/doc/snippets/qml/visualdatamodel.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml
index 87b836e224..4774277d5d 100644
--- a/src/qml/doc/snippets/qml/visualdatamodel.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml
@@ -37,28 +37,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
import QtQuick 2.0
+//![0]
+Item {
+ id: item
+ width: 300; height: 100
-Rectangle {
- width: 200; height: 100
-
- VisualDataModel {
- id: visualModel
- model: ListModel {
- ListElement { name: "Apple" }
- ListElement { name: "Orange" }
- }
- delegate: Rectangle {
- height: 25
- width: 100
- Text { text: "Name: " + name}
- }
+ function myMethod() {
+ console.log("Button was clicked!")
}
- ListView {
- anchors.fill: parent
- model: visualModel
+ Row { id: row }
+
+ Component.onCompleted: {
+ var component = Qt.createComponent("Button.qml")
+ for (var i=0; i<3; i++) {
+ var button = component.createObject(row)
+ button.border.width = 1
+ button.buttonClicked.connect(myMethod)
+ }
}
}
//![0]
diff --git a/src/qml/doc/snippets/qml/systempalette.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml
index 4cb42dee93..ec0d2bec6a 100644
--- a/src/qml/doc/snippets/qml/systempalette.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml
@@ -37,18 +37,20 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
import QtQuick 2.0
+//![0]
+Item {
+ id: item
+ width: 200; height: 200
-Rectangle {
- SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
-
- width: 640; height: 480
- color: myPalette.window
+ function myMethod() {
+ console.log("Button was clicked!")
+ }
- Text {
+ Button {
+ id: button
anchors.fill: parent
- text: "Hello!"; color: myPalette.windowText
+ Component.onCompleted: buttonClicked.connect(item.myMethod)
}
}
//![0]
diff --git a/src/qml/doc/snippets/qml/coloranimation.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml
index bb2d83bfb8..09cdfd40de 100644
--- a/src/qml/doc/snippets/qml/coloranimation.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml
@@ -37,15 +37,13 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
//![0]
+// application.qml
import QtQuick 2.0
-Rectangle {
+Button {
width: 100; height: 100
- color: "red"
-
- ColorAnimation on color { to: "yellow"; duration: 1000 }
+ onButtonClicked: console.log("Mouse was clicked")
}
//![0]
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
new file mode 100644
index 0000000000..d2a2071557
--- /dev/null
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+//![0]
+// application.qml
+Button {
+ width: 100; height: 100
+ onButtonClicked: {
+ console.log("Mouse clicked at " + xPos + "," + yPos)
+ }
+}
+//![0]
+
diff --git a/src/qml/doc/snippets/qml/rotation.qml b/src/quick/doc/snippets/qml/texteditor.qml
index c7f9df3a9b..cc28992223 100644
--- a/src/qml/doc/snippets/qml/rotation.qml
+++ b/src/quick/doc/snippets/qml/texteditor.qml
@@ -37,33 +37,36 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//! [0]
import QtQuick 2.0
-Row {
- x: 10; y: 10
- spacing: 10
+//! [0]
+Flickable {
+ id: flick
+
+ width: 300; height: 200;
+ contentWidth: edit.paintedWidth
+ contentHeight: edit.paintedHeight
+ clip: true
+
+ function ensureVisible(r)
+ {
+ if (contentX >= r.x)
+ contentX = r.x;
+ else if (contentX+width <= r.x+r.width)
+ contentX = r.x+r.width-width;
+ if (contentY >= r.y)
+ contentY = r.y;
+ else if (contentY+height <= r.y+r.height)
+ contentY = r.y+r.height-height;
+ }
- Image { source: "pics/qt.png" }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
- smooth: true
- }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
- smooth: true
- }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
- smooth: true
- }
- Image {
- source: "pics/qt.png"
- transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
- smooth: true
- }
-}
+ TextEdit {
+ id: edit
+ width: flick.width
+ height: flick.height
+ focus: true
+ wrapMode: TextEdit.Wrap
+ onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
+ }
+ }
//! [0]
diff --git a/src/quick/doc/src/animation.qdoc b/src/quick/doc/src/animation.qdoc
index 013359a0c5..6644e794f5 100644
--- a/src/quick/doc/src/animation.qdoc
+++ b/src/quick/doc/src/animation.qdoc
@@ -71,14 +71,14 @@ There are several ways of setting animation to an object.
To create an immediate movement or animated movement, set the property value
directly. This may be done in signal handlers or attached properties.
-\snippet doc/snippets/qml/animation.qml direct property change
+\snippet qml/animation.qml direct property change
However, to create more control, \e {property animations} apply smooth movements
by interpolating values between property value changes. Property animations
provide timing controls and allows different interpolations through
\l{qml-easing-animation}{easing curves}.
-\snippet doc/snippets/qml/animation.qml property animation
+\snippet qml/animation.qml property animation
Specialized \l{qml-property-animation-elements}{property animation elements}
have more efficient implementations than the \l{PropertyAnimation} element. They
@@ -107,14 +107,14 @@ change from the \c pressed state to the \c released state. Likewise, there would
be an animation during the change from the \c released state to the \c pressed
state.
-\snippet doc/snippets/qml/animation.qml transition animation
+\snippet qml/animation.qml transition animation
Binding the \c to and \c from properties to the state's name will assign that
particular transition to the state change. For simple or symmetric transitions,
setting the to \c to property to the wild card symbol, "\c{*}", denotes
that the transition applies to any state change.
-\snippet doc/snippets/qml/animation.qml wildcard animation
+\snippet qml/animation.qml wildcard animation
\section2 Default Animation as Behaviors
@@ -128,7 +128,7 @@ A ball component might have a behavior animation assigned to its \c x, \c y, and
elastic effect. In effect, this behavior animation would apply the elastic
effect to the properties whenever the ball moves.
-\snippet doc/snippets/qml/animation.qml behavior animation
+\snippet qml/animation.qml behavior animation
There are several methods of assigning behavior animations to properties. The
\c{Behavior on <property>} declaration is a convenient way of assigning a
@@ -151,7 +151,7 @@ object. Using the \l{SequentialAnimation} element, the opacity animations will
play after the preceding animation finishes. The \l{ParallelAnimation} element
will play the animations at the same time.
-\snippet doc/snippets/qml/animation.qml sequential animation
+\snippet qml/animation.qml sequential animation
Once individual animations are placed into a SequentialAnimation or
ParallelAnimation, they can no longer be started and stopped independently. The
@@ -249,18 +249,3 @@ Rectangle {
\endqml
*/
-
-
-
-\snippet doc/snippets/qml/animation-elements.qml color
-\snippet doc/snippets/qml/animation-propertyvaluesource.qml 0
-\snippet doc/snippets/qml/animation-signalhandler.qml 0
-\snippet doc/snippets/qml/animation-standalone.qml 0
-
-\snippet doc/snippets/qml/animation-transitions.qml 0
-\snippet doc/snippets/qml/animation-groups.qml 0
-
-\snippet doc/snippets/qml/animation-groups.qml 1
-\snippet doc/snippets/qml/animation-groups.qml 0
-\image propanim.gif
-
diff --git a/src/quick/doc/src/focus.qdoc b/src/quick/doc/src/focus.qdoc
index 1aafb10baa..69617c9773 100644
--- a/src/quick/doc/src/focus.qdoc
+++ b/src/quick/doc/src/focus.qdoc
@@ -56,8 +56,8 @@ If the \c {Rectangle} element in the following example has active focus and the
it will bubble up to its parent. However, pressing the \c B key will bubble up to the root
item and thus subsequently be ignored.
-\snippet doc/snippets/qml/focus/rectangle.qml simple key event
-\snippet doc/snippets/qml/focus/rectangle.qml simple key event end
+\snippet qml/focus/rectangle.qml simple key event
+\snippet qml/focus/rectangle.qml simple key event end
\li If the root \l Item is reached, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues.
@@ -71,7 +71,7 @@ Whether or not an \l Item has active focus can be queried through the
property \c {Item::activeFocus} property. For example, here we have a \l Text
element whose text is determined by whether or not it has active focus.
-\snippet doc/snippets/qml/focus/rectangle.qml active focus
+\snippet qml/focus/rectangle.qml active focus
\section1 Acquiring Focus and Focus Scopes
@@ -82,7 +82,7 @@ sufficient. If we run the following example with the \l {QML Viewer}, we see tha
the \c {keyHandler} element has active focus and pressing the \c A, \c B,
or \c C keys modifies the text appropriately.
-\snippet doc/snippets/qml/focus/basicwidget.qml focus true
+\snippet qml/focus/basicwidget.qml focus true
\image declarative-qmlfocus1.png
@@ -95,10 +95,10 @@ set the first one to have focus. The intention is that when the \c A, \c B, or
responds accordingly.
The code that imports and creates two MyWidget instances:
-\snippet doc/snippets/qml/focus/widget.qml window
+\snippet qml/focus/widget.qml window
The MyWidget code:
-\snippet doc/snippets/qml/focus/MyWidget.qml mywidget
+\snippet qml/focus/MyWidget.qml mywidget
We would like to have the first MyWidget object to have the focus by setting its
\c focus property to \c true. However, by running the code, we can confirm that
@@ -126,7 +126,7 @@ A focus scope is created by declaring the \l FocusScope element.
In the next example, a \l FocusScope element is added to the component, and the
visual result shown.
-\snippet doc/snippets/qml/focus/myfocusscopewidget.qml widget in focusscope
+\snippet qml/focus/myfocusscopewidget.qml widget in focusscope
\image declarative-qmlfocus3.png
@@ -158,10 +158,10 @@ Now, clicking either MyClickableWidget gives it focus and the other widget
loses the focus.
The code that imports and creates two MyClickableWidget instances:
-\snippet doc/snippets/qml/focus/clickablewidget.qml clickable window
+\snippet qml/focus/clickablewidget.qml clickable window
The MyClickableWidget code:
-\snippet doc/snippets/qml/focus/MyClickableWidget.qml clickable in focusscope
+\snippet qml/focus/MyClickableWidget.qml clickable in focusscope
\image declarative-qmlfocus4.png
@@ -188,7 +188,7 @@ current item delegate to react to key presses.
This contrived example shows how this works. Pressing the \c Return key will
print the name of the current list item.
-\snippet doc/snippets/qml/focus/advancedFocus.qml FocusScope delegate
+\snippet qml/focus/advancedFocus.qml FocusScope delegate
\image declarative-qmlfocus5.png
diff --git a/src/quick/doc/src/localstorage/localstorage.qdoc b/src/quick/doc/src/localstorage/localstorage.qdoc
index 96c44328cb..e9d2a46b53 100644
--- a/src/quick/doc/src/localstorage/localstorage.qdoc
+++ b/src/quick/doc/src/localstorage/localstorage.qdoc
@@ -64,12 +64,12 @@ Database connections are automatically closed during Javascript garbage collecti
The API can be used from JavaScript functions in your QML:
-\snippet declarative/sqllocalstorage/hello.qml 0
+\snippet examples/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.
-The \l{declarative/sqllocalstorage}{SQL Local Storage example} demonstrates the basics of
+The \l{examples/localstorage}{SQL Local Storage example} demonstrates the basics of
using the Local Storage API.
\section3 db = openDatabaseSync(identifier, version, description, estimated_size, callback(db))
diff --git a/src/quick/doc/src/modelview.qdoc b/src/quick/doc/src/modelview.qdoc
index 7d5b334ee7..e9a34b34e4 100644
--- a/src/quick/doc/src/modelview.qdoc
+++ b/src/quick/doc/src/modelview.qdoc
@@ -80,13 +80,13 @@ To visualize data, bind the view's \c model property to a model and the
Suppose that a specific club wants to decorate its members list with its brand
colors. A member list is in a \c model and the \c delegate will display the
model's content.
- \snippet doc/snippets/qml/listview-decorations.qml model
- \snippet doc/snippets/qml/listview-decorations.qml delegate
+ \snippet qml/listview-decorations.qml model
+ \snippet qml/listview-decorations.qml delegate
The club may decorate the members list by binding visual objects to the \c
header and \c footer properties. The visual object may be defined inline, in
another file, or in a \l {Component} element.
- \snippet doc/snippets/qml/listview-decorations.qml decorations
+ \snippet qml/listview-decorations.qml decorations
\image listview-decorations.png
\section2 Mouse and Touch Handling
@@ -110,8 +110,8 @@ To visualize data, bind the view's \c model property to a model and the
A list may contain a list indicating people's names and the team on which
team the person belongs.
- \snippet doc/snippets/qml/listview-sections.qml model
- \snippet doc/snippets/qml/listview-sections.qml delegate
+ \snippet qml/listview-sections.qml model
+ \snippet qml/listview-sections.qml delegate
The ListView element has the \c section \l{Property Binding in QML#Attached
Properties}{attached property} that can combine adjacent and related
@@ -119,7 +119,7 @@ To visualize data, bind the view's \c model property to a model and the
which list element property to use as sections. The \c criteria can dictate
how the section names are displayed and the \c delegate is similar to the
views' \l {qml-view-delegate}{delegate} property.
- \snippet doc/snippets/qml/listview-sections.qml section
+ \snippet qml/listview-sections.qml section
\image listview-section.png
\keyword qml-view-delegate
@@ -129,7 +129,7 @@ To visualize data, bind the view's \c model property to a model and the
visualize each item list according to the template defined by the delegate.
Items in a model are accessible through the \c index property as well as the
item's properties.
- \snippet doc/snippets/qml/listview.qml delegate
+ \snippet qml/listview.qml delegate
\image listview-setup.png
\section2 Accessing Views and Models from Delegates
@@ -150,7 +150,7 @@ To visualize data, bind the view's \c model property to a model and the
the model, and the color of one of the fields depends on the property
\e{fruit_color} of the view.
- \snippet doc/snippets/qml/models/views-models-delegates.qml rectangle
+ \snippet qml/models/views-models-delegates.qml rectangle
\keyword qml-data-models
\section1 Models
@@ -159,7 +159,7 @@ To visualize data, bind the view's \c model property to a model and the
bind to. Here is a ListModel with two roles, \e type and \e age, and a
ListView with a delegate that binds to these roles to display their values:
- \snippet doc/snippets/qml/qml-data-models/listmodel-listview.qml document
+ \snippet qml/qml-data-models/listmodel-listview.qml document
If there is a naming clash between the model's properties and the delegate's
properties, the roles can be accessed with the qualified \e model name
@@ -197,12 +197,12 @@ To visualize data, bind the view's \c model property to a model and the
ListModel is a simple hierarchy of elements specified in QML. The
available roles are specified by the \l ListElement properties.
- \snippet doc/snippets/qml/qml-data-models/listelements.qml model
+ \snippet qml/qml-data-models/listelements.qml model
The above model has two roles, \e name and \e cost. These can be bound
to by a ListView delegate, for example:
- \snippet doc/snippets/qml/qml-data-models/listelements.qml view
+ \snippet qml/qml-data-models/listelements.qml view
ListModel provides methods to manipulate the ListModel directly via JavaScript.
In this case, the first item inserted determines the roles available
@@ -210,9 +210,9 @@ To visualize data, bind the view's \c model property to a model and the
created and populated via JavaScript, the roles provided by the first
insertion are the only roles that will be shown in the view:
- \snippet doc/snippets/qml/qml-data-models/dynamic-listmodel.qml model
+ \snippet qml/qml-data-models/dynamic-listmodel.qml model
\dots
- \snippet doc/snippets/qml/qml-data-models/dynamic-listmodel.qml mouse area
+ \snippet qml/qml-data-models/dynamic-listmodel.qml mouse area
When the MouseArea is clicked, \c fruitModel will have two roles, \e cost and \e name.
Even if subsequent roles are added, only the first two will be handled by views
@@ -253,7 +253,7 @@ To visualize data, bind the view's \c model property to a model and the
VisualItemModel provide the contents of the delegate. The model
does not provide any roles.
- \snippet doc/snippets/qml/models/visual-model-and-view.qml visual model and view
+ \snippet qml/models/visual-model-and-view.qml visual model and view
Note that in the above example there is no delegate required.
The items of the model itself provide the visual elements that
@@ -347,7 +347,7 @@ The following example shows a repeater used with a \l{#Grid}{Grid} item to
arrange a set of Rectangle items. The Repeater item creates a series of 24
rectangles for the Grid item to position in a 5 by 5 arrangement.
-\snippet doc/snippets/qml/repeaters/repeater-grid-index.qml document
+\snippet qml/repeaters/repeater-grid-index.qml document
The number of items created by a Repeater is held by its \l{Repeater::}{count}
property. It is not possible to set this property to determine the number of
diff --git a/src/quick/doc/src/mouseevents.qdoc b/src/quick/doc/src/mouseevents.qdoc
index 2281cda1cd..aa4f3501e0 100644
--- a/src/quick/doc/src/mouseevents.qdoc
+++ b/src/quick/doc/src/mouseevents.qdoc
@@ -55,7 +55,7 @@ to define this area is to anchor the \c MouseArea to its parent's area using the
component), then the MouseArea will fill the area defined by the parent's
dimensions. Alternatively, an area smaller or larger than the parent is
definable.
-\snippet doc/snippets/qml/mousearea/mousearea-snippet.qml anchor fill
+\snippet qml/mousearea/mousearea-snippet.qml anchor fill
\section1 Receiving Events
@@ -77,7 +77,7 @@ gestures in greater detail:
\endlist
These signals have signal handlers that are invoked when the signals are emitted.
-\snippet doc/snippets/qml/mousearea/mousearea-snippet.qml mouse handlers
+\snippet qml/mousearea/mousearea-snippet.qml mouse handlers
\section1 Enabling Gestures
Some mouse gestures and button clicks need to be enabled before they send or
@@ -95,7 +95,7 @@ positioning even when there are no mouse button presses. Setting the
\c hoverEnabled property to \c true, in turn will enable the \c entered,
\c exited, and \c positionChanged signal and their respective signal handlers.
-\snippet doc/snippets/qml/mousearea/mousearea-snippet.qml enable handlers
+\snippet qml/mousearea/mousearea-snippet.qml enable handlers
Additionally, to disable the whole mouse area, set the \c MouseArea
element's \c enabled property to \c false.
diff --git a/src/quick/doc/src/positioners.qdoc b/src/quick/doc/src/positioners.qdoc
index d73d1cdbac..4ca87cf910 100644
--- a/src/quick/doc/src/positioners.qdoc
+++ b/src/quick/doc/src/positioners.qdoc
@@ -61,7 +61,7 @@ uses a Column item to arrange three \l Rectangle items in an area defined
by an outer \l Item. The \l{Column::spacing}{spacing} property is set to
include a small amount of space between the rectangles.
-\snippet doc/snippets/qml/column/column.qml document
+\snippet qml/column/column.qml document
Note that, since Column inherits directly from Item, any background color
must be added to a parent Rectangle, if desired.
@@ -80,7 +80,7 @@ include a small amount of space between the rectangles.
We ensure that the parent Rectangle is large enough so that there is some space
left around the edges of the horizontally centered Row item.
-\snippet doc/snippets/qml/row.qml document
+\snippet qml/row.qml document
\section2 Grid
@@ -93,7 +93,7 @@ The following example uses a Grid item to place four \l Rectangle items
in a 2-by-2 grid. As with the other positioners, the spacing between items
can be specified using the \l{Grid::spacing}{spacing} property.
-\snippet doc/snippets/qml/grid-spacing.qml document
+\snippet qml/grid-spacing.qml document
There is no difference between horizontal and vertical spacing inserted
between items, so any additional space must be added within the items
@@ -122,7 +122,7 @@ The following example shows a Flow item containing a number of \l Text
child items. These are arranged in a similar way to those shown in the
screenshots.
-\snippet doc/snippets/qml/flow.qml document
+\snippet qml/flow.qml document
The main differences between the Grid and Flow positioners are that items
inside a Flow will wrap when they run out of space on the minor axis, and
diff --git a/src/quick/doc/src/qmlintro.qdoc b/src/quick/doc/src/qmlintro.qdoc
index 86502b0d17..8a01e6464a 100644
--- a/src/quick/doc/src/qmlintro.qdoc
+++ b/src/quick/doc/src/qmlintro.qdoc
@@ -41,7 +41,7 @@ diving deeper into QML. It is also helpful to have a basic understanding of
other Web technologies like HTML and JSON, but it is not required.
The examples shown in this guide are located in the
-\c{examples/declarative/tutorials/qmlintro} directory within the Qt source
+\c{examples/quick/tutorials/qmlintro} directory within the Qt source
package. You can run then with the \l{QML Viewer} tool.
\section1 \l{QML Concepts and Syntax}
@@ -75,7 +75,7 @@ The following example shows the basic syntax of QML. When opened in
the \l{QML Viewer}{\QQV tool}, the output displayed should match the
image shown on the right: a light blue rectangle.
-\snippet examples/declarative/tutorials/qmlintro/basic-syntax.qml document
+\snippet examples/quick/tutorials/qmlintro/basic-syntax.qml document
In this example, we import the features defined by Qt Quick 1.0, and
we declare and create a single rectangle with width, height and color.
@@ -103,7 +103,7 @@ defined for the object, such as its property values and any child objects.
\div {class="float-right"}
\inlineimage declarative-qmlintro-elements1.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/elements1.qml document
+\snippet examples/quick/tutorials/qmlintro/elements1.qml document
Here, we create two elements: a rectangle with an image inside it. We say that
the rectangle is the parent element and the image is its child. Since the
@@ -119,7 +119,7 @@ element.
\div {class="float-right"}
\inlineimage declarative-qmlintro-elements2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/elements2.qml document
+\snippet examples/quick/tutorials/qmlintro/elements2.qml document
In this example, we can define as many elements inside the rectangle
as we like, but we cannot define other top level elements. All the
@@ -218,11 +218,11 @@ display text.
Grouped properties can be written like this:
-\snippet examples/declarative/tutorials/qmlintro/grouped-properties1.qml text with grouped properties
+\snippet examples/quick/tutorials/qmlintro/grouped-properties1.qml text with grouped properties
or like this:
-\snippet examples/declarative/tutorials/qmlintro/grouped-properties2.qml text with grouped properties
+\snippet examples/quick/tutorials/qmlintro/grouped-properties2.qml text with grouped properties
In the element documentation, grouped properties are shown using the "dot" notation.
@@ -276,7 +276,7 @@ automatically updated to the new value. For example:
\br
\inlineimage declarative-qmlintro-property-binding2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/property-binding.qml elements
+\snippet examples/quick/tutorials/qmlintro/property-binding.qml elements
Here, the child \l Rectangle item's \c width property is set relative to
the width of its parent. Whenever the parent's width changes, the width of
@@ -308,7 +308,7 @@ to be the same as that of the Text object by referring to
\inlineimage declarative-qmlintro-object-identifiers.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/object-identifiers.qml document
+\snippet examples/quick/tutorials/qmlintro/object-identifiers.qml document
An object can be referred to by its \c id from anywhere within the
\l{QML Documents}{component} in which it is declared. Therefore, an
@@ -340,7 +340,7 @@ Comments are ignored by the QML engine. They are useful for explaining what
you are doing; for referring back to at a later date, or for others reading
your QML files.
-\snippet examples/declarative/tutorials/qmlintro/comments.qml commenting
+\snippet examples/quick/tutorials/qmlintro/comments.qml commenting
Comments can also be used to prevent the execution of code, which is
sometimes useful for tracking down problems. In the above example, the
@@ -363,7 +363,7 @@ For example, the \l MouseArea element has an \l{MouseArea::}{onClicked} handler
that can be used to respond to a mouse click. Below, we use this handler to
print a message whenever the mouse is clicked:
-\snippet examples/declarative/tutorials/qmlintro/signal-handlers.qml document
+\snippet examples/quick/tutorials/qmlintro/signal-handlers.qml document
All signal handlers begin with \e "on".
@@ -372,7 +372,7 @@ the MouseArea \l{MouseArea::}{onPressed} signal handler has a \c mouse parameter
that contains information about the mouse press. This parameter can be
referred to in the JavaScript code, as below:
-\snippet examples/declarative/tutorials/qmlintro/signal-handlers-parameters.qml mouse area
+\snippet examples/quick/tutorials/qmlintro/signal-handlers-parameters.qml mouse area
\section2 Property Change Notifications
@@ -396,7 +396,7 @@ The following code shows this in practice:
\br
\inlineimage declarative-qmlintro-property-change2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/property-change.qml property change
+\snippet examples/quick/tutorials/qmlintro/property-change.qml property change
When the user modifies the text, the expression assigned to the \c textChanged
handler will be evaluated. In this example, the text changes color when this
@@ -435,7 +435,7 @@ attaches properties for handling key presses to any item. For example:
\div {class="float-right"}
\inlineimage declarative-qmlintro-attached-properties.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/attached-properties.qml attached properties
+\snippet examples/quick/tutorials/qmlintro/attached-properties.qml attached properties
The \l Keys properties are not defined by the \l Item element. They are
defined separately and attached to the item.
@@ -447,7 +447,7 @@ the \e ListView.isCurrentItem property to each delegate it creates:
\div {class="float-right"}
\inlineimage declarative-qmlintro-attached-properties-view.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/attached-properties-view.qml delegate with attached property
+\snippet examples/quick/tutorials/qmlintro/attached-properties-view.qml delegate with attached property
In effect, by attaching this property, \l ListView provides an interface
that lets the delegate access information about the current item in the
@@ -528,7 +528,7 @@ center of a \l Rectangle.
\div {class="float-right"}
\inlineimage declarative-qmlintro-anchors-centerin.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/anchors.qml centered text
+\snippet examples/quick/tutorials/qmlintro/anchors.qml centered text
In this case, the center of the text item is anchored to the center of
its parent item by using the \c{anchors.centerIn} grouped property.
@@ -549,7 +549,7 @@ to define its position relative to the text item.
\div {class="float-right"}
\inlineimage declarative-qmlintro-anchors-edges.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/anchors2.qml anchored items
+\snippet examples/quick/tutorials/qmlintro/anchors2.qml anchored items
By giving the text item the \c textItem identifier, we can refer to it when
defining the anchors for the rectangle. We line up the right edge of the
@@ -575,7 +575,7 @@ the same width.
\br
\inlineimage declarative-qmlintro-anchors-expanding2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/anchors-expanding.qml anchored items
+\snippet examples/quick/tutorials/qmlintro/anchors-expanding.qml anchored items
The anchor lines on the left and right edges of the rectangle are connected
to those of the text input item. Since the text can be modified by the user,
@@ -597,7 +597,7 @@ between them.
\br
\inlineimage declarative-qmlintro-anchors-baseline-margins.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/anchors-margins.qml anchored items
+\snippet examples/quick/tutorials/qmlintro/anchors-margins.qml anchored items
Note that the image also uses a margin to leave a gap between its left edge
and the left edge of the user interface.
@@ -634,7 +634,7 @@ order in which items will be updated. Problems can occur if circular dependencie
are created between items. The following example shows this occurring with a
parent item and its child.
-\snippet examples/declarative/tutorials/qmlintro/circular.qml circular
+\snippet examples/quick/tutorials/qmlintro/circular.qml circular
\section3 Strategies for Use
@@ -655,7 +655,7 @@ items contain an image and a text item that are anchored to their parent.
\div {class="float-right"}
\inlineimage declarative-qmlintro-anchors-strategy-annotated.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/anchors-strategy.qml anchor strategy
+\snippet examples/quick/tutorials/qmlintro/anchors-strategy.qml anchor strategy
The above example shows how each item is anchored to its parent. This ensures
that the dependencies introduced by the anchors all consistently point to each
@@ -687,7 +687,7 @@ item.
\div {class="float-right"}
\inlineimage declarative-qmlintro-anchors-stretch.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/anchors-stretch.qml items
+\snippet examples/quick/tutorials/qmlintro/anchors-stretch.qml items
The rectangle uses anchors to define its top, left and right edges in terms
of its parent item, and the bottom edge is aligned with the top of the text
@@ -745,7 +745,7 @@ include a small amount of space between the rectangles.
\div {class="float-right"}
\inlineimage qml-row.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/row.qml document
+\snippet examples/quick/tutorials/qmlintro/row.qml document
We ensure that the parent \l Rectangle is large enough so that there is some space
left around the edges of the horizontally centered Row item. The equally-sized
@@ -763,7 +763,7 @@ different sizes.
\div {class="float-right"}
\inlineimage declarative-qmlintro-row-anchors.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/row-anchors.qml row
+\snippet examples/quick/tutorials/qmlintro/row-anchors.qml row
Note that the \l Row item itself uses \c horizontalCenter and \c verticalCenter
anchors to place itself in the center of its parent. It is free to do this
@@ -787,7 +787,7 @@ include a small amount of space between the rectangles.
\div {class="float-right"}
\inlineimage qml-column.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/column.qml document
+\snippet examples/quick/tutorials/qmlintro/column.qml document
In the above example, each of the rounded rectangles are positioned by the
\l Column item. The column only changes the vertical positions of its
@@ -803,7 +803,7 @@ it will only be as wide as the widest child item.
\div {class="float-right"}
\inlineimage declarative-qmlintro-column-anchors.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/column-anchors.qml document
+\snippet examples/quick/tutorials/qmlintro/column-anchors.qml document
The example above stretches the column horizontally to fill the entire
user interface, and stretches each rectangle inside to fill the column.
@@ -819,7 +819,7 @@ can be specified using the \l{Grid::spacing}{spacing} property.
\div {class="float-right"}
\inlineimage qml-grid-spacing.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/grid-spacing.qml document
+\snippet examples/quick/tutorials/qmlintro/grid-spacing.qml document
There is no difference between horizontal and vertical spacing inserted
between items, so any additional space must be added within the items
@@ -836,8 +836,8 @@ them.
\div {class="float-right"}
\inlineimage declarative-qmlintro-grid-positioning.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/grid-positioning.qml document start
-\snippet examples/declarative/tutorials/qmlintro/grid-positioning.qml document end
+\snippet examples/quick/tutorials/qmlintro/grid-positioning.qml document start
+\snippet examples/quick/tutorials/qmlintro/grid-positioning.qml document end
We only show the first item, but the principle is the same for the others.
@@ -861,7 +861,7 @@ screenshots.
\br
\inlineimage qml-flow-text2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/flow.qml document
+\snippet examples/quick/tutorials/qmlintro/flow.qml document
The main differences between the \l Grid and \l Flow positioners are that
items inside a \l Flow will wrap when they run out of space on the minor
@@ -878,7 +878,7 @@ items, placing one positioner inside another. The following example shows a
\div {class="float-right"}
\inlineimage declarative-qmlintro-nested-positioners.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/nested-positioners.qml column
+\snippet examples/quick/tutorials/qmlintro/nested-positioners.qml column
The example works around the restrictions on the use of anchors mentioned
earlier by using appropriate anchors for each item. The innermost items,
@@ -941,7 +941,7 @@ is in the user interface, but it will not be visible in the running example.
\div {class="float-right"}
\inlineimage declarative-qmlintro-mousearea-annotated.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mousearea.qml mouse area
+\snippet examples/quick/tutorials/qmlintro/mousearea.qml mouse area
The \l{MouseArea::}{onPressed} and \l{MouseArea::}{onReleased} definitions
are \l{QML Concepts and Syntax#Signal Handlers}{signal handlers} that
@@ -965,7 +965,7 @@ area, and defines two signal handlers to response to mouse button input.
\br
\inlineimage declarative-qmlintro-mouse-pressed2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-pressed-signals.qml text item
+\snippet examples/quick/tutorials/qmlintro/mouse-pressed-signals.qml text item
The \l{MouseArea::}{onPressed} and \l{MouseArea::}{onReleased}
signal handlers are defined for the mouse area. As a result, when the user
@@ -981,7 +981,7 @@ operator), as in the following example.
\div {class="float-right"}
\inlineimage declarative-qmlintro-mouse-pressed-buttons.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-pressed-buttons.qml items
+\snippet examples/quick/tutorials/qmlintro/mouse-pressed-buttons.qml items
The mouse area covers the entire area of the user interface and accepts
input from both left and right buttons. Each of the rectangles defines its
@@ -1005,7 +1005,7 @@ position of the cursor, as shown in the following example.
\div {class="float-right"}
\inlineimage declarative-qmlintro-mouse-pressed-position.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-pressed-position.qml text item
+\snippet examples/quick/tutorials/qmlintro/mouse-pressed-position.qml text item
When the user presses the mouse button over the text item, the text changes
to show the coordinates within the mouse area where the press occurred. If
@@ -1023,7 +1023,7 @@ case, we could try the following:
\div {class="float-right"}
\inlineimage declarative-qmlintro-mouse-pressed-position2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-pressed-position2.qml text item
+\snippet examples/quick/tutorials/qmlintro/mouse-pressed-position2.qml text item
When we run this example, the text item shows the initial, default value of
the mouse area's \c mouseX and \c mouseY properties. Moving the cursor over
@@ -1038,7 +1038,7 @@ mouse cursor, we need to enable \e{mouse hover} by setting its
\div {class="float-right"}
\inlineimage declarative-qmlintro-mouse-hover-enabled.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-hover-enabled.qml text item
+\snippet examples/quick/tutorials/qmlintro/mouse-hover-enabled.qml text item
With mouse hover enabled, other properties of the \l MouseArea can be
monitored. For example, the \l{MouseArea::}{containsMouse} property can be
@@ -1051,7 +1051,7 @@ press a mouse button over the area.
\br
\inlineimage declarative-qmlintro-mouse-hover-containsmouse2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-hover-containsmouse.qml items
+\snippet examples/quick/tutorials/qmlintro/mouse-hover-containsmouse.qml items
The above example uses \l{QML Concepts and Syntax#Expressions}{an expression}
to show the coordinates of the mouse cursor when it is in the mouse area,
@@ -1072,7 +1072,7 @@ following example shows how dragging is enabled for an item.
\div {class="float-right"}
\inlineimage declarative-qmlintro-mouse-drag.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/mouse-drag.qml draggable item
+\snippet examples/quick/tutorials/qmlintro/mouse-drag.qml draggable item
The item to be dragged is the \l Rectangle containing a \l MouseArea and
\l Text items. All that is required is to set the value of the
@@ -1135,7 +1135,7 @@ positioner. These are defined with identifiers, \c{leftRect} and
\br
\inlineimage declarative-qmlintro-key-navigation2.png
\enddiv
-\snippet examples/declarative/tutorials/qmlintro/key-navigation.qml items
+\snippet examples/quick/tutorials/qmlintro/key-navigation.qml items
The \c{leftRect} rectangle attaches the
\l{KeyNavigation::right}{KeyNavigation.right} property, setting it to refer
@@ -1183,7 +1183,7 @@ The following example shows a repeater used with a \l{#Grid}{Grid} item to
arrange a set of Rectangle items. The Repeater item creates a series of 24
rectangles for the Grid item to position in a 5 by 5 arrangement.
-\snippet doc/snippets/qml/repeaters/repeater-grid-index.qml document
+\snippet qml/repeaters/repeater-grid-index.qml document
The number of items created by a Repeater is held by its \l{Repeater::}{count}
property. It is not possible to set this property to determine the number of
diff --git a/src/quick/doc/src/qmltexthandling.qdoc b/src/quick/doc/src/qmltexthandling.qdoc
index 105b094be4..63f2c40145 100644
--- a/src/quick/doc/src/qmltexthandling.qdoc
+++ b/src/quick/doc/src/qmltexthandling.qdoc
@@ -60,10 +60,10 @@ respective element documentation.
The \l {Validators}{validator} elements enforce the type and format of
\l TextInput objects.
-\snippet doc/snippets/qml/texthandling.qml int validator
+\snippet qml/texthandling.qml int validator
The validator elements bind to \c {TextInput}'s \c validator property.
-\snippet doc/snippets/qml/texthandling.qml regexp validator
+\snippet qml/texthandling.qml regexp validator
The regular expression in the snippet will only allow the inputted text to be
\c {fruit basket}.
diff --git a/src/quick/doc/src/qtquick-intro.qdoc b/src/quick/doc/src/qtquick-intro.qdoc
index 0fcf4ef603..56f507dd82 100644
--- a/src/quick/doc/src/qtquick-intro.qdoc
+++ b/src/quick/doc/src/qtquick-intro.qdoc
@@ -57,7 +57,7 @@ A Dial element might define a \e value property that can be used to control
the position of the needle on the dial. The element could be declared to
use a slider that adjusts the value of this property.
-\snippet examples/declarative/ui-components/dialcontrol/qml/dialcontrol.qml the dial in use
+\snippet examples/tutorials/ui-components/dialcontrol/dialcontrol.qml the dial in use
Building user interfaces by importing these elements and linking their properties
together is one of the fundamental features of QML and Qt Quick.
diff --git a/src/quick/doc/src/righttoleft.qdoc b/src/quick/doc/src/righttoleft.qdoc
index 2769970798..d24d18d0c2 100644
--- a/src/quick/doc/src/righttoleft.qdoc
+++ b/src/quick/doc/src/righttoleft.qdoc
@@ -68,7 +68,7 @@ Note that when \l LayoutMirroring is set, the \c horizontalAlignment property va
the effective alignment of the text element that takes the mirroring into account can be read from the
\c effectiveHorizontalAlignment property.
-\snippet doc/snippets/qml/righttoleft.qml 0
+\snippet qml/righttoleft.qml 0
\section1 Layout direction of positioners and views
@@ -84,7 +84,7 @@ This causes the effective \c layoutDirection of positioners and views to be mirr
of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and
views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property.
-\snippet doc/snippets/qml/righttoleft.qml 1
+\snippet qml/righttoleft.qml 1
\section1 Layout mirroring
@@ -95,11 +95,11 @@ support for existing left-to-right Qt Quick applications. It mirrors the behavio
You can enable layout mirroring for a particular \l Item:
-\snippet doc/snippets/qml/righttoleft.qml 2
+\snippet qml/righttoleft.qml 2
Or set all child elements to also inherit the layout direction:
-\snippet doc/snippets/qml/righttoleft.qml 3
+\snippet qml/righttoleft.qml 3
Applying mirroring in this manner does not change the actual value of the relevant anchor,
\c layoutDirection or \c horizontalAlignment properties. The separate read-only property
@@ -116,7 +116,7 @@ especially in views that rely on both the anchors and x coordinate-based positio
the \l LayoutMirroring attached property to apply mirroring to an item that is positioned using \l {Item::}{x}
coordinates:
-\snippet doc/snippets/qml/righttoleft.qml 4
+\snippet qml/righttoleft.qml 4
Not all layouts should necessarily be mirrored. There are cases where a visual element is positioned to
the right side of the screen for improved one-handed use, because most people are right-handed, and not
@@ -135,7 +135,7 @@ aligned and just make sure that text is translated and aligned properly.
Most images do not need to be mirrored, but some directional icons, such as arrows, may need to be mirrored.
The painting of these icons can be mirrored with a dedicated \c mirror property introduced in Qt Quick 1.1:
-\snippet doc/snippets/qml/righttoleft.qml 5
+\snippet qml/righttoleft.qml 5
\section1 Default layout direction
diff --git a/src/quick/doc/src/states.qdoc b/src/quick/doc/src/states.qdoc
index 13d2d82412..cc42adfb82 100644
--- a/src/quick/doc/src/states.qdoc
+++ b/src/quick/doc/src/states.qdoc
@@ -79,7 +79,7 @@ signal should be \c green and the warning \c flag is down. Meanwhile, in the
\c CRITICAL state, the \c color should be \c red and the flag is \c up. We may
model the states using the \c State element and the color and flag
configurations with the \c PropertyChanges element.
-\snippet doc/snippets/qml/states.qml signal states
+\snippet qml/states.qml signal states
The \l PropertyChanges element will change the values of object properties.
Objects are referenced through their \l {qml-id}{id}. Objects outside
the component are also referenced using the \c id property, exemplified by the
@@ -88,7 +88,7 @@ property change to the external \c flag object.
Further, the state may change by assigning the \c state property with the
appropriate signal state. A state switch could be in a \l MouseArea element,
assigning a different state whenever the signal receives a mouse click.
-\snippet doc/snippets/qml/states.qml switch states
+\snippet qml/states.qml switch states
The State element is not limited to performing modifications on property values.
It can also:
@@ -114,7 +114,7 @@ expressions to change the state whenever the bound expression evaluates to
\c true. The \c when property will revert the state back to the
\l {The Default State}{default state} when the expression evaluates to false.
-\snippet doc/snippets/qml/states.qml when property
+\snippet qml/states.qml when property
The \c bell component will change to the \c RINGING state whenever the
\c signal.state is \c CRITICAL.
diff --git a/src/quick/doc/src/writingcomponents.qdoc b/src/quick/doc/src/writingcomponents.qdoc
index 104e1c6b2c..c664b7799f 100644
--- a/src/quick/doc/src/writingcomponents.qdoc
+++ b/src/quick/doc/src/writingcomponents.qdoc
@@ -55,14 +55,14 @@ For example, one of the simplest and most common components you can build in QML
button-type component. Below, we implement this component as a \l Rectangle with a clickable
\l MouseArea, in a file named \c Button.qml:
-\snippet doc/snippets/qml/qml-extending-types/components/Button.qml 0
+\snippet qml/qml-extending-types/components/Button.qml 0
Now this component can be reused by another file within the same directory. Since the file is
named \c Button.qml, the component is referred to as \c Button:
\table
\row
-\li \snippet doc/snippets/qml/qml-extending-types/components/application.qml 0
+\li \snippet qml/qml-extending-types/components/application.qml 0
\li \image qml-extending-types.png
\endtable
@@ -119,8 +119,8 @@ an \c ImageViewer object and read or modify the \c currentImage value:
\table
\row
-\li \snippet doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml 0
-\li \snippet doc/snippets/qml/qml-extending-types/properties/application.qml 0
+\li \snippet qml/qml-extending-types/properties/ImageViewer.qml 0
+\li \snippet qml/qml-extending-types/properties/application.qml 0
\endtable
It is optional for a property to have a default value. The default value is a convenient shortcut, and is
@@ -195,7 +195,7 @@ property name.
For example, the following \c onMyNumberChanged signal handler is automatically called whenever the
\c myNumber property changes:
-\snippet doc/snippets/qml/qml-extending-types/properties/property-signals.qml 0
+\snippet qml/qml-extending-types/properties/property-signals.qml 0
\section2 Default properties
@@ -266,7 +266,7 @@ declaring the alias, and, optionally, <property> refers to a property on that ob
For example, below is a \c Button.qml component with a \c buttonText aliased property which is
connected to the child Text object's \c text property:
-\snippet doc/snippets/qml/qml-extending-types/properties/alias.qml 0
+\snippet qml/qml-extending-types/properties/alias.qml 0
The following code would create a \c Button with a defined text string for the
child \l Text object:
@@ -290,8 +290,8 @@ been changed to an alias to the child \l Image object:
\table
\row
-\li \snippet doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml 0
-\li \snippet doc/snippets/qml/qml-extending-types/properties/alias/application.qml 0
+\li \snippet qml/qml-extending-types/properties/alias/ImageViewer.qml 0
+\li \snippet qml/qml-extending-types/properties/alias/application.qml 0
\endtable
Instead of being limited to setting the \l Image source, \c application.qml can now directly
@@ -335,7 +335,7 @@ It is possible for an aliased property to have the same name as an existing prop
the following component has a \c color alias property, named the same as the built-in
\l {Rectangle::color} property:
-\snippet doc/snippets/qml/qml-extending-types/properties/alias-override.qml 0
+\snippet qml/qml-extending-types/properties/alias-override.qml 0
Any objects that use this component and refer to its \c color property will be
referring to the alias rather than the ordinary \l {Rectangle::color} property. Internally,
@@ -366,7 +366,7 @@ the parameters by name.
Here is an example of a component with a \c say() method that accepts a single \c text argument:
-\snippet doc/snippets/qml/qml-extending-types/methods/app.qml 0
+\snippet qml/qml-extending-types/methods/app.qml 0
A method can be connected to a signal so that it is automatically invoked whenever the signal
is emitted. See \l {Connecting signals to methods and other signals} below.
@@ -422,8 +422,8 @@ signal is received by \c application.qml through an \c onButtonClicked signal ha
\table
\row
-\li \snippet doc/snippets/qml/qml-extending-types/signals/basic.qml 0
-\li \snippet doc/snippets/qml/qml-extending-types/signals/no-parameters.qml 0
+\li \snippet qml/qml-extending-types/signals/basic.qml 0
+\li \snippet qml/qml-extending-types/signals/no-parameters.qml 0
\endtable
If the signal has parameters, they are accessible by parameter name in the signal handler.
@@ -431,8 +431,8 @@ In the example below, \c buttonClicked is emitted with \c xPos and \c yPos param
\table
\row
-\li \snippet doc/snippets/qml/qml-extending-types/signals/Button.qml 0
-\li \snippet doc/snippets/qml/qml-extending-types/signals/parameters.qml 0
+\li \snippet qml/qml-extending-types/signals/Button.qml 0
+\li \snippet qml/qml-extending-types/signals/parameters.qml 0
\endtable
@@ -446,7 +446,7 @@ to be received by a method instead of a \l {Signal Handlers}{signal handler}.
For example, the \c application.qml above could be rewritten as:
-\snippet doc/snippets/qml/qml-extending-types/signals/connectslots.qml 0
+\snippet qml/qml-extending-types/signals/connectslots.qml 0
The \c myMethod() method will be called whenever the \c buttonClicked signal is received.
@@ -458,7 +458,7 @@ or \l {Integrating JavaScript}{integrating JavaScript code}, then you will find
objects dynamically, and connects the \c buttonClicked signal of each object to the
\c myMethod() function:
-\snippet doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml 0
+\snippet qml/qml-extending-types/signals/connectdynamic.qml 0
In the same way, you could connect a signal to methods defined in a dynamically
created object, or \l {Receiving QML Signals in JavaScript}{connect a signal to a JavaScript method}.
diff --git a/src/quick/items/qquickaccessibleattached.cpp b/src/quick/items/qquickaccessibleattached.cpp
index 0ab96c184b..c07a60bd9a 100644
--- a/src/quick/items/qquickaccessibleattached.cpp
+++ b/src/quick/items/qquickaccessibleattached.cpp
@@ -98,13 +98,18 @@ QT_BEGIN_NAMESPACE
\qml
Item {
id: myButton
+
Text {
id: label
// ...
}
+
Accessible.name: label.text
Accessible.role: Accessible.Button
- funtion accessiblePressAction { ... }
+
+ function accessiblePressAction() {
+ //...
+ }
}
\endqml
diff --git a/src/quick/items/qquickanimatedimage.cpp b/src/quick/items/qquickanimatedimage.cpp
index 4fd7b99190..f93dc4aa28 100644
--- a/src/quick/items/qquickanimatedimage.cpp
+++ b/src/quick/items/qquickanimatedimage.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
\b Note: Unlike images, animated images are not cached or shared internally.
\clearfloat
- \snippet doc/snippets/qml/animatedimage.qml document
+ \snippet qml/animatedimage.qml document
\sa BorderImage, Image
*/
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp
index 9c3992792e..015dca5809 100644
--- a/src/quick/items/qquickborderimage.cpp
+++ b/src/quick/items/qquickborderimage.cpp
@@ -100,7 +100,7 @@ QT_BEGIN_NAMESPACE
used to determine the parts of the image that will lie inside the unscaled corner
areas and the parts that will be stretched horizontally and vertically.
- \snippet doc/snippets/qml/borderimage/normal-image.qml normal image
+ \snippet qml/borderimage/normal-image.qml normal image
\clearfloat
\beginfloatleft
@@ -114,7 +114,7 @@ QT_BEGIN_NAMESPACE
is set to \l{BorderImage::verticalTileMode}{BorderImage.Stretch}, the parts of image
in regions 4 and 6 are stretched vertically.
- \snippet doc/snippets/qml/borderimage/borderimage-scaled.qml scaled border image
+ \snippet qml/borderimage/borderimage-scaled.qml scaled border image
\clearfloat
\beginfloatleft
@@ -128,7 +128,7 @@ QT_BEGIN_NAMESPACE
\l{BorderImage::verticalTileMode}{BorderImage.Repeat}, the parts of image in regions
4 and 6 are tiled so that they fill the space at the left and right of the element.
- \snippet doc/snippets/qml/borderimage/borderimage-tiled.qml tiled border image
+ \snippet qml/borderimage/borderimage-tiled.qml tiled border image
\clearfloat
In some situations, the width of regions 2 and 8 may not be an exact multiple of the width
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index bc9732b6b3..7768d73dca 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -112,7 +112,7 @@ public:
However, dragging is not limited to mouse drags, anything that can move an item
can generate drag events, this can include touch events, animations and bindings.
- \snippet doc/snippets/qml/drag.qml 0
+ \snippet qml/drag.qml 0
A drag can be terminated either by canceling it with Drag.cancel() or setting
Drag.active to false, or it can be terminated with a drop event by calling
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index ba61ca4972..b6d80cdd9b 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -534,7 +534,7 @@ is finished.
The following example shows a small view onto a large image in which the
user can drag or flick the image in order to view different parts of it.
- \snippet doc/snippets/qml/flickable.qml document
+ \snippet qml/flickable.qml document
\clearfloat
@@ -596,9 +596,9 @@ is finished.
These properties are typically used to draw a scrollbar. For example:
- \snippet doc/snippets/qml/flickableScrollbar.qml 0
+ \snippet qml/flickableScrollbar.qml 0
\dots 8
- \snippet doc/snippets/qml/flickableScrollbar.qml 1
+ \snippet qml/flickableScrollbar.qml 1
\sa {declarative/ui-components/scrollbar}{scrollbar example}
*/
@@ -1507,7 +1507,7 @@ void QQuickFlickable::setBoundsBehavior(BoundsBehavior b)
The following snippet shows how these properties are used to display
an image that is larger than the Flickable item itself:
- \snippet doc/snippets/qml/flickable.qml document
+ \snippet qml/flickable.qml document
In some cases, the the content dimensions can be automatically set
using the \l {Item::childrenRect.width}{childrenRect.width}
diff --git a/src/quick/items/qquickflipable.cpp b/src/quick/items/qquickflipable.cpp
index 0231e84cf7..c2f487c9f2 100644
--- a/src/quick/items/qquickflipable.cpp
+++ b/src/quick/items/qquickflipable.cpp
@@ -113,7 +113,7 @@ public:
degrees to produce the flipping effect. When \c flipped is false, the
item reverts to the default state, in which the \c angle value is 0.
- \snippet doc/snippets/qml/flipable/flipable.qml 0
+ \snippet qml/flipable/flipable.qml 0
\image flipable.gif
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
index 48d04bf7e7..932518489f 100644
--- a/src/quick/items/qquickgridview.cpp
+++ b/src/quick/items/qquickgridview.cpp
@@ -1167,7 +1167,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
The following example shows the definition of a simple list model defined
in a file called \c ContactModel.qml:
- \snippet doc/snippets/qml/gridview/ContactModel.qml 0
+ \snippet qml/gridview/ContactModel.qml 0
\div {class="float-right"}
\inlineimage gridview-simple.png
@@ -1181,9 +1181,9 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
(containing \l Image and \l Text elements) for its delegate.
\clearfloat
- \snippet doc/snippets/qml/gridview/gridview.qml import
+ \snippet qml/gridview/gridview.qml import
\codeline
- \snippet doc/snippets/qml/gridview/gridview.qml classdocs simple
+ \snippet qml/gridview/gridview.qml classdocs simple
\div {class="float-right"}
\inlineimage gridview-highlight.png
@@ -1196,7 +1196,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
into a separate \c contactDelegate component.
\clearfloat
- \snippet doc/snippets/qml/gridview/gridview.qml classdocs advanced
+ \snippet qml/gridview/gridview.qml classdocs advanced
The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property,
and \c focus is set to \c true to enable keyboard navigation for the grid view.
@@ -1210,7 +1210,7 @@ void QQuickGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
this attached property directly as \c GridView.isCurrentItem, while the child
\c contactInfo object must refer to this property as \c wrapper.GridView.isCurrentItem.
- \snippet doc/snippets/qml/gridview/gridview.qml isCurrentItem
+ \snippet qml/gridview/gridview.qml isCurrentItem
\note Views do not set the \l{Item::}{clip} property automatically.
If the view is not clipped by another item or the screen, it will be necessary
@@ -1308,7 +1308,7 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight)
It is attached to each instance of the delegate.
- \snippet doc/snippets/qml/gridview/gridview.qml isCurrentItem
+ \snippet qml/gridview/gridview.qml isCurrentItem
*/
/*!
@@ -1320,7 +1320,7 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight)
until an animation completes. The example delegate below ensures that the
animation completes before the item is removed from the list.
- \snippet doc/snippets/qml/gridview/gridview.qml delayRemove
+ \snippet qml/gridview/gridview.qml delayRemove
If a \l remove transition has been specified, it will not be applied until
delayRemove is returned to \c false.
@@ -1428,7 +1428,7 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight)
Here is a highlight with its motion defined by a \l {SpringAnimation} item:
- \snippet doc/snippets/qml/gridview/gridview.qml highlightFollowsCurrentItem
+ \snippet qml/gridview/gridview.qml highlightFollowsCurrentItem
*/
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp
index 8331d14d0a..d4a3cd5b0d 100644
--- a/src/quick/items/qquickimage.cpp
+++ b/src/quick/items/qquickimage.cpp
@@ -120,7 +120,7 @@ QQuickImagePrivate::QQuickImagePrivate()
The following example shows the simplest usage of the Image element.
- \snippet doc/snippets/qml/image.qml document
+ \snippet qml/image.qml document
\beginfloatleft
\image declarative-qtlogo.png
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 0dd04e8d70..747f1a1da9 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -254,7 +254,7 @@ void QQuickItemPrivate::registerAccessorProperties()
rotations you must specify the axis to rotate around in addition to the origin point.
The following example shows various 3D-like rotations applied to an \l Image.
- \snippet doc/snippets/qml/rotation.qml 0
+ \snippet qml/rotation.qml 0
\image axisrotation.png
@@ -512,7 +512,7 @@ void QQuickItemKeyFilter::componentComplete()
The following example provides key navigation for a 2x2 grid of items:
- \snippet doc/snippets/qml/keynavigation.qml 0
+ \snippet qml/keynavigation.qml 0
The top-left item initially receives focus by setting \l {Item::}{focus} to
\c true. When an arrow key is pressed, the focus will move to the
@@ -937,13 +937,13 @@ bool QQuickKeysAttached::isConnected(const char *signalName)
be used to test for a certain key; in this case, the left cursor
key:
- \snippet doc/snippets/qml/keys/keys-pressed.qml key item
+ \snippet qml/keys/keys-pressed.qml key item
Some keys may alternatively be handled via specific signal properties,
for example \e onSelectPressed. These handlers automatically set
\e event.accepted to true.
- \snippet doc/snippets/qml/keys/keys-handler.qml key item
+ \snippet qml/keys/keys-handler.qml key item
See \l{Qt::Key}{Qt.Key} for the list of keyboard codes.
@@ -1485,7 +1485,7 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
from left to right by default, they are now positioned from right to left instead, as demonstrated
by the numbering and opacity of the items:
- \snippet doc/snippets/qml/layoutmirroring.qml 0
+ \snippet qml/layoutmirroring.qml 0
\image layoutmirroring.png
diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp
index a0437b271e..03ada67c06 100644
--- a/src/quick/items/qquickitemanimation.cpp
+++ b/src/quick/items/qquickitemanimation.cpp
@@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
the transition, ensures the item animates smoothly as it moves to
its new parent:
- \snippet doc/snippets/qml/parentanimation.qml 0
+ \snippet qml/parentanimation.qml 0
A ParentAnimation can contain any number of animations. These animations will
be run in parallel; to run them sequentially, define them within a
@@ -425,7 +425,7 @@ QAbstractAnimationJob* QQuickParentAnimation::transition(QQuickStateActions &act
In the following snippet we animate the addition of a right anchor to a \l Rectangle:
- \snippet doc/snippets/qml/anchoranimation.qml 0
+ \snippet qml/anchoranimation.qml 0
For convenience, when an AnchorAnimation is used in a \l Transition, it will
animate any AnchorChanges that have occurred during the state change.
diff --git a/src/quick/items/qquickitemviewtransition.cpp b/src/quick/items/qquickitemviewtransition.cpp
index aec4de43b6..d51d79230a 100644
--- a/src/quick/items/qquickitemviewtransition.cpp
+++ b/src/quick/items/qquickitemviewtransition.cpp
@@ -642,7 +642,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
Here is a basic example of the use of view transitions. The view below specifies transitions for
the \c add and \c displaced properties, which will be run when items are added to the view:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-basic.qml 0
+ \snippet qml/viewtransitions/viewtransitions-basic.qml 0
When the space key is pressed, adding an item to the model, the new item will fade in and
increase in scale over 400 milliseconds as it is added to the view. Also, any item that is
@@ -728,7 +728,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
each displaced item based on the difference between its index (provided by ViewTransition.index)
and the first removed index (provided by ViewTransition.targetIndexes):
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml 0
+ \snippet qml/viewtransitions/viewtransitions-delayedbyindex.qml 0
Each displaced item delays its animation by an additional 100 milliseconds, producing a subtle
ripple-type effect when items are displaced by the add, like this:
@@ -748,7 +748,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
animate to an intermediate position relative to its starting point for the transition, before
animating to its final position in the view:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml 0
+ \snippet qml/viewtransitions/viewtransitions-intermediatemove.qml 0
Now, a displaced item will first move to a position of (20, 50) relative to its starting
position, and then to its final, correct position in the view:
@@ -764,7 +764,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
a curved path. For example, the \c add transition in the previous example could be augmented with
a PathAnimation as follows: to animate newly added items along a path:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-pathanim.qml 0
+ \snippet qml/viewtransitions/viewtransitions-pathanim.qml 0
This animates newly added items along a path. Notice that each path is specified relative to
each item's final destination point, so that items inserted at different indexes start their
@@ -787,7 +787,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
properties, this interruption may cause unwanted side effects. Consider the first example on this
page, repeated below for convenience:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-basic.qml 0
+ \snippet qml/viewtransitions/viewtransitions-basic.qml 0
If multiple items are added in rapid succession, without waiting for a previous transition
to finish, this is the result:
@@ -804,7 +804,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
set to the end values specified in the \c add transition, effectively resetting these values
whenever an item is displaced. In this case, it means setting the item opacity and scale to 1.0:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml 0
+ \snippet qml/viewtransitions/viewtransitions-interruptedgood.qml 0
Now, when an item's \c add transition is interrupted, its opacity and scale are animated to 1.0
upon displacement, avoiding the erroneous visual effects from before:
@@ -829,7 +829,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
attached property, as it may not refer to the expected values at the time that the ScriptAction
is actually invoked. Consider the following example:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml 0
+ \snippet qml/viewtransitions/viewtransitions-scriptactionbad.qml 0
When the space key is pressed, three items are moved from index 5 to index 1. For each moved
item, the \c moveTransition sequence presumably animates the item's color to "yellow", then
@@ -847,7 +847,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent)
In this instance, to avoid this issue, the view could set the property using a PropertyAction
instead:
- \snippet doc/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml 0
+ \snippet qml/viewtransitions/viewtransitions-scriptactiongood.qml 0
When the transition is initialized, the PropertyAction \c target will be set to the respective
ViewTransition.item for the transition and will later run with the correct item target as
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 864c639f35..8ee3625775 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1659,13 +1659,13 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
The following example shows the definition of a simple list model defined
in a file called \c ContactModel.qml:
- \snippet doc/snippets/qml/listview/ContactModel.qml 0
+ \snippet qml/listview/ContactModel.qml 0
Another component can display this model data in a ListView, like this:
- \snippet doc/snippets/qml/listview/listview.qml import
+ \snippet qml/listview/listview.qml import
\codeline
- \snippet doc/snippets/qml/listview/listview.qml classdocs simple
+ \snippet qml/listview/listview.qml classdocs simple
\image listview-simple.png
@@ -1676,7 +1676,7 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
An improved list view is shown below. The delegate is visually improved and is moved
into a separate \c contactDelegate component.
- \snippet doc/snippets/qml/listview/listview.qml classdocs advanced
+ \snippet qml/listview/listview.qml classdocs advanced
\image listview-highlight.png
The currently selected item is highlighted with a blue \l Rectangle using the \l highlight property,
@@ -1691,7 +1691,7 @@ void QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
this attached property directly as \c ListView.isCurrentItem, while the child
\c contactInfo object must refer to this property as \c wrapper.ListView.isCurrentItem.
- \snippet doc/snippets/qml/listview/listview.qml isCurrentItem
+ \snippet qml/listview/listview.qml isCurrentItem
\note Views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
@@ -1756,7 +1756,7 @@ QQuickListView::~QQuickListView()
This property may be used to adjust the appearance of the current item, for example:
- \snippet doc/snippets/qml/listview/listview.qml isCurrentItem
+ \snippet qml/listview/listview.qml isCurrentItem
*/
/*!
@@ -1803,7 +1803,7 @@ QQuickListView::~QQuickListView()
until an animation completes. The example delegate below ensures that the
animation completes before the item is removed from the list.
- \snippet doc/snippets/qml/listview/listview.qml delayRemove
+ \snippet qml/listview/listview.qml delayRemove
If a \l remove transition has been specified, it will not be applied until
delayRemove is returned to \c false.
@@ -1913,7 +1913,7 @@ QQuickListView::~QQuickListView()
Here is a highlight with its motion defined by a \l {SpringAnimation} item:
- \snippet doc/snippets/qml/listview/listview.qml highlightFollowsCurrentItem
+ \snippet qml/listview/listview.qml highlightFollowsCurrentItem
Note that the highlight animation also affects the way that the view
is scrolled. This is because the view moves to maintain the
@@ -2172,7 +2172,7 @@ void QQuickListView::setOrientation(QQuickListView::Orientation orientation)
each section.
- \snippet examples/declarative/modelviews/listview/sections.qml 0
+ \snippet examples/quick/modelviews/listview/sections.qml 0
\image qml-listview-sections-example.png
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp
index 2cde9effdc..843d0c18fd 100644
--- a/src/quick/items/qquickloader.cpp
+++ b/src/quick/items/qquickloader.cpp
@@ -173,7 +173,7 @@ qreal QQuickLoaderPrivate::getImplicitHeight() const
Here is a Loader that loads "Page1.qml" as a component when the
\l MouseArea is clicked:
- \snippet doc/snippets/qml/loader/simple.qml 0
+ \snippet qml/loader/simple.qml 0
The loaded item can be accessed using the \l item property.
@@ -205,8 +205,8 @@ qreal QQuickLoaderPrivate::getImplicitHeight() const
\li sizeloader.qml
\li sizeitem.qml
\row
- \li \snippet doc/snippets/qml/loader/sizeloader.qml 0
- \li \snippet doc/snippets/qml/loader/sizeitem.qml 0
+ \li \snippet qml/loader/sizeloader.qml 0
+ \li \snippet qml/loader/sizeitem.qml 0
\row
\li The red rectangle will be sized to the size of the root item.
\li The red rectangle will be 50x50, centered in the root item.
@@ -225,8 +225,8 @@ qreal QQuickLoaderPrivate::getImplicitHeight() const
\li application.qml
\li MyItem.qml
\row
- \li \snippet doc/snippets/qml/loader/connections.qml 0
- \li \snippet doc/snippets/qml/loader/MyItem.qml 0
+ \li \snippet qml/loader/connections.qml 0
+ \li \snippet qml/loader/MyItem.qml 0
\endtable
Alternatively, since \c MyItem.qml is loaded within the scope of the
@@ -252,8 +252,8 @@ qreal QQuickLoaderPrivate::getImplicitHeight() const
\li application.qml
\li KeyReader.qml
\row
- \li \snippet doc/snippets/qml/loader/focus.qml 0
- \li \snippet doc/snippets/qml/loader/KeyReader.qml 0
+ \li \snippet qml/loader/focus.qml 0
+ \li \snippet qml/loader/KeyReader.qml 0
\endtable
Once \c KeyReader.qml is loaded, it accepts key events and sets
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 0ef19633df..30930c3cd8 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -354,9 +354,9 @@ bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *i
The following example uses a MouseArea in a \l Rectangle that changes
the \l Rectangle color to red when clicked:
- \snippet doc/snippets/qml/mousearea/mousearea.qml import
+ \snippet qml/mousearea/mousearea.qml import
\codeline
- \snippet doc/snippets/qml/mousearea/mousearea.qml intro
+ \snippet qml/mousearea/mousearea.qml intro
\clearfloat
Many MouseArea signals pass a \l{MouseEvent}{mouse} parameter that contains
@@ -366,7 +366,7 @@ bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *i
Here is an extension of the previous example that produces a different
color when the area is right clicked:
- \snippet doc/snippets/qml/mousearea/mousearea.qml intro-extended
+ \snippet qml/mousearea/mousearea.qml intro-extended
Behavioral Change in QtQuick 2.0
@@ -676,7 +676,7 @@ void QQuickMouseArea::setPropagateComposedEvents(bool prevent)
The code below displays "right" when the right mouse buttons is pressed:
- \snippet doc/snippets/qml/mousearea/mousearea.qml mousebuttons
+ \snippet qml/mousearea/mousearea.qml mousebuttons
\sa acceptedButtons
*/
@@ -1181,7 +1181,7 @@ bool QQuickMouseArea::setPressed(bool p)
The following example displays a \l Rectangle that can be dragged along the X-axis. The opacity
of the rectangle is reduced when it is dragged to the right.
- \snippet doc/snippets/qml/mousearea/mousearea.qml drag
+ \snippet qml/mousearea/mousearea.qml drag
\note Items cannot be dragged if they are anchored for the requested
\c drag.axis. For example, if \c anchors.left or \c anchors.right was set
@@ -1192,7 +1192,7 @@ bool QQuickMouseArea::setPressed(bool p)
If \c drag.filterChildren is set to true, a drag can override descendant MouseAreas. This
enables a parent MouseArea to handle drags, for example, while descendants handle clicks:
- \snippet doc/snippets/qml/mousearea/mouseareadragfilter.qml dragfilter
+ \snippet qml/mousearea/mouseareadragfilter.qml dragfilter
*/
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp
index 6f10ea77f1..fa6bb31767 100644
--- a/src/quick/items/qquickmultipointtoucharea.cpp
+++ b/src/quick/items/qquickmultipointtoucharea.cpp
@@ -309,7 +309,7 @@ void QQuickTouchPoint::setSceneY(qreal sceneY)
In the following example, we have two small rectangles that follow our touch points.
- \snippet doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml 0
+ \snippet qml/multipointtoucharea/multipointtoucharea.qml 0
By default this property holds an empty list.
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index bf4f9960ce..393f83b34a 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -453,11 +453,11 @@ void QQuickPathViewPrivate::regenerate()
For example, if there is a simple list model defined in a file \c ContactModel.qml like this:
- \snippet doc/snippets/qml/pathview/ContactModel.qml 0
+ \snippet qml/pathview/ContactModel.qml 0
This data can be represented as a PathView, like this:
- \snippet doc/snippets/qml/pathview/pathview.qml 0
+ \snippet qml/pathview/pathview.qml 0
\image pathview.gif
@@ -490,7 +490,7 @@ void QQuickPathViewPrivate::regenerate()
this attached property directly as \c PathView.isCurrentItem, while the child
\c nameText object must refer to this property as \c wrapper.PathView.isCurrentItem.
- \snippet doc/snippets/qml/pathview/pathview.qml 1
+ \snippet qml/pathview/pathview.qml 1
\b Note that views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
@@ -552,7 +552,7 @@ QQuickPathView::~QQuickPathView()
This property may be used to adjust the appearance of the current item.
- \snippet doc/snippets/qml/pathview/pathview.qml 1
+ \snippet qml/pathview/pathview.qml 1
*/
/*!
@@ -1122,7 +1122,7 @@ bool QQuickPathView::isFlicking() const
item in the delegate.
Here is an example delegate:
- \snippet doc/snippets/qml/pathview/pathview.qml 1
+ \snippet qml/pathview/pathview.qml 1
*/
QQmlComponent *QQuickPathView::delegate() const
{
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 52450b181d..b5816136cd 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -587,7 +587,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
Below is a Column that contains three rectangles of various sizes:
- \snippet doc/snippets/qml/column/vertical-positioner.qml document
+ \snippet qml/column/vertical-positioner.qml document
The Column automatically positions these items in a vertical formation, like this:
@@ -616,7 +616,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
For example, the Column below sets the \l move property to a specific \l Transition:
- \snippet doc/snippets/qml/column/column-transitions.qml document
+ \snippet qml/column/column-transitions.qml document
When the Space key is pressed, the \l {Item::visible}{visible} value of the green
\l Rectangle is toggled. As it appears and disappears, the blue \l Rectangle moves within
@@ -755,7 +755,7 @@ void QQuickColumn::reportConflictingAnchors()
Below is a Row that contains three rectangles of various sizes:
- \snippet doc/snippets/qml/row/row.qml document
+ \snippet qml/row/row.qml document
The Row automatically positions these items in a horizontal formation, like this:
@@ -993,7 +993,7 @@ void QQuickRow::reportConflictingAnchors()
For example, below is a Grid that contains five rectangles of various sizes:
- \snippet doc/snippets/qml/grid/grid.qml document
+ \snippet qml/grid/grid.qml document
The Grid automatically positions the child items in a grid formation:
@@ -1426,7 +1426,7 @@ void QQuickGrid::reportConflictingAnchors()
Below is a Flow that contains various \l Text items:
- \snippet doc/snippets/qml/flow.qml flow item
+ \snippet qml/flow.qml flow item
The Flow item automatically positions the child \l Text items side by
side, wrapping as necessary:
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index b5a03e88af..f4fe4714ea 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -207,7 +207,7 @@ void QQuickGradientStop::updateGradient()
with red, blending to yellow at one third of the height of the rectangle,
and ending with green:
- \snippet doc/snippets/qml/gradient.qml code
+ \snippet qml/gradient.qml code
\clearfloat
\section1 Performance and Limitations
@@ -309,7 +309,7 @@ int QQuickRectanglePrivate::doUpdateSlotIdx = -1;
The following example shows the effects of some of the common properties on a
Rectangle item, which in this case is used to create a square:
- \snippet doc/snippets/qml/rectangle/rectangle.qml document
+ \snippet qml/rectangle/rectangle.qml document
\clearfloat
\section1 Performance
@@ -370,7 +370,7 @@ void QQuickRectangle::doUpdate()
\inlineimage rect-border-width.png
\enddiv
- \snippet doc/snippets/qml/rectangle/rect-border-width.qml 0
+ \snippet qml/rectangle/rect-border-width.qml 0
\clearfloat
Here, the innermost rectangle's border is clipped on the bottom and right edges by its
@@ -394,7 +394,7 @@ QQuickPen *QQuickRectangle::border()
\inlineimage declarative-rect_gradient.png
\enddiv
- \snippet doc/snippets/qml/rectangle/rectangle-gradient.qml rectangles
+ \snippet qml/rectangle/rectangle-gradient.qml rectangles
\clearfloat
If both a gradient and a color are specified, the gradient will be used.
@@ -463,7 +463,7 @@ void QQuickRectangle::setRadius(qreal radius)
The following example shows rectangles with colors specified
using hexadecimal and named color notation:
- \snippet doc/snippets/qml/rectangle/rectangle-colors.qml rectangles
+ \snippet qml/rectangle/rectangle-colors.qml rectangles
\clearfloat
If both a gradient and a color are specified, the gradient will be used.
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index db58fba00c..fdba3aa21d 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -78,9 +78,9 @@ QQuickRepeaterPrivate::~QQuickRepeaterPrivate()
The following Repeater creates three instances of a \l Rectangle item within
a \l Row:
- \snippet doc/snippets/qml/repeaters/repeater.qml import
+ \snippet qml/repeaters/repeater.qml import
\codeline
- \snippet doc/snippets/qml/repeaters/repeater.qml simple
+ \snippet qml/repeaters/repeater.qml simple
\image repeater-simple.png
@@ -95,7 +95,7 @@ QQuickRepeaterPrivate::~QQuickRepeaterPrivate()
a Repeater to be used inside a layout. For example, the following Repeater's
items are stacked between a red rectangle and a blue rectangle:
- \snippet doc/snippets/qml/repeaters/repeater.qml layout
+ \snippet qml/repeaters/repeater.qml layout
\image repeater.png
@@ -242,7 +242,7 @@ void QQuickRepeater::setModel(const QVariant &model)
\table
\row
- \li \snippet doc/snippets/qml/repeaters/repeater.qml index
+ \li \snippet qml/repeaters/repeater.qml index
\li \image repeater-index.png
\endtable
@@ -253,7 +253,7 @@ void QQuickRepeater::setModel(const QVariant &model)
\table
\row
- \li \snippet doc/snippets/qml/repeaters/repeater.qml modeldata
+ \li \snippet qml/repeaters/repeater.qml modeldata
\li \image repeater-modeldata.png
\endtable
diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp
index b6b055c359..6857e3f9b6 100644
--- a/src/quick/items/qquickstateoperations.cpp
+++ b/src/quick/items/qquickstateoperations.cpp
@@ -165,7 +165,7 @@ void QQuickParentChangePrivate::doChange(QQuickItem *targetParent, QQuickItem *s
When the \c blueRect is clicked, it changes to the "reparented" state: its parent is changed to \c redRect and it is
positioned at (10, 10) within the red rectangle, as specified in the ParentChange.
- \snippet doc/snippets/qml/parentchange.qml 0
+ \snippet qml/parentchange.qml 0
\image parentchange.png
@@ -572,7 +572,7 @@ void QQuickParentChange::rewind()
using AnchorChanges, and the top and bottom anchor margins using
PropertyChanges:
- \snippet doc/snippets/qml/anchorchanges.qml 0
+ \snippet qml/anchorchanges.qml 0
\image anchorchanges.png
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 642409e84a..add789dff7 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -1247,7 +1247,7 @@ QQuickText::~QQuickText()
The link must be in rich text or HTML format and the
\a link string provides access to the particular link.
- \snippet doc/snippets/qml/text/onLinkActivated.qml 0
+ \snippet qml/text/onLinkActivated.qml 0
The example code will display the text
"The main website is at \l{http://qt.nokia.com}{Nokia Qt DF}."
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index de5cff217d..5134376807 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -93,7 +93,7 @@ TextEdit {
Note that the TextEdit does not implement scrolling, following the cursor, or other behaviors specific
to a look-and-feel. For example, to add flickable scrolling that follows the cursor:
- \snippet snippets/declarative/texteditor.qml 0
+ \snippet qml/texteditor.qml 0
A particular look-and-feel might use smooth scrolling (eg. using SmoothedFollow), might have a visible
scrollbar, or a scrollbar that fades in to show location, etc.
@@ -105,7 +105,7 @@ TextEdit {
You can translate between cursor positions (characters from the start of the document) and pixel
points using positionAt() and positionToRectangle().
- \sa Text, TextInput, {declarative/text/textselection}{Text Selection example}
+ \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example}
*/
/*!
diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/quick/items/qquickvisualdatamodel.cpp
index 0abcf81cb7..c0277cbb93 100644
--- a/src/quick/items/qquickvisualdatamodel.cpp
+++ b/src/quick/items/qquickvisualdatamodel.cpp
@@ -136,7 +136,7 @@ QQuickVisualDataModelParts::QQuickVisualDataModelParts(QQuickVisualDataModel *pa
The example below illustrates using a VisualDataModel with a ListView.
- \snippet doc/snippets/qml/visualdatamodel.qml 0
+ \snippet qml/visualdatamodel.qml 0
*/
QQuickVisualDataModelPrivate::QQuickVisualDataModelPrivate(QQmlContext *ctxt)
@@ -374,10 +374,10 @@ void QQuickVisualDataModel::setDelegate(QQmlComponent *delegate)
the new directory's contents.
\c main.cpp:
- \snippet doc/snippets/qml/visualdatamodel_rootindex/main.cpp 0
+ \snippet qml/visualdatamodel_rootindex/main.cpp 0
\c view.qml:
- \snippet doc/snippets/qml/visualdatamodel_rootindex/view.qml 0
+ \snippet qml/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
@@ -578,7 +578,7 @@ QQuickVisualDataGroup *QQuickVisualDataModelPrivate::group_at(
The following example illustrates using groups to select items in a model.
- \snippet doc/snippets/qml/visualdatagroup.qml 0
+ \snippet qml/visualdatagroup.qml 0
*/
QQmlListProperty<QQuickVisualDataGroup> QQuickVisualDataModel::groups()
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index f6e2e57cc8..33c24f38d7 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -698,7 +698,7 @@ QAbstractAnimationJob* QQuickPauseAnimation::transition(QQuickStateActions &acti
as a property value source. It animates the \c color property's value from
its current value to a value of "red", over 1000 milliseconds:
- \snippet doc/snippets/qml/coloranimation.qml 0
+ \snippet qml/coloranimation.qml 0
Like any other animation element, a ColorAnimation can be applied in a
number of ways, including transitions, behaviors and property value
@@ -852,7 +852,7 @@ void QActionAnimation::updateState(State newState, State oldState)
When used as part of a Transition, you can also target a specific
StateChangeScript to run using the \c scriptName property.
- \snippet doc/snippets/qml/states/statechangescript.qml state and transition
+ \snippet qml/states/statechangescript.qml state and transition
\sa StateChangeScript
*/
@@ -970,14 +970,14 @@ QAbstractAnimationJob* QQuickScriptAction::transition(QQuickStateActions &action
\l {Image::}{smooth} property to \c true, animates the width of the image,
then sets \l {Image::}{smooth} back to \c false:
- \snippet doc/snippets/qml/propertyaction.qml standalone
+ \snippet qml/propertyaction.qml standalone
PropertyAction is also useful for setting the exact point at which a property
change should occur during a \l Transition. For example, if PropertyChanges
was used in a \l State to rotate an item around a particular
\l {Item::}{transformOrigin}, it might be implemented like this:
- \snippet doc/snippets/qml/propertyaction.qml transition
+ \snippet qml/propertyaction.qml transition
However, with this code, the \c transformOrigin is not set until \e after
the animation, as a \l State is taken to define the values at the \e end of
@@ -985,7 +985,7 @@ QAbstractAnimationJob* QQuickScriptAction::transition(QQuickStateActions &action
then jump to \c Item.BottomRight. To fix this, insert a PropertyAction
before the RotationAnimation begins:
- \snippet doc/snippets/qml/propertyaction-sequential.qml sequential
+ \snippet qml/propertyaction-sequential.qml sequential
This immediately sets the \c transformOrigin property to the value defined
in the end state of the \l Transition (i.e. the value defined in the
@@ -1220,7 +1220,7 @@ QAbstractAnimationJob* QQuickPropertyAction::transition(QQuickStateActions &acti
as a property value source. It animates the \c x value from its current
value to a value of 50, over 1000 milliseconds:
- \snippet doc/snippets/qml/numberanimation.qml 0
+ \snippet qml/numberanimation.qml 0
Like any other animation element, a NumberAnimation can be applied in a
number of ways, including transitions, behaviors and property value
@@ -1413,7 +1413,7 @@ void QQuickVector3dAnimation::setTo(QVector3D t)
In the following example we use RotationAnimation to animate the rotation
between states via the shortest path:
- \snippet doc/snippets/qml/rotationanimation.qml 0
+ \snippet qml/rotationanimation.qml 0
Notice the RotationAnimation did not need to set a \l target
value. As a convenience, when used in a transition, RotationAnimation will rotate all
@@ -1649,7 +1649,7 @@ QQmlListProperty<QQuickAbstractAnimation> QQuickAnimationGroup::animations()
The following example runs two number animations in a sequence. The \l Rectangle
animates to a \c x position of 50, then to a \c y position of 50.
- \snippet doc/snippets/qml/sequentialanimation.qml 0
+ \snippet qml/sequentialanimation.qml 0
Animations defined within a \l Transition are automatically run in parallel,
so SequentialAnimation can be used to enclose the animations in a \l Transition
@@ -1722,7 +1722,7 @@ QAbstractAnimationJob* QQuickSequentialAnimation::transition(QQuickStateActions
The following animation runs two number animations in parallel. The \l Rectangle
moves to (50,50) by animating its \c x and \c y properties at the same time.
- \snippet doc/snippets/qml/parallelanimation.qml 0
+ \snippet qml/parallelanimation.qml 0
Like any other animation element, a ParallelAnimation can be applied in a
number of ways, including transitions, behaviors and property value
@@ -1850,21 +1850,21 @@ void QQuickBulkValueAnimator::topLevelAnimationLoopChanged()
For example, to animate any objects that have changed their \c x or \c y properties
as a result of a state change, using an \c InOutQuad easing curve:
- \snippet doc/snippets/qml/propertyanimation.qml transition
+ \snippet qml/propertyanimation.qml transition
\li In a \l Behavior
For example, to animate all changes to a rectangle's \c x property:
- \snippet doc/snippets/qml/propertyanimation.qml behavior
+ \snippet qml/propertyanimation.qml behavior
\li As a property value source
For example, to repeatedly animate the rectangle's \c x property:
- \snippet doc/snippets/qml/propertyanimation.qml propertyvaluesource
+ \snippet qml/propertyanimation.qml propertyvaluesource
\li In a signal handler
@@ -1881,7 +1881,7 @@ void QQuickBulkValueAnimator::topLevelAnimationLoopChanged()
For example, to animate \c rect's \c width property over 500ms, from its current width to 30:
- \snippet doc/snippets/qml/propertyanimation.qml standalone
+ \snippet qml/propertyanimation.qml standalone
\endlist
diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp
index 1623a00a49..4aa3d17c0e 100644
--- a/src/quick/util/qquickbehavior.cpp
+++ b/src/quick/util/qquickbehavior.cpp
@@ -85,7 +85,7 @@ public:
whenever the \l Rectangle's \c width value changes. When the MouseArea
is clicked, the \c width is changed, triggering the behavior's animation:
- \snippet doc/snippets/qml/behavior.qml 0
+ \snippet qml/behavior.qml 0
Note that a property cannot have more than one assigned Behavior. To provide
multiple animations within a Behavior, use ParallelAnimation or
diff --git a/src/quick/util/qquickbind.cpp b/src/quick/util/qquickbind.cpp
index 622965de23..81377bf778 100644
--- a/src/quick/util/qquickbind.cpp
+++ b/src/quick/util/qquickbind.cpp
@@ -104,10 +104,10 @@ public:
other cirumstances). This often isn't possible to accomplish with a direct
binding, as you need to supply values for all possible branches.
- \qml
- // warning: "Unable to assign [undefined] to double value"
+ \code
+ // produces warning: "Unable to assign [undefined] to double value"
value: if (mouse.pressed) mouse.mouseX
- \endqml
+ \endcode
The above example will produce a warning whenever we release the mouse, as the value
of the binding is undefined when the mouse isn't pressed. We can use the Binding
@@ -124,7 +124,7 @@ public:
the property. In that sense, it functions much like a simplified State.
\qml
- // this is equivilant to the above Binding
+ // this is equivalent to the above Binding
State {
name: "pressed"
when: mouse.pressed
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 5ded343195..b0bbf46489 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -154,7 +154,7 @@ QImage QQuickTextureFactory::image() const
an image provider named "colors", and the images to be loaded are "yellow"
and "red", respectively:
- \snippet examples/declarative/cppextensions/imageprovider/imageprovider-example.qml 0
+ \snippet examples/qml/cppextensions/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
@@ -165,9 +165,9 @@ QImage QQuickTextureFactory::image() const
requested by the above QML. This implementation dynamically
generates QPixmap images that are filled with the requested color:
- \snippet examples/declarative/cppextensions/imageprovider/imageprovider.cpp 0
+ \snippet examples/qml/cppextensions/imageprovider/imageprovider.cpp 0
\codeline
- \snippet examples/declarative/cppextensions/imageprovider/imageprovider.cpp 1
+ \snippet examples/qml/cppextensions/imageprovider/imageprovider.cpp 1
To make this provider accessible to QML, it is registered with the QML engine
with a "colors" identifier:
@@ -189,7 +189,7 @@ QImage QQuickTextureFactory::image() const
\image imageprovider.png
A complete example is available in Qt's
- \l {declarative/cppextensions/imageprovider}{examples/declarative/cppextensions/imageprovider}
+ \l {declarative/cppextensions/imageprovider}{examples/qml/cppextensions/imageprovider}
directory. Note the example registers the provider via a \l{QQmlExtensionPlugin}{plugin}
instead of registering it in the application \c main() function as shown above.
diff --git a/src/quick/util/qquickpackage.cpp b/src/quick/util/qquickpackage.cpp
index 6c95989ba7..ede1c68d02 100644
--- a/src/quick/util/qquickpackage.cpp
+++ b/src/quick/util/qquickpackage.cpp
@@ -64,13 +64,13 @@ QT_BEGIN_NAMESPACE
delegate it should appear in. This allows an item to move
between views.
- \snippet examples/declarative/modelviews/package/Delegate.qml 0
+ \snippet examples/quick/modelviews/package/Delegate.qml 0
These named items are used as the delegates by the two views who
reference the special \l{VisualDataModel::parts} property to select
a model which provides the chosen delegate.
- \snippet examples/declarative/modelviews/package/view.qml 0
+ \snippet examples/quick/modelviews/package/view.qml 0
\sa {declarative/modelviews/package}{Package example}, {declarative/photoviewer}{Photo Viewer example}, QtQml
*/
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index 32dd9cca88..cce412a851 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -181,7 +181,7 @@ bool QQuickPath::hasEnd() const
\li \l PathPercent - a way to spread out items along various segments of the path.
\endlist
- \snippet doc/snippets/qml/pathview/pathattributes.qml 2
+ \snippet qml/pathview/pathattributes.qml 2
*/
QQmlListProperty<QQuickPathElement> QQuickPath::pathElements()
@@ -825,7 +825,7 @@ bool QQuickCurve::hasRelativeY()
\row
\li \image declarative-pathattribute.png
\li
- \snippet doc/snippets/qml/pathview/pathattributes.qml 0
+ \snippet qml/pathview/pathattributes.qml 0
(see the PathView documentation for the specification of ContactModel.qml
used for ContactModel above.)
\endtable
@@ -1359,7 +1359,7 @@ void QQuickPathCubic::addToPath(QPainterPath &path, const QQuickPathData &data)
PathCurve provides an easy way to specify a curve passing directly through a set of points.
Typically multiple PathCurves are used in a series, as the following example demonstrates:
- \snippet doc/snippets/qml/path/basiccurve.qml 0
+ \snippet qml/path/basiccurve.qml 0
This example produces the following path (with the starting point and PathCurve points
highlighted in red):
@@ -1508,7 +1508,7 @@ void QQuickPathCatmullRomCurve::addToPath(QPainterPath &path, const QQuickPathDa
\table
\row
\li \image declarative-patharc.png
- \li \snippet doc/snippets/qml/path/basicarc.qml 0
+ \li \snippet qml/path/basicarc.qml 0
\endtable
Note that a single PathArc cannot be used to specify a circle. Instead, you can
@@ -1552,7 +1552,7 @@ void QQuickPathCatmullRomCurve::addToPath(QPainterPath &path, const QQuickPathDa
\table
\row
\li \image declarative-arcradius.png
- \li \snippet doc/snippets/qml/path/arcradius.qml 0
+ \li \snippet qml/path/arcradius.qml 0
\endtable
*/
@@ -1597,7 +1597,7 @@ void QQuickPathArc::setRadiusY(qreal radius)
\table
\row
\li \image declarative-largearc.png
- \li \snippet doc/snippets/qml/path/largearc.qml 0
+ \li \snippet qml/path/largearc.qml 0
\endtable
The default value is false.
@@ -1628,7 +1628,7 @@ void QQuickPathArc::setUseLargeArc(bool largeArc)
\table
\row
\li \image declarative-arcdirection.png
- \li \snippet doc/snippets/qml/path/arcdirection.qml 0
+ \li \snippet qml/path/arcdirection.qml 0
\endtable
\sa useLargeArc
diff --git a/src/quick/util/qquickpathinterpolator.cpp b/src/quick/util/qquickpathinterpolator.cpp
index 4328305cd0..62bb9c1a10 100644
--- a/src/quick/util/qquickpathinterpolator.cpp
+++ b/src/quick/util/qquickpathinterpolator.cpp
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
In the following example, we animate a green rectangle along a bezier path.
- \snippet doc/snippets/qml/pathinterpolator.qml 0
+ \snippet qml/pathinterpolator.qml 0
*/
QQuickPathInterpolator::QQuickPathInterpolator(QObject *parent) :
diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp
index 5252f625ad..969c326b97 100644
--- a/src/quick/util/qquickpropertychanges.cpp
+++ b/src/quick/util/qquickpropertychanges.cpp
@@ -77,9 +77,9 @@ QT_BEGIN_NAMESPACE
properties are to be modified, and define the new property values or
bindings. For example:
- \snippet doc/snippets/qml/propertychanges.qml import
+ \snippet qml/propertychanges.qml import
\codeline
- \snippet doc/snippets/qml/propertychanges.qml 0
+ \snippet qml/propertychanges.qml 0
When the mouse is pressed, the \l Rectangle changes to the \e resized
state. In this state, the PropertyChanges object sets the rectangle's
@@ -113,7 +113,7 @@ QT_BEGIN_NAMESPACE
state, its \c width property is reset, giving the text its natural width
and displaying the whole string on a single line.
- \snippet doc/snippets/qml/propertychanges.qml reset
+ \snippet qml/propertychanges.qml reset
\section2 Immediate property changes in transitions
diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp
index 75682152f1..4bc802cded 100644
--- a/src/quick/util/qquicksmoothedanimation.cpp
+++ b/src/quick/util/qquicksmoothedanimation.cpp
@@ -324,7 +324,7 @@ void QSmoothedAnimation::init()
bound to those of the red rectangle. Whenever these values change, the
green rectangle smoothly animates to its new position:
- \snippet doc/snippets/qml/smoothedanimation.qml 0
+ \snippet qml/smoothedanimation.qml 0
A SmoothedAnimation can be configured by setting the \l velocity at which the
animation should occur, or the \l duration that the animation should take.
diff --git a/src/quick/util/qquickspringanimation.cpp b/src/quick/util/qquickspringanimation.cpp
index 1f5b15cf77..1f6e51e2b9 100644
--- a/src/quick/util/qquickspringanimation.cpp
+++ b/src/quick/util/qquickspringanimation.cpp
@@ -357,7 +357,7 @@ void QQuickSpringAnimationPrivate::updateMode()
on the \c x and \c y values indicates that whenever these values are
changed, a SpringAnimation should be applied.
- \snippet doc/snippets/qml/springanimation.qml 0
+ \snippet qml/springanimation.qml 0
Like any other animation element, a SpringAnimation can be applied in a
number of ways, including transitions, behaviors and property value
diff --git a/src/quick/util/qquickstate.cpp b/src/quick/util/qquickstate.cpp
index 7cbd16a51b..da4dde5af3 100644
--- a/src/quick/util/qquickstate.cpp
+++ b/src/quick/util/qquickstate.cpp
@@ -139,7 +139,7 @@ QQuickStateOperation::QQuickStateOperation(QObjectPrivate &dd, QObject *parent)
between the default state and the "clicked" state, thus toggling the color of the
rectangle between black and red.
- \snippet doc/snippets/qml/state.qml 0
+ \snippet qml/state.qml 0
Notice the default state is referred to using an empty string ("").
@@ -205,7 +205,7 @@ bool QQuickState::isWhenKnown() const
be applied. For example, the following \l Rectangle changes in and out of the "hidden"
state when the \l MouseArea is pressed:
- \snippet doc/snippets/qml/state-when.qml 0
+ \snippet qml/state-when.qml 0
If multiple states in a group have \c when clauses that evaluate to \c true
at the same time, the first matching state will be applied. For example, in
diff --git a/src/quick/util/qquickstatechangescript.cpp b/src/quick/util/qquickstatechangescript.cpp
index 4865859a91..49db12740c 100644
--- a/src/quick/util/qquickstatechangescript.cpp
+++ b/src/quick/util/qquickstatechangescript.cpp
@@ -77,7 +77,7 @@ public:
ScriptAction to specify the point in the transition at which
the StateChangeScript should to be run.
- \snippet snippets/qml/states/statechangescript.qml state and transition
+ \snippet qml/states/statechangescript.qml state and transition
\sa ScriptAction
*/
diff --git a/src/quick/util/qquicksystempalette.cpp b/src/quick/util/qquicksystempalette.cpp
index cf5098e8ec..cc3a618faf 100644
--- a/src/quick/util/qquicksystempalette.cpp
+++ b/src/quick/util/qquicksystempalette.cpp
@@ -76,7 +76,7 @@ public:
group and uses this to color the window and text items
appropriately:
- \snippet doc/snippets/qml/systempalette.qml 0
+ \snippet qml/systempalette.qml 0
\sa QPalette
*/
diff --git a/src/quick/util/qquicktransition.cpp b/src/quick/util/qquicktransition.cpp
index edad787b6e..3f56145566 100644
--- a/src/quick/util/qquicktransition.cpp
+++ b/src/quick/util/qquicktransition.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
changes between the default and the "moved" state, any changes
to the \c x and \c y properties should be animated, using an \c Easing.InOutQuad.
- \snippet doc/snippets/qml/transition.qml 0
+ \snippet qml/transition.qml 0
Notice the example does not require \l{PropertyAnimation::}{to} and
\l{PropertyAnimation::}{from} values for the NumberAnimation. As a convenience,
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
To define multiple transitions, specify \l Item::transitions as a list:
- \snippet doc/snippets/qml/transitions-list.qml list of transitions
+ \snippet qml/transitions-list.qml list of transitions
If multiple Transitions are specified, only a single (best-matching) Transition will be applied for any particular
state change. In the example above, when changing to \c state1, the first transition will be used, rather
@@ -283,11 +283,11 @@ QQuickTransitionInstance *QQuickTransition::prepare(QQuickStateOperation::Action
properties, so the animation is always applied when changing between
the two states (i.e. when the mouse is pressed and released).
- \snippet doc/snippets/qml/transition-from-to.qml 0
+ \snippet qml/transition-from-to.qml 0
If the transition was changed to this:
- \snippet doc/snippets/qml/transition-from-to-modified.qml modified transition
+ \snippet qml/transition-from-to-modified.qml modified transition
The animation would only be applied when changing from the default state to
the "brighter" state (i.e. when the mouse is pressed, but not on release).
@@ -330,7 +330,7 @@ void QQuickTransition::setFromState(const QString &f)
transition applies a sequential animation when the mouse is pressed,
and reverses the sequence of the animation when the mouse is released:
- \snippet doc/snippets/qml/transition-reversible.qml 0
+ \snippet qml/transition-reversible.qml 0
If the transition did not set the \c to and \c reversible values, then
on the mouse release, the transition would play the PropertyAnimation
@@ -378,19 +378,22 @@ void QQuickTransition::setToState(const QString &t)
Note that in some circumstances disabling a Transition may cause an
alternative Transition to be used in its place. In the following
- example, the generic Transition will be used to animate the change
- from \c state1 to \c state2, as the more specific Transition has
- been disabled.
+ example, although the first Transition has been set to animate changes
+ from "state1" to "state2", this transition has been disabled by setting
+ \c enabled to \c false, so any such state change will actually be animated
+ by the second Transition instead.
\qml
Item {
states: [
- State { name: "state1" ... }
- State { name: "state2" ... }
+ State { name: "state1" },
+ State { name: "state2" }
]
transitions: [
- Transition { from: "state1"; to: "state2"; enabled: false ... }
- Transition { ... }
+ Transition { from: "state1"; to: "state2"; enabled: false },
+ Transition {
+ // ...
+ }
]
}
\endqml
@@ -431,12 +434,12 @@ bool QQuickTransition::running() const
This property holds a list of the animations to be run for this transition.
- \snippet examples/declarative/toys/dynamicscene/dynamicscene.qml top-level transitions
+ \snippet examples/qml/dynamicscene/dynamicscene.qml top-level transitions
The top-level animations are run in parallel. To run them sequentially,
define them within a SequentialAnimation:
- \snippet doc/snippets/qml/transition-reversible.qml sequential animations
+ \snippet qml/transition-reversible.qml sequential animations
*/
QQmlListProperty<QQuickAbstractAnimation> QQuickTransition::animations()
{
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index 7e376b4b4e..3c23c6c9d1 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -89,7 +89,7 @@ private:
tst_examples::tst_examples() : canvas(0)
{
// Add files to exclude here
- excludedFiles << "snippets/qml/listmodel.qml"; //Just a ListModel, no root QQuickItem
+ excludedFiles << "snippets/qml/listmodel/listmodel.qml"; //Just a ListModel, no root QQuickItem
// Add directories you want excluded here (don't add examples/, because they install to examples/qtdeclarative/)
excludedDirs << "shared"; //Not an example