MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _populate

Method _populate

SLiCAP/schematic/palette.py:35–45  ·  view source on GitHub ↗
(self, library: SymbolLibrary)

Source from the content-addressed store, hash-verified

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
48def _render_icon(svg_bytes: bytes, size: int) -> QIcon:

Callers 1

__init__Method · 0.95

Calls 2

_render_iconFunction · 0.85
svg_bytesMethod · 0.45

Tested by

no test coverage detected