Fix QGraphicsItem.scale monkey patch for Qt5

Preserve the QGraphicsItem.scale() -> float overload behaviour
This commit is contained in:
Ales Erjavec 2016-02-22 11:19:24 +01:00
parent 5388d52928
commit 167bcbb7aa

View File

@ -150,10 +150,18 @@ elif QT_LIB == PYQT5:
pass
# Re-implement deprecated APIs
def scale(self, sx, sy):
tr = self.transform()
tr.scale(sx, sy)
self.setTransform(tr)
__QGraphicsItem_scale = QtWidgets.QGraphicsItem.scale
def scale(self, *args):
if args:
sx, sy = args
tr = self.transform()
tr.scale(sx, sy)
self.setTransform(tr)
else:
return __QGraphicsItem_scale(self)
QtWidgets.QGraphicsItem.scale = scale
def rotate(self, angle):