summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-15 00:35:53 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-15 00:35:53 (GMT)
commite7104992c731749335466b6ff771ee886af79f1d (patch)
treeaa37ad96e3f72ebc17a0445d05f244fafbf25ec6
parente03075954936444feda8670330e94b87d82deb79 (diff)
downloadQt-e7104992c731749335466b6ff771ee886af79f1d.zip
Qt-e7104992c731749335466b6ff771ee886af79f1d.tar.gz
Qt-e7104992c731749335466b6ff771ee886af79f1d.tar.bz2
Fix finishPlaying behavior for repeating animations.
Make sure we stop at the end of the current loop.
-rw-r--r--src/declarative/util/qmlanimation.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index dd4e1eb..24bcac98 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -243,8 +243,12 @@ void QmlAbstractAnimation::setRunning(bool r)
d->startOnCompletion = true;
emit started();
} else {
- if (!d->finishPlaying)
+ if (d->finishPlaying) {
+ if (d->repeat)
+ qtAnimation()->setLoopCount(qtAnimation()->currentLoop()+1);
+ } else
qtAnimation()->stop();
+
emit completed();
}
@@ -512,7 +516,11 @@ void QmlAbstractAnimation::transition(QmlStateActions &actions,
void QmlAbstractAnimation::timelineComplete()
{
+ Q_D(QmlAbstractAnimation);
setRunning(false);
+ if (d->finishPlaying && d->repeat) {
+ qtAnimation()->setLoopCount(-1);
+ }
}
/*!