aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/fusion/qquickfusionbusyindicator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/fusion/qquickfusionbusyindicator.cpp')
-rw-r--r--src/imports/controls/fusion/qquickfusionbusyindicator.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/imports/controls/fusion/qquickfusionbusyindicator.cpp b/src/imports/controls/fusion/qquickfusionbusyindicator.cpp
index 7254b7b7..f5c92010 100644
--- a/src/imports/controls/fusion/qquickfusionbusyindicator.cpp
+++ b/src/imports/controls/fusion/qquickfusionbusyindicator.cpp
@@ -59,11 +59,22 @@ void QQuickFusionBusyIndicator::setColor(const QColor &color)
update();
}
+bool QQuickFusionBusyIndicator::isRunning() const
+{
+ return isVisible();
+}
+
+void QQuickFusionBusyIndicator::setRunning(bool running)
+{
+ if (running)
+ setVisible(true);
+}
+
void QQuickFusionBusyIndicator::paint(QPainter *painter)
{
const qreal w = width();
const qreal h = height();
- if (w <= 0 || h <= 0 || !isVisible())
+ if (w <= 0 || h <= 0 || !isRunning())
return;
const qreal sz = qMin(w, h);
@@ -87,4 +98,12 @@ void QQuickFusionBusyIndicator::paint(QPainter *painter)
painter->drawArc(bounds, 0, 20 * 16);
}
+void QQuickFusionBusyIndicator::itemChange(ItemChange change, const ItemChangeData &data)
+{
+ QQuickPaintedItem::itemChange(change, data);
+
+ if (change == ItemOpacityHasChanged && qFuzzyIsNull(data.realValue))
+ setVisible(false);
+}
+
QT_END_NAMESPACE