diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-04-22 15:38:15 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-24 13:46:52 +0200 |
commit | 2d8cde43e8ead44fb8bae7078741ca2fe6266733 (patch) | |
tree | 0b921a77502aac846bc8bb545c8090d0be18db4d /src/qml/animations | |
parent | 9bd69842ed8a03381914733a778fbda0d3d56630 (diff) |
Fix sequential animations with uncontrolled looped children.
An animation needs to be through all its loop cycles or
explicitly stopped before we can consider it finished.
Task-number: QTBUG-37246
Change-Id: Ia30b27448ec7a1e0d2dd8165575b8a7105caae8d
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/animations')
-rw-r--r-- | src/qml/animations/qsequentialanimationgroupjob.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp index 135760b3cb..cfc53d552a 100644 --- a/src/qml/animations/qsequentialanimationgroupjob.cpp +++ b/src/qml/animations/qsequentialanimationgroupjob.cpp @@ -75,8 +75,12 @@ bool QSequentialAnimationGroupJob::atEnd() const int QSequentialAnimationGroupJob::animationActualTotalDuration(QAbstractAnimationJob *anim) const { int ret = anim->totalDuration(); - if (ret == -1) - ret = uncontrolledAnimationFinishTime(anim); //we can try the actual duration there + if (ret == -1) { + int done = uncontrolledAnimationFinishTime(anim); + // If the animation has reached the end, use the uncontrolledFinished value. + if (done >= 0 && (anim->loopCount() - 1 == anim->currentLoop() || anim->state() == Stopped)) + return done; + } return ret; } |