开发者

PySide Error - QPaintDevice: Cannot destroy paint device that is being painted

I'm baffled by this one. I tried moving the QPainter to it's own def as some have suggested, but it gives the exact same error. Here's the def I created.

def PaintButtons(self):
    solid = QtGui.QPixmap(200, 32)
    paint = QtGui.QPainter()
    paint.begin(solid)
  开发者_如何学C  paint.setPen(QtGui.Qcolor(255,255,255))
    paint.setBrush(QtGui.QColor(255, 0, 0))
    paint.drawRect(0, 0, 200, 32)
    paint.end()


It was just a typo. You're using Qcolor (the first occurrence).
Changing that to QColor will do the trick. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜