diff --git a/src/silx/gui/utils/test/test_waiter_overlay.py b/src/silx/gui/utils/test/test_waiter_overlay.py index 686f60f4d5..68d78e1f52 100644 --- a/src/silx/gui/utils/test/test_waiter_overlay.py +++ b/src/silx/gui/utils/test/test_waiter_overlay.py @@ -12,6 +12,7 @@ def test_show(qapp_utils): waitingOverlay.setWaiting(False) assert waitingOverlay.parent() is plot + assert waitingOverlay._waitingButton.parent() is plot.getWidgetHandle() plot.close() waitingOverlay.close() diff --git a/src/silx/gui/utils/waiteroverlay.py b/src/silx/gui/utils/waiteroverlay.py index a3b274a162..6b38ba36e1 100644 --- a/src/silx/gui/utils/waiteroverlay.py +++ b/src/silx/gui/utils/waiteroverlay.py @@ -11,13 +11,13 @@ def __init__(self, parent: qt.QWidget) -> None: :param qt.QWidget underlying_widget: widget on top of which we want to displat the "processing/waiting wheel" :param str waiting_text: text to apply near the processing wheel """ - super().__init__() - + super().__init__(parent) if isinstance(parent, PlotWidget): parent = parent.getWidgetHandle() if not isinstance(parent, qt.QWidget): raise TypeError(f"underlying_widget is expected to be an instance of QWidget. {type(parent)} provided.") + self._waitingButton = WaitingPushButton( parent=parent, )