From a02104fec44e2ea1953f73881d4d6c6cf12974e4 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 10 Dec 2009 13:03:46 +1000 Subject: 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 --- src/declarative/util/qmlanimation.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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())); -- cgit v0.12