This commit is contained in:
2022-12-18 15:18:06 +01:00
parent 36d2fbf6ec
commit 6f2bd3d7c9

13
mdi.py
View File

@ -23,15 +23,16 @@ class MDIArea(QMdiArea):
menu.addAction("Close All")
menu.triggered[QAction].connect(self.on_menu_select)
self.actions = {
"Cascade": self.cascadeSubWindows,
"Tile": self.tileSubWindows,
"Close All": self.closeAllSubWindows
}
def on_menu_select(self, p):
txt = p.text()
if txt == "Cascade":
self.cascadeSubWindows()
elif txt == "Tile":
self.tileSubWindows()
elif txt == "Close All":
self.closeAllSubWindows()
self.actions[txt]()
def paintEvent(self, _event):