Created
March 5, 2025 13:56
-
-
Save cpascual/f042acdbc45cc666342b3f57da78aabf to your computer and use it in GitHub Desktop.
Catalog of theme icons in Qt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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