diff options
Diffstat (limited to 'examples/widgets/graphicsview')
-rw-r--r-- | examples/widgets/graphicsview/collidingmice/collidingmice.py | 4 | ||||
-rwxr-xr-x | examples/widgets/graphicsview/elasticnodes.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.py b/examples/widgets/graphicsview/collidingmice/collidingmice.py index 575ecc1f1..8bff64bc3 100644 --- a/examples/widgets/graphicsview/collidingmice/collidingmice.py +++ b/examples/widgets/graphicsview/collidingmice/collidingmice.py @@ -90,7 +90,7 @@ class Mouse(QtWidgets.QGraphicsItem): def shape(self): path = QtGui.QPainterPath() path.addRect(-10, -20, 20, 40) - return path; + return path def paint(self, painter, option, widget): # Body. @@ -133,7 +133,7 @@ class Mouse(QtWidgets.QGraphicsItem): if lineToCenter.length() > 150: angleToCenter = math.acos(lineToCenter.dx() / lineToCenter.length()) if lineToCenter.dy() < 0: - angleToCenter = Mouse.TwoPi - angleToCenter; + angleToCenter = Mouse.TwoPi - angleToCenter angleToCenter = Mouse.normalizeAngle((Mouse.Pi - angleToCenter) + Mouse.Pi / 2) if angleToCenter < Mouse.Pi and angleToCenter > Mouse.Pi / 4: diff --git a/examples/widgets/graphicsview/elasticnodes.py b/examples/widgets/graphicsview/elasticnodes.py index f013156d7..f640ab60c 100755 --- a/examples/widgets/graphicsview/elasticnodes.py +++ b/examples/widgets/graphicsview/elasticnodes.py @@ -131,7 +131,7 @@ class Edge(QtWidgets.QGraphicsItem): sourceArrowP1 = self.sourcePoint + QtCore.QPointF(math.sin(angle + Edge.Pi / 3) * self.arrowSize, math.cos(angle + Edge.Pi / 3) * self.arrowSize) sourceArrowP2 = self.sourcePoint + QtCore.QPointF(math.sin(angle + Edge.Pi - Edge.Pi / 3) * self.arrowSize, - math.cos(angle + Edge.Pi - Edge.Pi / 3) * self.arrowSize); + math.cos(angle + Edge.Pi - Edge.Pi / 3) * self.arrowSize) destArrowP1 = self.destPoint + QtCore.QPointF(math.sin(angle - Edge.Pi / 3) * self.arrowSize, math.cos(angle - Edge.Pi / 3) * self.arrowSize) destArrowP2 = self.destPoint + QtCore.QPointF(math.sin(angle - Edge.Pi + Edge.Pi / 3) * self.arrowSize, |