提交 92c9ab01 编写于 作者: 之一Yo's avatar 之一Yo

修复头像组件类型转换问题

上级 860ee617
......@@ -23,7 +23,7 @@ class Demo(QWidget):
sizes = [96, 48, 32, 24]
for s in sizes:
w = AvatarWidget(avatar, self)
w.setRadius(s / 2)
w.setRadius(s // 2)
self.hBoxLayout.addWidget(w)
......
......@@ -382,7 +382,7 @@ class AvatarWidget(ImageLabel):
iw, ih = image.width(), image.height()
d = self.getRadius() * 2 * self.devicePixelRatioF()
x, y = (iw - d) / 2, (ih - d) / 2
image = image.copy(int(x), int(y), d, d)
image = image.copy(int(x), int(y), int(d), int(d))
# draw image
path = QPainterPath()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册