(self, library: SymbolLibrary)
| 33 | ) |
| 34 | |
| 35 | def _populate(self, library: SymbolLibrary): |
| 36 | for name in library.names: |
| 37 | svg = library.svg_bytes(name) |
| 38 | if svg is None: |
| 39 | continue |
| 40 | item_icon = _render_icon(svg, _ICON_PX) |
| 41 | from PySide6.QtWidgets import QListWidgetItem |
| 42 | item = QListWidgetItem(item_icon, name) |
| 43 | item.setData(Qt.UserRole, name) |
| 44 | item.setTextAlignment(Qt.AlignHCenter | Qt.AlignBottom) |
| 45 | self.addItem(item) |
| 46 | |
| 47 | |
| 48 | def _render_icon(svg_bytes: bytes, size: int) -> QIcon: |
no test coverage detected