aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-05-12 17:10:35 +0200
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-05-13 13:14:55 +0200
commit3c1a6f732a3a2c69e7133d07b89db0bdd788316b (patch)
tree44114d011f4e0a3522896df9c8113bee1bba3b78 /examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py
parenta6dfbb2a72235ecabc7b1d61c085a7d7de3df8d0 (diff)
examples: clean and improve code
- removing '\' from long lines, - use f-strings instead of concatenating strings - Use f-strings instead of the old '%' formatting Task-number: PYSIDE-841 Change-Id: I4983c25a6272e10119d5d1a74c180828ca6f64e6 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py')
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py
index 8732c1c67..4f074aa19 100644
--- a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py
+++ b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py
@@ -142,8 +142,8 @@ class RobotPart(QGraphicsItem):
self.setAcceptDrops(True)
def dragEnterEvent(self, event):
- if event.mimeData().hasColor() or \
- (isinstance(self, RobotHead) and event.mimeData().hasImage()):
+ if (event.mimeData().hasColor() or
+ (isinstance(self, RobotHead) and event.mimeData().hasImage())):
event.setAccepted(True)
self._drag_over = True
self.update()