Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: close tabs in tab widget when main window is closed #89

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/source/upcoming_release_notes/89-tab_widget_cleanup.rst
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions superscore/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)