aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
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/quick
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/quick')
-rw-r--r--src/quick/util/qquickanimatorjob.cpp9
-rw-r--r--src/quick/util/qquickanimatorjob_p.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index 1c2472dc49..f196005561 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -118,6 +118,11 @@ QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObje
}
}
+void QQuickAnimatorProxyJob::updateLoopCount(int loopCount)
+{
+ m_job->setLoopCount(loopCount);
+}
+
QQuickAnimatorProxyJob::~QQuickAnimatorProxyJob()
{
if (m_job && m_controller)
@@ -138,6 +143,10 @@ void QQuickAnimatorProxyJob::updateCurrentTime(int)
if (m_internalState != State_Running)
return;
+ // Copy current loop number from the job
+ // we could make currentLoop() virtual but it would be less efficient
+ m_currentLoop = m_job->currentLoop();
+
// A proxy which is being ticked should be associated with a window, (see
// setWindow() below). If we get here when there is no more controller we
// have a problem.
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 0ec1253118..c79c5341bc 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -86,6 +86,7 @@ public:
protected:
void updateCurrentTime(int) override;
+ void updateLoopCount(int) override;
void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override;
void debugAnimation(QDebug d) const override;