(self)
| 122 | # QTimer.singleShot(self._timeout, self.closeAnimation) |
| 123 | |
| 124 | def closeAnimation(self): |
| 125 | print("closeAnimation hasFocus", self.hasFocus()) |
| 126 | # 关闭动画 |
| 127 | if self.hasFocus(): |
| 128 | # 如果弹出后倒计时5秒后还有焦点存在则失去焦点后需要主动触发关闭 |
| 129 | self._timeouted = True |
| 130 | return # 如果有焦点则不关闭 |
| 131 | self.isShow = False |
| 132 | self.animation.stop() |
| 133 | self.animation.setStartValue(self.pos()) |
| 134 | self.animation.setEndValue(self._startPos) |
| 135 | self.animation.start() |
| 136 | |
| 137 | def onAnimationEnd(self): |
| 138 | # 动画结束 |