You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that all initializations of QGraphicsItem subclasses are refactored in this way:
class MyEllipse(QtGui.QGraphicsEllipseItem):
+class MyEllipse(QtWidgets.QGraphicsEllipseItem):
def __init__(self, radius=5.0):
- super(MyEllipse, self).__init__(-radius/2, -radius/2, radius, radius)+ super(MyEllipse, self).__init__(-radius/2, -radius/2, radius)+ if radius is not None: radius.addItem(self)
The last argument is assumed to be scene and the addition to the scene is moved to a separate line. This assumption is not always true, in the sample above, the arguments are x, y, width, height and the addition to the scene is done elsewhere.
Workaround
Review the automatic changes using git.
changes not commited yet:
git diff --no-color > diff.txt
already commited changes:
git log # find the commit with changes done by pyqt4topyqt5
git show <commit> --no-color > diff.txt
Find new lines with addItem text using regexp: ^\+.*addItem (e.g. with less diff.txt).
The text was updated successfully, but these errors were encountered:
It seems that all initializations of QGraphicsItem subclasses are refactored in this way:
The last argument is assumed to be
scene
and the addition to the scene is moved to a separate line. This assumption is not always true, in the sample above, the arguments arex, y, width, height
and the addition to thescene
is done elsewhere.Workaround
Review the automatic changes using git.
changes not commited yet:
already commited changes:
Find new lines with
addItem
text using regexp:^\+.*addItem
(e.g. withless diff.txt
).The text was updated successfully, but these errors were encountered: