aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/impl
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2025-12-15 16:14:22 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2025-12-15 16:14:22 +0200
commitb58ec3b086518da5aa573f99426235854c23e35f (patch)
tree861a9935d8f1cdba2fdca546836a351736dbddbf /src/quickcontrols/material/impl
parent4826f86e274f1b29bd769e6790824f9e62a40f62 (diff)
parent22032227d16c39211e2ebceef97d21f4d89c7c87 (diff)
Merge tag 'v6.5.8-lts-lgpl' into 6.56.5
Qt 6.5.8-lts-lgpl release
Diffstat (limited to 'src/quickcontrols/material/impl')
-rw-r--r--src/quickcontrols/material/impl/qquickmaterialbusyindicator.cpp14
-rw-r--r--src/quickcontrols/material/impl/qquickmaterialbusyindicator_p.h1
2 files changed, 12 insertions, 3 deletions
diff --git a/src/quickcontrols/material/impl/qquickmaterialbusyindicator.cpp b/src/quickcontrols/material/impl/qquickmaterialbusyindicator.cpp
index 4d5b4e13e7..d99140b113 100644
--- a/src/quickcontrols/material/impl/qquickmaterialbusyindicator.cpp
+++ b/src/quickcontrols/material/impl/qquickmaterialbusyindicator.cpp
@@ -162,13 +162,16 @@ void QQuickMaterialBusyIndicator::setColor(const QColor &color)
bool QQuickMaterialBusyIndicator::isRunning() const
{
- return isVisible();
+ return m_running;
}
void QQuickMaterialBusyIndicator::setRunning(bool running)
{
- if (running)
+ m_running = running;
+
+ if (m_running)
setVisible(true);
+ // Don't set visible to false if not running, because we use an opacity animation (in QML) to hide ourselves.
}
int QQuickMaterialBusyIndicator::elapsed() const
@@ -181,7 +184,12 @@ void QQuickMaterialBusyIndicator::itemChange(QQuickItem::ItemChange change, cons
QQuickItem::itemChange(change, data);
switch (change) {
case ItemOpacityHasChanged:
- if (qFuzzyIsNull(data.realValue))
+ // If running is set to false and then true within a short period (QTBUG-85860), our
+ // OpacityAnimator cancels the 1 => 0 animation (which was for running being set to false),
+ // setting opacity to 0 and hence visible to false. This happens _after_ setRunning(true)
+ // was called, because the properties were set synchronously but the animation is
+ // asynchronous. To account for this situation, we only hide ourselves if we're not running.
+ if (qFuzzyIsNull(data.realValue) && !m_running)
setVisible(false);
break;
case ItemVisibleHasChanged:
diff --git a/src/quickcontrols/material/impl/qquickmaterialbusyindicator_p.h b/src/quickcontrols/material/impl/qquickmaterialbusyindicator_p.h
index b6bbd925c7..ab70432d61 100644
--- a/src/quickcontrols/material/impl/qquickmaterialbusyindicator_p.h
+++ b/src/quickcontrols/material/impl/qquickmaterialbusyindicator_p.h
@@ -45,6 +45,7 @@ protected:
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
private:
+ bool m_running = false;
int m_elapsed = 0;
QColor m_color = Qt::black;
};