Skip to content

Instantly share code, notes, and snippets.

@cpascual
Created March 5, 2025 13:56
Show Gist options
  • Save cpascual/f042acdbc45cc666342b3f57da78aabf to your computer and use it in GitHub Desktop.
Save cpascual/f042acdbc45cc666342b3f57da78aabf to your computer and use it in GitHub Desktop.
Catalog of theme icons in Qt
import sys
from PySide6.QtWidgets import (
QWidget,
QApplication,
QGridLayout,
QToolButton,
)
from PySide6.QtGui import QIcon
class IconCatalog(QWidget):
COLS = 16
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setLayout(QGridLayout())
for i, a in enumerate(QIcon.ThemeIcon):
row = i // self.COLS
col = i % self.COLS
button = QToolButton()
button.setToolTip(str(a))
button.setIcon(QIcon.fromTheme(a))
self.layout().addWidget(button, row, col)
def main():
app = QApplication(sys.argv)
w = IconCatalog()
w.show()
app.exec()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment