Skip to content

Instantly share code, notes, and snippets.

@5j9
Created August 15, 2025 17:28
Show Gist options
  • Select an option

  • Save 5j9/6f01384fbb3e378283f6b529d03b1450 to your computer and use it in GitHub Desktop.

Select an option

Save 5j9/6f01384fbb3e378283f6b529d03b1450 to your computer and use it in GitHub Desktop.
PyQt6 List of Standard Icons
# A fork of https://joekuan.wordpress.com/2015/09/23/list-of-qt-icons/
# Modified to work with PyQt6 and also avoids using a hardcoded list.
# of icons.
from PyQt6.QtWidgets import (
QApplication,
QGridLayout,
QPushButton,
QStyle,
QWidget,
)
class Widget(QWidget):
def __init__(self, parent=None):
super().__init__()
colSize = 4
layout = QGridLayout()
count = 0
for icon in QStyle.StandardPixmap:
btn = QPushButton(icon.name)
style = self.style()
assert style is not None
btn.setIcon(style.standardIcon(icon))
layout.addWidget(btn, count // colSize, count % colSize)
count += 1
self.setLayout(layout)
if __name__ == '__main__':
app = QApplication([])
dialog = Widget()
dialog.show()
app.exec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment