aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py')
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
index 142aff4c8..039b818df 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
@@ -2,13 +2,12 @@
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import sys
-from PySide6.QtGui import QAction
from PySide6.QtWidgets import QApplication, QMainWindow
class MainWindow(QMainWindow):
def __init__(self):
- QMainWindow.__init__(self)
+ super().__init__()
self.setWindowTitle("Tutorial")
# Menu
@@ -16,11 +15,9 @@ class MainWindow(QMainWindow):
self.file_menu = self.menu.addMenu("File")
# Exit QAction
- exit_action = QAction("Exit", self)
+ exit_action = self.file_menu.addAction("Exit", self.close)
exit_action.setShortcut("Ctrl+Q")
- self.file_menu.addAction(exit_action)
-
if __name__ == "__main__":
# Qt Application