From 80182287816d95c21778c2aeeedf35c5ab05d9f5 Mon Sep 17 00:00:00 2001 From: Devan Agrawal Date: Fri, 27 Sep 2024 13:50:56 -0700 Subject: [PATCH 1/2] BUG: close tabs in tab widget when main window is closed --- superscore/widgets/window.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/superscore/widgets/window.py b/superscore/widgets/window.py index 98d13f3..62e431a 100644 --- a/superscore/widgets/window.py +++ b/superscore/widgets/window.py @@ -9,6 +9,7 @@ import qtawesome as qta from pcdsutils.qt.callbacks import WeakPartialMethodSlot from qtpy import QtCore, QtWidgets +from qtpy.QtGui import QCloseEvent from superscore.client import Client from superscore.model import Entry @@ -137,3 +138,8 @@ def open(*_, **__): open_action.triggered.connect(open) self.menu.exec_(self.tree_view.mapToGlobal(pos)) + + def closeEvent(self, a0: QCloseEvent) -> None: + while self.tab_widget.count() > 0: + self.remove_tab(0) + super().closeEvent(a0) From a6d74d1721bd1741a9ef57224d2f32557fe89c88 Mon Sep 17 00:00:00 2001 From: Devan Agrawal Date: Fri, 27 Sep 2024 14:07:09 -0700 Subject: [PATCH 2/2] DOC: pre-release notes --- .../89-tab_widget_cleanup.rst | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/source/upcoming_release_notes/89-tab_widget_cleanup.rst diff --git a/docs/source/upcoming_release_notes/89-tab_widget_cleanup.rst b/docs/source/upcoming_release_notes/89-tab_widget_cleanup.rst new file mode 100644 index 0000000..611fb45 --- /dev/null +++ b/docs/source/upcoming_release_notes/89-tab_widget_cleanup.rst @@ -0,0 +1,22 @@ +89 tab widget cleanup +################# + +API Breaks +---------- +- N/A + +Features +-------- +- N/A + +Bugfixes +-------- +- Main window closes tab widget tabs when closed, so they can do their clean up + +Maintenance +----------- +- N/A + +Contributors +------------ +- shilorigins