aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/util')
-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
14 files changed, 58 insertions, 55 deletions
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()
{