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

Method __init__

QPushButton/RotateButton.py:49–59  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

47 DURATION = 540 # 动画完成总时间
48
49 def __init__(self, *args, **kwargs):
50 super(RotateButton, self).__init__(*args, **kwargs)
51 self.setCursor(Qt.PointingHandCursor)
52 self._angle = 0 # 角度
53 self._padding = 10 # 阴影边距
54 self._image = "" # 图片路径
55 self._shadowColor = QColor(33, 33, 33) # 阴影颜色
56 self._pixmap = None # 图片对象
57 # 属性动画
58 self._animation = QPropertyAnimation(self, b"angle", self)
59 self._animation.setLoopCount(1) # 只循环一次
60
61 def paintEvent(self, event):
62 """绘制事件"""

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected