MCPcopy Create free account
hub / github.com/PyQt5/PyQtClient / enterEvent

Method enterEvent

Widgets/Buttons/RotateButton.py:73–91  ·  view source on GitHub ↗

鼠标进入事件

(self, _)

Source from the content-addressed store, hash-verified

71 super(RotateButton, self).paintEvent(event)
72
73 def enterEvent(self, _):
74 """鼠标进入事件"""
75 # 设置阴影
76 # 边框阴影效果
77 effect = QGraphicsDropShadowEffect(self)
78 effect.setBlurRadius(self._padding * 2)
79 effect.setOffset(0, 0)
80 effect.setColor(self._shadowColor)
81 self.setGraphicsEffect(effect)
82
83 # 开启旋转动画
84 self._animation.stop()
85 cv = self._animation.currentValue() or self.STARTVALUE
86 self._animation.setDuration(self.DURATION if cv ==
87 0 else int(cv / self.ENDVALUE *
88 self.DURATION))
89 self._animation.setStartValue(cv)
90 self._animation.setEndValue(self.ENDVALUE)
91 self._animation.start()
92
93 def leaveEvent(self, _):
94 """鼠标离开事件"""

Callers

nothing calls this directly

Calls 2

stopMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected