summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-03 07:54:43 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-03 07:54:43 (GMT)
commit07bd4f61caaa61866fcfa7847eeeb905d4fa2b38 (patch)
treee55835d515209ee355cb5c8b61832d4347b2223c /src/declarative/util
parentaebadf248a93458615a53b3480987f829aba0ee6 (diff)
downloadQt-07bd4f61caaa61866fcfa7847eeeb905d4fa2b38.zip
Qt-07bd4f61caaa61866fcfa7847eeeb905d4fa2b38.tar.gz
Qt-07bd4f61caaa61866fcfa7847eeeb905d4fa2b38.tar.bz2
'on' syntax fixes
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp18
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp6
-rw-r--r--src/declarative/util/qdeclarativeeasefollow.cpp34
-rw-r--r--src/declarative/util/qdeclarativespringfollow.cpp6
4 files changed, 32 insertions, 32 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 7f4f1c0..b14de19 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -110,7 +110,7 @@ QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QDeclarativeAbstrac
\code
Rectangle {
width: 100; height: 100
- x: NumberAnimation {
+ NumberAnimation on x {
running: myMouse.pressed
from: 0; to: 100
}
@@ -310,7 +310,7 @@ void QDeclarativeAbstractAnimation::setAlwaysRunToEnd(bool f)
\code
Rectangle {
- rotation: NumberAnimation { running: true; repeat: true; from: 0 to: 360 }
+ NumberAnimation on rotation { running: true; repeat: true; from: 0 to: 360 }
}
\endcode
*/
@@ -412,7 +412,7 @@ void QDeclarativeAbstractAnimation::resume()
no further influence on property values. In this example animation
\code
Rectangle {
- x: NumberAnimation { from: 0; to: 100; duration: 500 }
+ NumberAnimation on x { from: 0; to: 100; duration: 500 }
}
\endcode
was stopped at time 250ms, the \c x property will have a value of 50.
@@ -450,7 +450,7 @@ void QDeclarativeAbstractAnimation::restart()
its end. In the following example,
\code
Rectangle {
- x: NumberAnimation { from: 0; to: 100; duration: 500 }
+ NumberAnimation on x { from: 0; to: 100; duration: 500 }
}
\endcode
calling \c stop() at time 250ms will result in the \c x property having
@@ -1292,7 +1292,7 @@ QDeclarativeVector3dAnimation::QDeclarativeVector3dAnimation(QObject *parent)
Q_D(QDeclarativePropertyAnimation);
d->interpolatorType = QMetaType::QVector3D;
d->interpolator = QVariantAnimationPrivate::getInterpolator(d->interpolatorType);
- d->defaultToInterpolatorType = true;
+ d->defaultToInterpolatorType = true;
}
QDeclarativeVector3dAnimation::~QDeclarativeVector3dAnimation()
@@ -1741,7 +1741,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
Animate all changes to a rectangle's x property.
\qml
Rectangle {
- x: Behavior { PropertyAnimation {} }
+ Behavior on x { PropertyAnimation {} }
}
\endqml
\o As a property value source
@@ -1749,7 +1749,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
Repeatedly animate the rectangle's x property.
\qml
Rectangle {
- x: SequentialAnimation {
+ SequentialAnimation on x {
repeat: true
PropertyAnimation { to: 50 }
PropertyAnimation { to: 0 }
@@ -2140,8 +2140,8 @@ void QDeclarativePropertyAnimation::setProperties(const QString &prop)
id: theRect
width: 100; height: 100
color: Qt.rgba(0,0,1)
- x: NumberAnimation { to: 500; repeat: true } //animate theRect's x property
- y: Behavior { NumberAnimation {} } //animate theRect's y property
+ NumberAnimation on x { to: 500; repeat: true } //animate theRect's x property
+ Behavior on y { NumberAnimation {} } //animate theRect's y property
}
\endqml
\row
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 5352341..dea2c02 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -75,13 +75,13 @@ public:
Behaviors provide one way to specify \l{qdeclarativeanimation.html}{animations} in QML.
- In the example below, the rect will use a bounce easing curve over 200 millisecond for any changes to its y property:
+ In the example below, the rectangle will use a bounce easing curve over 200 millisecond for any changes to its y property:
\code
Rectangle {
width: 20; height: 20
color: "#00ff00"
- y: 200 //initial value
- y: Behavior {
+ y: 200 // initial value
+ Behavior on y {
NumberAnimation {
easing: "easeOutBounce(amplitude:100)"
duration: 200
diff --git a/src/declarative/util/qdeclarativeeasefollow.cpp b/src/declarative/util/qdeclarativeeasefollow.cpp
index 3fa9866..ee181dd 100644
--- a/src/declarative/util/qdeclarativeeasefollow.cpp
+++ b/src/declarative/util/qdeclarativeeasefollow.cpp
@@ -59,10 +59,10 @@ class QDeclarativeEaseFollowPrivate : public QObjectPrivate
public:
QDeclarativeEaseFollowPrivate()
: source(0), velocity(200), duration(-1), maximumEasingTime(-1),
- reversingMode(QDeclarativeEaseFollow::Eased), initialVelocity(0),
+ reversingMode(QDeclarativeEaseFollow::Eased), initialVelocity(0),
initialValue(0), invert(false), enabled(true), trackVelocity(0), clockOffset(0),
lastTick(0), clock(this)
- {}
+ {}
qreal source;
qreal velocity;
@@ -173,7 +173,7 @@ bool QDeclarativeEaseFollowPrivate::recalc()
}
/*
- qWarning() << "a:" << a << "tf:" << tf << "tp:" << tp << "vp:"
+ qWarning() << "a:" << a << "tf:" << tf << "tp:" << tp << "vp:"
<< vp << "sp:" << sp << "vi:" << vi << "invert:" << invert;
*/
return true;
@@ -254,19 +254,19 @@ void QDeclarativeEaseFollowPrivate::tick(int t)
\since 4.7
\brief The EaseFollow element allows a property to smoothly track a value.
- The EaseFollow smoothly animates a property's value to a set target value
+ The EaseFollow smoothly animates a property's value to a set target value
using an ease in/out quad easing curve. If the target value changes while
- the animation is in progress, the easing curves used to animate to the old
+ the animation is in progress, the easing curves used to animate to the old
and the new target values are spliced together to avoid any obvious visual
glitches.
The property animation is configured by setting the velocity at which the
- animation should occur, or the duration that the animation should take.
+ animation should occur, or the duration that the animation should take.
If both a velocity and a duration are specified, the one that results in
the quickest animation is chosen for each change in the target value.
For example, animating from 0 to 800 will take 4 seconds if a velocity
- of 200 is set, will take 8 seconds with a duration of 8000 set, and will
+ of 200 is set, will take 8 seconds with a duration of 8000 set, and will
take 4 seconds with both a velocity of 200 and a duration of 8000 set.
Animating from 0 to 20000 will take 10 seconds if a velocity of 200 is set,
will take 8 seconds with a duration of 8000 set, and will take 8 seconds
@@ -283,8 +283,8 @@ Rectangle {
color: "green"
width: 60; height: 60;
x: -5; y: -5;
- x: EaseFollow { source: rect1.x - 5; velocity: 200 }
- y: EaseFollow { source: rect1.y - 5; velocity: 200 }
+ EaseFollow on x { source: rect1.x - 5; velocity: 200 }
+ EaseFollow on y { source: rect1.y - 5; velocity: 200 }
}
Rectangle {
@@ -338,8 +338,8 @@ qreal QDeclarativeEaseFollow::sourceValue() const
Sets how the EaseFollow behaves if an animation direction is reversed.
If reversing mode is \c Eased, the animation will smoothly decelerate, and
- then reverse direction. If the reversing mode is \c Immediate, the
- animation will immediately begin accelerating in the reverse direction,
+ then reverse direction. If the reversing mode is \c Immediate, the
+ animation will immediately begin accelerating in the reverse direction,
begining with a velocity of 0. If the reversing mode is \c Sync, the
property is immediately set to the target value.
*/
@@ -373,7 +373,7 @@ void QDeclarativeEaseFollowPrivate::restart()
return;
}
- bool hasReversed = trackVelocity != 0. &&
+ bool hasReversed = trackVelocity != 0. &&
((trackVelocity > 0) == ((initialValue - source) > 0));
if (hasReversed) {
@@ -440,7 +440,7 @@ void QDeclarativeEaseFollow::setDuration(qreal v)
d->duration = v;
d->trackVelocity = 0;
- if (d->clock.state() == QAbstractAnimation::Running)
+ if (d->clock.state() == QAbstractAnimation::Running)
d->restart();
emit durationChanged();
@@ -470,7 +470,7 @@ void QDeclarativeEaseFollow::setVelocity(qreal v)
d->velocity = v;
d->trackVelocity = 0;
- if (d->clock.state() == QAbstractAnimation::Running)
+ if (d->clock.state() == QAbstractAnimation::Running)
d->restart();
emit velocityChanged();
@@ -511,8 +511,8 @@ void QDeclarativeEaseFollow::setTarget(const QDeclarativeProperty &t)
\qmlproperty qreal EaseFollow::maximumEasingTime
This property specifies the maximum time an "eases" during the follow should take.
-Setting this property causes the velocity to "level out" after at a time. Setting
-a negative value reverts to the normal mode of easing over the entire animation
+Setting this property causes the velocity to "level out" after at a time. Setting
+a negative value reverts to the normal mode of easing over the entire animation
duration.
The default value is -1.
@@ -528,7 +528,7 @@ void QDeclarativeEaseFollow::setMaximumEasingTime(qreal v)
Q_D(QDeclarativeEaseFollow);
d->maximumEasingTime = v;
- if (d->clock.state() == QAbstractAnimation::Running)
+ if (d->clock.state() == QAbstractAnimation::Running)
d->restart();
emit maximumEasingTimeChanged();
diff --git a/src/declarative/util/qdeclarativespringfollow.cpp b/src/declarative/util/qdeclarativespringfollow.cpp
index 6205ab9..1d69dd3 100644
--- a/src/declarative/util/qdeclarativespringfollow.cpp
+++ b/src/declarative/util/qdeclarativespringfollow.cpp
@@ -222,8 +222,8 @@ void QDeclarativeSpringFollowPrivate::stop()
id: rect1
width: 20; height: 20
color: "#00ff00"
- y: 200 //initial value
- y: SequentialAnimation {
+ y: 200 // initial value
+ SequentialAnimation on y {
running: true
repeat: true
NumberAnimation {
@@ -239,7 +239,7 @@ void QDeclarativeSpringFollowPrivate::stop()
x: rect1.width
width: 20; height: 20
color: "#ff0000"
- y: SpringFollow { source: rect1.y; velocity: 200 }
+ SpringFollow on y { source: rect1.y; velocity: 200 }
}
\endcode