summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativeanimation.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-02-22 03:33:12 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-02-22 03:36:43 (GMT)
commitb254be20c03d4dbfc1803cd40dc95d52115b955c (patch)
treebe7f945b101150007723a1d54a128dbb93b277f2 /src/declarative/util/qdeclarativeanimation.cpp
parent2dad737a8cef6191a46eead8ea9940034d083884 (diff)
downloadQt-b254be20c03d4dbfc1803cd40dc95d52115b955c.zip
Qt-b254be20c03d4dbfc1803cd40dc95d52115b955c.tar.gz
Qt-b254be20c03d4dbfc1803cd40dc95d52115b955c.tar.bz2
Fix animations with alwaysRunToEnd that are frequently stopped/started.
A previous refactoring of the animation logic introduced a regression -- 'restart' rather than 'continue' behavior. Change-Id: I8ade2286298fad48f5e268793a0b2571884bc5d0 Task-number: QTBUG-16736 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/util/qdeclarativeanimation.cpp')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 014d368..58c346c 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -203,6 +203,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
d->running = r;
if (d->running) {
+ bool supressStart = false;
if (d->alwaysRunToEnd && d->loopCount != 1
&& qtAnimation()->state() == QAbstractAnimation::Running) {
//we've restarted before the final loop finished; restore proper loop count
@@ -210,6 +211,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
qtAnimation()->setLoopCount(d->loopCount);
else
qtAnimation()->setLoopCount(qtAnimation()->currentLoop() + d->loopCount);
+ supressStart = true; //we want the animation to continue, rather than restart
}
if (!d->connectedTimeLine) {
@@ -217,7 +219,8 @@ void QDeclarativeAbstractAnimation::setRunning(bool r)
this, SLOT(timelineComplete()));
d->connectedTimeLine = true;
}
- d->commence();
+ if (!supressStart)
+ d->commence();
emit started();
} else {
if (d->alwaysRunToEnd) {