(self, parent=None)
| 4 | |
| 5 | class TooltipPopup(QWidget): |
| 6 | def __init__(self, parent=None): |
| 7 | super().__init__(parent, Qt.Window | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) |
| 8 | self.setFocusPolicy(Qt.StrongFocus) |
| 9 | self.setWindowTitle("Tooltip Popup") |
| 10 | |
| 11 | layout = QVBoxLayout() |
| 12 | label = QLabel("This is a tooltip-style popup. Press ESC to close.") |
| 13 | layout.addWidget(label) |
| 14 | |
| 15 | self.setLayout(layout) |
| 16 | self.adjustSize() |
| 17 | |
| 18 | def keyPressEvent(self, event): |
| 19 | # This causes the fake tooltip to be closed when you hit Esc |
nothing calls this directly
no test coverage detected