mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-06-05 21:08:40 +02:00
wip cleanup of the device_selection.py
This commit is contained in:
@@ -14,6 +14,7 @@ class DeviceSelection(QWidget):
|
||||
super().__init__(parent=parent)
|
||||
|
||||
self.client = client
|
||||
self._cleanup_done = False
|
||||
self.supported_signals = [
|
||||
"PreviewSignal",
|
||||
"AsyncSignal",
|
||||
@@ -138,11 +139,19 @@ class DeviceSelection(QWidget):
|
||||
|
||||
def cleanup(self):
|
||||
"""Clean up the widget resources."""
|
||||
if self._cleanup_done:
|
||||
return
|
||||
self._cleanup_done = True
|
||||
self.device_combo_box.close()
|
||||
self.device_combo_box.deleteLater()
|
||||
self.signal_combo_box.close()
|
||||
self.signal_combo_box.deleteLater()
|
||||
|
||||
def closeEvent(self, event):
|
||||
"""Ensure embedded BEC widgets clean up when the toolbar widget closes."""
|
||||
self.cleanup()
|
||||
super().closeEvent(event)
|
||||
|
||||
|
||||
def device_selection_bundle(components: ToolbarComponents, client=None) -> ToolbarBundle:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user