aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview/collidingmice
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2023-12-05 13:00:27 +0100
committerAdrian Herrmann <adrian.herrmann@qt.io>2023-12-06 11:52:07 +0100
commit592c734e57b00040329b49dfbe11869980dff88a (patch)
tree79fa3498cb974e5026415971ec83107b92b65919 /examples/widgets/graphicsview/collidingmice
parentc0329cff9d7378b8bf6a17baeb97bf5a240977fc (diff)
Examples: Fix a number of flake8 errors (part 1)
First batch, including low-hanging fruit like Alignments, whitespaces, line length, indents, etc. Pick-to: 6.6 Change-Id: I55966876077f7fddfdc82cbe376677af9995f329 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/graphicsview/collidingmice')
-rw-r--r--examples/widgets/graphicsview/collidingmice/collidingmice.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.py b/examples/widgets/graphicsview/collidingmice/collidingmice.py
index 7cce60b22..8165335a0 100644
--- a/examples/widgets/graphicsview/collidingmice/collidingmice.py
+++ b/examples/widgets/graphicsview/collidingmice/collidingmice.py
@@ -5,12 +5,9 @@
import math
import sys
-from PySide6.QtCore import (QLineF, QPointF, QRandomGenerator, QRectF, QTimer,
- Qt)
-from PySide6.QtGui import (QBrush, QColor, QPainter, QPainterPath, QPixmap,
- QPolygonF, QTransform)
-from PySide6.QtWidgets import (QApplication, QGraphicsItem, QGraphicsScene,
- QGraphicsView)
+from PySide6.QtCore import (QLineF, QPointF, QRandomGenerator, QRectF, QTimer, Qt)
+from PySide6.QtGui import (QBrush, QColor, QPainter, QPainterPath, QPixmap, QPolygonF, QTransform)
+from PySide6.QtWidgets import (QApplication, QGraphicsItem, QGraphicsScene, QGraphicsView)
import mice_rc
@@ -103,7 +100,8 @@ class Mouse(QGraphicsItem):
if angle_to_center < Mouse.PI and angle_to_center > Mouse.PI / 4:
# Rotate left.
self.angle += [-0.25, 0.25][self.angle < -Mouse.PI / 2]
- elif angle_to_center >= Mouse.PI and angle_to_center < (Mouse.PI + Mouse.PI / 2 + Mouse.PI / 4):
+ elif (angle_to_center >= Mouse.PI
+ and angle_to_center < (Mouse.PI + Mouse.PI / 2 + Mouse.PI / 4)):
# Rotate right.
self.angle += [-0.25, 0.25][self.angle < Mouse.PI / 2]
elif math.sin(self.angle) < 0: