鼠标离开事件
(self, _)
| 91 | self._animation.start() |
| 92 | |
| 93 | def leaveEvent(self, _): |
| 94 | """鼠标离开事件""" |
| 95 | # 取消阴影 |
| 96 | self.setGraphicsEffect(None) |
| 97 | |
| 98 | # 旋转动画 |
| 99 | self._animation.stop() |
| 100 | cv = self._animation.currentValue() or self.ENDVALUE |
| 101 | self._animation.setDuration(int(cv / self.ENDVALUE * self.DURATION)) |
| 102 | self._animation.setStartValue(cv) |
| 103 | self._animation.setEndValue(self.STARTVALUE) |
| 104 | self._animation.start() |
| 105 | |
| 106 | def setPixmap(self, path): |
| 107 | if not os.path.exists(path): |