Still implementing
This commit is contained in:
31
icons.py
Normal file
31
icons.py
Normal file
@ -0,0 +1,31 @@
|
||||
import sys
|
||||
|
||||
from PySide6.QtWidgets import QApplication, QGridLayout, QPushButton, QStyle, QWidget
|
||||
|
||||
|
||||
class Window(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
icons = sorted(
|
||||
[attr for attr in dir(QStyle.StandardPixmap) if attr.startswith("SP_")]
|
||||
)
|
||||
layout = QGridLayout()
|
||||
|
||||
for n, name in enumerate(icons):
|
||||
btn = QPushButton(name)
|
||||
|
||||
pixmapi = getattr(QStyle, name)
|
||||
icon = self.style().standardIcon(pixmapi)
|
||||
btn.setIcon(icon)
|
||||
layout.addWidget(btn, n // 4, n % 4)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
w = Window()
|
||||
w.show()
|
||||
|
||||
app.exec()
|
||||
Reference in New Issue
Block a user