diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-22 15:41:48 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-22 19:41:03 +0000 |
commit | 570cc14c50782ed46393a0a6a8d9d491fbb3785a (patch) | |
tree | 9b123ff862fb83b2c70db4791792919ecc59bd47 /examples/widgets/graphicsview/dragdroprobot | |
parent | 80aec29aca246f1f67a4f8c453b49f1eadfee6fd (diff) |
Replace % formatting in examples by f-strings
As drive-by, Fix fortune server, addressbook and dombookmarks examples to work.
Task-number: PYSIDE-1112
Change-Id: I8ef7759ed56aeb7157cf2222bee9b6481973112a
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/widgets/graphicsview/dragdroprobot')
-rw-r--r-- | examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py index a72c9351b..95134c313 100644 --- a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py +++ b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py @@ -57,10 +57,9 @@ class ColorItem(QtWidgets.QGraphicsItem): self.color = QtGui.QColor(random(256), random(256), random(256)) + (r, g, b) = (self.color.red(), self.color.green(), self.color.blue()) self.setToolTip( - "QColor(%d, %d, %d)\nClick and drag this color onto the robot!" % - (self.color.red(), self.color.green(), self.color.blue()) - ) + f"QColor({r}, {g}, {b})\nClick and drag this color onto the robot!") self.setCursor(QtCore.Qt.OpenHandCursor) def boundingRect(self): |