此代码http://pastebin.com/XGWDyRd1
在场景上绘制一个矩形。 当我移动它时,它不移动光标,并跳到某处。 我做错了什么?
答案 0 :(得分:0)
错字
class MyRect(QtGui.QGraphicsRectItem):
def mousePressEvent(self, event):
print 'press event'
super(MyRect, self).mousePressEvent(event)
def mouseReleaseEvent(self, event):
print 'press release'
super(MyRect, self).mouseReleaseEvent(event)