aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
authorPiotr Mikolajczyk <piotr.mikolajczyk@qt.io>2020-10-06 10:27:20 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-10-16 10:36:36 +0000
commit0f3df189e57d4c2bddce09380bbed8e0ed1fe2b7 (patch)
tree643759e17c0b06c5acbe7d45d626ce7a90815df6 /src/quick/util
parent7f87b07cf393707d448b0fa515a33b90c79fc584 (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 Change-Id: I6a1ca787f06789064e05407bbe9ae5e5861f24d5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d66d0540dc323e6a536b952acedcfda70cd90c0c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/util')
-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 767be96403..2ae8a5a2aa 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -123,6 +123,11 @@ QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObje
}
}
+void QQuickAnimatorProxyJob::updateLoopCount(int loopCount)
+{
+ m_job->setLoopCount(loopCount);
+}
+
QQuickAnimatorProxyJob::~QQuickAnimatorProxyJob()
{
if (m_job && m_controller)
@@ -143,6 +148,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 74085526c0..522540bcbc 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -87,6 +87,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;