added "Close All But Active"

This commit is contained in:
2023-01-03 20:51:30 +01:00
parent 29ac73c3b5
commit 25289b6862

View File

@ -23,6 +23,7 @@ class MDIArea(QMdiArea):
menu.addAction("Tabbed", self.enable_tabbed_view)
menu.addSeparator()
menu.addAction("Close All", self.closeAllSubWindows)
menu.addAction("Close All But Active", self.closeAllButActiveSubWindows)
def on_cascade(self):
self.enable_subwindow_view()
@ -72,4 +73,11 @@ class MDIArea(QMdiArea):
return sub
def closeAllButActiveSubWindows(self):
active = self.activeSubWindow()
for sub in self.subWindowList():
if sub != active:
sub.close()