Utils: Fix visibility handling for aspects

Otherwise we may fail to hide widgets of aspects that are explicitly
set invisible while construction.

Change-Id: I2679c8fa22e79e4eb32ca5ae4266010d8cf9387d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2023-07-17 14:28:30 +02:00
parent 814fabfe4b
commit 9338f7a4d7

View File

@@ -209,7 +209,7 @@ void BaseAspect::setVisible(bool visible)
// This may happen during layout building. Explicit setting visibility here
// may create a show a toplevel widget for a moment until it is parented
// to some non-shown widget.
if (w->parentWidget())
if (!visible || w->parentWidget())
w->setVisible(visible);
}
}