summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmlspringfollow.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-28 03:20:15 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-28 03:20:15 (GMT)
commitfc733f4573f1fe43e0cfe43734623d77f61a4614 (patch)
treeb57fffa13e4380cd04ac5832d8131035f25ebd6c /src/declarative/util/qmlspringfollow.cpp
parent5f9091771eaa26db5ad35e4788c13ac011512b61 (diff)
downloadQt-fc733f4573f1fe43e0cfe43734623d77f61a4614.zip
Qt-fc733f4573f1fe43e0cfe43734623d77f61a4614.tar.gz
Qt-fc733f4573f1fe43e0cfe43734623d77f61a4614.tar.bz2
Ensure that the Follows handle the target value changing unexpectedly.
If the target's property was changed elsewhere while the Follow wasn't running, it would fail to start when a source identical to its current source valule was set.
Diffstat (limited to 'src/declarative/util/qmlspringfollow.cpp')
-rw-r--r--src/declarative/util/qmlspringfollow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/declarative/util/qmlspringfollow.cpp b/src/declarative/util/qmlspringfollow.cpp
index 34ec976..569cc48 100644
--- a/src/declarative/util/qmlspringfollow.cpp
+++ b/src/declarative/util/qmlspringfollow.cpp
@@ -272,10 +272,11 @@ qreal QmlSpringFollow::sourceValue() const
void QmlSpringFollow::setSourceValue(qreal value)
{
Q_D(QmlSpringFollow);
- if (d->sourceValue != value) {
- d->sourceValue = value;
- d->start();
- }
+ if (d->clock.state() == QAbstractAnimation::Running && d->sourceValue == value)
+ return;
+
+ d->sourceValue = value;
+ d->start();
}
/*!