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

Method paintEvent

SLiCAP/schematic/place_subcircuit_dialog.py:52–67  ·  view source on GitHub ↗
(self, _ev)

Source from the content-addressed store, hash-verified

50 self.update()
51
52 def paintEvent(self, _ev) -> None:
53 p = QPainter(self)
54 p.fillRect(self.rect(), Qt.white)
55 if self._sym is None:
56 return
57 p.setRenderHint(QPainter.Antialiasing)
58 renderer = QSvgRenderer(QByteArray(_apply_symbol_colors(self._sym.svg)))
59 vb = renderer.viewBoxF()
60 scale = min(self.width() / vb.width(), self.height() / vb.height()) * 0.7
61 p.translate(self.width() / 2, self.height() / 2)
62 p.scale(scale, scale)
63 p.translate(-vb.center().x(), -vb.center().y())
64 renderer.render(p, vb)
65 if self._sym.show_pinnames:
66 draw_subckt_pin_names(p, self._sym.nodes, self._sym.pins)
67 p.end()
68
69
70class PlaceSubcircuitDialog(QDialog):

Callers

nothing calls this directly

Calls 2

_apply_symbol_colorsFunction · 0.85
draw_subckt_pin_namesFunction · 0.85

Tested by

no test coverage detected