pyuic6 can't handle ThemeIcon enum

JakobDev jakobdev at gmx.de
Thu Apr 10 18:29:25 BST 2025


Hi,

pyuic6 can't handle the ThemeIcon enum from QIcon.

I have attached 2 files: A ui file which contains a button with a save
icon and the compiled Python file.

As you can see, the compiled Python file contains this line:

icon = QtGui.QIcon.fromTheme("QIcon::ThemeIcon::DocumentSave")

which causes the button to not have an icon. The correct line would be:

icon = QtGui.QIcon.fromTheme(QtGui.QIcon.ThemeIcon.DocumentSave)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ui
Type: application/x-designer
Size: 743 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250410/be75f895/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 1007 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250410/be75f895/attachment.py>


More information about the PyQt mailing list