(self, url: str, label: str)
| 571 | self.placing_started.emit() |
| 572 | |
| 573 | def start_hyperlink_placement(self, url: str, label: str): |
| 574 | from .config import ( |
| 575 | HYPERLINK_FONT_FAMILY, HYPERLINK_FONT_SIZE, |
| 576 | HYPERLINK_COLOR, HYPERLINK_UNDERLINE, |
| 577 | ) |
| 578 | from PySide6.QtGui import QFont, QBrush |
| 579 | self._end_wire(commit=False) |
| 580 | self._cancel_placement() |
| 581 | self._hyperlink_pending = (url, label) |
| 582 | display = label or url or "hyperlink" |
| 583 | ghost = QGraphicsSimpleTextItem(display[:50]) |
| 584 | font = QFont(HYPERLINK_FONT_FAMILY, HYPERLINK_FONT_SIZE) |
| 585 | font.setUnderline(HYPERLINK_UNDERLINE) |
| 586 | ghost.setFont(font) |
| 587 | ghost.setBrush(QBrush(HYPERLINK_COLOR)) |
| 588 | ghost.setOpacity(0.5) |
| 589 | ghost.setAcceptedMouseButtons(Qt.NoButton) |
| 590 | self._ghost = ghost |
| 591 | self._ghost.setPos(QPointF(-9999, -9999)) |
| 592 | self.addItem(self._ghost) |
| 593 | self._mode = _Mode.PLACING_HYPERLINK |
| 594 | self.placing_started.emit() |
| 595 | |
| 596 | def start_command_placement(self): |
| 597 | self._end_wire(commit=False) |
no test coverage detected