added "Close All But Active"
This commit is contained in:
@ -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()
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user