aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2023-09-26 17:22:38 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-01-11 11:33:46 +0000
commit147ecd467d545898e1fe60bca952aa784949cb72 (patch)
treed3aa4d99be64c6d2e80afc0a1cf4b67216148640
parent000e0ec5169fd055cc6d49af9842185f0e5b5b2c (diff)
Fix BusyIndicator invisibility under Fusion style
When an initially invisible BusyIndicator is first made visible under the Fusion style, it does not in actuality become visible. This is because the QQuickFusionBusyIndicator::itemChange() function ignores ItemVisibleHasChanged, so the appropriate actions don't take place. The fix is a partial copy and paste of QQuickMaterialBusyIndicator::itemChange's implementation which has identical logic except for calling the appropriate ::itemChange() super function. Task-number: QTBUG-108808 Pick-to: 6.5 Change-Id: Id92c62a1eef4fc278ab91097f04db5b41a5d2c8a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 321110041143065a6939b157a0e85510ec5a0841) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8f2aa4de88db7a4d5c7c35d30df0688fa1e52594)
-rw-r--r--src/quickcontrols/fusion/impl/qquickfusionbusyindicator.cpp13
-rw-r--r--tests/auto/quickcontrols/controls/data/tst_busyindicator.qml21
2 files changed, 31 insertions, 3 deletions
diff --git a/src/quickcontrols/fusion/impl/qquickfusionbusyindicator.cpp b/src/quickcontrols/fusion/impl/qquickfusionbusyindicator.cpp
index cce69b0e4b..8e58b09ed3 100644
--- a/src/quickcontrols/fusion/impl/qquickfusionbusyindicator.cpp
+++ b/src/quickcontrols/fusion/impl/qquickfusionbusyindicator.cpp
@@ -71,8 +71,17 @@ void QQuickFusionBusyIndicator::itemChange(ItemChange change, const ItemChangeDa
{
QQuickPaintedItem::itemChange(change, data);
- if (change == ItemOpacityHasChanged && qFuzzyIsNull(data.realValue))
- setVisible(false);
+ switch (change) {
+ case ItemOpacityHasChanged:
+ if (qFuzzyIsNull(data.realValue))
+ setVisible(false);
+ break;
+ case ItemVisibleHasChanged:
+ update();
+ break;
+ default:
+ break;
+ }
}
QT_END_NAMESPACE
diff --git a/tests/auto/quickcontrols/controls/data/tst_busyindicator.qml b/tests/auto/quickcontrols/controls/data/tst_busyindicator.qml
index 7385677f93..69b1cc1d11 100644
--- a/tests/auto/quickcontrols/controls/data/tst_busyindicator.qml
+++ b/tests/auto/quickcontrols/controls/data/tst_busyindicator.qml
@@ -22,7 +22,14 @@ TestCase {
id: mouseArea
MouseArea { }
}
-
+
+ Component {
+ id: busyIndicatorInItem
+ Item {
+ BusyIndicator { }
+ }
+ }
+
function init() {
failOnWarning(/.?/)
}
@@ -63,4 +70,16 @@ TestCase {
touch.release(0, control).commit()
verify(!ma.pressed)
}
+
+ // QTBUG-108808
+ function test_visibility() {
+ let control = createTemporaryObject(busyIndicatorInItem, testCase, {visible: false})
+ verify(control)
+
+ let invisibleImage = grabImage(control)
+ control.visible = true
+ let visibleImage = grabImage(control)
+
+ verify(!invisibleImage.equals(visibleImage))
+ }
}