From d66d0540dc323e6a536b952acedcfda70cd90c0c Mon Sep 17 00:00:00 2001 From: Piotr Mikolajczyk Date: Tue, 6 Oct 2020 10:27:20 +0200 Subject: 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 --- src/qml/animations/qabstractanimationjob.cpp | 3 +++ src/qml/animations/qabstractanimationjob_p.h | 1 + 2 files changed, 4 insertions(+) (limited to 'src/qml/animations') 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() {} -- cgit v1.2.3