0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

refactor: fix cleanup for various widgets, including RoundedFrame

This commit is contained in:
2025-03-24 09:24:46 +01:00
committed by wyzula-jan
parent be83c7d5f4
commit d05179a519
5 changed files with 6 additions and 1 deletions

View File

@ -104,6 +104,7 @@ class DeviceComboBox(DeviceInputBase, QComboBox):
"""Cleanup the widget."""
if self._callback_id is not None:
self.bec_dispatcher.client.callbacks.remove(self._callback_id)
super().cleanup()
def get_current_device(self) -> object:
"""

View File

@ -111,6 +111,7 @@ class DeviceLineEdit(DeviceInputBase, QLineEdit):
"""Cleanup the widget."""
if self._callback_id is not None:
self.bec_dispatcher.client.callbacks.remove(self._callback_id)
super().cleanup()
def get_current_device(self) -> object:
"""

View File

@ -403,6 +403,7 @@ class Minesweeper(BECWidget, QWidget):
def cleanup(self):
self._timer.stop()
super().cleanup()
if __name__ == "__main__":

View File

@ -971,6 +971,7 @@ class PlotBase(BECWidget, QWidget):
self.axis_settings_dialog.close()
self.axis_settings_dialog = None
self.cleanup_pyqtgraph()
self.round_plot_widget.close()
super().cleanup()
def cleanup_pyqtgraph(self, item: pg.PlotItem | None = None):

View File

@ -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
@ -514,6 +514,7 @@ class LogPanel(TextBox):
def cleanup(self):
self._service_status.cleanup()
self._log_manager.disconnect()
super().cleanup()
if __name__ == "__main__": # pragma: no cover