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

Method __init__

SLiCAP/schematic/palette.py:20–33  ·  view source on GitHub ↗
(self, library: SymbolLibrary, parent=None)

Source from the content-addressed store, hash-verified

18 symbol_selected = Signal(str)
19
20 def __init__(self, library: SymbolLibrary, parent=None):
21 super().__init__(parent)
22 self.setViewMode(QListView.IconMode)
23 self.setIconSize(QSize(_ICON_PX, _ICON_PX))
24 self.setGridSize(QSize(_GRID_PX, _GRID_PX + 20))
25 self.setResizeMode(QListWidget.Adjust)
26 self.setWordWrap(True)
27 self.setSpacing(4)
28 self.setFixedWidth(200)
29
30 self._populate(library)
31 self.itemClicked.connect(
32 lambda item: self.symbol_selected.emit(item.data(Qt.UserRole))
33 )
34
35 def _populate(self, library: SymbolLibrary):
36 for name in library.names:

Callers

nothing calls this directly

Calls 1

_populateMethod · 0.95

Tested by

no test coverage detected