summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-07-08 15:49:23 (GMT)
committermae <qt-info@nokia.com>2010-07-08 16:34:25 (GMT)
commitb22a5e13003ff9f23b075284a1a1e0a6b0e46250 (patch)
tree178f70df43aa34851efd82b1286a472c3f1fd500 /doc/src
parentd5d16b3d3304774df11f40df0206d90ed5f840de (diff)
downloadQt-b22a5e13003ff9f23b075284a1a1e0a6b0e46250.zip
Qt-b22a5e13003ff9f23b075284a1a1e0a6b0e46250.tar.gz
Qt-b22a5e13003ff9f23b075284a1a1e0a6b0e46250.tar.bz2
Follow -> Behavior
Replace the usages of Follows with Behaviors, update docs.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/declarative/advtutorial.qdoc11
-rw-r--r--doc/src/declarative/elements.qdoc3
-rw-r--r--doc/src/examples/qml-examples.qdoc6
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml6
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml10
5 files changed, 19 insertions, 17 deletions
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index 2c3610c..afedb44 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -306,18 +306,17 @@ In anticipation of the new block animations, \c Block.qml file is now renamed to
\section3 Animating block movement
First we will animate the blocks so that they move in a fluid manner. QML has a number of methods for adding fluid
-movement, and in this case we're going to use the \l SpringFollow element to add an animation with a spring-like
-movement. In \c BoomBlock.qml, we apply a \l SpringFollow
-to the \c x and \c y properties so that the block will follow and animate its movement towards the
-position specified by the new \c targetX and \c targetY properties (whose values will be set by \c samegame.js).
-Here is the code added to \c BoomBlock.qml:
+movement, and in this case we're going to use the \l Behavior element to add a \l SpringAnimation.
+In \c BoomBlock.qml, we apply a \l SpringAnimation behavior to the \c x and \c y properties so that the
+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
The \c spring and \c damping values can be changed to modify the spring-like effect of the animation.
The \c {enabled: spawned} setting refers to the \c spawned value that is set from \c createBlock() in \c samegame.js.
-This ensures the \l SpringFollow on the \c x is only enabled after \c createBlock() has set the block to
+This ensures the \l SpringAnimation on the \c x is only enabled after \c createBlock() has set the block to
the correct position. Otherwise, the blocks will slide out of the corner (0,0) when a game begins, instead of falling
from the top in rows. (Try commenting out \c {enabled: spawned} and see for yourself.)
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 48eb09f..0edd242 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -76,11 +76,10 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
\row \o \l {AnchorAnimation} \o Animates anchor changes
\row \o \l {PauseAnimation} \o Pauses an animation
\row \o \l {SmoothedAnimation} \o Allows a property to smoothly track a value
+\row \o \l {SpringAnimation} \o Allows a property to track a value in a spring-like motion
\row \o \l {PropertyAction} \o Sets immediate property changes during animation
\row \o \l {ScriptAction} \o Runs scripts during an animation
\row \o \l {Transition} \o Animates transitions during state changes
-\row \o \l {SpringFollow} \o Allows a property to follow value changes
-\row \o \l {SmoothedFollow} \o Allows animation to smoothly follow value changes
\header \o {2,1} \bold {Working with Data}
\row \o \l {Binding} \o Binds any value to any property
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index 4ad11d9..ce53677 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -477,7 +477,7 @@
This example displays a set of clocks with different times for different cities.
Each clock is created by combining \l Image elements with \l Rotation transforms
- and \l SpringFollow animations.
+ and \l SpringAnimation behaviors.
\image qml-clocks-example.png
*/
@@ -517,7 +517,7 @@
\title Toys: TV Tennis
\example declarative/toys/tvtennis
- This example shows how to use animation components such as \l SpringFollow,
+ This example shows how to use animation components such as \l SpringAnimation,
\l SequentialAnimation and \l PropertyAction to create a game of TV tennis.
\image qml-tvtennis-example.png
@@ -545,7 +545,7 @@
\example declarative/ui-components/dialcontrol
This example shows how to create a dial-type control. It combines
- \l Image elements with \l Rotation transforms and \l SpringFollow animations
+ \l Image elements with \l Rotation transforms and \l SpringAnimatino behaviors
to produce an interactive speedometer-type dial.
\image qml-dialcontrol-example.png
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
index 7377cee..e92a429 100644
--- a/doc/src/snippets/declarative/gridview/gridview.qml
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -108,8 +108,10 @@ Component {
Rectangle {
width: view.cellWidth; height: view.cellHeight
color: "lightsteelblue"; radius: 5
- SpringFollow on x { to: view.currentItem.x; spring: 3; damping: 0.2 }
- SpringFollow on y { to: view.currentItem.y; spring: 3; damping: 0.2 }
+ 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 } }
}
}
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
index 0c6dfd4..cde820e 100644
--- a/doc/src/snippets/declarative/listview/listview.qml
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -99,10 +99,12 @@ Component {
Rectangle {
width: 180; height: 40
color: "lightsteelblue"; radius: 5
- SpringFollow on y {
- to: list.currentItem.y
- spring: 3
- damping: 0.2
+ y: list.currentItem.y
+ Behavior on y {
+ SpringAnimation {
+ spring: 3
+ damping: 0.2
+ }
}
}
}