链接标签组件
| 76 | |
| 77 | |
| 78 | class LinkLabel(QLabel): |
| 79 | """链接标签组件""" |
| 80 | |
| 81 | clicked = pyqtSignal() |
| 82 | |
| 83 | def __init__(self, text: str, parent=None): |
| 84 | super().__init__(text, parent) |
| 85 | self.setFont(get_default_font(10)) |
| 86 | self.setProperty("class", "link") |
| 87 | self.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) |
| 88 | |
| 89 | def mousePressEvent(self, event): |
| 90 | """鼠标点击事件""" |
| 91 | if event.button() == Qt.MouseButton.LeftButton: |
| 92 | self.clicked.emit() |
| 93 | super().mousePressEvent(event) |
| 94 | |
| 95 | |
| 96 | class WarningFrame(QFrame): |
no outgoing calls
no test coverage detected