aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/gallery
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-23 08:46:34 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-23 10:02:37 +0100
commit401d8c212b1d394b05cfd7f5db05062a07604150 (patch)
tree8e5645e8ec5e8f1464d880f68859264ba9c439ec /examples/widgets/gallery
parent570cc14c50782ed46393a0a6a8d9d491fbb3785a (diff)
Replace .format() in examples by f-strings
As a drive by, fix the chartthemes example to work. Task-number: PYSIDE-1112 Change-Id: I35deeba69f2db2c8c0848cce7316fb621b1b5818 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/widgets/gallery')
-rw-r--r--examples/widgets/gallery/widgetgallery.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/widgets/gallery/widgetgallery.py b/examples/widgets/gallery/widgetgallery.py
index 3ea21888e..fe70dba52 100644
--- a/examples/widgets/gallery/widgetgallery.py
+++ b/examples/widgets/gallery/widgetgallery.py
@@ -75,7 +75,7 @@ def class_name(o):
def help_url(page):
"""Build a Qt help URL from the page name"""
major_version = qVersion().split('.')[0]
- return "https://doc.qt.io/qt-{}/{}.html".format(major_version, page)
+ return f"https://doc.qt.io/qt-{major_version}/{page}.html"
def launch_help(widget):
@@ -204,7 +204,8 @@ class WidgetGallery(QDialog):
main_layout.addWidget(self._progress_bar, 3, 0, 1, 2)
main_layout.addWidget(dialog_buttonbox, 4, 0, 1, 2)
- self.setWindowTitle("Widget Gallery Qt {}".format(qVersion()))
+ qv = qVersion()
+ self.setWindowTitle(f"Widget Gallery Qt {qv}")
def setVisible(self, visible):
super(WidgetGallery, self).setVisible(visible)