(self, text: str = "Text")
| 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 ( |
no test coverage detected