From fdb0668c8aa863abf14b3bc057a3932575a62662 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Tue, 2 Jul 2024 13:15:09 +0800 Subject: [PATCH] moninj: set parent to main window on widget delete --- artiq/dashboard/moninj.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/dashboard/moninj.py b/artiq/dashboard/moninj.py index c38940ddc..946ce7c3f 100644 --- a/artiq/dashboard/moninj.py +++ b/artiq/dashboard/moninj.py @@ -861,9 +861,10 @@ class _MonInjDock(QDockWidgetCloseDetect): def delete_widget(self, index, checked): widget = self.flow.itemAt(index).widget() - widget.hide() self.manager.dm.setup_monitoring(False, widget) self.flow.layout.takeAt(index) + widget.setParent(self.manager.main_window) + widget.hide() def add_channels(self): channels = self.channel_dialog.channels @@ -948,7 +949,7 @@ class MonInj: del self.docks[name] self.update_closable() dock.delete_all_widgets() - dock.hide() # dock may be parent, only delete on exit + dock.deleteLater() def update_closable(self): flags = (QtWidgets.QDockWidget.DockWidgetMovable |