diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-03-13 21:53:16 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-03-14 10:03:30 +0100 |
commit | b33d8e3ff47c5027d0147f74c35c7e4b4f874ca5 (patch) | |
tree | b468edd7143ab877445570326731bb76f5aecfba /examples/widgets/mainwindows/mdi | |
parent | fefb8237fc87512ade55381e3af990b8478f0863 (diff) |
Examples: Use theme icons
Add some missing icons.
Task-number: PYSIDE-2206
Change-Id: I7763f3ad145427dd97084e6191fd4828c2432baa
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/widgets/mainwindows/mdi')
-rw-r--r-- | examples/widgets/mainwindows/mdi/mdi.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/widgets/mainwindows/mdi/mdi.py b/examples/widgets/mainwindows/mdi/mdi.py index 92c0c9c2b..c1fa01b8c 100644 --- a/examples/widgets/mainwindows/mdi/mdi.py +++ b/examples/widgets/mainwindows/mdi/mdi.py @@ -271,17 +271,17 @@ class MainWindow(QMainWindow): def create_actions(self): - icon = QIcon.fromTheme("document-new") + icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentNew) self._new_act = QAction(icon, "&New", self, shortcut=QKeySequence.New, statusTip="Create a new file", triggered=self.new_file) - icon = QIcon.fromTheme("document-open") + icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentOpen) self._open_act = QAction(icon, "&Open...", self, shortcut=QKeySequence.Open, statusTip="Open an existing file", triggered=self.open) - icon = QIcon.fromTheme("document-save") + icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentSave) self._save_act = QAction(icon, "&Save", self, shortcut=QKeySequence.Save, statusTip="Save the document to disk", triggered=self.save) @@ -291,23 +291,24 @@ class MainWindow(QMainWindow): statusTip="Save the document under a new name", triggered=self.save_as) - self._exit_act = QAction("E&xit", self, shortcut=QKeySequence.Quit, + icon = QIcon.fromTheme(QIcon.ThemeIcon.ApplicationExit) + self._exit_act = QAction(icon, "E&xit", self, shortcut=QKeySequence.Quit, statusTip="Exit the application", triggered=QApplication.instance().closeAllWindows) - icon = QIcon.fromTheme("edit-cut") + icon = QIcon.fromTheme(QIcon.ThemeIcon.EditCut) self._cut_act = QAction(icon, "Cu&t", self, shortcut=QKeySequence.Cut, statusTip="Cut the current selection's contents to the clipboard", triggered=self.cut) - icon = QIcon.fromTheme("edit-copy") + icon = QIcon.fromTheme(QIcon.ThemeIcon.EditCopy) self._copy_act = QAction(icon, "&Copy", self, shortcut=QKeySequence.Copy, statusTip="Copy the current selection's contents to the clipboard", triggered=self.copy) - icon = QIcon.fromTheme("edit-paste") + icon = QIcon.fromTheme(QIcon.ThemeIcon.EditPaste) self._paste_act = QAction(icon, "&Paste", self, shortcut=QKeySequence.Paste, statusTip="Paste the clipboard's contents into the current " @@ -341,7 +342,8 @@ class MainWindow(QMainWindow): self._separator_act = QAction(self) self._separator_act.setSeparator(True) - self._about_act = QAction("&About", self, + icon = QIcon.fromTheme(QIcon.ThemeIcon.HelpAbout) + self._about_act = QAction(icon, "&About", self, statusTip="Show the application's About box", triggered=self.about) |