mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
refactor: fix cleanup for various widgets, including RoundedFrame
This commit is contained in:
@ -104,6 +104,7 @@ class DeviceComboBox(DeviceInputBase, QComboBox):
|
|||||||
"""Cleanup the widget."""
|
"""Cleanup the widget."""
|
||||||
if self._callback_id is not None:
|
if self._callback_id is not None:
|
||||||
self.bec_dispatcher.client.callbacks.remove(self._callback_id)
|
self.bec_dispatcher.client.callbacks.remove(self._callback_id)
|
||||||
|
super().cleanup()
|
||||||
|
|
||||||
def get_current_device(self) -> object:
|
def get_current_device(self) -> object:
|
||||||
"""
|
"""
|
||||||
|
@ -111,6 +111,7 @@ class DeviceLineEdit(DeviceInputBase, QLineEdit):
|
|||||||
"""Cleanup the widget."""
|
"""Cleanup the widget."""
|
||||||
if self._callback_id is not None:
|
if self._callback_id is not None:
|
||||||
self.bec_dispatcher.client.callbacks.remove(self._callback_id)
|
self.bec_dispatcher.client.callbacks.remove(self._callback_id)
|
||||||
|
super().cleanup()
|
||||||
|
|
||||||
def get_current_device(self) -> object:
|
def get_current_device(self) -> object:
|
||||||
"""
|
"""
|
||||||
|
@ -403,6 +403,7 @@ class Minesweeper(BECWidget, QWidget):
|
|||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self._timer.stop()
|
self._timer.stop()
|
||||||
|
super().cleanup()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -971,6 +971,7 @@ class PlotBase(BECWidget, QWidget):
|
|||||||
self.axis_settings_dialog.close()
|
self.axis_settings_dialog.close()
|
||||||
self.axis_settings_dialog = None
|
self.axis_settings_dialog = None
|
||||||
self.cleanup_pyqtgraph()
|
self.cleanup_pyqtgraph()
|
||||||
|
self.round_plot_widget.close()
|
||||||
super().cleanup()
|
super().cleanup()
|
||||||
|
|
||||||
def cleanup_pyqtgraph(self, item: pg.PlotItem | None = None):
|
def cleanup_pyqtgraph(self, item: pg.PlotItem | None = None):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
""" Module for a LogPanel widget to display BEC log messages """
|
"""Module for a LogPanel widget to display BEC log messages"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
@ -514,6 +514,7 @@ class LogPanel(TextBox):
|
|||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self._service_status.cleanup()
|
self._service_status.cleanup()
|
||||||
self._log_manager.disconnect()
|
self._log_manager.disconnect()
|
||||||
|
super().cleanup()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__": # pragma: no cover
|
if __name__ == "__main__": # pragma: no cover
|
||||||
|
Reference in New Issue
Block a user