aboutsummaryrefslogtreecommitdiffstats
path: root/src/qtquick1/util
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-08-09 11:49:57 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-09 07:28:26 +0200
commit955c2b0f29dc709a5cc7e563c21f0f2cf2370336 (patch)
treefbfe91cf07bf03664ed6eb2fa0d0d435a076b3e2 /src/qtquick1/util
parent8c0c89a72a0ad463bde36c3d36f00cc5914721e1 (diff)
Copy the docs for QtQuick 1
Change-Id: Iaaaaaaa13726fa471f94fc7f809911164df24544 Reviewed-on: http://codereview.qt.nokia.com/2755 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src/qtquick1/util')
-rw-r--r--src/qtquick1/util/qdeclarativeanimation.cpp30
-rw-r--r--src/qtquick1/util/qdeclarativebehavior.cpp2
-rw-r--r--src/qtquick1/util/qdeclarativelistmodel.cpp16
-rw-r--r--src/qtquick1/util/qdeclarativepropertychanges.cpp6
-rw-r--r--src/qtquick1/util/qdeclarativesmoothedanimation.cpp2
-rw-r--r--src/qtquick1/util/qdeclarativespringanimation.cpp2
-rw-r--r--src/qtquick1/util/qdeclarativestate.cpp4
-rw-r--r--src/qtquick1/util/qdeclarativestateoperations.cpp4
-rw-r--r--src/qtquick1/util/qdeclarativesystempalette.cpp2
-rw-r--r--src/qtquick1/util/qdeclarativetransition.cpp12
-rw-r--r--src/qtquick1/util/qdeclarativexmllistmodel.cpp6
11 files changed, 43 insertions, 43 deletions
diff --git a/src/qtquick1/util/qdeclarativeanimation.cpp b/src/qtquick1/util/qdeclarativeanimation.cpp
index 89b768b827..8204e33022 100644
--- a/src/qtquick1/util/qdeclarativeanimation.cpp
+++ b/src/qtquick1/util/qdeclarativeanimation.cpp
@@ -642,7 +642,7 @@ QAbstractAnimation *QDeclarative1PauseAnimation::qtAnimation()
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/src/snippets/declarative/coloranimation.qml 0
+ \snippet doc/src/snippets/qtquick1/coloranimation.qml 0
Like any other animation element, a ColorAnimation can be applied in a
number of ways, including transitions, behaviors and property value
@@ -757,7 +757,7 @@ void QDeclarative1ColorAnimation::setTo(const QColor &t)
When used as part of a Transition, you can also target a specific
StateChangeScript to run using the \c scriptName property.
- \snippet doc/src/snippets/declarative/states/statechangescript.qml state and transition
+ \snippet doc/src/snippets/qtquick1/states/statechangescript.qml state and transition
\sa StateChangeScript
*/
@@ -884,14 +884,14 @@ QAbstractAnimation *QDeclarative1ScriptAction::qtAnimation()
\l {Image::}{smooth} property to \c true, animates the width of the image,
then sets \l {Image::}{smooth} back to \c false:
- \snippet doc/src/snippets/declarative/propertyaction.qml standalone
+ \snippet doc/src/snippets/qtquick1/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/src/snippets/declarative/propertyaction.qml transition
+ \snippet doc/src/snippets/qtquick1/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
@@ -899,7 +899,7 @@ QAbstractAnimation *QDeclarative1ScriptAction::qtAnimation()
then jump to \c Item.BottomRight. To fix this, insert a PropertyAction
before the RotationAnimation begins:
- \snippet doc/src/snippets/declarative/propertyaction-sequential.qml sequential
+ \snippet doc/src/snippets/qtquick1/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
@@ -1144,7 +1144,7 @@ void QDeclarative1PropertyAction::transition(QDeclarative1StateActions &actions,
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/src/snippets/declarative/numberanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/numberanimation.qml 0
Like any other animation element, a NumberAnimation can be applied in a
number of ways, including transitions, behaviors and property value
@@ -1339,7 +1339,7 @@ void QDeclarative1Vector3dAnimation::setTo(QVector3D t)
In the following example we use RotationAnimation to animate the rotation
between states via the shortest path:
- \snippet doc/src/snippets/declarative/rotationanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/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
@@ -1580,7 +1580,7 @@ QDeclarativeListProperty<QDeclarative1AbstractAnimation> QDeclarative1AnimationG
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/src/snippets/declarative/sequentialanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/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
@@ -1655,7 +1655,7 @@ void QDeclarative1SequentialAnimation::transition(QDeclarative1StateActions &act
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/src/snippets/declarative/parallelanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/parallelanimation.qml 0
Like any other animation element, a ParallelAnimation can be applied in a
number of ways, including transitions, behaviors and property value
@@ -1772,21 +1772,21 @@ void QDeclarative1PropertyAnimationPrivate::convertVariant(QVariant &variant, in
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/src/snippets/declarative/propertyanimation.qml transition
+ \snippet doc/src/snippets/qtquick1/propertyanimation.qml transition
\o In a \l Behavior
For example, to animate all changes to a rectangle's \c x property:
- \snippet doc/src/snippets/declarative/propertyanimation.qml behavior
+ \snippet doc/src/snippets/qtquick1/propertyanimation.qml behavior
\o As a property value source
For example, to repeatedly animate the rectangle's \c x property:
- \snippet doc/src/snippets/declarative/propertyanimation.qml propertyvaluesource
+ \snippet doc/src/snippets/qtquick1/propertyanimation.qml propertyvaluesource
\o In a signal handler
@@ -1803,7 +1803,7 @@ void QDeclarative1PropertyAnimationPrivate::convertVariant(QVariant &variant, in
For example, to animate \c rect's \c width property over 500ms, from its current width to 30:
- \snippet doc/src/snippets/declarative/propertyanimation.qml standalone
+ \snippet doc/src/snippets/qtquick1/propertyanimation.qml standalone
\endlist
@@ -2460,7 +2460,7 @@ void QDeclarative1PropertyAnimation::transition(QDeclarative1StateActions &actio
the transition, ensures the item animates smoothly as it moves to
its new parent:
- \snippet doc/src/snippets/declarative/parentanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/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
@@ -2818,7 +2818,7 @@ QAbstractAnimation *QDeclarative1ParentAnimation::qtAnimation()
In the following snippet we animate the addition of a right anchor to a \l Rectangle:
- \snippet doc/src/snippets/declarative/anchoranimation.qml 0
+ \snippet doc/src/snippets/qtquick1/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/qtquick1/util/qdeclarativebehavior.cpp b/src/qtquick1/util/qdeclarativebehavior.cpp
index 02d1b0eed1..0475eea01f 100644
--- a/src/qtquick1/util/qdeclarativebehavior.cpp
+++ b/src/qtquick1/util/qdeclarativebehavior.cpp
@@ -86,7 +86,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/src/snippets/declarative/behavior.qml 0
+ \snippet doc/src/snippets/qtquick1/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/qtquick1/util/qdeclarativelistmodel.cpp b/src/qtquick1/util/qdeclarativelistmodel.cpp
index 520d9ac388..d5aa75bec5 100644
--- a/src/qtquick1/util/qdeclarativelistmodel.cpp
+++ b/src/qtquick1/util/qdeclarativelistmodel.cpp
@@ -115,7 +115,7 @@ QDeclarative1ListModelParser::ListInstruction *QDeclarative1ListModelParser::Lis
\inlineimage listmodel.png
\enddiv
- \snippet doc/src/snippets/declarative/listmodel.qml 0
+ \snippet doc/src/snippets/qtquick1/listmodel.qml 0
\clearfloat
Roles (properties) in each element must begin with a lower-case letter and
@@ -125,14 +125,14 @@ QDeclarative1ListModelParser::ListInstruction *QDeclarative1ListModelParser::Lis
Since the example model contains an \c id property, it can be referenced
by views, such as the ListView in this example:
- \snippet doc/src/snippets/declarative/listmodel-simple.qml 0
+ \snippet doc/src/snippets/qtquick1/listmodel-simple.qml 0
\dots 8
- \snippet doc/src/snippets/declarative/listmodel-simple.qml 1
+ \snippet doc/src/snippets/qtquick1/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/src/snippets/declarative/listmodel-nested.qml model
+ \snippet doc/src/snippets/qtquick1/listmodel-nested.qml model
The delegate displays all the fruit attributes:
@@ -140,7 +140,7 @@ QDeclarative1ListModelParser::ListInstruction *QDeclarative1ListModelParser::Lis
\inlineimage listmodel-nested.png
\enddiv
- \snippet doc/src/snippets/declarative/listmodel-nested.qml delegate
+ \snippet doc/src/snippets/qtquick1/listmodel-nested.qml delegate
\clearfloat
\section1 Modifying List Models
@@ -148,7 +148,7 @@ QDeclarative1ListModelParser::ListInstruction *QDeclarative1ListModelParser::Lis
The content of a ListModel may be created and modified using the clear(),
append(), set(), insert() and setProperty() methods. For example:
- \snippet doc/src/snippets/declarative/listmodel-modify.qml delegate
+ \snippet doc/src/snippets/qtquick1/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
@@ -905,12 +905,12 @@ bool QDeclarative1ListModelParser::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/src/snippets/declarative/qml-data-models/listelements.qml model
+ \snippet doc/src/snippets/qtquick1/qml-data-models/listelements.qml model
The delegate obtains the name and cost for each element by simply referring
to \c name and \c cost:
- \snippet doc/src/snippets/declarative/qml-data-models/listelements.qml view
+ \snippet doc/src/snippets/qtquick1/qml-data-models/listelements.qml view
\sa ListModel
*/
diff --git a/src/qtquick1/util/qdeclarativepropertychanges.cpp b/src/qtquick1/util/qdeclarativepropertychanges.cpp
index 5882fc5810..776701e58f 100644
--- a/src/qtquick1/util/qdeclarativepropertychanges.cpp
+++ b/src/qtquick1/util/qdeclarativepropertychanges.cpp
@@ -80,9 +80,9 @@ QT_BEGIN_NAMESPACE
properties are to be modified, and define the new property values or
bindings. For example:
- \snippet doc/src/snippets/declarative/propertychanges.qml import
+ \snippet doc/src/snippets/qtquick1/propertychanges.qml import
\codeline
- \snippet doc/src/snippets/declarative/propertychanges.qml 0
+ \snippet doc/src/snippets/qtquick1/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
@@ -116,7 +116,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/src/snippets/declarative/propertychanges.qml reset
+ \snippet doc/src/snippets/qtquick1/propertychanges.qml reset
\section2 Immediate property changes in transitions
diff --git a/src/qtquick1/util/qdeclarativesmoothedanimation.cpp b/src/qtquick1/util/qdeclarativesmoothedanimation.cpp
index 0bad1a416b..7e96fe6a1c 100644
--- a/src/qtquick1/util/qdeclarativesmoothedanimation.cpp
+++ b/src/qtquick1/util/qdeclarativesmoothedanimation.cpp
@@ -269,7 +269,7 @@ void QSmoothedAnimation_1::init()
bound to those of the red rectangle. Whenever these values change, the
green rectangle smoothly animates to its new position:
- \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/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/qtquick1/util/qdeclarativespringanimation.cpp b/src/qtquick1/util/qdeclarativespringanimation.cpp
index d6dd68c4c6..155f7bb08f 100644
--- a/src/qtquick1/util/qdeclarativespringanimation.cpp
+++ b/src/qtquick1/util/qdeclarativespringanimation.cpp
@@ -254,7 +254,7 @@ void QDeclarative1SpringAnimationPrivate::updateMode()
on the \c x and \c y values indicates that whenever these values are
changed, a SpringAnimation should be applied.
- \snippet doc/src/snippets/declarative/springanimation.qml 0
+ \snippet doc/src/snippets/qtquick1/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/qtquick1/util/qdeclarativestate.cpp b/src/qtquick1/util/qdeclarativestate.cpp
index 6d96f8d1f7..1be3395c5a 100644
--- a/src/qtquick1/util/qdeclarativestate.cpp
+++ b/src/qtquick1/util/qdeclarativestate.cpp
@@ -151,7 +151,7 @@ QDeclarative1StateOperation::QDeclarative1StateOperation(QObjectPrivate &dd, QOb
between the default state and the "clicked" state, thus toggling the color of the
rectangle between black and red.
- \snippet doc/src/snippets/declarative/state.qml 0
+ \snippet doc/src/snippets/qtquick1/state.qml 0
Notice the default state is referred to using an empty string ("").
@@ -217,7 +217,7 @@ bool QDeclarative1State::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/src/snippets/declarative/state-when.qml 0
+ \snippet doc/src/snippets/qtquick1/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/qtquick1/util/qdeclarativestateoperations.cpp b/src/qtquick1/util/qdeclarativestateoperations.cpp
index 47420f370e..e405fba34f 100644
--- a/src/qtquick1/util/qdeclarativestateoperations.cpp
+++ b/src/qtquick1/util/qdeclarativestateoperations.cpp
@@ -189,7 +189,7 @@ void QDeclarative1ParentChangePrivate::doChange(QDeclarativeItem *targetParent,
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/src/snippets/declarative/parentchange.qml 0
+ \snippet doc/src/snippets/qtquick1/parentchange.qml 0
\image parentchange.png
@@ -703,7 +703,7 @@ QString QDeclarative1StateChangeScript::typeName() const
using AnchorChanges, and the top and bottom anchor margins using
PropertyChanges:
- \snippet doc/src/snippets/declarative/anchorchanges.qml 0
+ \snippet doc/src/snippets/qtquick1/anchorchanges.qml 0
\image anchorchanges.png
diff --git a/src/qtquick1/util/qdeclarativesystempalette.cpp b/src/qtquick1/util/qdeclarativesystempalette.cpp
index 7f0dde3a93..a026c5f805 100644
--- a/src/qtquick1/util/qdeclarativesystempalette.cpp
+++ b/src/qtquick1/util/qdeclarativesystempalette.cpp
@@ -79,7 +79,7 @@ public:
group and uses this to color the window and text items
appropriately:
- \snippet doc/src/snippets/declarative/systempalette.qml 0
+ \snippet doc/src/snippets/qtquick1/systempalette.qml 0
\sa QPalette
*/
diff --git a/src/qtquick1/util/qdeclarativetransition.cpp b/src/qtquick1/util/qdeclarativetransition.cpp
index b484873d5c..235db8b483 100644
--- a/src/qtquick1/util/qdeclarativetransition.cpp
+++ b/src/qtquick1/util/qdeclarativetransition.cpp
@@ -68,7 +68,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/src/snippets/declarative/transition.qml 0
+ \snippet doc/src/snippets/qtquick1/transition.qml 0
Notice the example does not require \l{PropertyAnimation::}{to} and
\l{PropertyAnimation::}{from} values for the NumberAnimation. As a convenience,
@@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE
To define multiple transitions, specify \l Item::transitions as a list:
- \snippet doc/src/snippets/declarative/transitions-list.qml list of transitions
+ \snippet doc/src/snippets/qtquick1/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
@@ -238,11 +238,11 @@ void QDeclarative1Transition::prepare(QDeclarative1StateOperation::ActionList &a
properties, so the animation is always applied when changing between
the two states (i.e. when the mouse is pressed and released).
- \snippet doc/src/snippets/declarative/transition-from-to.qml 0
+ \snippet doc/src/snippets/qtquick1/transition-from-to.qml 0
If the transition was changed to this:
- \snippet doc/src/snippets/declarative/transition-from-to-modified.qml modified transition
+ \snippet doc/src/snippets/qtquick1/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).
@@ -285,7 +285,7 @@ void QDeclarative1Transition::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/src/snippets/declarative/transition-reversible.qml 0
+ \snippet doc/src/snippets/qtquick1/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
@@ -334,7 +334,7 @@ void QDeclarative1Transition::setToState(const QString &t)
The top-level animations are run in parallel. To run them sequentially,
define them within a SequentialAnimation:
- \snippet doc/src/snippets/declarative/transition-reversible.qml sequential animations
+ \snippet doc/src/snippets/qtquick1/transition-reversible.qml sequential animations
*/
QDeclarativeListProperty<QDeclarative1AbstractAnimation> QDeclarative1Transition::animations()
{
diff --git a/src/qtquick1/util/qdeclarativexmllistmodel.cpp b/src/qtquick1/util/qdeclarativexmllistmodel.cpp
index 8beb5d2a94..2450534174 100644
--- a/src/qtquick1/util/qdeclarativexmllistmodel.cpp
+++ b/src/qtquick1/util/qdeclarativexmllistmodel.cpp
@@ -115,13 +115,13 @@ typedef QPair<int, int> QDeclarative1XmlListRange;
For example, if there is an XML document like this:
- \quotefile doc/src/snippets/declarative/xmlrole.xml
+ \quotefile doc/src/snippets/qtquick1/xmlrole.xml
Here are some valid XPath expressions for XmlRole queries on this document:
- \snippet doc/src/snippets/declarative/xmlrole.qml 0
+ \snippet doc/src/snippets/qtquick1/xmlrole.qml 0
\dots 4
- \snippet doc/src/snippets/declarative/xmlrole.qml 1
+ \snippet doc/src/snippets/qtquick1/xmlrole.qml 1
See the \l{http://www.w3.org/TR/xpath20/}{W3C XPath 2.0 specification} for more information.
*/