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

Method start_text_placement

SLiCAP/schematic/canvas.py:555–571  ·  view source on GitHub ↗
(self, text: str = "Text")

Source from the content-addressed store, hash-verified

553 self.placing_started.emit()
554
555 def start_text_placement(self, text: str = "Text"):
556 from .config import TEXT_FONT, TEXT_COLOR
557 from PySide6.QtGui import QBrush
558 self._end_wire(commit=False)
559 self._cancel_placement()
560 self._placing_text = text
561 first_line = (text.split('\n')[0] or "Text")[:50]
562 ghost = QGraphicsSimpleTextItem(first_line)
563 ghost.setFont(TEXT_FONT)
564 ghost.setBrush(QBrush(TEXT_COLOR))
565 ghost.setOpacity(0.4)
566 ghost.setAcceptedMouseButtons(Qt.NoButton)
567 self._ghost = ghost
568 self._ghost.setPos(QPointF(-9999, -9999))
569 self.addItem(self._ghost)
570 self._mode = _Mode.PLACING_TEXT
571 self.placing_started.emit()
572
573 def start_hyperlink_placement(self, url: str, label: str):
574 from .config import (

Callers 1

_on_place_textMethod · 0.80

Calls 2

_end_wireMethod · 0.95
_cancel_placementMethod · 0.95

Tested by

no test coverage detected