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

Method __init__

Widgets/Buttons/RotateButton.py:27–40  ·  view source on GitHub ↗
(self, *args, image='', **kwargs)

Source from the content-addressed store, hash-verified

25 DURATION = 540 # 动画完成总时间
26
27 def __init__(self, *args, image='', **kwargs):
28 super(RotateButton, self).__init__(*args, **kwargs)
29 self.setCursor(Qt.PointingHandCursor)
30 self._angle = 0 # 角度
31 self._padding = 10 # 阴影边距
32 self._image = '' # 图片路径
33 self._shadowColor = QColor(33, 33, 33) # 阴影颜色
34 self._pixmap = None # 图片对象
35 # 属性动画
36 self._animation = QPropertyAnimation(self, b'angle', self)
37 self._animation.setLoopCount(1) # 只循环一次
38 self.setPixmap(image)
39 # 绑定提示框
40 ToolTip.bind(self)
41
42 def paintEvent(self, event):
43 """绘制事件"""

Callers

nothing calls this directly

Calls 2

setPixmapMethod · 0.95
bindMethod · 0.80

Tested by

no test coverage detected