aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-03-13 21:53:16 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-03-14 10:03:30 +0100
commitb33d8e3ff47c5027d0147f74c35c7e4b4f874ca5 (patch)
treeb468edd7143ab877445570326731bb76f5aecfba
parentfefb8237fc87512ade55381e3af990b8478f0863 (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>
-rw-r--r--examples/demos/documentviewer/jsonviewer/jsonviewer.py4
-rw-r--r--examples/demos/documentviewer/pdfviewer/pdfviewer.py8
-rw-r--r--examples/demos/documentviewer/txtviewer/txtviewer.py6
-rw-r--r--examples/multimedia/player/player.py17
-rw-r--r--examples/scriptableapplication/mainwindow.cpp6
-rw-r--r--examples/widgets/mainwindows/application/application.py18
-rw-r--r--examples/widgets/mainwindows/mdi/mdi.py18
-rw-r--r--examples/widgets/richtext/textedit/textedit.py41
8 files changed, 66 insertions, 52 deletions
diff --git a/examples/demos/documentviewer/jsonviewer/jsonviewer.py b/examples/demos/documentviewer/jsonviewer/jsonviewer.py
index d582edd09..1e5a34ca0 100644
--- a/examples/demos/documentviewer/jsonviewer/jsonviewer.py
+++ b/examples/demos/documentviewer/jsonviewer/jsonviewer.py
@@ -184,13 +184,13 @@ class JsonViewer(AbstractViewer):
menu = self.addMenu("Json")
tb = self.addToolBar("Json Actions")
- zoomInIcon = QIcon.fromTheme("zoom-in")
+ zoomInIcon = QIcon.fromTheme(QIcon.ThemeIcon.ZoomIn)
a = menu.addAction(zoomInIcon, "&+Expand all", self._tree.expandAll)
tb.addAction(a)
a.setPriority(QAction.LowPriority)
a.setShortcut(QKeySequence.New)
- zoomOutIcon = QIcon.fromTheme("zoom-out")
+ zoomOutIcon = QIcon.fromTheme(QIcon.ThemeIcon.ZoomOut)
a = menu.addAction(zoomOutIcon, "&-Collapse all", self._tree.collapseAll)
tb.addAction(a)
a.setPriority(QAction.LowPriority)
diff --git a/examples/demos/documentviewer/pdfviewer/pdfviewer.py b/examples/demos/documentviewer/pdfviewer/pdfviewer.py
index 63d25bf70..d5695e4d0 100644
--- a/examples/demos/documentviewer/pdfviewer/pdfviewer.py
+++ b/examples/demos/documentviewer/pdfviewer/pdfviewer.py
@@ -62,13 +62,17 @@ class PdfViewer(AbstractViewer):
actionZoomIn = self._toolBar.addAction("Zoom in")
actionZoomIn.setToolTip("Increase zoom level")
- actionZoomIn.setIcon(QIcon(":/demos/documentviewer/images/zoom-in.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.ZoomIn,
+ QIcon(":/demos/documentviewer/images/zoom-in.png"))
+ actionZoomIn.setIcon(icon)
self._toolBar.addAction(actionZoomIn)
actionZoomIn.triggered.connect(self.onActionZoomInTriggered)
actionZoomOut = self._toolBar.addAction("Zoom out")
actionZoomOut.setToolTip("Decrease zoom level")
- actionZoomOut.setIcon(QIcon(":/demos/documentviewer/images/zoom-out.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.ZoomIn,
+ QIcon(":/demos/documentviewer/images/zoom-out.png"))
+ actionZoomOut.setIcon(icon)
self._toolBar.addAction(actionZoomOut)
actionZoomOut.triggered.connect(self.onActionZoomOutTriggered)
diff --git a/examples/demos/documentviewer/txtviewer/txtviewer.py b/examples/demos/documentviewer/txtviewer/txtviewer.py
index 27f81ecb7..ef5a38fcd 100644
--- a/examples/demos/documentviewer/txtviewer/txtviewer.py
+++ b/examples/demos/documentviewer/txtviewer/txtviewer.py
@@ -28,7 +28,7 @@ class TxtViewer(AbstractViewer):
def setupTxtUi(self):
editMenu = self.addMenu("Edit")
editToolBar = self.addToolBar("Edit")
- cutIcon = QIcon.fromTheme("edit-cut",
+ cutIcon = QIcon.fromTheme(QIcon.ThemeIcon.EditCut,
QIcon(":/demos/documentviewer/images/cut.png"))
cutAct = QAction(cutIcon, "Cut", self)
cutAct.setShortcuts(QKeySequence.Cut)
@@ -37,7 +37,7 @@ class TxtViewer(AbstractViewer):
editMenu.addAction(cutAct)
editToolBar.addAction(cutAct)
- copyIcon = QIcon.fromTheme("edit-copy",
+ copyIcon = QIcon.fromTheme(QIcon.ThemeIcon.EditCopy,
QIcon(":/demos/documentviewer/images/copy.png"))
copyAct = QAction(copyIcon, "Copy", self)
copyAct.setShortcuts(QKeySequence.Copy)
@@ -46,7 +46,7 @@ class TxtViewer(AbstractViewer):
editMenu.addAction(copyAct)
editToolBar.addAction(copyAct)
- pasteIcon = QIcon.fromTheme("edit-paste",
+ pasteIcon = QIcon.fromTheme(QIcon.ThemeIcon.EditPaste,
QIcon(":/demos/documentviewer/images/paste.png"))
pasteAct = QAction(pasteIcon, "Paste", self)
pasteAct.setShortcuts(QKeySequence.Paste)
diff --git a/examples/multimedia/player/player.py b/examples/multimedia/player/player.py
index 4731386ad..d28f2887e 100644
--- a/examples/multimedia/player/player.py
+++ b/examples/multimedia/player/player.py
@@ -44,43 +44,43 @@ class MainWindow(QMainWindow):
self.addToolBar(tool_bar)
file_menu = self.menuBar().addMenu("&File")
- icon = QIcon.fromTheme("document-open")
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentOpen)
open_action = QAction(icon, "&Open...", self,
shortcut=QKeySequence.Open, triggered=self.open)
file_menu.addAction(open_action)
tool_bar.addAction(open_action)
- icon = QIcon.fromTheme("application-exit")
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.ApplicationExit)
exit_action = QAction(icon, "E&xit", self,
shortcut="Ctrl+Q", triggered=self.close)
file_menu.addAction(exit_action)
play_menu = self.menuBar().addMenu("&Play")
style = self.style()
- icon = QIcon.fromTheme("media-playback-start.png",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStart,
style.standardIcon(QStyle.SP_MediaPlay))
self._play_action = tool_bar.addAction(icon, "Play")
self._play_action.triggered.connect(self._player.play)
play_menu.addAction(self._play_action)
- icon = QIcon.fromTheme("media-skip-backward-symbolic.svg",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaSkipBackward,
style.standardIcon(QStyle.SP_MediaSkipBackward))
self._previous_action = tool_bar.addAction(icon, "Previous")
self._previous_action.triggered.connect(self.previous_clicked)
play_menu.addAction(self._previous_action)
- icon = QIcon.fromTheme("media-playback-pause.png",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackPause,
style.standardIcon(QStyle.SP_MediaPause))
self._pause_action = tool_bar.addAction(icon, "Pause")
self._pause_action.triggered.connect(self._player.pause)
play_menu.addAction(self._pause_action)
- icon = QIcon.fromTheme("media-skip-forward-symbolic.svg",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaSkipForward,
style.standardIcon(QStyle.SP_MediaSkipForward))
self._next_action = tool_bar.addAction(icon, "Next")
self._next_action.triggered.connect(self.next_clicked)
play_menu.addAction(self._next_action)
- icon = QIcon.fromTheme("media-playback-stop.png",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStop,
style.standardIcon(QStyle.SP_MediaStop))
self._stop_action = tool_bar.addAction(icon, "Stop")
self._stop_action.triggered.connect(self._ensure_stopped)
@@ -99,8 +99,9 @@ class MainWindow(QMainWindow):
self._volume_slider.valueChanged.connect(self._audio_output.setVolume)
tool_bar.addWidget(self._volume_slider)
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.HelpAbout)
about_menu = self.menuBar().addMenu("&About")
- about_qt_act = QAction("About &Qt", self, triggered=qApp.aboutQt) # noqa: F821
+ about_qt_act = QAction(icon, "About &Qt", self, triggered=qApp.aboutQt) # noqa: F821
about_menu.addAction(about_qt_act)
self._video_widget = QVideoWidget()
diff --git a/examples/scriptableapplication/mainwindow.cpp b/examples/scriptableapplication/mainwindow.cpp
index 26d80a7de..ece7989e7 100644
--- a/examples/scriptableapplication/mainwindow.cpp
+++ b/examples/scriptableapplication/mainwindow.cpp
@@ -41,18 +41,18 @@ MainWindow::MainWindow()
diagnosticAction->setShortcut(Qt::CTRL | Qt::Key_D);
fileMenu->addAction(tr("&Invoke testFunction1()"),
this, &MainWindow::testFunction1);
- const QIcon quitIcon = QIcon::fromTheme("application-exit"_L1);
+ const QIcon quitIcon = QIcon::fromTheme(QIcon::ThemeIcon::ApplicationExit);
auto *quitAction = fileMenu->addAction(quitIcon, tr("&Quit"),
qApp, &QCoreApplication::quit);
quitAction->setShortcut(Qt::CTRL | Qt::Key_Q);
auto *editMenu = menuBar()->addMenu(tr("&Edit"));
- const QIcon clearIcon = QIcon::fromTheme("edit-clear"_L1);
+ const QIcon clearIcon = QIcon::fromTheme(QIcon::ThemeIcon::EditClear);
auto *clearAction = editMenu->addAction(clearIcon, tr("&Clear"),
m_scriptEdit, &QPlainTextEdit::clear);
auto *helpMenu = menuBar()->addMenu(tr("&Help"));
- const QIcon aboutIcon = QIcon::fromTheme("help-about"_L1);
+ const QIcon aboutIcon = QIcon::fromTheme(QIcon::ThemeIcon::HelpAbout);
auto *aboutAction = helpMenu->addAction(aboutIcon, tr("&About Qt"),
qApp, &QApplication::aboutQt);
diff --git a/examples/widgets/mainwindows/application/application.py b/examples/widgets/mainwindows/application/application.py
index 7b2fa0672..f69eade2e 100644
--- a/examples/widgets/mainwindows/application/application.py
+++ b/examples/widgets/mainwindows/application/application.py
@@ -82,16 +82,16 @@ class MainWindow(QMainWindow):
self.setWindowModified(self._text_edit.document().isModified())
def create_actions(self):
- icon = QIcon.fromTheme("document-new", QIcon(':/images/new.png'))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentNew, QIcon(':/images/new.png'))
self._new_act = QAction(icon, "&New", self, shortcut=QKeySequence.New,
statusTip="Create a new file", triggered=self.new_file)
- icon = QIcon.fromTheme("document-open", QIcon(':/images/open.png'))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentOpen, QIcon(':/images/open.png'))
self._open_act = QAction(icon, "&Open...", self,
shortcut=QKeySequence.Open, statusTip="Open an existing file",
triggered=self.open)
- icon = QIcon.fromTheme("document-save", QIcon(':/images/save.png'))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentSave, QIcon(':/images/save.png'))
self._save_act = QAction(icon, "&Save", self,
shortcut=QKeySequence.Save,
statusTip="Save the document to disk", triggered=self.save)
@@ -101,28 +101,30 @@ class MainWindow(QMainWindow):
statusTip="Save the document under a new name",
triggered=self.save_as)
- self._exit_act = QAction("E&xit", self, shortcut="Ctrl+Q",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.ApplicationExit)
+ self._exit_act = QAction(icon, "E&xit", self, shortcut="Ctrl+Q",
statusTip="Exit the application", triggered=self.close)
- icon = QIcon.fromTheme("edit-cut", QIcon(':/images/cut.png'))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditCut, QIcon(':/images/cut.png'))
self._cut_act = QAction(icon, "Cu&t", self, shortcut=QKeySequence.Cut,
statusTip="Cut the current selection's contents to the clipboard",
triggered=self._text_edit.cut)
- icon = QIcon.fromTheme("edit-copy", QIcon(':/images/copy.png'))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditCopy, QIcon(':/images/copy.png'))
self._copy_act = QAction(icon, "&Copy",
self, shortcut=QKeySequence.Copy,
statusTip="Copy the current selection's contents to the clipboard",
triggered=self._text_edit.copy)
- icon = QIcon.fromTheme("edit-paste", QIcon(':/images/paste.png'))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditPaste, QIcon(':/images/paste.png'))
self._paste_act = QAction(icon, "&Paste",
self, shortcut=QKeySequence.Paste,
statusTip="Paste the clipboard's contents into the current "
"selection",
triggered=self._text_edit.paste)
- 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)
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)
diff --git a/examples/widgets/richtext/textedit/textedit.py b/examples/widgets/richtext/textedit/textedit.py
index a3940ae0f..8019446f0 100644
--- a/examples/widgets/richtext/textedit/textedit.py
+++ b/examples/widgets/richtext/textedit/textedit.py
@@ -101,13 +101,14 @@ class TextEdit(QMainWindow):
tb = self.addToolBar("File self.actions")
menu = self.menuBar().addMenu("&File")
- icon = QIcon.fromTheme("document-new", QIcon(RSRC_PATH + "/filenew.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentNew,
+ QIcon(RSRC_PATH + "/filenew.png"))
a = menu.addAction(icon, "&New", self.file_new)
tb.addAction(a)
a.setPriority(QAction.LowPriority)
a.setShortcut(QKeySequence.New)
- icon = QIcon.fromTheme("document-open",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentOpen,
QIcon(RSRC_PATH + "/fileopen.png"))
a = menu.addAction(icon, "&Open...", self.file_open)
a.setShortcut(QKeySequence.Open)
@@ -115,7 +116,7 @@ class TextEdit(QMainWindow):
menu.addSeparator()
- icon = QIcon.fromTheme("document-save",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentSave,
QIcon(RSRC_PATH + "/filesave.png"))
self._action_save = menu.addAction(icon, "&Save", self.file_save)
self._action_save.setShortcut(QKeySequence.Save)
@@ -126,7 +127,7 @@ class TextEdit(QMainWindow):
a.setPriority(QAction.LowPriority)
menu.addSeparator()
- icon = QIcon.fromTheme("document-print",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.DocumentPrint,
QIcon(RSRC_PATH + "/fileprint.png"))
a = menu.addAction(icon, "&Print...", self.file_print)
a.setPriority(QAction.LowPriority)
@@ -151,32 +152,36 @@ class TextEdit(QMainWindow):
tb = self.addToolBar("Edit self.actions")
menu = self.menuBar().addMenu("&Edit")
- icon = QIcon.fromTheme("edit-undo",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditUndo,
QIcon(RSRC_PATH + "/editundo.png"))
self._action_undo = menu.addAction(icon, "&Undo", self._text_edit.undo)
self._action_undo.setShortcut(QKeySequence.Undo)
tb.addAction(self._action_undo)
- icon = QIcon.fromTheme("edit-redo", QIcon(RSRC_PATH + "/editredo.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditRedo,
+ QIcon(RSRC_PATH + "/editredo.png"))
self._action_redo = menu.addAction(icon, "&Redo", self._text_edit.redo)
self._action_redo.setPriority(QAction.LowPriority)
self._action_redo.setShortcut(QKeySequence.Redo)
tb.addAction(self._action_redo)
menu.addSeparator()
- icon = QIcon.fromTheme("edit-cut", QIcon(RSRC_PATH + "/editcut.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditCut,
+ QIcon(RSRC_PATH + "/editcut.png"))
self._action_cut = menu.addAction(icon, "Cu&t", self._text_edit.cut)
self._action_cut.setPriority(QAction.LowPriority)
self._action_cut.setShortcut(QKeySequence.Cut)
tb.addAction(self._action_cut)
- icon = QIcon.fromTheme("edit-copy", QIcon(RSRC_PATH + "/editcopy.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditCopy,
+ QIcon(RSRC_PATH + "/editcopy.png"))
self._action_copy = menu.addAction(icon, "&Copy", self._text_edit.copy)
self._action_copy.setPriority(QAction.LowPriority)
self._action_copy.setShortcut(QKeySequence.Copy)
tb.addAction(self._action_copy)
- icon = QIcon.fromTheme("edit-paste", QIcon(RSRC_PATH + "/editpaste.png"))
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.EditPaste,
+ QIcon(RSRC_PATH + "/editpaste.png"))
self._action_paste = menu.addAction(icon, "&Paste", self._text_edit.paste)
self._action_paste.setPriority(QAction.LowPriority)
self._action_paste.setShortcut(QKeySequence.Paste)
@@ -190,7 +195,7 @@ class TextEdit(QMainWindow):
tb = self.addToolBar("Format self.actions")
menu = self.menuBar().addMenu("F&ormat")
- icon = QIcon.fromTheme("format-text-bold",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatTextBold,
QIcon(RSRC_PATH + "/textbold.png"))
self._action_text_bold = menu.addAction(icon, "&Bold", self.text_bold)
self._action_text_bold.setShortcut(Qt.CTRL | Qt.Key_B)
@@ -201,7 +206,7 @@ class TextEdit(QMainWindow):
tb.addAction(self._action_text_bold)
self._action_text_bold.setCheckable(True)
- icon = QIcon.fromTheme("format-text-italic",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatTextItalic,
QIcon(RSRC_PATH + "/textitalic.png"))
self._action_text_italic = menu.addAction(icon, "&Italic", self.text_italic)
self._action_text_italic.setPriority(QAction.LowPriority)
@@ -212,7 +217,7 @@ class TextEdit(QMainWindow):
tb.addAction(self._action_text_italic)
self._action_text_italic.setCheckable(True)
- icon = QIcon.fromTheme("format-text-underline",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatTextUnderline,
QIcon(RSRC_PATH + "/textunder.png"))
self._action_text_underline = menu.addAction(icon, "&Underline",
self.text_underline)
@@ -226,36 +231,36 @@ class TextEdit(QMainWindow):
menu.addSeparator()
- icon = QIcon.fromTheme("format-justify-left",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatJustifyLeft,
QIcon(RSRC_PATH + "/textleft.png"))
self._action_align_left = QAction(icon, "&Left", self)
self._action_align_left.setShortcut(Qt.CTRL | Qt.Key_L)
self._action_align_left.setCheckable(True)
self._action_align_left.setPriority(QAction.LowPriority)
- icon = QIcon.fromTheme("format-justify-center",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatJustifyCenter,
QIcon(RSRC_PATH + "/textcenter.png"))
self._action_align_center = QAction(icon, "C&enter", self)
self._action_align_center.setShortcut(Qt.CTRL | Qt.Key_E)
self._action_align_center.setCheckable(True)
self._action_align_center.setPriority(QAction.LowPriority)
- icon = QIcon.fromTheme("format-justify-right",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatJustifyRight,
QIcon(RSRC_PATH + "/textright.png"))
self._action_align_right = QAction(icon, "&Right", self)
self._action_align_right.setShortcut(Qt.CTRL | Qt.Key_R)
self._action_align_right.setCheckable(True)
self._action_align_right.setPriority(QAction.LowPriority)
- icon = QIcon.fromTheme("format-justify-fill",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatJustifyFill,
QIcon(RSRC_PATH + "/textjustify.png"))
self._action_align_justify = QAction(icon, "&Justify", self)
self._action_align_justify.setShortcut(Qt.CTRL | Qt.Key_J)
self._action_align_justify.setCheckable(True)
self._action_align_justify.setPriority(QAction.LowPriority)
- icon = QIcon.fromTheme("format-indent-more",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatIndentMore,
QIcon(RSRC_PATH + "/format-indent-more.png"))
self._action_indent_more = menu.addAction(icon, "&Indent", self.indent)
self._action_indent_more.setShortcut(Qt.CTRL | Qt.Key_BracketRight)
self._action_indent_more.setPriority(QAction.LowPriority)
- icon = QIcon.fromTheme("format-indent-less",
+ icon = QIcon.fromTheme(QIcon.ThemeIcon.FormatIndentLess,
QIcon(RSRC_PATH + "/format-indent-less.png"))
self._action_indent_less = menu.addAction(icon, "&Unindent",
self.unindent)