()
| 33 | if not hasattr(self, '_tip'): |
| 34 | |
| 35 | def test(): |
| 36 | self._tip = ToolTip() |
| 37 | self._tip.setText('底部居中提示') |
| 38 | self._tip.show() |
| 39 | self._tip.move( |
| 40 | self.pos().x() + int( |
| 41 | (self.width() - self._tip.width()) / 2), |
| 42 | self.pos().y() + self.height() - 20, |
| 43 | ) |
| 44 | self._tip._hideTimer.timeout.connect(self._tip.close) |
| 45 | self._tip._hideTimer.start(2000) |
| 46 | |
| 47 | QTimer.singleShot(1000, test) |
| 48 |
no test coverage detected