diff options
Diffstat (limited to 'examples/widgets')
113 files changed, 119 insertions, 9 deletions
diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.py b/examples/widgets/animation/animatedtiles/animatedtiles.py index 02fc75bf5..5be56b0e4 100644 --- a/examples/widgets/animation/animatedtiles/animatedtiles.py +++ b/examples/widgets/animation/animatedtiles/animatedtiles.py @@ -1,6 +1,7 @@ # Copyright (C) 2010 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys import math diff --git a/examples/widgets/animation/appchooser/appchooser.py b/examples/widgets/animation/appchooser/appchooser.py index 610050210..6b29f9997 100644 --- a/examples/widgets/animation/appchooser/appchooser.py +++ b/examples/widgets/animation/appchooser/appchooser.py @@ -1,6 +1,7 @@ # Copyright (C) 2010 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/animation/easing/easing.py b/examples/widgets/animation/easing/easing.py index ba5032458..5ea2348d1 100644 --- a/examples/widgets/animation/easing/easing.py +++ b/examples/widgets/animation/easing/easing.py @@ -1,6 +1,7 @@ # Copyright (C) 2010 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from enum import IntEnum import sys diff --git a/examples/widgets/animation/states/states.py b/examples/widgets/animation/states/states.py index 509c3a7aa..97cdb452a 100644 --- a/examples/widgets/animation/states/states.py +++ b/examples/widgets/animation/states/states.py @@ -1,6 +1,7 @@ # Copyright (C) 2010 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/animation/states/states_rc.py b/examples/widgets/animation/states/states_rc.py index 8b87b5e5e..ea7cfa0b0 100644 --- a/examples/widgets/animation/states/states_rc.py +++ b/examples/widgets/animation/states/states_rc.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # Resource object code # diff --git a/examples/widgets/desktop/screenshot/screenshot.py b/examples/widgets/desktop/screenshot/screenshot.py index a5688da7a..4494ecab4 100644 --- a/examples/widgets/desktop/screenshot/screenshot.py +++ b/examples/widgets/desktop/screenshot/screenshot.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/desktop/screenshot example from Qt v6.x""" diff --git a/examples/widgets/desktop/systray/main.py b/examples/widgets/desktop/systray/main.py index c52c51387..38e7fbb20 100644 --- a/examples/widgets/desktop/systray/main.py +++ b/examples/widgets/desktop/systray/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/desktop/systray/window.py b/examples/widgets/desktop/systray/window.py index 0b5bc39dc..db1569a7a 100644 --- a/examples/widgets/desktop/systray/window.py +++ b/examples/widgets/desktop/systray/window.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import Slot from PySide6.QtGui import QAction, QIcon diff --git a/examples/widgets/dialogs/classwizard/classwizard.py b/examples/widgets/dialogs/classwizard/classwizard.py index 0efbde69f..d956ec7c5 100644 --- a/examples/widgets/dialogs/classwizard/classwizard.py +++ b/examples/widgets/dialogs/classwizard/classwizard.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import os from pathlib import Path diff --git a/examples/widgets/dialogs/classwizard/listchooser.py b/examples/widgets/dialogs/classwizard/listchooser.py index 6bf47c6d1..eb621baca 100644 --- a/examples/widgets/dialogs/classwizard/listchooser.py +++ b/examples/widgets/dialogs/classwizard/listchooser.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import QRegularExpression, Property, Slot from PySide6.QtGui import QRegularExpressionValidator diff --git a/examples/widgets/dialogs/extension/extension.py b/examples/widgets/dialogs/extension/extension.py index b8919f38e..824be89d6 100644 --- a/examples/widgets/dialogs/extension/extension.py +++ b/examples/widgets/dialogs/extension/extension.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/dialogs/extension example from Qt v5.x""" diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.py b/examples/widgets/dialogs/licensewizard/licensewizard.py index 28667d173..ea8198154 100644 --- a/examples/widgets/dialogs/licensewizard/licensewizard.py +++ b/examples/widgets/dialogs/licensewizard/licensewizard.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from enum import IntEnum diff --git a/examples/widgets/dialogs/licensewizard/main.py b/examples/widgets/dialogs/licensewizard/main.py index 26537ddf9..4e2167342 100644 --- a/examples/widgets/dialogs/licensewizard/main.py +++ b/examples/widgets/dialogs/licensewizard/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/dialogs/standarddialogs/standarddialogs.py b/examples/widgets/dialogs/standarddialogs/standarddialogs.py index ef677d5a8..c03a28a74 100644 --- a/examples/widgets/dialogs/standarddialogs/standarddialogs.py +++ b/examples/widgets/dialogs/standarddialogs/standarddialogs.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/dialogs/standarddialogs example from Qt v5.x""" diff --git a/examples/widgets/dialogs/tabdialog/tabdialog.py b/examples/widgets/dialogs/tabdialog/tabdialog.py index 6be3d020b..0e6c5071b 100644 --- a/examples/widgets/dialogs/tabdialog/tabdialog.py +++ b/examples/widgets/dialogs/tabdialog/tabdialog.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/dialogs/tabdialog example from Qt v6.x""" diff --git a/examples/widgets/dialogs/trivialwizard/trivialwizard.py b/examples/widgets/dialogs/trivialwizard/trivialwizard.py index 2e551ae19..25f4f9625 100644 --- a/examples/widgets/dialogs/trivialwizard/trivialwizard.py +++ b/examples/widgets/dialogs/trivialwizard/trivialwizard.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/dialogs/trivialwizard example from Qt v5.x""" diff --git a/examples/widgets/draganddrop/draggableicons/draggableicons.py b/examples/widgets/draganddrop/draggableicons/draggableicons.py index b929bd5e3..d54528c6e 100644 --- a/examples/widgets/draganddrop/draggableicons/draggableicons.py +++ b/examples/widgets/draganddrop/draggableicons/draggableicons.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from pathlib import Path import sys diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.py b/examples/widgets/draganddrop/draggabletext/draggabletext.py index 6ffdbd70e..532e705c6 100644 --- a/examples/widgets/draganddrop/draggabletext/draggabletext.py +++ b/examples/widgets/draganddrop/draggabletext/draggabletext.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/draganddrop/draggabletext example from Qt v5.x, originating from PyQt""" diff --git a/examples/widgets/draganddrop/dropsite/droparea.py b/examples/widgets/draganddrop/dropsite/droparea.py index efc4614f0..86714b5d0 100644 --- a/examples/widgets/draganddrop/dropsite/droparea.py +++ b/examples/widgets/draganddrop/dropsite/droparea.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import QMimeData, Qt, Slot, Signal from PySide6.QtGui import QPalette, QPixmap diff --git a/examples/widgets/draganddrop/dropsite/dropsitewindow.py b/examples/widgets/draganddrop/dropsite/dropsitewindow.py index 5427d520d..5d09d87ae 100644 --- a/examples/widgets/draganddrop/dropsite/dropsitewindow.py +++ b/examples/widgets/draganddrop/dropsite/dropsitewindow.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import re from PySide6.QtCore import QMimeData, Qt, Slot diff --git a/examples/widgets/draganddrop/dropsite/main.py b/examples/widgets/draganddrop/dropsite/main.py index bce476a61..1c4365ed7 100644 --- a/examples/widgets/draganddrop/dropsite/main.py +++ b/examples/widgets/draganddrop/dropsite/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/effects/blurpicker/blureffect.py b/examples/widgets/effects/blurpicker/blureffect.py index 16c14a758..cb9b2f34e 100644 --- a/examples/widgets/effects/blurpicker/blureffect.py +++ b/examples/widgets/effects/blurpicker/blureffect.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import QRect diff --git a/examples/widgets/effects/blurpicker/blurpicker.py b/examples/widgets/effects/blurpicker/blurpicker.py index 6ff11f217..a0cad5edc 100644 --- a/examples/widgets/effects/blurpicker/blurpicker.py +++ b/examples/widgets/effects/blurpicker/blurpicker.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from pathlib import Path diff --git a/examples/widgets/effects/blurpicker/main.py b/examples/widgets/effects/blurpicker/main.py index 053ac60ec..7f2df0db8 100644 --- a/examples/widgets/effects/blurpicker/main.py +++ b/examples/widgets/effects/blurpicker/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/effects/blurpicker example from Qt v6.x""" diff --git a/examples/widgets/effects/lighting/lighting.py b/examples/widgets/effects/lighting/lighting.py index f074813c3..bec09aa94 100644 --- a/examples/widgets/effects/lighting/lighting.py +++ b/examples/widgets/effects/lighting/lighting.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import math import sys diff --git a/examples/widgets/gettext/main.py b/examples/widgets/gettext/main.py index 85695728d..02e6c2e08 100644 --- a/examples/widgets/gettext/main.py +++ b/examples/widgets/gettext/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from pathlib import Path import gettext diff --git a/examples/widgets/graphicsview/anchorlayout/anchorlayout.py b/examples/widgets/graphicsview/anchorlayout/anchorlayout.py index 9d9be041f..7153018e1 100644 --- a/examples/widgets/graphicsview/anchorlayout/anchorlayout.py +++ b/examples/widgets/graphicsview/anchorlayout/anchorlayout.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.py b/examples/widgets/graphicsview/collidingmice/collidingmice.py index fb24db3ab..7f1a3d233 100644 --- a/examples/widgets/graphicsview/collidingmice/collidingmice.py +++ b/examples/widgets/graphicsview/collidingmice/collidingmice.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import math import sys diff --git a/examples/widgets/graphicsview/collidingmice/mice_rc.py b/examples/widgets/graphicsview/collidingmice/mice_rc.py index e2a22b2e4..0fe2f9022 100644 --- a/examples/widgets/graphicsview/collidingmice/mice_rc.py +++ b/examples/widgets/graphicsview/collidingmice/mice_rc.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # Resource object code # diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.py b/examples/widgets/graphicsview/diagramscene/diagramscene.py index 60e05613c..5cf5edf8b 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramscene.py +++ b/examples/widgets/graphicsview/diagramscene/diagramscene.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import math import sys diff --git a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py index 9ed92b26e..b3ec221fe 100644 --- a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py +++ b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys import math diff --git a/examples/widgets/graphicsview/elasticnodes/elasticnodes.py b/examples/widgets/graphicsview/elasticnodes/elasticnodes.py index 90cb49626..d41981dce 100644 --- a/examples/widgets/graphicsview/elasticnodes/elasticnodes.py +++ b/examples/widgets/graphicsview/elasticnodes/elasticnodes.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys import weakref diff --git a/examples/widgets/imageviewer/imageviewer.py b/examples/widgets/imageviewer/imageviewer.py index 93b1e87ba..ebf420f92 100644 --- a/examples/widgets/imageviewer/imageviewer.py +++ b/examples/widgets/imageviewer/imageviewer.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtPrintSupport import QPrintDialog, QPrinter from PySide6.QtWidgets import (QApplication, QDialog, QFileDialog, QLabel, diff --git a/examples/widgets/imageviewer/main.py b/examples/widgets/imageviewer/main.py index 949def62e..2af5833aa 100644 --- a/examples/widgets/imageviewer/main.py +++ b/examples/widgets/imageviewer/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/imageviewer example from Qt v6.0""" diff --git a/examples/widgets/itemviews/address_book/adddialogwidget.py b/examples/widgets/itemviews/address_book/adddialogwidget.py index ecb853e80..29d0a4756 100644 --- a/examples/widgets/itemviews/address_book/adddialogwidget.py +++ b/examples/widgets/itemviews/address_book/adddialogwidget.py @@ -1,6 +1,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import Qt from PySide6.QtWidgets import (QDialog, QLabel, QTextEdit, QLineEdit, diff --git a/examples/widgets/itemviews/address_book/address_book.py b/examples/widgets/itemviews/address_book/address_book.py index af0cf3dee..647326903 100644 --- a/examples/widgets/itemviews/address_book/address_book.py +++ b/examples/widgets/itemviews/address_book/address_book.py @@ -1,6 +1,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import Slot from PySide6.QtGui import QAction diff --git a/examples/widgets/itemviews/address_book/addresswidget.py b/examples/widgets/itemviews/address_book/addresswidget.py index cb2f46ea1..5852263e1 100644 --- a/examples/widgets/itemviews/address_book/addresswidget.py +++ b/examples/widgets/itemviews/address_book/addresswidget.py @@ -1,6 +1,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations try: import cpickle as pickle diff --git a/examples/widgets/itemviews/address_book/newaddresstab.py b/examples/widgets/itemviews/address_book/newaddresstab.py index d3d037ad4..055137db9 100644 --- a/examples/widgets/itemviews/address_book/newaddresstab.py +++ b/examples/widgets/itemviews/address_book/newaddresstab.py @@ -1,6 +1,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import (Qt, Signal) from PySide6.QtWidgets import (QWidget, QLabel, QPushButton, QVBoxLayout) diff --git a/examples/widgets/itemviews/address_book/tablemodel.py b/examples/widgets/itemviews/address_book/tablemodel.py index 3c1dbd4cc..9a69be24e 100644 --- a/examples/widgets/itemviews/address_book/tablemodel.py +++ b/examples/widgets/itemviews/address_book/tablemodel.py @@ -1,6 +1,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import (Qt, QAbstractTableModel, QModelIndex) diff --git a/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py b/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py index a30b0abdf..7ee69c183 100644 --- a/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py +++ b/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from PySide6.QtCore import (QDate, QDateTime, QRegularExpression, diff --git a/examples/widgets/itemviews/dirview/dirview.py b/examples/widgets/itemviews/dirview/dirview.py index d1be6958e..5408f5c7f 100644 --- a/examples/widgets/itemviews/dirview/dirview.py +++ b/examples/widgets/itemviews/dirview/dirview.py @@ -1,5 +1,6 @@ # Copyright (C) 2020 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from argparse import ArgumentParser, RawTextHelpFormatter diff --git a/examples/widgets/itemviews/editabletreemodel/main.py b/examples/widgets/itemviews/editabletreemodel/main.py index 491baa68d..dd33c5424 100644 --- a/examples/widgets/itemviews/editabletreemodel/main.py +++ b/examples/widgets/itemviews/editabletreemodel/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/itemviews/editabletreemodel/mainwindow.py b/examples/widgets/itemviews/editabletreemodel/mainwindow.py index 1489bf28b..2691c0139 100644 --- a/examples/widgets/itemviews/editabletreemodel/mainwindow.py +++ b/examples/widgets/itemviews/editabletreemodel/mainwindow.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from pathlib import Path diff --git a/examples/widgets/itemviews/editabletreemodel/treeitem.py b/examples/widgets/itemviews/editabletreemodel/treeitem.py index 1a25b0774..dfc98b3e8 100644 --- a/examples/widgets/itemviews/editabletreemodel/treeitem.py +++ b/examples/widgets/itemviews/editabletreemodel/treeitem.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations class TreeItem: diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.py b/examples/widgets/itemviews/editabletreemodel/treemodel.py index a58572fca..ac27fe795 100644 --- a/examples/widgets/itemviews/editabletreemodel/treemodel.py +++ b/examples/widgets/itemviews/editabletreemodel/treemodel.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import QModelIndex, Qt, QAbstractItemModel diff --git a/examples/widgets/itemviews/fetchmore/fetchmore.py b/examples/widgets/itemviews/fetchmore/fetchmore.py index 5150250e0..1b9202f2f 100644 --- a/examples/widgets/itemviews/fetchmore/fetchmore.py +++ b/examples/widgets/itemviews/fetchmore/fetchmore.py @@ -2,6 +2,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the itemviews/fetchmore/fetchmore example from Qt v6.x diff --git a/examples/widgets/itemviews/jsonmodel/jsonmodel.py b/examples/widgets/itemviews/jsonmodel/jsonmodel.py index 6e614c77f..0ff14e67c 100644 --- a/examples/widgets/itemviews/jsonmodel/jsonmodel.py +++ b/examples/widgets/itemviews/jsonmodel/jsonmodel.py @@ -1,9 +1,10 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import json import sys -from typing import Any, List, Dict, Union +from typing import Any from PySide6.QtWidgets import QTreeView, QApplication, QHeaderView from PySide6.QtCore import QAbstractItemModel, QModelIndex, QObject, Qt, QFileInfo @@ -71,7 +72,7 @@ class TreeItem: @classmethod def load( - cls, value: Union[List, Dict], parent: "TreeItem" = None, sort=True + cls, value: list | dict, parent: "TreeItem" = None, sort=True ) -> "TreeItem": """Create a 'root' TreeItem from a nested list or a nested dictonary diff --git a/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.py b/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.py index 577f0faa5..f701d32fe 100644 --- a/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.py +++ b/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/itemviews/spreadsheet/main.py b/examples/widgets/itemviews/spreadsheet/main.py index 0ecc5ec23..b21059ffe 100644 --- a/examples/widgets/itemviews/spreadsheet/main.py +++ b/examples/widgets/itemviews/spreadsheet/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.py b/examples/widgets/itemviews/spreadsheet/spreadsheet.py index 82ebe5ebb..342b60f26 100644 --- a/examples/widgets/itemviews/spreadsheet/spreadsheet.py +++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import QPoint, Qt, QCoreApplication, Slot from PySide6.QtGui import QAction, QBrush, QPixmap, QColor, QPainter @@ -11,12 +12,11 @@ from PySide6.QtWidgets import (QColorDialog, QComboBox, QDialog, QFontDialog, from spreadsheetdelegate import SpreadSheetDelegate from spreadsheetitem import SpreadSheetItem -from typing import Optional from numbers import Number class SpreadSheet(QMainWindow): - def __init__(self, rows: Number, cols: Number, parent: Optional[QWidget] = None) -> None: + def __init__(self, rows: Number, cols: Number, parent: QWidget | None = None) -> None: super().__init__(parent) self._tool_bar = QToolBar(self) diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.py b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.py index 57aba6f47..c098a6fbb 100644 --- a/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.py +++ b/examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.py @@ -1,16 +1,15 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import (QAbstractItemModel, QDate, QModelIndex, QObject, QStringListModel, Qt, Slot) from PySide6.QtWidgets import (QCompleter, QDateTimeEdit, QLineEdit, QStyleOptionViewItem, QStyledItemDelegate, QWidget) -from typing import Optional - class SpreadSheetDelegate(QStyledItemDelegate): - def __init__(self, parent: Optional[QObject] = None) -> None: + def __init__(self, parent: QObject | None = None) -> None: super().__init__(parent) def create_editor(self, parent: QWidget, diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.py b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.py index dc70da883..9dcdc47d6 100644 --- a/examples/widgets/itemviews/spreadsheet/spreadsheetitem.py +++ b/examples/widgets/itemviews/spreadsheet/spreadsheetitem.py @@ -1,7 +1,8 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations -from typing import Any, Tuple +from typing import Any from PySide6.QtCore import QMetaType, Qt from PySide6.QtWidgets import QTableWidget, QTableWidgetItem @@ -106,7 +107,7 @@ class SpreadSheetItem(QTableWidgetItem): return result - def decode_pos(pos: str) -> Tuple[int, int]: + def decode_pos(pos: str) -> tuple[int, int]: if (not pos): col = -1 row = -1 diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.py b/examples/widgets/itemviews/stardelegate/stardelegate.py index 973eb14f6..394bfc98f 100644 --- a/examples/widgets/itemviews/stardelegate/stardelegate.py +++ b/examples/widgets/itemviews/stardelegate/stardelegate.py @@ -2,6 +2,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtWidgets import QStyledItemDelegate, QStyle diff --git a/examples/widgets/itemviews/stardelegate/stareditor.py b/examples/widgets/itemviews/stardelegate/stareditor.py index 296afa950..1fd7839e1 100644 --- a/examples/widgets/itemviews/stardelegate/stareditor.py +++ b/examples/widgets/itemviews/stardelegate/stareditor.py @@ -2,6 +2,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtWidgets import (QWidget) from PySide6.QtGui import (QPainter) diff --git a/examples/widgets/itemviews/stardelegate/starrating.py b/examples/widgets/itemviews/stardelegate/starrating.py index 28dbacd6f..e457e2f50 100644 --- a/examples/widgets/itemviews/stardelegate/starrating.py +++ b/examples/widgets/itemviews/stardelegate/starrating.py @@ -2,6 +2,7 @@ # Copyright (C) 2011 Arun Srinivasan <rulfzid@gmail.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from math import (cos, sin, pi) diff --git a/examples/widgets/layouts/basiclayouts/basiclayouts.py b/examples/widgets/layouts/basiclayouts/basiclayouts.py index 827cb7850..be99d804f 100644 --- a/examples/widgets/layouts/basiclayouts/basiclayouts.py +++ b/examples/widgets/layouts/basiclayouts/basiclayouts.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/layouts/basiclayout example from Qt v5.x""" diff --git a/examples/widgets/layouts/borderlayout/borderlayout.py b/examples/widgets/layouts/borderlayout/borderlayout.py index 3268d7034..19ba3e94b 100644 --- a/examples/widgets/layouts/borderlayout/borderlayout.py +++ b/examples/widgets/layouts/borderlayout/borderlayout.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/layouts/borderlayout example from Qt v5.x""" diff --git a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py index c9dfcc730..419b4e97c 100644 --- a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py +++ b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/layouts/dynamiclayouts example from Qt v5.x""" diff --git a/examples/widgets/layouts/flowlayout/flowlayout.py b/examples/widgets/layouts/flowlayout/flowlayout.py index 3ab4318fa..4764de70a 100644 --- a/examples/widgets/layouts/flowlayout/flowlayout.py +++ b/examples/widgets/layouts/flowlayout/flowlayout.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/layouts/flowlayout example from Qt v6.x""" diff --git a/examples/widgets/linguist/main.py b/examples/widgets/linguist/main.py index e4212e801..dd6ef4d09 100644 --- a/examples/widgets/linguist/main.py +++ b/examples/widgets/linguist/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/mainwindows/application/application.py b/examples/widgets/mainwindows/application/application.py index f69eade2e..e17c0cae4 100644 --- a/examples/widgets/mainwindows/application/application.py +++ b/examples/widgets/mainwindows/application/application.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from argparse import ArgumentParser, RawTextHelpFormatter import sys diff --git a/examples/widgets/mainwindows/dockwidgets/dockwidgets.py b/examples/widgets/mainwindows/dockwidgets/dockwidgets.py index 83487ee58..d0917063f 100644 --- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.py +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/mainwindows/dockwidgets example from Qt v5.x, originating from PyQt""" diff --git a/examples/widgets/mainwindows/mdi/mdi.py b/examples/widgets/mainwindows/mdi/mdi.py index c1fa01b8c..e41200ca1 100644 --- a/examples/widgets/mainwindows/mdi/mdi.py +++ b/examples/widgets/mainwindows/mdi/mdi.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/mainwindows/mdi example from Qt v5.x, originating from PyQt""" diff --git a/examples/widgets/painting/basicdrawing/basicdrawing.py b/examples/widgets/painting/basicdrawing/basicdrawing.py index 858a8cd9f..cdc7fd9d5 100644 --- a/examples/widgets/painting/basicdrawing/basicdrawing.py +++ b/examples/widgets/painting/basicdrawing/basicdrawing.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/painting/basicdrawing example from Qt v5.x, originating from PyQt""" diff --git a/examples/widgets/painting/concentriccircles/concentriccircles.py b/examples/widgets/painting/concentriccircles/concentriccircles.py index d2c60178f..297ab1db7 100644 --- a/examples/widgets/painting/concentriccircles/concentriccircles.py +++ b/examples/widgets/painting/concentriccircles/concentriccircles.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/painting/concentriccircles example from Qt v5.x, originating from PyQt""" diff --git a/examples/widgets/painting/painter/painter.py b/examples/widgets/painting/painter/painter.py index 2ca078ad9..1c06a4b47 100644 --- a/examples/widgets/painting/painter/painter.py +++ b/examples/widgets/painting/painter/painter.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtWidgets import ( QWidget, diff --git a/examples/widgets/painting/plot/plot.py b/examples/widgets/painting/plot/plot.py index fd7ff9937..d437309d0 100644 --- a/examples/widgets/painting/plot/plot.py +++ b/examples/widgets/painting/plot/plot.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import math import sys diff --git a/examples/widgets/rhi/simplerhiwidget/examplewidget.py b/examples/widgets/rhi/simplerhiwidget/examplewidget.py index 5b3e40f50..9f3ef70e9 100644 --- a/examples/widgets/rhi/simplerhiwidget/examplewidget.py +++ b/examples/widgets/rhi/simplerhiwidget/examplewidget.py @@ -1,5 +1,6 @@ # Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import numpy diff --git a/examples/widgets/rhi/simplerhiwidget/main.py b/examples/widgets/rhi/simplerhiwidget/main.py index 59be81ddc..5b23af0df 100644 --- a/examples/widgets/rhi/simplerhiwidget/main.py +++ b/examples/widgets/rhi/simplerhiwidget/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the Qt Simple RHI Widget Example example from Qt v6.x""" diff --git a/examples/widgets/richtext/orderform/orderform.py b/examples/widgets/richtext/orderform/orderform.py index 9725624c3..b8f99cac4 100644 --- a/examples/widgets/richtext/orderform/orderform.py +++ b/examples/widgets/richtext/orderform/orderform.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/richtext/orderform example from Qt v5.x""" diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py index 021328977..5f85ab24d 100644 --- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py +++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/richtext/syntaxhighlighter example from Qt v5.x""" diff --git a/examples/widgets/richtext/textedit/main.py b/examples/widgets/richtext/textedit/main.py index 330ea5fc5..3bebace78 100644 --- a/examples/widgets/richtext/textedit/main.py +++ b/examples/widgets/richtext/textedit/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/richtext/textedit example from Qt v6.x""" diff --git a/examples/widgets/richtext/textedit/textedit.py b/examples/widgets/richtext/textedit/textedit.py index 8019446f0..428a5eae3 100644 --- a/examples/widgets/richtext/textedit/textedit.py +++ b/examples/widgets/richtext/textedit/textedit.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from PySide6.QtCore import (QCoreApplication, QDir, QFile, QFileInfo, diff --git a/examples/widgets/richtext/textobject/textobject.py b/examples/widgets/richtext/textobject/textobject.py index 9ab7bf8ae..d42b5643c 100644 --- a/examples/widgets/richtext/textobject/textobject.py +++ b/examples/widgets/richtext/textobject/textobject.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/richtext/textobject example from Qt v5.x""" diff --git a/examples/widgets/thread_signals/thread_signals.py b/examples/widgets/thread_signals/thread_signals.py index ae8e1ba72..f9101bd8c 100644 --- a/examples/widgets/thread_signals/thread_signals.py +++ b/examples/widgets/thread_signals/thread_signals.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from PySide6.QtCore import QObject, QThread, Signal, Slot diff --git a/examples/widgets/tools/regularexpression/regularexpression.py b/examples/widgets/tools/regularexpression/regularexpression.py index 261e26196..ac08ddd32 100644 --- a/examples/widgets/tools/regularexpression/regularexpression.py +++ b/examples/widgets/tools/regularexpression/regularexpression.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """ PySide6 port of Qt6 example qtbase/examples/widgets/tools/regularexpression diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.py b/examples/widgets/tools/regularexpression/regularexpressiondialog.py index 2d2bb2bb7..bbaa2f452 100644 --- a/examples/widgets/tools/regularexpression/regularexpressiondialog.py +++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import re import logging diff --git a/examples/widgets/tutorials/addressbook/part1.py b/examples/widgets/tutorials/addressbook/part1.py index 648ddea46..87174453f 100644 --- a/examples/widgets/tutorials/addressbook/part1.py +++ b/examples/widgets/tutorials/addressbook/part1.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/addressbook/part2.py b/examples/widgets/tutorials/addressbook/part2.py index 3c0eb451d..b91d08d8a 100644 --- a/examples/widgets/tutorials/addressbook/part2.py +++ b/examples/widgets/tutorials/addressbook/part2.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/addressbook/part3.py b/examples/widgets/tutorials/addressbook/part3.py index 611796f5e..b6cf0598f 100644 --- a/examples/widgets/tutorials/addressbook/part3.py +++ b/examples/widgets/tutorials/addressbook/part3.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/addressbook/part4.py b/examples/widgets/tutorials/addressbook/part4.py index 95f31d46c..0a569adb7 100644 --- a/examples/widgets/tutorials/addressbook/part4.py +++ b/examples/widgets/tutorials/addressbook/part4.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/addressbook/part5.py b/examples/widgets/tutorials/addressbook/part5.py index 1e9c05862..364a56a3f 100644 --- a/examples/widgets/tutorials/addressbook/part5.py +++ b/examples/widgets/tutorials/addressbook/part5.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/addressbook/part6.py b/examples/widgets/tutorials/addressbook/part6.py index d11298fb9..a00fec3a2 100644 --- a/examples/widgets/tutorials/addressbook/part6.py +++ b/examples/widgets/tutorials/addressbook/part6.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import pickle import sys diff --git a/examples/widgets/tutorials/addressbook/part7.py b/examples/widgets/tutorials/addressbook/part7.py index 3829c003d..dc560cd1a 100644 --- a/examples/widgets/tutorials/addressbook/part7.py +++ b/examples/widgets/tutorials/addressbook/part7.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import pickle import sys diff --git a/examples/widgets/tutorials/cannon/t1.py b/examples/widgets/tutorials/cannon/t1.py index 62411ace2..924069610 100644 --- a/examples/widgets/tutorials/cannon/t1.py +++ b/examples/widgets/tutorials/cannon/t1.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 1 diff --git a/examples/widgets/tutorials/cannon/t10.py b/examples/widgets/tutorials/cannon/t10.py index 8649bb562..710d4e253 100644 --- a/examples/widgets/tutorials/cannon/t10.py +++ b/examples/widgets/tutorials/cannon/t10.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 10 diff --git a/examples/widgets/tutorials/cannon/t11.py b/examples/widgets/tutorials/cannon/t11.py index fbfd2481d..010d22c0c 100644 --- a/examples/widgets/tutorials/cannon/t11.py +++ b/examples/widgets/tutorials/cannon/t11.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 11 diff --git a/examples/widgets/tutorials/cannon/t12.py b/examples/widgets/tutorials/cannon/t12.py index 749c24684..551eb058e 100644 --- a/examples/widgets/tutorials/cannon/t12.py +++ b/examples/widgets/tutorials/cannon/t12.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 12 diff --git a/examples/widgets/tutorials/cannon/t13.py b/examples/widgets/tutorials/cannon/t13.py index f9a771d15..f5ed124ec 100644 --- a/examples/widgets/tutorials/cannon/t13.py +++ b/examples/widgets/tutorials/cannon/t13.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 13 diff --git a/examples/widgets/tutorials/cannon/t14.py b/examples/widgets/tutorials/cannon/t14.py index 3c94408f3..77c61b893 100644 --- a/examples/widgets/tutorials/cannon/t14.py +++ b/examples/widgets/tutorials/cannon/t14.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 14 diff --git a/examples/widgets/tutorials/cannon/t2.py b/examples/widgets/tutorials/cannon/t2.py index d3adba396..7379ba4d9 100644 --- a/examples/widgets/tutorials/cannon/t2.py +++ b/examples/widgets/tutorials/cannon/t2.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 2 diff --git a/examples/widgets/tutorials/cannon/t3.py b/examples/widgets/tutorials/cannon/t3.py index 13bd8f736..ed7cf00e0 100644 --- a/examples/widgets/tutorials/cannon/t3.py +++ b/examples/widgets/tutorials/cannon/t3.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 3 diff --git a/examples/widgets/tutorials/cannon/t4.py b/examples/widgets/tutorials/cannon/t4.py index 37a2dc9dd..199b65731 100644 --- a/examples/widgets/tutorials/cannon/t4.py +++ b/examples/widgets/tutorials/cannon/t4.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 4 diff --git a/examples/widgets/tutorials/cannon/t5.py b/examples/widgets/tutorials/cannon/t5.py index ed5d085f8..e56991629 100644 --- a/examples/widgets/tutorials/cannon/t5.py +++ b/examples/widgets/tutorials/cannon/t5.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 5 diff --git a/examples/widgets/tutorials/cannon/t6.py b/examples/widgets/tutorials/cannon/t6.py index ea2e044e6..98dd9ec11 100644 --- a/examples/widgets/tutorials/cannon/t6.py +++ b/examples/widgets/tutorials/cannon/t6.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 6 diff --git a/examples/widgets/tutorials/cannon/t7.py b/examples/widgets/tutorials/cannon/t7.py index 1175107b8..d0a0704b0 100644 --- a/examples/widgets/tutorials/cannon/t7.py +++ b/examples/widgets/tutorials/cannon/t7.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 7 diff --git a/examples/widgets/tutorials/cannon/t8.py b/examples/widgets/tutorials/cannon/t8.py index 9bb5516b8..33f18a0a0 100644 --- a/examples/widgets/tutorials/cannon/t8.py +++ b/examples/widgets/tutorials/cannon/t8.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 8 diff --git a/examples/widgets/tutorials/cannon/t9.py b/examples/widgets/tutorials/cannon/t9.py index 7cdda4e7b..37c753118 100644 --- a/examples/widgets/tutorials/cannon/t9.py +++ b/examples/widgets/tutorials/cannon/t9.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations # PySide6 tutorial 9 diff --git a/examples/widgets/tutorials/modelview/1_readonly.py b/examples/widgets/tutorials/modelview/1_readonly.py index 9dc923260..4606bc47b 100644 --- a/examples/widgets/tutorials/modelview/1_readonly.py +++ b/examples/widgets/tutorials/modelview/1_readonly.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/modelview/2_formatting.py b/examples/widgets/tutorials/modelview/2_formatting.py index f39ec462c..70cbda03b 100644 --- a/examples/widgets/tutorials/modelview/2_formatting.py +++ b/examples/widgets/tutorials/modelview/2_formatting.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/modelview/3_changingmodel.py b/examples/widgets/tutorials/modelview/3_changingmodel.py index 2148ec5d3..bc6661e66 100644 --- a/examples/widgets/tutorials/modelview/3_changingmodel.py +++ b/examples/widgets/tutorials/modelview/3_changingmodel.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/modelview/4_headers.py b/examples/widgets/tutorials/modelview/4_headers.py index 3feef17bf..91fbe16a7 100644 --- a/examples/widgets/tutorials/modelview/4_headers.py +++ b/examples/widgets/tutorials/modelview/4_headers.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/modelview/5_edit.py b/examples/widgets/tutorials/modelview/5_edit.py index 1a4481fc9..450ac5072 100644 --- a/examples/widgets/tutorials/modelview/5_edit.py +++ b/examples/widgets/tutorials/modelview/5_edit.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from itertools import chain diff --git a/examples/widgets/tutorials/modelview/6_treeview.py b/examples/widgets/tutorials/modelview/6_treeview.py index cac3c6d53..d0259f485 100644 --- a/examples/widgets/tutorials/modelview/6_treeview.py +++ b/examples/widgets/tutorials/modelview/6_treeview.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/tutorials/modelview/7_selections.py b/examples/widgets/tutorials/modelview/7_selections.py index c879d8f67..0a4638bcf 100644 --- a/examples/widgets/tutorials/modelview/7_selections.py +++ b/examples/widgets/tutorials/modelview/7_selections.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/widgets/charactermap/characterwidget.py b/examples/widgets/widgets/charactermap/characterwidget.py index 0f01f9684..e96dacf9e 100644 --- a/examples/widgets/widgets/charactermap/characterwidget.py +++ b/examples/widgets/widgets/charactermap/characterwidget.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from textwrap import dedent diff --git a/examples/widgets/widgets/charactermap/fontinfodialog.py b/examples/widgets/widgets/charactermap/fontinfodialog.py index aa874884f..43b0c1145 100644 --- a/examples/widgets/widgets/charactermap/fontinfodialog.py +++ b/examples/widgets/widgets/charactermap/fontinfodialog.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import Qt, qVersion, qFuzzyCompare from PySide6.QtGui import QGuiApplication, QFontDatabase diff --git a/examples/widgets/widgets/charactermap/main.py b/examples/widgets/widgets/charactermap/main.py index e84a1d8af..8feded90a 100644 --- a/examples/widgets/widgets/charactermap/main.py +++ b/examples/widgets/widgets/charactermap/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys diff --git a/examples/widgets/widgets/charactermap/mainwindow.py b/examples/widgets/widgets/charactermap/mainwindow.py index d79285def..a2dbb3b25 100644 --- a/examples/widgets/widgets/charactermap/mainwindow.py +++ b/examples/widgets/widgets/charactermap/mainwindow.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations from PySide6.QtCore import Qt, QSignalBlocker, Slot from PySide6.QtGui import QGuiApplication, QClipboard, QFont, QFontDatabase diff --git a/examples/widgets/widgets/digitalclock/digitalclock.py b/examples/widgets/widgets/digitalclock/digitalclock.py index f0030b356..53c40c823 100644 --- a/examples/widgets/widgets/digitalclock/digitalclock.py +++ b/examples/widgets/widgets/digitalclock/digitalclock.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys from PySide6.QtCore import QTime, QTimer, Slot diff --git a/examples/widgets/widgets/tetrix/tetrix.py b/examples/widgets/widgets/tetrix/tetrix.py index b5df2aa35..68a5033e7 100644 --- a/examples/widgets/widgets/tetrix/tetrix.py +++ b/examples/widgets/widgets/tetrix/tetrix.py @@ -1,6 +1,7 @@ # Copyright (C) 2013 Riverbank Computing Limited. # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/widgets/tetrix example from Qt v5.x""" diff --git a/examples/widgets/widgetsgallery/main.py b/examples/widgets/widgetsgallery/main.py index e40077a38..ec2b5d651 100644 --- a/examples/widgets/widgetsgallery/main.py +++ b/examples/widgets/widgetsgallery/main.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations """PySide6 port of the widgets/gallery example from Qt v5.15""" diff --git a/examples/widgets/widgetsgallery/widgetgallery.py b/examples/widgets/widgetsgallery/widgetgallery.py index d43ab26a5..75e6d4245 100644 --- a/examples/widgets/widgetsgallery/widgetgallery.py +++ b/examples/widgets/widgetsgallery/widgetgallery.py @@ -1,5 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +from __future__ import annotations import sys |