(self)
| 27 | class ScrollArea(QScrollArea): |
| 28 | |
| 29 | def __init__(self): |
| 30 | super(ScrollArea, self).__init__() |
| 31 | self.setWindowTitle("FontAwesome Fonts") |
| 32 | self.window = QWidget(self) |
| 33 | self.setWidget(self.window) |
| 34 | |
| 35 | layout = QGridLayout(self.window) |
| 36 | fonts = list(FontAwesomes.alls().items()) # 786个 131*6 |
| 37 | print(fonts) |
| 38 | |
| 39 | for row in range(131): |
| 40 | for col in range(6): |
| 41 | # print(row, col, row * 6 + col) |
| 42 | layout.addWidget(QPushButton( |
| 43 | ": ".join(fonts[row * 6 + col]), |
| 44 | self.window, |
| 45 | minimumHeight=33, |
| 46 | font=QFont("FontAwesome", 14)), |
| 47 | row, col, 1, 1) |
| 48 | |
| 49 | self.showMaximized() |
| 50 | |
| 51 | def resizeEvent(self, event): |
| 52 | super(ScrollArea, self).resizeEvent(event) |
nothing calls this directly
no test coverage detected