MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / __init__

Method __init__

SLiCAP/schematic/image_item.py:33–46  ·  view source on GitHub ↗
(self, file_path: str, display_width: int, display_height: int,
                 pos: QPointF = QPointF(0, 0))

Source from the content-addressed store, hash-verified

31 """
32
33 def __init__(self, file_path: str, display_width: int, display_height: int,
34 pos: QPointF = QPointF(0, 0)):
35 super().__init__()
36 self.file_path: str = file_path
37 self.display_width: int = display_width
38 self.display_height: int = display_height
39 self.setPos(pos)
40 self.setFlag(QGraphicsItem.ItemIsSelectable)
41 self.setFlag(QGraphicsItem.ItemIsMovable)
42 self.setFlag(QGraphicsItem.ItemSendsGeometryChanges)
43 self._renderer = None # QSvgRenderer for SVG files
44 self._pixmap: QPixmap | None = None # QPixmap for raster / PDF
45 _live_image_items.add(self)
46 self._load()
47
48 def rescale(self, ratio: float) -> None:
49 self.prepareGeometryChange()

Callers

nothing calls this directly

Calls 1

_loadMethod · 0.95

Tested by

no test coverage detected