aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations
diff options
context:
space:
mode:
authorPiotr Mikolajczyk <piotr.mikolajczyk@qt.io>2020-10-06 10:27:20 +0200
committerPiotr Mikolajczyk <piotr.mikolajczyk@qt.io>2020-10-13 11:57:03 +0200
commitd66d0540dc323e6a536b952acedcfda70cd90c0c (patch)
treec23de7945f4b104e345afa31a398e5846eb5b872 /src/qml/animations
parentaba1bf6fca24ec6ee21ffc4417ef05d5d2cfdfeb (diff)
Fix alwaysRunToEnd==true prevented complex Anim from stopping
AnimatorProxyJob would not forward loopCount to the controlled job causing the sequential or parallel animation to go infinitely after attempt to stop Task-number: QTBUG-82890 Pick-to: 5.15 Change-Id: I6a1ca787f06789064e05407bbe9ae5e5861f24d5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/animations')
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp3
-rw-r--r--src/qml/animations/qabstractanimationjob_p.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index 82f3e53d68..f3c12bce3f 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -416,7 +416,10 @@ void QAbstractAnimationJob::setDirection(Direction direction)
void QAbstractAnimationJob::setLoopCount(int loopCount)
{
+ if (m_loopCount == loopCount)
+ return;
m_loopCount = loopCount;
+ updateLoopCount(loopCount);
}
int QAbstractAnimationJob::totalDuration() const
diff --git a/src/qml/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h
index d046ce9def..9490070246 100644
--- a/src/qml/animations/qabstractanimationjob_p.h
+++ b/src/qml/animations/qabstractanimationjob_p.h
@@ -134,6 +134,7 @@ public:
SelfDeletable m_selfDeletable;
protected:
virtual void updateCurrentTime(int) {}
+ virtual void updateLoopCount(int) {}
virtual void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState);
virtual void updateDirection(QAbstractAnimationJob::Direction direction);
virtual void topLevelAnimationLoopChanged() {}