Fix QGraphicsItem.scale monkey patch for Qt5
Preserve the QGraphicsItem.scale() -> float overload behaviour
This commit is contained in:
parent
5388d52928
commit
167bcbb7aa
@ -150,10 +150,18 @@ elif QT_LIB == PYQT5:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# Re-implement deprecated APIs
|
# Re-implement deprecated APIs
|
||||||
def scale(self, sx, sy):
|
|
||||||
tr = self.transform()
|
__QGraphicsItem_scale = QtWidgets.QGraphicsItem.scale
|
||||||
tr.scale(sx, sy)
|
|
||||||
self.setTransform(tr)
|
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
|
QtWidgets.QGraphicsItem.scale = scale
|
||||||
|
|
||||||
def rotate(self, angle):
|
def rotate(self, angle):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user