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 commit3211100411
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit8f2aa4de88
)
This commit is contained in:
parent
000e0ec516
commit
147ecd467d
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue