summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-12-10 03:03:46 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-12-10 03:03:46 (GMT)
commita02104fec44e2ea1953f73881d4d6c6cf12974e4 (patch)
tree92d177cdf2220debb641fbb522e1766eda9958b5
parentcaa136ca80f5a85e4b28a24e33d8796f82044a28 (diff)
downloadQt-a02104fec44e2ea1953f73881d4d6c6cf12974e4.zip
Qt-a02104fec44e2ea1953f73881d4d6c6cf12974e4.tar.gz
Qt-a02104fec44e2ea1953f73881d4d6c6cf12974e4.tar.bz2
Have setRunning(true) continue the animation if alwaysRunToEnd/repeat is set.
If alwaysRunToEnd and repeat are set, and an animation is in the midst of running to the end, then when we call start again the animation should (smoothly) continue. Reviewed-by: Leo
-rw-r--r--src/declarative/util/qmlanimation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index 357a03f..1b01741 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -247,6 +247,11 @@ void QmlAbstractAnimation::setRunning(bool r)
d->running = r;
if (d->running) {
+ if (d->alwaysRunToEnd && d->repeat
+ && qtAnimation()->state() == QAbstractAnimation::Running) {
+ qtAnimation()->setLoopCount(-1);
+ }
+
if (!d->connectedTimeLine) {
QObject::connect(qtAnimation(), SIGNAL(finished()),
this, SLOT(timelineComplete()));