Are there default icons in PyQt/PySide?

What you need is Pyside QIcon.fromTheme function.
Basicaly it creates QIcon object with needed icon from current system theme.


undoicon = QIcon.fromTheme("edit-undo")

“edit undo” – name of the icon “type””function” can be found here

This works on X11 systems, for MacOSX and Windows check QIcon documentation

Edit Inserting this from the website, since last time it was a broken link.

static PySide.QtGui.QIcon.fromTheme(name[, fallback=QIcon()])


  • name – unicode
  • fallback – PySide.QtGui.QIcon

Return type:


Returns the PySide.QtGui.QIcon corresponding to name in the current icon theme. If no such icon is found in the current theme
fallback is returned instead.

The latest version of the freedesktop icon specification and naming specification can be obtained here:


To fetch an icon from the current icon theme:

undoicon = QIcon.fromTheme("edit-undo")

Or if you want to provide a guaranteed fallback for platforms that do not support theme icons, you can use the second argument:

undoicon = QIcon.fromTheme("edit-undo", QIcon(":/undo.png"))


By default, only X11 will support themed icons. In order to use themed icons on Mac and Windows, you will have to bundle a compliant theme in one of your PySide.QtGui.QIcon.themeSearchPaths() and set the appropriate PySide.QtGui.QIcon.themeName() .

See also

  • PySide.QtGui.QIcon.themeName()
  • PySide.QtGui.QIcon.setThemeName()
  • PySide.QtGui.QIcon.themeSearchPaths()

Leave a Comment