鼠标进入事件
(self, _)
| 90 | super(RotateButton, self).paintEvent(event) |
| 91 | |
| 92 | def enterEvent(self, _): |
| 93 | """鼠标进入事件""" |
| 94 | # 设置阴影 |
| 95 | # 边框阴影效果 |
| 96 | effect = QGraphicsDropShadowEffect(self) |
| 97 | effect.setBlurRadius(self._padding * 2) |
| 98 | effect.setOffset(0, 0) |
| 99 | effect.setColor(self._shadowColor) |
| 100 | self.setGraphicsEffect(effect) |
| 101 | |
| 102 | # 开启旋转动画 |
| 103 | self._animation.stop() |
| 104 | cv = self._animation.currentValue() or self.STARTVALUE |
| 105 | self._animation.setDuration( |
| 106 | self.DURATION if cv == 0 else int(cv / self.ENDVALUE * self.DURATION) |
| 107 | ) |
| 108 | self._animation.setStartValue(cv) |
| 109 | self._animation.setEndValue(self.ENDVALUE) |
| 110 | self._animation.start() |
| 111 | |
| 112 | def leaveEvent(self, _): |
| 113 | """鼠标离开事件""" |
nothing calls this directly
no test coverage detected