aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/dialogs/standarddialogs/standarddialogs.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/dialogs/standarddialogs/standarddialogs.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/dialogs/standarddialogs/standarddialogs.py')
-rw-r--r--examples/widgets/dialogs/standarddialogs/standarddialogs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/widgets/dialogs/standarddialogs/standarddialogs.py b/examples/widgets/dialogs/standarddialogs/standarddialogs.py
index 86397adc2..fb2dbc184 100644
--- a/examples/widgets/dialogs/standarddialogs/standarddialogs.py
+++ b/examples/widgets/dialogs/standarddialogs/standarddialogs.py
@@ -75,10 +75,10 @@ class DialogOptionsWidget(QGroupBox):
class Dialog(QDialog):
- MESSAGE = "<p>Message boxes have a caption, a text, and up to three " \
- "buttons, each with standard or custom texts.</p>" \
- "<p>Click a button to close the message box. Pressing the Esc " \
- "button will activate the detected escape button (if any).</p>"
+ MESSAGE = ("<p>Message boxes have a caption, a text, and up to three "
+ "buttons, each with standard or custom texts.</p>"
+ "<p>Click a button to close the message box. Pressing the Esc "
+ "button will activate the detected escape button (if any).</p>")
def __init__(self, parent=None):
super().__init__(parent)
@@ -285,7 +285,7 @@ class Dialog(QDialog):
d, ok = QInputDialog.getDouble(self, "QInputDialog.getDouble()",
"Amount:", 37.56, -10000, 10000, 2)
if ok:
- self._double_label.setText("$%g" % d)
+ self._double_label.setText(f"${d:g}")
def set_item(self):
items = ("Spring", "Summer", "Fall", "Winter")