aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations/qsequentialanimationgroupjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/animations/qsequentialanimationgroupjob.cpp')
-rw-r--r--src/qml/animations/qsequentialanimationgroupjob.cpp8
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;
}