aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/3d/simple3d/simple3d.py1
-rw-r--r--examples/async/eratosthenes/eratosthenes_asyncio.py1
-rw-r--r--examples/async/eratosthenes/eratosthenes_trio.py1
-rw-r--r--examples/async/minimal/minimal_asyncio.py1
-rw-r--r--examples/async/minimal/minimal_trio.py1
-rw-r--r--examples/axcontainer/axviewer/axviewer.py1
-rw-r--r--examples/bluetooth/btscanner/device.py1
-rw-r--r--examples/bluetooth/btscanner/main.py1
-rw-r--r--examples/bluetooth/btscanner/service.py1
-rw-r--r--examples/bluetooth/heartrate_game/bluetoothbaseclass.py1
-rw-r--r--examples/bluetooth/heartrate_game/connectionhandler.py1
-rw-r--r--examples/bluetooth/heartrate_game/devicefinder.py1
-rw-r--r--examples/bluetooth/heartrate_game/devicehandler.py1
-rw-r--r--examples/bluetooth/heartrate_game/deviceinfo.py1
-rw-r--r--examples/bluetooth/heartrate_game/heartrate_global.py1
-rw-r--r--examples/bluetooth/heartrate_game/main.py1
-rw-r--r--examples/bluetooth/heartrate_server/heartrate_server.py1
-rw-r--r--examples/bluetooth/lowenergyscanner/characteristicinfo.py1
-rw-r--r--examples/bluetooth/lowenergyscanner/device.py1
-rw-r--r--examples/bluetooth/lowenergyscanner/deviceinfo.py1
-rw-r--r--examples/bluetooth/lowenergyscanner/main.py1
-rw-r--r--examples/bluetooth/lowenergyscanner/serviceinfo.py1
-rw-r--r--examples/charts/areachart/areachart.py1
-rw-r--r--examples/charts/audio/audio.py1
-rw-r--r--examples/charts/barchart/barchart.py1
-rw-r--r--examples/charts/callout/callout.py1
-rw-r--r--examples/charts/chartthemes/main.py1
-rw-r--r--examples/charts/donutbreakdown/donutbreakdown.py1
-rw-r--r--examples/charts/dynamicspline/chart.py1
-rw-r--r--examples/charts/dynamicspline/main.py1
-rw-r--r--examples/charts/legend/legend.py1
-rw-r--r--examples/charts/lineandbar/lineandbar.py1
-rw-r--r--examples/charts/linechart/linechart.py1
-rw-r--r--examples/charts/logvalueaxis/logvalueaxis.py1
-rw-r--r--examples/charts/memoryusage/memoryusage.py1
-rw-r--r--examples/charts/modeldata/modeldata.py1
-rw-r--r--examples/charts/nesteddonuts/nesteddonuts.py1
-rw-r--r--examples/charts/percentbarchart/percentbarchart.py1
-rw-r--r--examples/charts/piechart/piechart.py1
-rw-r--r--examples/charts/pointconfiguration/chartwindow.py4
-rw-r--r--examples/charts/pointconfiguration/pointconfiguration.py1
-rw-r--r--examples/charts/pointselectionandmarkers/pointselectionandmarkers.py1
-rw-r--r--examples/charts/pointselectionandmarkers/utilities.py1
-rw-r--r--examples/charts/qmlpolarchart/qmlpolarchart.py1
-rw-r--r--examples/charts/temperaturerecords/temperaturerecords.py1
-rw-r--r--examples/corelib/ipc/sharedmemory/dialog.py1
-rw-r--r--examples/corelib/ipc/sharedmemory/main.py1
-rw-r--r--examples/corelib/mimetypesbrowser/mainwindow.py1
-rw-r--r--examples/corelib/mimetypesbrowser/mimetypemodel.py5
-rw-r--r--examples/corelib/mimetypesbrowser/mimetypesbrowser.py1
-rw-r--r--examples/corelib/settingseditor/settingseditor.py1
-rw-r--r--examples/corelib/threads/mandelbrot.py1
-rw-r--r--examples/datavisualization/bars3d/bars3d.py1
-rw-r--r--examples/datavisualization/graphgallery/axesinputhandler.py1
-rw-r--r--examples/datavisualization/graphgallery/bargraph.py1
-rw-r--r--examples/datavisualization/graphgallery/custominputhandler.py1
-rw-r--r--examples/datavisualization/graphgallery/graphmodifier.py1
-rw-r--r--examples/datavisualization/graphgallery/highlightseries.py1
-rw-r--r--examples/datavisualization/graphgallery/main.py1
-rw-r--r--examples/datavisualization/graphgallery/rainfalldata.py1
-rw-r--r--examples/datavisualization/graphgallery/scatterdatamodifier.py1
-rw-r--r--examples/datavisualization/graphgallery/scattergraph.py1
-rw-r--r--examples/datavisualization/graphgallery/surfacegraph.py1
-rw-r--r--examples/datavisualization/graphgallery/surfacegraphmodifier.py1
-rw-r--r--examples/datavisualization/graphgallery/topographicseries.py1
-rw-r--r--examples/datavisualization/graphgallery/variantbardatamapping.py1
-rw-r--r--examples/datavisualization/graphgallery/variantbardataproxy.py1
-rw-r--r--examples/datavisualization/graphgallery/variantdataset.py1
-rw-r--r--examples/datavisualization/minimalsurface/main.py1
-rw-r--r--examples/datavisualization/qmlsurfacegallery/datasource.py1
-rw-r--r--examples/datavisualization/qmlsurfacegallery/main.py1
-rw-r--r--examples/datavisualization/surface/main.py1
-rw-r--r--examples/datavisualization/surface/surfacegraph.py1
-rw-r--r--examples/datavisualization/surface_model_numpy/main.py1
-rw-r--r--examples/datavisualization/surface_model_numpy/surfacegraph.py1
-rw-r--r--examples/datavisualization/surface_numpy/main.py1
-rw-r--r--examples/datavisualization/surface_numpy/surfacegraph.py1
-rw-r--r--examples/dbus/listnames/listnames.py1
-rw-r--r--examples/dbus/pingpong/ping.py1
-rw-r--r--examples/dbus/pingpong/pong.py1
-rw-r--r--examples/demos/colorpaletteclient/abstractresource.py1
-rw-r--r--examples/demos/colorpaletteclient/basiclogin.py1
-rw-r--r--examples/demos/colorpaletteclient/main.py1
-rw-r--r--examples/demos/colorpaletteclient/paginatedresource.py1
-rw-r--r--examples/demos/colorpaletteclient/restservice.py1
-rw-r--r--examples/demos/documentviewer/abstractviewer.py1
-rw-r--r--examples/demos/documentviewer/jsonviewer/jsonviewer.py1
-rw-r--r--examples/demos/documentviewer/main.py1
-rw-r--r--examples/demos/documentviewer/mainwindow.py1
-rw-r--r--examples/demos/documentviewer/pdfviewer/pdfviewer.py1
-rw-r--r--examples/demos/documentviewer/pdfviewer/zoomselector.py1
-rw-r--r--examples/demos/documentviewer/recentfilemenu.py1
-rw-r--r--examples/demos/documentviewer/recentfiles.py1
-rw-r--r--examples/demos/documentviewer/txtviewer/txtviewer.py1
-rw-r--r--examples/demos/documentviewer/viewerfactory.py1
-rw-r--r--examples/designer/taskmenuextension/main.py1
-rw-r--r--examples/designer/taskmenuextension/registertictactoe.py1
-rw-r--r--examples/designer/taskmenuextension/tictactoe.py1
-rw-r--r--examples/designer/taskmenuextension/tictactoeplugin.py1
-rw-r--r--examples/designer/taskmenuextension/tictactoetaskmenu.py1
-rw-r--r--examples/external/matplotlib/widget3d/widget3d.py1
-rw-r--r--examples/external/matplotlib/widget_gaussian/widget_gaussian.py1
-rw-r--r--examples/external/networkx/main.py1
-rw-r--r--examples/external/opencv/webcam_pattern_detection.py1
-rw-r--r--examples/external/pandas/dataframe_model.py1
-rw-r--r--examples/external/scikit/staining_colors_separation.py1
-rw-r--r--examples/graphs/2d/hellographs/main.py1
-rw-r--r--examples/graphs/3d/minimalsurfacegraph/main.py1
-rw-r--r--examples/graphs/3d/minimalsurfacegraph/minimalsurfacegraph.pyproject3
-rw-r--r--examples/graphs/3d/widgetgallery/doc/widgetgallery.rst11
-rw-r--r--examples/graphs/3d/widgetgraphgallery/axesinputhandler.py (renamed from examples/graphs/3d/widgetgallery/axesinputhandler.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/bargraph.py (renamed from examples/graphs/3d/widgetgallery/bargraph.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/custominputhandler.py (renamed from examples/graphs/3d/widgetgallery/custominputhandler.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/layer_1.png (renamed from examples/graphs/3d/widgetgallery/data/layer_1.png)bin34540 -> 34540 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/layer_2.png (renamed from examples/graphs/3d/widgetgallery/data/layer_2.png)bin10553 -> 10553 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/layer_3.png (renamed from examples/graphs/3d/widgetgallery/data/layer_3.png)bin7119 -> 7119 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/license.txt (renamed from examples/graphs/3d/widgetgallery/data/license.txt)0
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/maptexture.jpg (renamed from examples/graphs/3d/widgetgallery/data/maptexture.jpg)bin352922 -> 352922 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/narrowarrow.mesh (renamed from examples/graphs/3d/widgetgallery/data/narrowarrow.mesh)bin15420 -> 15420 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/oilrig.mesh (renamed from examples/graphs/3d/widgetgallery/data/oilrig.mesh)bin69728 -> 69728 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/pipe.mesh (renamed from examples/graphs/3d/widgetgallery/data/pipe.mesh)bin4760 -> 4760 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/raindata.txt (renamed from examples/graphs/3d/widgetgallery/data/raindata.txt)0
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/refinery.mesh (renamed from examples/graphs/3d/widgetgallery/data/refinery.mesh)bin75216 -> 75216 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/data/topography.png (renamed from examples/graphs/3d/widgetgallery/data/topography.png)bin395504 -> 395504 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.rst11
-rw-r--r--examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.webp (renamed from examples/graphs/3d/widgetgallery/doc/widgetgallery.webp)bin93150 -> 93150 bytes
-rw-r--r--examples/graphs/3d/widgetgraphgallery/graphmodifier.py (renamed from examples/graphs/3d/widgetgallery/graphmodifier.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/highlightseries.py (renamed from examples/graphs/3d/widgetgallery/highlightseries.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/main.py (renamed from examples/graphs/3d/widgetgallery/main.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/rainfalldata.py (renamed from examples/graphs/3d/widgetgallery/rainfalldata.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.py (renamed from examples/graphs/3d/widgetgallery/scatterdatamodifier.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/scattergraph.py (renamed from examples/graphs/3d/widgetgallery/scattergraph.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/surfacegraph.py (renamed from examples/graphs/3d/widgetgallery/surfacegraph.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.py (renamed from examples/graphs/3d/widgetgallery/surfacegraphmodifier.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/topographicseries.py (renamed from examples/graphs/3d/widgetgallery/topographicseries.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/variantbardatamapping.py (renamed from examples/graphs/3d/widgetgallery/variantbardatamapping.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/variantbardataproxy.py (renamed from examples/graphs/3d/widgetgallery/variantbardataproxy.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/variantdataset.py (renamed from examples/graphs/3d/widgetgallery/variantdataset.py)1
-rw-r--r--examples/graphs/3d/widgetgraphgallery/widgetgraphgallery.pyproject (renamed from examples/graphs/3d/widgetgallery/widgetgallery.pyproject)0
-rw-r--r--examples/gui/analogclock/main.py1
-rw-r--r--examples/gui/rhiwindow/main.py1
-rw-r--r--examples/gui/rhiwindow/rhiwindow.py1
-rw-r--r--examples/httpserver/afterrequest/main.py1
-rw-r--r--examples/installer_test/hello.py1
-rw-r--r--examples/location/mapviewer/main.py1
-rw-r--r--examples/multimedia/audiooutput/audiooutput.py1
-rw-r--r--examples/multimedia/audiosource/audiosource.py4
-rw-r--r--examples/multimedia/camera/camera.py1
-rw-r--r--examples/multimedia/camera/imagesettings.py1
-rw-r--r--examples/multimedia/camera/main.py1
-rw-r--r--examples/multimedia/camera/metadatadialog.py1
-rw-r--r--examples/multimedia/camera/videosettings.py1
-rw-r--r--examples/multimedia/player/player.py1
-rw-r--r--examples/multimedia/screencapture/main.py1
-rw-r--r--examples/multimedia/screencapture/screencapturepreview.py1
-rw-r--r--examples/multimedia/screencapture/screenlistmodel.py1
-rw-r--r--examples/multimedia/screencapture/windowlistmodel.py1
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.py1
-rw-r--r--examples/network/downloader/downloader.py1
-rw-r--r--examples/network/fortuneclient/fortuneclient.py1
-rw-r--r--examples/network/fortuneserver/fortuneserver.py1
-rw-r--r--examples/network/googlesuggest/googlesuggest.py7
-rw-r--r--examples/network/googlesuggest/main.py1
-rw-r--r--examples/network/googlesuggest/searchbox.py1
-rw-r--r--examples/network/loopback/dialog.py1
-rw-r--r--examples/network/loopback/main.py1
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.py1
-rw-r--r--examples/networkauth/redditclient/main.py1
-rw-r--r--examples/networkauth/redditclient/redditmodel.py1
-rw-r--r--examples/networkauth/redditclient/redditwrapper.py1
-rw-r--r--examples/opengl/contextinfo/contextinfo.py1
-rw-r--r--examples/opengl/hellogl2/glwidget.py1
-rw-r--r--examples/opengl/hellogl2/logo.py1
-rw-r--r--examples/opengl/hellogl2/main.py1
-rw-r--r--examples/opengl/hellogl2/mainwindow.py1
-rw-r--r--examples/opengl/hellogl2/window.py1
-rw-r--r--examples/opengl/textures/textures.py1
-rw-r--r--examples/opengl/threadedqopenglwidget/glwidget.py1
-rw-r--r--examples/opengl/threadedqopenglwidget/main.py1
-rw-r--r--examples/opengl/threadedqopenglwidget/mainwindow.py1
-rw-r--r--examples/opengl/threadedqopenglwidget/renderer.py1
-rw-r--r--examples/pdf/quickpdfviewer/main.py1
-rw-r--r--examples/pdfwidgets/pdfviewer/main.py1
-rw-r--r--examples/pdfwidgets/pdfviewer/mainwindow.py1
-rw-r--r--examples/pdfwidgets/pdfviewer/zoomselector.py1
-rw-r--r--examples/qml/editingmodel/main.py1
-rw-r--r--examples/qml/editingmodel/model.py1
-rw-r--r--examples/qml/signals/pytoqml1/main.py1
-rw-r--r--examples/qml/signals/pytoqml2/main.py1
-rw-r--r--examples/qml/signals/qmltopy1/main.py1
-rw-r--r--examples/qml/signals/qmltopy2/main.py1
-rw-r--r--examples/qml/signals/qmltopy3/main.py1
-rw-r--r--examples/qml/signals/qmltopy4/main.py1
-rw-r--r--examples/qml/textproperties/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/adding/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/adding/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/happybirthdaysong.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/binding/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/binding/happybirthdaysong.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/binding/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/binding/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/extended/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/methods/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/methods/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/methods/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/properties/birthdayparty.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/properties/main.py1
-rw-r--r--examples/qml/tutorials/extending-qml-advanced/properties/person.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter1-basics/basics.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter2-methods/methods.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter3-bindings/bindings.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.py1
-rw-r--r--examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.py1
-rw-r--r--examples/qml/usingmodel/usingmodel.py1
-rw-r--r--examples/quick/models/objectlistmodel/objectlistmodel.py1
-rw-r--r--examples/quick/models/stringlistmodel/stringlistmodel.py1
-rw-r--r--examples/quick/painteditem/painteditem.py1
-rw-r--r--examples/quick/rendercontrol/rendercontrol_opengl/cuberenderer.py1
-rw-r--r--examples/quick/rendercontrol/rendercontrol_opengl/main.py1
-rw-r--r--examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.py1
-rw-r--r--examples/quick/scenegraph/openglunderqml/main.py1
-rw-r--r--examples/quick/scenegraph/openglunderqml/squircle.py1
-rw-r--r--examples/quick/scenegraph/openglunderqml/squirclerenderer.py1
-rw-r--r--examples/quick/scenegraph/scenegraph_customgeometry/main.py1
-rw-r--r--examples/quick/window/main.py1
-rw-r--r--examples/quick3d/customgeometry/examplepoint.py1
-rw-r--r--examples/quick3d/customgeometry/exampletriangle.py1
-rw-r--r--examples/quick3d/customgeometry/main.py1
-rw-r--r--examples/quick3d/intro/main.py1
-rw-r--r--examples/quick3d/proceduraltexture/gradienttexture.py1
-rw-r--r--examples/quick3d/proceduraltexture/main.py1
-rw-r--r--examples/quickcontrols/contactslist/contactmodel.py1
-rw-r--r--examples/quickcontrols/contactslist/main.py1
-rw-r--r--examples/quickcontrols/filesystemexplorer/editormodels.py1
-rw-r--r--examples/quickcontrols/filesystemexplorer/main.py1
-rw-r--r--examples/quickcontrols/gallery/gallery.py1
-rw-r--r--examples/remoteobjects/modelview/modelviewclient.py1
-rw-r--r--examples/remoteobjects/modelview/modelviewserver.py1
-rw-r--r--examples/samplebinding/doc/samplebinding.rst15
-rw-r--r--examples/samplebinding/main.py1
-rw-r--r--examples/scriptableapplication/doc/scriptableapplication.rst13
-rw-r--r--examples/serialbus/can/bitratebox.py1
-rw-r--r--examples/serialbus/can/canbusdeviceinfobox.py1
-rw-r--r--examples/serialbus/can/canbusdeviceinfodialog.py1
-rw-r--r--examples/serialbus/can/connectdialog.py1
-rw-r--r--examples/serialbus/can/main.py1
-rw-r--r--examples/serialbus/can/mainwindow.py1
-rw-r--r--examples/serialbus/can/receivedframesmodel.py1
-rw-r--r--examples/serialbus/can/receivedframesview.py1
-rw-r--r--examples/serialbus/can/sendframebox.py1
-rw-r--r--examples/serialbus/modbus/modbusclient/main.py1
-rw-r--r--examples/serialbus/modbus/modbusclient/mainwindow.py1
-rw-r--r--examples/serialbus/modbus/modbusclient/settingsdialog.py1
-rw-r--r--examples/serialbus/modbus/modbusclient/writeregistermodel.py1
-rw-r--r--examples/serialport/terminal/console.py1
-rw-r--r--examples/serialport/terminal/main.py1
-rw-r--r--examples/serialport/terminal/mainwindow.py1
-rw-r--r--examples/serialport/terminal/settingsdialog.py1
-rw-r--r--examples/spatialaudio/audiopanning/main.py1
-rw-r--r--examples/speech/hello_speak/main.py1
-rw-r--r--examples/speech/hello_speak/mainwindow.py1
-rw-r--r--examples/sql/books/bookdelegate.py1
-rw-r--r--examples/sql/books/bookwindow.py1
-rw-r--r--examples/sql/books/createdb.py1
-rw-r--r--examples/sql/books/main.py1
-rw-r--r--examples/sql/relationaltablemodel/connection.py1
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.py1
-rw-r--r--examples/statemachine/moveblocks/moveblocks.py1
-rw-r--r--examples/statemachine/ping_pong/ping_pong.py1
-rw-r--r--examples/statemachine/rogue/rogue.py1
-rw-r--r--examples/statemachine/trafficlight/trafficlight.py1
-rw-r--r--examples/uitools/uiloader/uiloader.py1
-rw-r--r--examples/utils/pyside_config.py1
-rw-r--r--examples/webchannel/standalone/core.py1
-rw-r--r--examples/webchannel/standalone/dialog.py1
-rw-r--r--examples/webchannel/standalone/main.py1
-rw-r--r--examples/webchannel/standalone/websocketclientwrapper.py1
-rw-r--r--examples/webchannel/standalone/websockettransport.py1
-rw-r--r--examples/webenginequick/nanobrowser/quicknanobrowser.py1
-rw-r--r--examples/webenginewidgets/markdowneditor/document.py1
-rw-r--r--examples/webenginewidgets/markdowneditor/main.py1
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.py1
-rw-r--r--examples/webenginewidgets/markdowneditor/previewpage.py1
-rw-r--r--examples/webenginewidgets/notifications/main.py1
-rw-r--r--examples/webenginewidgets/notifications/notificationpopup.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/browser.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/browserwindow.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadmanagerwidget.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/downloadwidget.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/main.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/webpage.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/webpopupwindow.py1
-rw-r--r--examples/webenginewidgets/simplebrowser/webview.py1
-rw-r--r--examples/webenginewidgets/widgetsnanobrowser/widgetsnanobrowser.py1
-rw-r--r--examples/widgetbinding/dialog.py1
-rw-r--r--examples/widgetbinding/doc/widgetbinding.md14
-rw-r--r--examples/widgetbinding/main.py1
-rw-r--r--examples/widgetbinding/registerwigglywidget.py1
-rw-r--r--examples/widgetbinding/wigglywidget.py1
-rw-r--r--examples/widgets/animation/animatedtiles/animatedtiles.py1
-rw-r--r--examples/widgets/animation/appchooser/appchooser.py1
-rw-r--r--examples/widgets/animation/easing/easing.py1
-rw-r--r--examples/widgets/animation/states/states.py1
-rw-r--r--examples/widgets/animation/states/states_rc.py1
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.py1
-rw-r--r--examples/widgets/desktop/systray/main.py1
-rw-r--r--examples/widgets/desktop/systray/window.py1
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.py1
-rw-r--r--examples/widgets/dialogs/classwizard/listchooser.py1
-rw-r--r--examples/widgets/dialogs/extension/extension.py1
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.py1
-rw-r--r--examples/widgets/dialogs/licensewizard/main.py1
-rw-r--r--examples/widgets/dialogs/standarddialogs/standarddialogs.py1
-rw-r--r--examples/widgets/dialogs/tabdialog/tabdialog.py1
-rw-r--r--examples/widgets/dialogs/trivialwizard/trivialwizard.py1
-rw-r--r--examples/widgets/draganddrop/draggableicons/draggableicons.py1
-rw-r--r--examples/widgets/draganddrop/draggabletext/draggabletext.py1
-rw-r--r--examples/widgets/draganddrop/dropsite/droparea.py1
-rw-r--r--examples/widgets/draganddrop/dropsite/dropsitewindow.py1
-rw-r--r--examples/widgets/draganddrop/dropsite/main.py1
-rw-r--r--examples/widgets/effects/blurpicker/blureffect.py1
-rw-r--r--examples/widgets/effects/blurpicker/blurpicker.py1
-rw-r--r--examples/widgets/effects/blurpicker/main.py1
-rw-r--r--examples/widgets/effects/lighting/lighting.py1
-rw-r--r--examples/widgets/gettext/main.py1
-rw-r--r--examples/widgets/graphicsview/anchorlayout/anchorlayout.py1
-rw-r--r--examples/widgets/graphicsview/collidingmice/collidingmice.py1
-rw-r--r--examples/widgets/graphicsview/collidingmice/mice_rc.py1
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramscene.py1
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/dragdroprobot.py1
-rw-r--r--examples/widgets/graphicsview/elasticnodes/elasticnodes.py1
-rw-r--r--examples/widgets/imageviewer/imageviewer.py1
-rw-r--r--examples/widgets/imageviewer/main.py1
-rw-r--r--examples/widgets/itemviews/address_book/adddialogwidget.py1
-rw-r--r--examples/widgets/itemviews/address_book/address_book.py1
-rw-r--r--examples/widgets/itemviews/address_book/addresswidget.py1
-rw-r--r--examples/widgets/itemviews/address_book/newaddresstab.py1
-rw-r--r--examples/widgets/itemviews/address_book/tablemodel.py1
-rw-r--r--examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py1
-rw-r--r--examples/widgets/itemviews/dirview/dirview.py1
-rw-r--r--examples/widgets/itemviews/editabletreemodel/main.py1
-rw-r--r--examples/widgets/itemviews/editabletreemodel/mainwindow.py1
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treeitem.py1
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.py1
-rw-r--r--examples/widgets/itemviews/fetchmore/fetchmore.py1
-rw-r--r--examples/widgets/itemviews/jsonmodel/jsonmodel.py5
-rw-r--r--examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.py1
-rw-r--r--examples/widgets/itemviews/spreadsheet/main.py1
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheet.py4
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetdelegate.py5
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheetitem.py5
-rw-r--r--examples/widgets/itemviews/stardelegate/stardelegate.py1
-rw-r--r--examples/widgets/itemviews/stardelegate/stareditor.py1
-rw-r--r--examples/widgets/itemviews/stardelegate/starrating.py1
-rw-r--r--examples/widgets/layouts/basiclayouts/basiclayouts.py1
-rw-r--r--examples/widgets/layouts/borderlayout/borderlayout.py1
-rw-r--r--examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py1
-rw-r--r--examples/widgets/layouts/flowlayout/flowlayout.py1
-rw-r--r--examples/widgets/linguist/main.py1
-rw-r--r--examples/widgets/mainwindows/application/application.py1
-rw-r--r--examples/widgets/mainwindows/dockwidgets/dockwidgets.py1
-rw-r--r--examples/widgets/mainwindows/mdi/mdi.py1
-rw-r--r--examples/widgets/painting/basicdrawing/basicdrawing.py1
-rw-r--r--examples/widgets/painting/concentriccircles/concentriccircles.py1
-rw-r--r--examples/widgets/painting/painter/painter.py1
-rw-r--r--examples/widgets/painting/plot/plot.py1
-rw-r--r--examples/widgets/rhi/simplerhiwidget/examplewidget.py1
-rw-r--r--examples/widgets/rhi/simplerhiwidget/main.py1
-rw-r--r--examples/widgets/richtext/orderform/orderform.py1
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.py1
-rw-r--r--examples/widgets/richtext/textedit/main.py1
-rw-r--r--examples/widgets/richtext/textedit/textedit.py1
-rw-r--r--examples/widgets/richtext/textobject/textobject.py1
-rw-r--r--examples/widgets/thread_signals/thread_signals.py1
-rw-r--r--examples/widgets/tools/regularexpression/regularexpression.py1
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part1.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part2.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part3.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part4.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part5.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part6.py1
-rw-r--r--examples/widgets/tutorials/addressbook/part7.py1
-rw-r--r--examples/widgets/tutorials/cannon/t1.py1
-rw-r--r--examples/widgets/tutorials/cannon/t10.py1
-rw-r--r--examples/widgets/tutorials/cannon/t11.py1
-rw-r--r--examples/widgets/tutorials/cannon/t12.py1
-rw-r--r--examples/widgets/tutorials/cannon/t13.py1
-rw-r--r--examples/widgets/tutorials/cannon/t14.py1
-rw-r--r--examples/widgets/tutorials/cannon/t2.py1
-rw-r--r--examples/widgets/tutorials/cannon/t3.py1
-rw-r--r--examples/widgets/tutorials/cannon/t4.py1
-rw-r--r--examples/widgets/tutorials/cannon/t5.py1
-rw-r--r--examples/widgets/tutorials/cannon/t6.py1
-rw-r--r--examples/widgets/tutorials/cannon/t7.py1
-rw-r--r--examples/widgets/tutorials/cannon/t8.py1
-rw-r--r--examples/widgets/tutorials/cannon/t9.py1
-rw-r--r--examples/widgets/tutorials/modelview/1_readonly.py1
-rw-r--r--examples/widgets/tutorials/modelview/2_formatting.py1
-rw-r--r--examples/widgets/tutorials/modelview/3_changingmodel.py1
-rw-r--r--examples/widgets/tutorials/modelview/4_headers.py1
-rw-r--r--examples/widgets/tutorials/modelview/5_edit.py1
-rw-r--r--examples/widgets/tutorials/modelview/6_treeview.py1
-rw-r--r--examples/widgets/tutorials/modelview/7_selections.py1
-rw-r--r--examples/widgets/widgets/charactermap/characterwidget.py1
-rw-r--r--examples/widgets/widgets/charactermap/fontinfodialog.py1
-rw-r--r--examples/widgets/widgets/charactermap/main.py1
-rw-r--r--examples/widgets/widgets/charactermap/mainwindow.py1
-rw-r--r--examples/widgets/widgets/digitalclock/digitalclock.py1
-rw-r--r--examples/widgets/widgets/tetrix/tetrix.py1
-rw-r--r--examples/widgets/widgetsgallery/main.py1
-rw-r--r--examples/widgets/widgetsgallery/widgetgallery.py1
-rw-r--r--examples/xml/dombookmarks/dombookmarks.py1
434 files changed, 466 insertions, 47 deletions
diff --git a/examples/3d/simple3d/simple3d.py b/examples/3d/simple3d/simple3d.py
index eef0dca5d..23ceae854 100644
--- a/examples/3d/simple3d/simple3d.py
+++ b/examples/3d/simple3d/simple3d.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 qt3d/simple-cpp example from Qt v5.x"""
diff --git a/examples/async/eratosthenes/eratosthenes_asyncio.py b/examples/async/eratosthenes/eratosthenes_asyncio.py
index c5d7fc2fe..54378daae 100644
--- a/examples/async/eratosthenes/eratosthenes_asyncio.py
+++ b/examples/async/eratosthenes/eratosthenes_asyncio.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, QObject, Signal, Slot)
from PySide6.QtGui import (QColor, QFont, QPalette)
diff --git a/examples/async/eratosthenes/eratosthenes_trio.py b/examples/async/eratosthenes/eratosthenes_trio.py
index 89d3d1ce6..9530077e8 100644
--- a/examples/async/eratosthenes/eratosthenes_trio.py
+++ b/examples/async/eratosthenes/eratosthenes_trio.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, QEvent, QObject, QTimer, Signal, Slot)
from PySide6.QtGui import (QColor, QFont, QPalette)
diff --git a/examples/async/minimal/minimal_asyncio.py b/examples/async/minimal/minimal_asyncio.py
index a6c4708b3..7ffd5030f 100644
--- a/examples/async/minimal/minimal_asyncio.py
+++ b/examples/async/minimal/minimal_asyncio.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
from PySide6.QtWidgets import (QApplication, QLabel, QMainWindow, QPushButton, QVBoxLayout, QWidget)
diff --git a/examples/async/minimal/minimal_trio.py b/examples/async/minimal/minimal_trio.py
index 5ae19fa36..5d331c109 100644
--- a/examples/async/minimal/minimal_trio.py
+++ b/examples/async/minimal/minimal_trio.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, QEvent, QObject, Signal, Slot)
from PySide6.QtWidgets import (QApplication, QLabel, QMainWindow, QPushButton, QVBoxLayout, QWidget)
diff --git a/examples/axcontainer/axviewer/axviewer.py b/examples/axcontainer/axviewer/axviewer.py
index bcd4c2714..a591b1689 100644
--- a/examples/axcontainer/axviewer/axviewer.py
+++ b/examples/axcontainer/axviewer/axviewer.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 Active Qt Viewer example"""
diff --git a/examples/bluetooth/btscanner/device.py b/examples/bluetooth/btscanner/device.py
index c75f5b8a1..f5a361fa9 100644
--- a/examples/bluetooth/btscanner/device.py
+++ b/examples/bluetooth/btscanner/device.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, Slot
from PySide6.QtGui import QColor
diff --git a/examples/bluetooth/btscanner/main.py b/examples/bluetooth/btscanner/main.py
index a54a862a2..cab83de28 100644
--- a/examples/bluetooth/btscanner/main.py
+++ b/examples/bluetooth/btscanner/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 bluetooth/btscanner example from Qt v6.x"""
diff --git a/examples/bluetooth/btscanner/service.py b/examples/bluetooth/btscanner/service.py
index 31df8a9ea..928c8cde2 100644
--- a/examples/bluetooth/btscanner/service.py
+++ b/examples/bluetooth/btscanner/service.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.QtWidgets import QDialog
diff --git a/examples/bluetooth/heartrate_game/bluetoothbaseclass.py b/examples/bluetooth/heartrate_game/bluetoothbaseclass.py
index cc5c9dbd0..6278b0418 100644
--- a/examples/bluetooth/heartrate_game/bluetoothbaseclass.py
+++ b/examples/bluetooth/heartrate_game/bluetoothbaseclass.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 QObject, Property, Signal, Slot
diff --git a/examples/bluetooth/heartrate_game/connectionhandler.py b/examples/bluetooth/heartrate_game/connectionhandler.py
index 7bf60bbc5..17b1500d9 100644
--- a/examples/bluetooth/heartrate_game/connectionhandler.py
+++ b/examples/bluetooth/heartrate_game/connectionhandler.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/bluetooth/heartrate_game/devicefinder.py b/examples/bluetooth/heartrate_game/devicefinder.py
index e581d12ec..5c00e7c94 100644
--- a/examples/bluetooth/heartrate_game/devicefinder.py
+++ b/examples/bluetooth/heartrate_game/devicefinder.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.QtBluetooth import (QBluetoothDeviceDiscoveryAgent,
diff --git a/examples/bluetooth/heartrate_game/devicehandler.py b/examples/bluetooth/heartrate_game/devicehandler.py
index df34052b8..67dae024f 100644
--- a/examples/bluetooth/heartrate_game/devicehandler.py
+++ b/examples/bluetooth/heartrate_game/devicehandler.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 struct
diff --git a/examples/bluetooth/heartrate_game/deviceinfo.py b/examples/bluetooth/heartrate_game/deviceinfo.py
index 5fd5c3270..136bbbacb 100644
--- a/examples/bluetooth/heartrate_game/deviceinfo.py
+++ b/examples/bluetooth/heartrate_game/deviceinfo.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/bluetooth/heartrate_game/heartrate_global.py b/examples/bluetooth/heartrate_game/heartrate_global.py
index de5c37ac3..384eb93a7 100644
--- a/examples/bluetooth/heartrate_game/heartrate_global.py
+++ b/examples/bluetooth/heartrate_game/heartrate_global.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 os
import sys
diff --git a/examples/bluetooth/heartrate_game/main.py b/examples/bluetooth/heartrate_game/main.py
index 3cb4f0672..076085f0c 100644
--- a/examples/bluetooth/heartrate_game/main.py
+++ b/examples/bluetooth/heartrate_game/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 bluetooth/heartrate-game example from Qt v6.x"""
diff --git a/examples/bluetooth/heartrate_server/heartrate_server.py b/examples/bluetooth/heartrate_server/heartrate_server.py
index abbf4eb7f..59b5af7b2 100644
--- a/examples/bluetooth/heartrate_server/heartrate_server.py
+++ b/examples/bluetooth/heartrate_server/heartrate_server.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 bluetooth/heartrate-server example from Qt v6.x"""
diff --git a/examples/bluetooth/lowenergyscanner/characteristicinfo.py b/examples/bluetooth/lowenergyscanner/characteristicinfo.py
index 42bde8753..18f4c4202 100644
--- a/examples/bluetooth/lowenergyscanner/characteristicinfo.py
+++ b/examples/bluetooth/lowenergyscanner/characteristicinfo.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 QObject, Property, Signal
from PySide6.QtBluetooth import QLowEnergyCharacteristic, QBluetoothUuid
diff --git a/examples/bluetooth/lowenergyscanner/device.py b/examples/bluetooth/lowenergyscanner/device.py
index 09108cf69..afa30ff80 100644
--- a/examples/bluetooth/lowenergyscanner/device.py
+++ b/examples/bluetooth/lowenergyscanner/device.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 warnings
from PySide6.QtBluetooth import (QBluetoothDeviceDiscoveryAgent, QLowEnergyController,
QBluetoothDeviceInfo, QBluetoothUuid, QLowEnergyService)
diff --git a/examples/bluetooth/lowenergyscanner/deviceinfo.py b/examples/bluetooth/lowenergyscanner/deviceinfo.py
index 35a568821..0952f8d74 100644
--- a/examples/bluetooth/lowenergyscanner/deviceinfo.py
+++ b/examples/bluetooth/lowenergyscanner/deviceinfo.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/bluetooth/lowenergyscanner/main.py b/examples/bluetooth/lowenergyscanner/main.py
index ec12f99e7..6b84a1031 100644
--- a/examples/bluetooth/lowenergyscanner/main.py
+++ b/examples/bluetooth/lowenergyscanner/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 bluetooth/lowenergyscanner example from Qt v6.x"""
diff --git a/examples/bluetooth/lowenergyscanner/serviceinfo.py b/examples/bluetooth/lowenergyscanner/serviceinfo.py
index cddffe663..30df4e0be 100644
--- a/examples/bluetooth/lowenergyscanner/serviceinfo.py
+++ b/examples/bluetooth/lowenergyscanner/serviceinfo.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 QObject, Property, Signal
from PySide6.QtBluetooth import QLowEnergyService
diff --git a/examples/charts/areachart/areachart.py b/examples/charts/areachart/areachart.py
index 164264ff7..d1e2b7042 100644
--- a/examples/charts/areachart/areachart.py
+++ b/examples/charts/areachart/areachart.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 areachart example from Qt v6.x"""
diff --git a/examples/charts/audio/audio.py b/examples/charts/audio/audio.py
index 8ba0b20c5..1d603f880 100644
--- a/examples/charts/audio/audio.py
+++ b/examples/charts/audio/audio.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 charts/audio example from Qt v5.x"""
diff --git a/examples/charts/barchart/barchart.py b/examples/charts/barchart/barchart.py
index 66126ad8a..f542b9fa3 100644
--- a/examples/charts/barchart/barchart.py
+++ b/examples/charts/barchart/barchart.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 linechart example from Qt v6.x"""
diff --git a/examples/charts/callout/callout.py b/examples/charts/callout/callout.py
index 622938d16..08c34fb6d 100644
--- a/examples/charts/callout/callout.py
+++ b/examples/charts/callout/callout.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 Callout example from Qt v5.x"""
diff --git a/examples/charts/chartthemes/main.py b/examples/charts/chartthemes/main.py
index 5787710ca..1157f270e 100644
--- a/examples/charts/chartthemes/main.py
+++ b/examples/charts/chartthemes/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 Chart Themes example from Qt v5.x"""
diff --git a/examples/charts/donutbreakdown/donutbreakdown.py b/examples/charts/donutbreakdown/donutbreakdown.py
index 9111d4aac..c4340931d 100644
--- a/examples/charts/donutbreakdown/donutbreakdown.py
+++ b/examples/charts/donutbreakdown/donutbreakdown.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 Donut Chart Breakdown example from Qt v5.x"""
diff --git a/examples/charts/dynamicspline/chart.py b/examples/charts/dynamicspline/chart.py
index 59ddef13f..0858007f1 100644
--- a/examples/charts/dynamicspline/chart.py
+++ b/examples/charts/dynamicspline/chart.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 random
diff --git a/examples/charts/dynamicspline/main.py b/examples/charts/dynamicspline/main.py
index 8405824dc..cbb5109f1 100644
--- a/examples/charts/dynamicspline/main.py
+++ b/examples/charts/dynamicspline/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 Dynamic Spline example from Qt v5.x"""
import sys
diff --git a/examples/charts/legend/legend.py b/examples/charts/legend/legend.py
index 5417a940f..36c5b6ed0 100644
--- a/examples/charts/legend/legend.py
+++ b/examples/charts/legend/legend.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 Legend example from Qt v5.x"""
diff --git a/examples/charts/lineandbar/lineandbar.py b/examples/charts/lineandbar/lineandbar.py
index 62721c763..e824b3aa1 100644
--- a/examples/charts/lineandbar/lineandbar.py
+++ b/examples/charts/lineandbar/lineandbar.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 line/bar example from Qt v5.x"""
diff --git a/examples/charts/linechart/linechart.py b/examples/charts/linechart/linechart.py
index cee4c16db..b618cbc33 100644
--- a/examples/charts/linechart/linechart.py
+++ b/examples/charts/linechart/linechart.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 linechart example from Qt v5.x"""
diff --git a/examples/charts/logvalueaxis/logvalueaxis.py b/examples/charts/logvalueaxis/logvalueaxis.py
index e727c1200..be58ca0a4 100644
--- a/examples/charts/logvalueaxis/logvalueaxis.py
+++ b/examples/charts/logvalueaxis/logvalueaxis.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 Logarithmic Axis Example from Qt v5.x"""
diff --git a/examples/charts/memoryusage/memoryusage.py b/examples/charts/memoryusage/memoryusage.py
index 3ba42368e..543b5f562 100644
--- a/examples/charts/memoryusage/memoryusage.py
+++ b/examples/charts/memoryusage/memoryusage.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 Charts example: Simple memory usage viewer"""
diff --git a/examples/charts/modeldata/modeldata.py b/examples/charts/modeldata/modeldata.py
index 0e36f7770..f12eb8999 100644
--- a/examples/charts/modeldata/modeldata.py
+++ b/examples/charts/modeldata/modeldata.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 Model Data example from Qt v5.x"""
diff --git a/examples/charts/nesteddonuts/nesteddonuts.py b/examples/charts/nesteddonuts/nesteddonuts.py
index 49173c33a..cfc2f80e9 100644
--- a/examples/charts/nesteddonuts/nesteddonuts.py
+++ b/examples/charts/nesteddonuts/nesteddonuts.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 Nested Donuts example from Qt v5.x"""
diff --git a/examples/charts/percentbarchart/percentbarchart.py b/examples/charts/percentbarchart/percentbarchart.py
index 9f70c0328..e518c1721 100644
--- a/examples/charts/percentbarchart/percentbarchart.py
+++ b/examples/charts/percentbarchart/percentbarchart.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 Percent Bar Chart example from Qt v5.x"""
diff --git a/examples/charts/piechart/piechart.py b/examples/charts/piechart/piechart.py
index e71359a98..d866ef9ed 100644
--- a/examples/charts/piechart/piechart.py
+++ b/examples/charts/piechart/piechart.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 Pie Chart Example from Qt v5.x"""
diff --git a/examples/charts/pointconfiguration/chartwindow.py b/examples/charts/pointconfiguration/chartwindow.py
index 36b10aa16..70ef84268 100644
--- a/examples/charts/pointconfiguration/chartwindow.py
+++ b/examples/charts/pointconfiguration/chartwindow.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 Selected Point Configuration Example from Qt 6.5"""
from PySide6.QtCore import QPointF, Slot
@@ -7,7 +8,6 @@ from PySide6.QtGui import QColor, QIcon, QPainter
from PySide6.QtWidgets import QMainWindow, QLineEdit, QLabel, QComboBox
from PySide6.QtWidgets import QCheckBox, QWidget, QGridLayout, QHBoxLayout
from PySide6.QtCharts import QLineSeries, QXYSeries, QChart, QChartView
-from typing import Union
PointConfig = QXYSeries.PointConfiguration
@@ -95,7 +95,7 @@ class ChartWindow(QMainWindow):
self._select_point(4)
@Slot(QPointF)
- def _select_point(self, point: Union[QPointF, int]):
+ def _select_point(self, point: QPointF | int):
try:
index = (self._series.points().index(point.toPoint()) if
isinstance(point, QPointF) else point)
diff --git a/examples/charts/pointconfiguration/pointconfiguration.py b/examples/charts/pointconfiguration/pointconfiguration.py
index d8c90d2df..b7bf43064 100644
--- a/examples/charts/pointconfiguration/pointconfiguration.py
+++ b/examples/charts/pointconfiguration/pointconfiguration.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 Light Markers Points Selection example from Qt v6.2"""
import sys
diff --git a/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py b/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py
index df7b61687..f151287f6 100644
--- a/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py
+++ b/examples/charts/pointselectionandmarkers/pointselectionandmarkers.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 Light Markers Points Selection example from Qt v6.2"""
import sys
diff --git a/examples/charts/pointselectionandmarkers/utilities.py b/examples/charts/pointselectionandmarkers/utilities.py
index b27a2542b..5b47dddc5 100644
--- a/examples/charts/pointselectionandmarkers/utilities.py
+++ b/examples/charts/pointselectionandmarkers/utilities.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.QtGui import QImage, QPainter, QColor
from PySide6.QtCore import Qt
diff --git a/examples/charts/qmlpolarchart/qmlpolarchart.py b/examples/charts/qmlpolarchart/qmlpolarchart.py
index 6391fc305..594ac7a6a 100644
--- a/examples/charts/qmlpolarchart/qmlpolarchart.py
+++ b/examples/charts/qmlpolarchart/qmlpolarchart.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 QML Polar Chart Example from Qt v5.x"""
diff --git a/examples/charts/temperaturerecords/temperaturerecords.py b/examples/charts/temperaturerecords/temperaturerecords.py
index 358f3818e..ef129c073 100644
--- a/examples/charts/temperaturerecords/temperaturerecords.py
+++ b/examples/charts/temperaturerecords/temperaturerecords.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 Temperature Records example from Qt v5.x"""
diff --git a/examples/corelib/ipc/sharedmemory/dialog.py b/examples/corelib/ipc/sharedmemory/dialog.py
index 134900047..8fe6f0534 100644
--- a/examples/corelib/ipc/sharedmemory/dialog.py
+++ b/examples/corelib/ipc/sharedmemory/dialog.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 os
from pathlib import Path
diff --git a/examples/corelib/ipc/sharedmemory/main.py b/examples/corelib/ipc/sharedmemory/main.py
index e497c8de6..ef8733782 100644
--- a/examples/corelib/ipc/sharedmemory/main.py
+++ b/examples/corelib/ipc/sharedmemory/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 ipc/sharedmemory example from Qt v6.x"""
diff --git a/examples/corelib/mimetypesbrowser/mainwindow.py b/examples/corelib/mimetypesbrowser/mainwindow.py
index 76404eeb7..beed81a53 100644
--- a/examples/corelib/mimetypesbrowser/mainwindow.py
+++ b/examples/corelib/mimetypesbrowser/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 mimetypemodel import MimeTypeModel
from PySide6.QtCore import (QDir, QFileInfo, QMimeDatabase, QModelIndex, Qt,
diff --git a/examples/corelib/mimetypesbrowser/mimetypemodel.py b/examples/corelib/mimetypesbrowser/mimetypemodel.py
index 5243f110e..96ad4e290 100644
--- a/examples/corelib/mimetypesbrowser/mimetypemodel.py
+++ b/examples/corelib/mimetypesbrowser/mimetypemodel.py
@@ -1,7 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-from typing import List
+from __future__ import annotations
from PySide6.QtCore import QMimeDatabase, QMimeType, QModelIndex, QObject, Qt, qWarning
from PySide6.QtGui import QStandardItem, QStandardItemModel
@@ -29,7 +28,7 @@ class MimeTypeModel(QStandardItemModel):
def populate(self):
mime_database = QMimeDatabase()
- all_types: List[QMimeType] = mime_database.allMimeTypes()
+ all_types: list[QMimeType] = mime_database.allMimeTypes()
# Move top level types to rear end of list, sort this partition,
# create top level items and truncate the list.
diff --git a/examples/corelib/mimetypesbrowser/mimetypesbrowser.py b/examples/corelib/mimetypesbrowser/mimetypesbrowser.py
index 4742a31b8..4f7b6959a 100644
--- a/examples/corelib/mimetypesbrowser/mimetypesbrowser.py
+++ b/examples/corelib/mimetypesbrowser/mimetypesbrowser.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 corelib/mimetypes/mimetypebrowser example from from Qt"""
diff --git a/examples/corelib/settingseditor/settingseditor.py b/examples/corelib/settingseditor/settingseditor.py
index f87a2f4b5..bd5766adb 100644
--- a/examples/corelib/settingseditor/settingseditor.py
+++ b/examples/corelib/settingseditor/settingseditor.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/tools/settingseditor example from Qt v5.x"""
diff --git a/examples/corelib/threads/mandelbrot.py b/examples/corelib/threads/mandelbrot.py
index 4689813d4..d2d108e1f 100644
--- a/examples/corelib/threads/mandelbrot.py
+++ b/examples/corelib/threads/mandelbrot.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 corelib/threads/mandelbrot example from Qt v5.x, originating from PyQt"""
diff --git a/examples/datavisualization/bars3d/bars3d.py b/examples/datavisualization/bars3d/bars3d.py
index f1283fcbd..587c91c37 100644
--- a/examples/datavisualization/bars3d/bars3d.py
+++ b/examples/datavisualization/bars3d/bars3d.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 QtDataVisualization example"""
diff --git a/examples/datavisualization/graphgallery/axesinputhandler.py b/examples/datavisualization/graphgallery/axesinputhandler.py
index 7f721d4aa..25f2e9b42 100644
--- a/examples/datavisualization/graphgallery/axesinputhandler.py
+++ b/examples/datavisualization/graphgallery/axesinputhandler.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum
from math import sin, cos, degrees
diff --git a/examples/datavisualization/graphgallery/bargraph.py b/examples/datavisualization/graphgallery/bargraph.py
index 7938a5ca1..b89560dd8 100644
--- a/examples/datavisualization/graphgallery/bargraph.py
+++ b/examples/datavisualization/graphgallery/bargraph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from graphmodifier import GraphModifier
diff --git a/examples/datavisualization/graphgallery/custominputhandler.py b/examples/datavisualization/graphgallery/custominputhandler.py
index 0402be607..6c856bf1a 100644
--- a/examples/datavisualization/graphgallery/custominputhandler.py
+++ b/examples/datavisualization/graphgallery/custominputhandler.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum
from math import sin, cos, degrees
diff --git a/examples/datavisualization/graphgallery/graphmodifier.py b/examples/datavisualization/graphgallery/graphmodifier.py
index e8d94ee96..f79e3d2b7 100644
--- a/examples/datavisualization/graphgallery/graphmodifier.py
+++ b/examples/datavisualization/graphgallery/graphmodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from math import atan, degrees
diff --git a/examples/datavisualization/graphgallery/highlightseries.py b/examples/datavisualization/graphgallery/highlightseries.py
index b5495b422..ea52799e0 100644
--- a/examples/datavisualization/graphgallery/highlightseries.py
+++ b/examples/datavisualization/graphgallery/highlightseries.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QPoint, Qt, Slot
from PySide6.QtGui import QLinearGradient, QVector3D
diff --git a/examples/datavisualization/graphgallery/main.py b/examples/datavisualization/graphgallery/main.py
index 4b57b85dd..9eb87ff5f 100644
--- a/examples/datavisualization/graphgallery/main.py
+++ b/examples/datavisualization/graphgallery/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the Qt DataVisualization graphgallery example from Qt v6.x"""
diff --git a/examples/datavisualization/graphgallery/rainfalldata.py b/examples/datavisualization/graphgallery/rainfalldata.py
index 18d6de8d7..28b177910 100644
--- a/examples/datavisualization/graphgallery/rainfalldata.py
+++ b/examples/datavisualization/graphgallery/rainfalldata.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import sys
diff --git a/examples/datavisualization/graphgallery/scatterdatamodifier.py b/examples/datavisualization/graphgallery/scatterdatamodifier.py
index 7c16ef7b9..52e27488a 100644
--- a/examples/datavisualization/graphgallery/scatterdatamodifier.py
+++ b/examples/datavisualization/graphgallery/scatterdatamodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from math import cos, degrees, sqrt
diff --git a/examples/datavisualization/graphgallery/scattergraph.py b/examples/datavisualization/graphgallery/scattergraph.py
index ffcd428ee..14a690280 100644
--- a/examples/datavisualization/graphgallery/scattergraph.py
+++ b/examples/datavisualization/graphgallery/scattergraph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, QSize, Qt
from PySide6.QtWidgets import (QCheckBox, QComboBox, QCommandLinkButton,
diff --git a/examples/datavisualization/graphgallery/surfacegraph.py b/examples/datavisualization/graphgallery/surfacegraph.py
index d42f496f9..78d5cdcf5 100644
--- a/examples/datavisualization/graphgallery/surfacegraph.py
+++ b/examples/datavisualization/graphgallery/surfacegraph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from surfacegraphmodifier import SurfaceGraphModifier
diff --git a/examples/datavisualization/graphgallery/surfacegraphmodifier.py b/examples/datavisualization/graphgallery/surfacegraphmodifier.py
index 68499fac8..9cd0afeae 100644
--- a/examples/datavisualization/graphgallery/surfacegraphmodifier.py
+++ b/examples/datavisualization/graphgallery/surfacegraphmodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import os
from math import sqrt, sin
diff --git a/examples/datavisualization/graphgallery/topographicseries.py b/examples/datavisualization/graphgallery/topographicseries.py
index 350edcb4f..95995e361 100644
--- a/examples/datavisualization/graphgallery/topographicseries.py
+++ b/examples/datavisualization/graphgallery/topographicseries.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 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.QtGui import QImage, QVector3D
diff --git a/examples/datavisualization/graphgallery/variantbardatamapping.py b/examples/datavisualization/graphgallery/variantbardatamapping.py
index 50bdefa6a..5b1986b87 100644
--- a/examples/datavisualization/graphgallery/variantbardatamapping.py
+++ b/examples/datavisualization/graphgallery/variantbardatamapping.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Signal
diff --git a/examples/datavisualization/graphgallery/variantbardataproxy.py b/examples/datavisualization/graphgallery/variantbardataproxy.py
index f69ebaf80..ad2b2a7cb 100644
--- a/examples/datavisualization/graphgallery/variantbardataproxy.py
+++ b/examples/datavisualization/graphgallery/variantbardataproxy.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 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.QtDataVisualization import QBarDataProxy, QBarDataItem
diff --git a/examples/datavisualization/graphgallery/variantdataset.py b/examples/datavisualization/graphgallery/variantdataset.py
index 752bc3887..c9b8ab1ab 100644
--- a/examples/datavisualization/graphgallery/variantdataset.py
+++ b/examples/datavisualization/graphgallery/variantdataset.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Signal
diff --git a/examples/datavisualization/minimalsurface/main.py b/examples/datavisualization/minimalsurface/main.py
index db720dced..df5e905a1 100644
--- a/examples/datavisualization/minimalsurface/main.py
+++ b/examples/datavisualization/minimalsurface/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 os
import sys
diff --git a/examples/datavisualization/qmlsurfacegallery/datasource.py b/examples/datavisualization/qmlsurfacegallery/datasource.py
index aca2a6ab8..05fa2183a 100644
--- a/examples/datavisualization/qmlsurfacegallery/datasource.py
+++ b/examples/datavisualization/qmlsurfacegallery/datasource.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from math import sin, pi
diff --git a/examples/datavisualization/qmlsurfacegallery/main.py b/examples/datavisualization/qmlsurfacegallery/main.py
index 7b980bc17..f1d3216e3 100644
--- a/examples/datavisualization/qmlsurfacegallery/main.py
+++ b/examples/datavisualization/qmlsurfacegallery/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the Qt DataVisualization qmlsurfacegallery example from Qt v6.x"""
diff --git a/examples/datavisualization/surface/main.py b/examples/datavisualization/surface/main.py
index f43970184..11756b805 100644
--- a/examples/datavisualization/surface/main.py
+++ b/examples/datavisualization/surface/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/datavisualization/surface/surfacegraph.py b/examples/datavisualization/surface/surfacegraph.py
index 69eea716c..26a910e8f 100644
--- a/examples/datavisualization/surface/surfacegraph.py
+++ b/examples/datavisualization/surface/surfacegraph.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
from pathlib import Path
diff --git a/examples/datavisualization/surface_model_numpy/main.py b/examples/datavisualization/surface_model_numpy/main.py
index f43970184..11756b805 100644
--- a/examples/datavisualization/surface_model_numpy/main.py
+++ b/examples/datavisualization/surface_model_numpy/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/datavisualization/surface_model_numpy/surfacegraph.py b/examples/datavisualization/surface_model_numpy/surfacegraph.py
index c0c1acecf..3e885d9c2 100644
--- a/examples/datavisualization/surface_model_numpy/surfacegraph.py
+++ b/examples/datavisualization/surface_model_numpy/surfacegraph.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 numpy as np
import math
diff --git a/examples/datavisualization/surface_numpy/main.py b/examples/datavisualization/surface_numpy/main.py
index f43970184..11756b805 100644
--- a/examples/datavisualization/surface_numpy/main.py
+++ b/examples/datavisualization/surface_numpy/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/datavisualization/surface_numpy/surfacegraph.py b/examples/datavisualization/surface_numpy/surfacegraph.py
index c9f6e75a9..654c9d05c 100644
--- a/examples/datavisualization/surface_numpy/surfacegraph.py
+++ b/examples/datavisualization/surface_numpy/surfacegraph.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 numpy as np
import math
diff --git a/examples/dbus/listnames/listnames.py b/examples/dbus/listnames/listnames.py
index 2240a06d8..1c279f5d7 100644
--- a/examples/dbus/listnames/listnames.py
+++ b/examples/dbus/listnames/listnames.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 QtDBus listnames example from Qt v6.x"""
diff --git a/examples/dbus/pingpong/ping.py b/examples/dbus/pingpong/ping.py
index d61f25499..2e6522441 100644
--- a/examples/dbus/pingpong/ping.py
+++ b/examples/dbus/pingpong/ping.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 QtDBus pingpong example from Qt v6.x (ping client)"""
diff --git a/examples/dbus/pingpong/pong.py b/examples/dbus/pingpong/pong.py
index 0dec6eda0..371291f2a 100644
--- a/examples/dbus/pingpong/pong.py
+++ b/examples/dbus/pingpong/pong.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 QtDBus pingpong example from Qt v6.x (pong server)"""
diff --git a/examples/demos/colorpaletteclient/abstractresource.py b/examples/demos/colorpaletteclient/abstractresource.py
index 3f3a7ed6a..49e6168fd 100644
--- a/examples/demos/colorpaletteclient/abstractresource.py
+++ b/examples/demos/colorpaletteclient/abstractresource.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
from PySide6.QtCore import QObject
from PySide6.QtQml import QmlAnonymous
diff --git a/examples/demos/colorpaletteclient/basiclogin.py b/examples/demos/colorpaletteclient/basiclogin.py
index b9139c2e2..1090f4d06 100644
--- a/examples/demos/colorpaletteclient/basiclogin.py
+++ b/examples/demos/colorpaletteclient/basiclogin.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 sys
from functools import partial
diff --git a/examples/demos/colorpaletteclient/main.py b/examples/demos/colorpaletteclient/main.py
index a249b9fa2..a35bdde80 100644
--- a/examples/demos/colorpaletteclient/main.py
+++ b/examples/demos/colorpaletteclient/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 RESTful API client demo from Qt v6.x"""
diff --git a/examples/demos/colorpaletteclient/paginatedresource.py b/examples/demos/colorpaletteclient/paginatedresource.py
index b7f036c4e..4c463e5d5 100644
--- a/examples/demos/colorpaletteclient/paginatedresource.py
+++ b/examples/demos/colorpaletteclient/paginatedresource.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 sys
from dataclasses import dataclass
diff --git a/examples/demos/colorpaletteclient/restservice.py b/examples/demos/colorpaletteclient/restservice.py
index d334ecd03..852c50fe3 100644
--- a/examples/demos/colorpaletteclient/restservice.py
+++ b/examples/demos/colorpaletteclient/restservice.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
from PySide6.QtCore import Property, Signal, ClassInfo
from PySide6.QtNetwork import (QNetworkAccessManager, QRestAccessManager,
diff --git a/examples/demos/documentviewer/abstractviewer.py b/examples/demos/documentviewer/abstractviewer.py
index 4039fe9fb..87eaf6fc3 100644
--- a/examples/demos/documentviewer/abstractviewer.py
+++ b/examples/demos/documentviewer/abstractviewer.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject
diff --git a/examples/demos/documentviewer/jsonviewer/jsonviewer.py b/examples/demos/documentviewer/jsonviewer/jsonviewer.py
index 1e5a34ca0..98ca997cc 100644
--- a/examples/demos/documentviewer/jsonviewer/jsonviewer.py
+++ b/examples/demos/documentviewer/jsonviewer/jsonviewer.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import json
diff --git a/examples/demos/documentviewer/main.py b/examples/demos/documentviewer/main.py
index 2af373ef3..5159b9c3b 100644
--- a/examples/demos/documentviewer/main.py
+++ b/examples/demos/documentviewer/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the Qt Document Viewer demo from Qt v6.x"""
diff --git a/examples/demos/documentviewer/mainwindow.py b/examples/demos/documentviewer/mainwindow.py
index e9abd0bec..c3e853f38 100644
--- a/examples/demos/documentviewer/mainwindow.py
+++ b/examples/demos/documentviewer/mainwindow.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWidgets import (QDialog, QFileDialog, QMainWindow, QMessageBox)
from PySide6.QtCore import (QDir, QFile, QFileInfo, QSettings, Slot)
diff --git a/examples/demos/documentviewer/pdfviewer/pdfviewer.py b/examples/demos/documentviewer/pdfviewer/pdfviewer.py
index d5695e4d0..08863502d 100644
--- a/examples/demos/documentviewer/pdfviewer/pdfviewer.py
+++ b/examples/demos/documentviewer/pdfviewer/pdfviewer.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from math import sqrt
diff --git a/examples/demos/documentviewer/pdfviewer/zoomselector.py b/examples/demos/documentviewer/pdfviewer/zoomselector.py
index e5da5708f..70133d998 100644
--- a/examples/demos/documentviewer/pdfviewer/zoomselector.py
+++ b/examples/demos/documentviewer/pdfviewer/zoomselector.py
@@ -1,5 +1,6 @@
# Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWidgets import QComboBox
from PySide6.QtCore import Signal, Slot
diff --git a/examples/demos/documentviewer/recentfilemenu.py b/examples/demos/documentviewer/recentfilemenu.py
index 36c7dc9f3..be5ffaf45 100644
--- a/examples/demos/documentviewer/recentfilemenu.py
+++ b/examples/demos/documentviewer/recentfilemenu.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWidgets import QMenu
from PySide6.QtCore import Signal, Slot
diff --git a/examples/demos/documentviewer/recentfiles.py b/examples/demos/documentviewer/recentfiles.py
index fdfc56d40..3f6e5e7a5 100644
--- a/examples/demos/documentviewer/recentfiles.py
+++ b/examples/demos/documentviewer/recentfiles.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum, auto
diff --git a/examples/demos/documentviewer/txtviewer/txtviewer.py b/examples/demos/documentviewer/txtviewer/txtviewer.py
index ef5a38fcd..f2fe5bd37 100644
--- a/examples/demos/documentviewer/txtviewer/txtviewer.py
+++ b/examples/demos/documentviewer/txtviewer/txtviewer.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWidgets import (QDialog, QFileDialog,
QPlainTextEdit)
diff --git a/examples/demos/documentviewer/viewerfactory.py b/examples/demos/documentviewer/viewerfactory.py
index ecae6770b..0d32cbfeb 100644
--- a/examples/demos/documentviewer/viewerfactory.py
+++ b/examples/demos/documentviewer/viewerfactory.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum, auto
diff --git a/examples/designer/taskmenuextension/main.py b/examples/designer/taskmenuextension/main.py
index ffde89d29..ff2cda53e 100644
--- a/examples/designer/taskmenuextension/main.py
+++ b/examples/designer/taskmenuextension/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 Qt Designer taskmenuextension example from Qt v6.x"""
diff --git a/examples/designer/taskmenuextension/registertictactoe.py b/examples/designer/taskmenuextension/registertictactoe.py
index 2b014c790..853355587 100644
--- a/examples/designer/taskmenuextension/registertictactoe.py
+++ b/examples/designer/taskmenuextension/registertictactoe.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 tictactoe import TicTacToe # noqa: F401
from tictactoeplugin import TicTacToePlugin
diff --git a/examples/designer/taskmenuextension/tictactoe.py b/examples/designer/taskmenuextension/tictactoe.py
index aa1c3158c..9e8118bb4 100644
--- a/examples/designer/taskmenuextension/tictactoe.py
+++ b/examples/designer/taskmenuextension/tictactoe.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, QPoint, QRect, QSize, Property, Slot
from PySide6.QtGui import QPainter, QPen
diff --git a/examples/designer/taskmenuextension/tictactoeplugin.py b/examples/designer/taskmenuextension/tictactoeplugin.py
index f9c925133..93a40a85a 100644
--- a/examples/designer/taskmenuextension/tictactoeplugin.py
+++ b/examples/designer/taskmenuextension/tictactoeplugin.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 tictactoe import TicTacToe
from tictactoetaskmenu import TicTacToeTaskMenuFactory
diff --git a/examples/designer/taskmenuextension/tictactoetaskmenu.py b/examples/designer/taskmenuextension/tictactoetaskmenu.py
index 71826dc7d..f2c6cceb0 100644
--- a/examples/designer/taskmenuextension/tictactoetaskmenu.py
+++ b/examples/designer/taskmenuextension/tictactoetaskmenu.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 tictactoe import TicTacToe
diff --git a/examples/external/matplotlib/widget3d/widget3d.py b/examples/external/matplotlib/widget3d/widget3d.py
index 8bfcc4ca2..01ead09c8 100644
--- a/examples/external/matplotlib/widget3d/widget3d.py
+++ b/examples/external/matplotlib/widget3d/widget3d.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/external/matplotlib/widget_gaussian/widget_gaussian.py b/examples/external/matplotlib/widget_gaussian/widget_gaussian.py
index 2423e496a..22669d1a5 100644
--- a/examples/external/matplotlib/widget_gaussian/widget_gaussian.py
+++ b/examples/external/matplotlib/widget_gaussian/widget_gaussian.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/external/networkx/main.py b/examples/external/networkx/main.py
index 8cd7e7903..8b88b5c30 100644
--- a/examples/external/networkx/main.py
+++ b/examples/external/networkx/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 math
diff --git a/examples/external/opencv/webcam_pattern_detection.py b/examples/external/opencv/webcam_pattern_detection.py
index 0c55a1333..00172410f 100644
--- a/examples/external/opencv/webcam_pattern_detection.py
+++ b/examples/external/opencv/webcam_pattern_detection.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 os
import sys
diff --git a/examples/external/pandas/dataframe_model.py b/examples/external/pandas/dataframe_model.py
index b3d9e81fe..142d4c722 100644
--- a/examples/external/pandas/dataframe_model.py
+++ b/examples/external/pandas/dataframe_model.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 pandas as pd
diff --git a/examples/external/scikit/staining_colors_separation.py b/examples/external/scikit/staining_colors_separation.py
index 94fdc3bdc..ce886a8e8 100644
--- a/examples/external/scikit/staining_colors_separation.py
+++ b/examples/external/scikit/staining_colors_separation.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/graphs/2d/hellographs/main.py b/examples/graphs/2d/hellographs/main.py
index acc349beb..aff9d129a 100644
--- a/examples/graphs/2d/hellographs/main.py
+++ b/examples/graphs/2d/hellographs/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 Hello Graphs example from Qt v6.x"""
diff --git a/examples/graphs/3d/minimalsurfacegraph/main.py b/examples/graphs/3d/minimalsurfacegraph/main.py
index 5fb4b4472..6ef940b52 100644
--- a/examples/graphs/3d/minimalsurfacegraph/main.py
+++ b/examples/graphs/3d/minimalsurfacegraph/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import sys
diff --git a/examples/graphs/3d/minimalsurfacegraph/minimalsurfacegraph.pyproject b/examples/graphs/3d/minimalsurfacegraph/minimalsurfacegraph.pyproject
new file mode 100644
index 000000000..cc7a74a34
--- /dev/null
+++ b/examples/graphs/3d/minimalsurfacegraph/minimalsurfacegraph.pyproject
@@ -0,0 +1,3 @@
+{
+ "files": ["main.py"]
+}
diff --git a/examples/graphs/3d/widgetgallery/doc/widgetgallery.rst b/examples/graphs/3d/widgetgallery/doc/widgetgallery.rst
deleted file mode 100644
index 1470001d6..000000000
--- a/examples/graphs/3d/widgetgallery/doc/widgetgallery.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-Widget Gallery
-==============
-
-
-Widget Gallery demonstrates all three graph types and some of their special
-features. The graphs have their own tabs in the application.
-
-
-.. image:: widgetgallery.webp
- :width: 400
- :alt: Widget Screenshot
diff --git a/examples/graphs/3d/widgetgallery/axesinputhandler.py b/examples/graphs/3d/widgetgraphgallery/axesinputhandler.py
index 4c4202974..2323d62e1 100644
--- a/examples/graphs/3d/widgetgallery/axesinputhandler.py
+++ b/examples/graphs/3d/widgetgraphgallery/axesinputhandler.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum
from math import sin, cos, degrees
diff --git a/examples/graphs/3d/widgetgallery/bargraph.py b/examples/graphs/3d/widgetgraphgallery/bargraph.py
index 822acb4a9..497916068 100644
--- a/examples/graphs/3d/widgetgallery/bargraph.py
+++ b/examples/graphs/3d/widgetgraphgallery/bargraph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from graphmodifier import GraphModifier
diff --git a/examples/graphs/3d/widgetgallery/custominputhandler.py b/examples/graphs/3d/widgetgraphgallery/custominputhandler.py
index 15fe00e70..a33968091 100644
--- a/examples/graphs/3d/widgetgallery/custominputhandler.py
+++ b/examples/graphs/3d/widgetgraphgallery/custominputhandler.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum
from math import sin, cos, degrees
diff --git a/examples/graphs/3d/widgetgallery/data/layer_1.png b/examples/graphs/3d/widgetgraphgallery/data/layer_1.png
index 9138c710a..9138c710a 100644
--- a/examples/graphs/3d/widgetgallery/data/layer_1.png
+++ b/examples/graphs/3d/widgetgraphgallery/data/layer_1.png
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/layer_2.png b/examples/graphs/3d/widgetgraphgallery/data/layer_2.png
index 61631ae8b..61631ae8b 100644
--- a/examples/graphs/3d/widgetgallery/data/layer_2.png
+++ b/examples/graphs/3d/widgetgraphgallery/data/layer_2.png
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/layer_3.png b/examples/graphs/3d/widgetgraphgallery/data/layer_3.png
index 066ffbe75..066ffbe75 100644
--- a/examples/graphs/3d/widgetgallery/data/layer_3.png
+++ b/examples/graphs/3d/widgetgraphgallery/data/layer_3.png
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/license.txt b/examples/graphs/3d/widgetgraphgallery/data/license.txt
index 749daf31f..749daf31f 100644
--- a/examples/graphs/3d/widgetgallery/data/license.txt
+++ b/examples/graphs/3d/widgetgraphgallery/data/license.txt
diff --git a/examples/graphs/3d/widgetgallery/data/maptexture.jpg b/examples/graphs/3d/widgetgraphgallery/data/maptexture.jpg
index ae5d66ebe..ae5d66ebe 100644
--- a/examples/graphs/3d/widgetgallery/data/maptexture.jpg
+++ b/examples/graphs/3d/widgetgraphgallery/data/maptexture.jpg
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/narrowarrow.mesh b/examples/graphs/3d/widgetgraphgallery/data/narrowarrow.mesh
index 288867b1e..288867b1e 100644
--- a/examples/graphs/3d/widgetgallery/data/narrowarrow.mesh
+++ b/examples/graphs/3d/widgetgraphgallery/data/narrowarrow.mesh
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/oilrig.mesh b/examples/graphs/3d/widgetgraphgallery/data/oilrig.mesh
index 4a7baeddf..4a7baeddf 100644
--- a/examples/graphs/3d/widgetgallery/data/oilrig.mesh
+++ b/examples/graphs/3d/widgetgraphgallery/data/oilrig.mesh
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/pipe.mesh b/examples/graphs/3d/widgetgraphgallery/data/pipe.mesh
index 984b6d443..984b6d443 100644
--- a/examples/graphs/3d/widgetgallery/data/pipe.mesh
+++ b/examples/graphs/3d/widgetgraphgallery/data/pipe.mesh
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/raindata.txt b/examples/graphs/3d/widgetgraphgallery/data/raindata.txt
index d95589219..d95589219 100644
--- a/examples/graphs/3d/widgetgallery/data/raindata.txt
+++ b/examples/graphs/3d/widgetgraphgallery/data/raindata.txt
diff --git a/examples/graphs/3d/widgetgallery/data/refinery.mesh b/examples/graphs/3d/widgetgraphgallery/data/refinery.mesh
index a7e249353..a7e249353 100644
--- a/examples/graphs/3d/widgetgallery/data/refinery.mesh
+++ b/examples/graphs/3d/widgetgraphgallery/data/refinery.mesh
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/data/topography.png b/examples/graphs/3d/widgetgraphgallery/data/topography.png
index 9349cdb31..9349cdb31 100644
--- a/examples/graphs/3d/widgetgallery/data/topography.png
+++ b/examples/graphs/3d/widgetgraphgallery/data/topography.png
Binary files differ
diff --git a/examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.rst b/examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.rst
new file mode 100644
index 000000000..33a4da15b
--- /dev/null
+++ b/examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.rst
@@ -0,0 +1,11 @@
+Widget Graph Gallery
+====================
+
+
+Widget Graph Gallery demonstrates all three graph types and some of their
+special features. The graphs have their own tabs in the application.
+
+
+.. image:: widgetgraphgallery.webp
+ :width: 400
+ :alt: Widget Screenshot
diff --git a/examples/graphs/3d/widgetgallery/doc/widgetgallery.webp b/examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.webp
index eb5767264..eb5767264 100644
--- a/examples/graphs/3d/widgetgallery/doc/widgetgallery.webp
+++ b/examples/graphs/3d/widgetgraphgallery/doc/widgetgraphgallery.webp
Binary files differ
diff --git a/examples/graphs/3d/widgetgallery/graphmodifier.py b/examples/graphs/3d/widgetgraphgallery/graphmodifier.py
index 2eaafa792..678864ac3 100644
--- a/examples/graphs/3d/widgetgallery/graphmodifier.py
+++ b/examples/graphs/3d/widgetgraphgallery/graphmodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from math import atan, degrees
diff --git a/examples/graphs/3d/widgetgallery/highlightseries.py b/examples/graphs/3d/widgetgraphgallery/highlightseries.py
index 8c7b91633..fce1bd0ac 100644
--- a/examples/graphs/3d/widgetgallery/highlightseries.py
+++ b/examples/graphs/3d/widgetgraphgallery/highlightseries.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QPoint, Qt, Slot
from PySide6.QtGui import QLinearGradient, QVector3D
diff --git a/examples/graphs/3d/widgetgallery/main.py b/examples/graphs/3d/widgetgraphgallery/main.py
index 7bb2238a7..d8380486b 100644
--- a/examples/graphs/3d/widgetgallery/main.py
+++ b/examples/graphs/3d/widgetgraphgallery/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the Qt Graphs widgetgallery example from Qt v6.x"""
diff --git a/examples/graphs/3d/widgetgallery/rainfalldata.py b/examples/graphs/3d/widgetgraphgallery/rainfalldata.py
index d74f45a8b..283b421e7 100644
--- a/examples/graphs/3d/widgetgallery/rainfalldata.py
+++ b/examples/graphs/3d/widgetgraphgallery/rainfalldata.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import sys
diff --git a/examples/graphs/3d/widgetgallery/scatterdatamodifier.py b/examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.py
index 15064b412..8d6cde59f 100644
--- a/examples/graphs/3d/widgetgallery/scatterdatamodifier.py
+++ b/examples/graphs/3d/widgetgraphgallery/scatterdatamodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from math import cos, degrees, sqrt
diff --git a/examples/graphs/3d/widgetgallery/scattergraph.py b/examples/graphs/3d/widgetgraphgallery/scattergraph.py
index 79e8933eb..9cf5ff33a 100644
--- a/examples/graphs/3d/widgetgallery/scattergraph.py
+++ b/examples/graphs/3d/widgetgraphgallery/scattergraph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, QSize, Qt
from PySide6.QtWidgets import (QCheckBox, QComboBox, QCommandLinkButton,
diff --git a/examples/graphs/3d/widgetgallery/surfacegraph.py b/examples/graphs/3d/widgetgraphgallery/surfacegraph.py
index 4052da821..5c0bc61c8 100644
--- a/examples/graphs/3d/widgetgallery/surfacegraph.py
+++ b/examples/graphs/3d/widgetgraphgallery/surfacegraph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from surfacegraphmodifier import SurfaceGraphModifier
diff --git a/examples/graphs/3d/widgetgallery/surfacegraphmodifier.py b/examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.py
index b2706c6fa..bcac7c3ea 100644
--- a/examples/graphs/3d/widgetgallery/surfacegraphmodifier.py
+++ b/examples/graphs/3d/widgetgraphgallery/surfacegraphmodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import os
from math import sqrt, sin
diff --git a/examples/graphs/3d/widgetgallery/topographicseries.py b/examples/graphs/3d/widgetgraphgallery/topographicseries.py
index 4f286a222..30805d66f 100644
--- a/examples/graphs/3d/widgetgallery/topographicseries.py
+++ b/examples/graphs/3d/widgetgraphgallery/topographicseries.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 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.QtGui import QImage, QVector3D
diff --git a/examples/graphs/3d/widgetgallery/variantbardatamapping.py b/examples/graphs/3d/widgetgraphgallery/variantbardatamapping.py
index 50bdefa6a..5b1986b87 100644
--- a/examples/graphs/3d/widgetgallery/variantbardatamapping.py
+++ b/examples/graphs/3d/widgetgraphgallery/variantbardatamapping.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Signal
diff --git a/examples/graphs/3d/widgetgallery/variantbardataproxy.py b/examples/graphs/3d/widgetgraphgallery/variantbardataproxy.py
index 5ab2a2cd2..9cd71b1a8 100644
--- a/examples/graphs/3d/widgetgallery/variantbardataproxy.py
+++ b/examples/graphs/3d/widgetgraphgallery/variantbardataproxy.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 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.QtGraphs import QBarDataProxy, QBarDataItem
diff --git a/examples/graphs/3d/widgetgallery/variantdataset.py b/examples/graphs/3d/widgetgraphgallery/variantdataset.py
index 752bc3887..c9b8ab1ab 100644
--- a/examples/graphs/3d/widgetgallery/variantdataset.py
+++ b/examples/graphs/3d/widgetgraphgallery/variantdataset.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Signal
diff --git a/examples/graphs/3d/widgetgallery/widgetgallery.pyproject b/examples/graphs/3d/widgetgraphgallery/widgetgraphgallery.pyproject
index 581b21483..581b21483 100644
--- a/examples/graphs/3d/widgetgallery/widgetgallery.pyproject
+++ b/examples/graphs/3d/widgetgraphgallery/widgetgraphgallery.pyproject
diff --git a/examples/gui/analogclock/main.py b/examples/gui/analogclock/main.py
index c0e00dd93..cae9811e0 100644
--- a/examples/gui/analogclock/main.py
+++ b/examples/gui/analogclock/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/gui/rhiwindow/main.py b/examples/gui/rhiwindow/main.py
index cfb73b10b..634a42064 100644
--- a/examples/gui/rhiwindow/main.py
+++ b/examples/gui/rhiwindow/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import sys
diff --git a/examples/gui/rhiwindow/rhiwindow.py b/examples/gui/rhiwindow/rhiwindow.py
index fe054af48..e33506568 100644
--- a/examples/gui/rhiwindow/rhiwindow.py
+++ b/examples/gui/rhiwindow/rhiwindow.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import numpy
import sys
diff --git a/examples/httpserver/afterrequest/main.py b/examples/httpserver/afterrequest/main.py
index e68c992ec..7971a1c3a 100644
--- a/examples/httpserver/afterrequest/main.py
+++ b/examples/httpserver/afterrequest/main.py
@@ -1,6 +1,7 @@
# Copyright (C) 2020 Mikhail Svetkin <mikhail.svetkin@gmail.com>
# 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 /httpserver/afterrequest from from Qt"""
diff --git a/examples/installer_test/hello.py b/examples/installer_test/hello.py
index 3921b5d51..e10276048 100644
--- a/examples/installer_test/hello.py
+++ b/examples/installer_test/hello.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
"""
hello.py
diff --git a/examples/location/mapviewer/main.py b/examples/location/mapviewer/main.py
index 24ae1623f..f982572d1 100644
--- a/examples/location/mapviewer/main.py
+++ b/examples/location/mapviewer/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the location/mapviewer example from Qt v6.x"""
diff --git a/examples/multimedia/audiooutput/audiooutput.py b/examples/multimedia/audiooutput/audiooutput.py
index 06d52f68a..c2cbd730f 100644
--- a/examples/multimedia/audiooutput/audiooutput.py
+++ b/examples/multimedia/audiooutput/audiooutput.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 multimedia/audiooutput example from Qt v5.x, originating from PyQt"""
diff --git a/examples/multimedia/audiosource/audiosource.py b/examples/multimedia/audiosource/audiosource.py
index a78beb584..5b4fe523c 100644
--- a/examples/multimedia/audiosource/audiosource.py
+++ b/examples/multimedia/audiosource/audiosource.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 examples/multimedia/audiosources
@@ -14,7 +15,6 @@ QIODevice have python bindings that needs to be fixed.
"""
import os
import sys
-from typing import Optional
import PySide6
from PySide6.QtCore import QByteArray, QMargins, Qt, Slot, qWarning
@@ -56,7 +56,7 @@ class AudioInfo:
class RenderArea(QWidget):
- def __init__(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None:
+ def __init__(self, parent: PySide6.QtWidgets.QWidget | None = None) -> None:
super().__init__(parent=parent)
self.m_level = 0
self.setBackgroundRole(QPalette.Base)
diff --git a/examples/multimedia/camera/camera.py b/examples/multimedia/camera/camera.py
index fa379c807..b98158a1c 100644
--- a/examples/multimedia/camera/camera.py
+++ b/examples/multimedia/camera/camera.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import os
import sys
diff --git a/examples/multimedia/camera/imagesettings.py b/examples/multimedia/camera/imagesettings.py
index 9ca1d92ce..392681f03 100644
--- a/examples/multimedia/camera/imagesettings.py
+++ b/examples/multimedia/camera/imagesettings.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtMultimedia import QImageCapture
from PySide6.QtWidgets import QDialog
diff --git a/examples/multimedia/camera/main.py b/examples/multimedia/camera/main.py
index fd4dd32e3..004f8fac5 100644
--- a/examples/multimedia/camera/main.py
+++ b/examples/multimedia/camera/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the QtMultiMedia camera example from Qt v6.x"""
diff --git a/examples/multimedia/camera/metadatadialog.py b/examples/multimedia/camera/metadatadialog.py
index 97d0a36e5..1ad2c0d89 100644
--- a/examples/multimedia/camera/metadatadialog.py
+++ b/examples/multimedia/camera/metadatadialog.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtMultimedia import QMediaMetaData
from PySide6.QtWidgets import (QDialog, QDialogButtonBox, QFileDialog,
diff --git a/examples/multimedia/camera/videosettings.py b/examples/multimedia/camera/videosettings.py
index a88cb39ed..d0485023a 100644
--- a/examples/multimedia/camera/videosettings.py
+++ b/examples/multimedia/camera/videosettings.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import os
from PySide6.QtMultimedia import (QCameraFormat, QMediaFormat, QMediaRecorder,
diff --git a/examples/multimedia/player/player.py b/examples/multimedia/player/player.py
index d28f2887e..e0e328b5d 100644
--- a/examples/multimedia/player/player.py
+++ b/examples/multimedia/player/player.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 Multimedia player example"""
diff --git a/examples/multimedia/screencapture/main.py b/examples/multimedia/screencapture/main.py
index f445bac03..df6392164 100644
--- a/examples/multimedia/screencapture/main.py
+++ b/examples/multimedia/screencapture/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the QtMultiMedia Screen Capture Example from Qt v6.x"""
diff --git a/examples/multimedia/screencapture/screencapturepreview.py b/examples/multimedia/screencapture/screencapturepreview.py
index c7e0c596a..774a855a7 100644
--- a/examples/multimedia/screencapture/screencapturepreview.py
+++ b/examples/multimedia/screencapture/screencapturepreview.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from enum import Enum, auto
diff --git a/examples/multimedia/screencapture/screenlistmodel.py b/examples/multimedia/screencapture/screenlistmodel.py
index 72bb306e3..dbb13e918 100644
--- a/examples/multimedia/screencapture/screenlistmodel.py
+++ b/examples/multimedia/screencapture/screenlistmodel.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtGui import QGuiApplication
from PySide6.QtCore import QAbstractListModel, Qt, Slot
diff --git a/examples/multimedia/screencapture/windowlistmodel.py b/examples/multimedia/screencapture/windowlistmodel.py
index 079040ec2..bffaba875 100644
--- a/examples/multimedia/screencapture/windowlistmodel.py
+++ b/examples/multimedia/screencapture/windowlistmodel.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QAbstractListModel, Qt, Slot
from PySide6.QtMultimedia import QWindowCapture
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.py b/examples/network/blockingfortuneclient/blockingfortuneclient.py
index d0dd7e0ad..f29cfe25b 100644
--- a/examples/network/blockingfortuneclient/blockingfortuneclient.py
+++ b/examples/network/blockingfortuneclient/blockingfortuneclient.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 network/blockingfortunclient example from Qt v5.x, originating from PyQt"""
diff --git a/examples/network/downloader/downloader.py b/examples/network/downloader/downloader.py
index fba0cb980..35e6d3057 100644
--- a/examples/network/downloader/downloader.py
+++ b/examples/network/downloader/downloader.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/network/fortuneclient/fortuneclient.py b/examples/network/fortuneclient/fortuneclient.py
index e88e5e35b..360702e03 100644
--- a/examples/network/fortuneclient/fortuneclient.py
+++ b/examples/network/fortuneclient/fortuneclient.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 network/fortuneclient example from Qt v5.x"""
diff --git a/examples/network/fortuneserver/fortuneserver.py b/examples/network/fortuneserver/fortuneserver.py
index a94a49f42..6b20b9b33 100644
--- a/examples/network/fortuneserver/fortuneserver.py
+++ b/examples/network/fortuneserver/fortuneserver.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 network/fortuneserver example from Qt v5.x"""
diff --git a/examples/network/googlesuggest/googlesuggest.py b/examples/network/googlesuggest/googlesuggest.py
index d3fc67c05..6c384a20b 100644
--- a/examples/network/googlesuggest/googlesuggest.py
+++ b/examples/network/googlesuggest/googlesuggest.py
@@ -1,7 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-from typing import List
+from __future__ import annotations
from PySide6.QtCore import (QByteArray, QEvent, QObject, QPoint, Qt, QTimer,
QXmlStreamReader, Slot)
@@ -77,7 +76,7 @@ class GSuggestCompletion(QObject):
return consumed
return False
- def show_completion(self, choices: List[str]):
+ def show_completion(self, choices: list[str]):
if not choices:
return
pal = self.editor.palette()
@@ -121,7 +120,7 @@ class GSuggestCompletion(QObject):
@Slot(QNetworkReply)
def handle_network_data(self, network_reply: QNetworkReply):
if network_reply.error() == QNetworkReply.NoError:
- choices: List[str] = []
+ choices: list[str] = []
response: QByteArray = network_reply.readAll()
xml = QXmlStreamReader(str(response))
diff --git a/examples/network/googlesuggest/main.py b/examples/network/googlesuggest/main.py
index 1efda08e6..50510421f 100644
--- a/examples/network/googlesuggest/main.py
+++ b/examples/network/googlesuggest/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/network/googlesuggest/searchbox.py b/examples/network/googlesuggest/searchbox.py
index 9cbe20b23..a713a6234 100644
--- a/examples/network/googlesuggest/searchbox.py
+++ b/examples/network/googlesuggest/searchbox.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 QDesktopServices
diff --git a/examples/network/loopback/dialog.py b/examples/network/loopback/dialog.py
index 673afce28..d46efecab 100644
--- a/examples/network/loopback/dialog.py
+++ b/examples/network/loopback/dialog.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 QByteArray, Qt
from PySide6.QtGui import QGuiApplication
diff --git a/examples/network/loopback/main.py b/examples/network/loopback/main.py
index d684b6bab..046a8fbac 100644
--- a/examples/network/loopback/main.py
+++ b/examples/network/loopback/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/network/threadedfortuneserver/threadedfortuneserver.py b/examples/network/threadedfortuneserver/threadedfortuneserver.py
index c75e2bc57..492c81085 100644
--- a/examples/network/threadedfortuneserver/threadedfortuneserver.py
+++ b/examples/network/threadedfortuneserver/threadedfortuneserver.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 network/threadedfortuneserver example from Qt v5.x, originating from PyQt"""
diff --git a/examples/networkauth/redditclient/main.py b/examples/networkauth/redditclient/main.py
index e88e32cc5..c3e3694d1 100644
--- a/examples/networkauth/redditclient/main.py
+++ b/examples/networkauth/redditclient/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 networkauth redditclient example from Qt v6.x"""
diff --git a/examples/networkauth/redditclient/redditmodel.py b/examples/networkauth/redditclient/redditmodel.py
index fd6f9bc97..5c2e6a0d4 100644
--- a/examples/networkauth/redditclient/redditmodel.py
+++ b/examples/networkauth/redditclient/redditmodel.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 functools
from PySide6.QtCore import (QAbstractTableModel, QJsonDocument, QModelIndex,
diff --git a/examples/networkauth/redditclient/redditwrapper.py b/examples/networkauth/redditclient/redditwrapper.py
index ed4c3d2c7..80dfb9448 100644
--- a/examples/networkauth/redditclient/redditwrapper.py
+++ b/examples/networkauth/redditclient/redditwrapper.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 functools
diff --git a/examples/opengl/contextinfo/contextinfo.py b/examples/opengl/contextinfo/contextinfo.py
index 311d5b765..233636853 100644
--- a/examples/opengl/contextinfo/contextinfo.py
+++ b/examples/opengl/contextinfo/contextinfo.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 opengl/contextinfo example from Qt v5.x"""
diff --git a/examples/opengl/hellogl2/glwidget.py b/examples/opengl/hellogl2/glwidget.py
index bbf200a6b..d86ba59e8 100644
--- a/examples/opengl/hellogl2/glwidget.py
+++ b/examples/opengl/hellogl2/glwidget.py
@@ -1,6 +1,7 @@
# Copyright (C) 2023 The Qt Company Ltd.
# Copyright (C) 2013 Riverbank Computing Limited.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import ctypes
from PySide6.QtCore import Signal, Slot, Qt, QSize, QPointF
diff --git a/examples/opengl/hellogl2/logo.py b/examples/opengl/hellogl2/logo.py
index c236a1ec9..3be1b5bda 100644
--- a/examples/opengl/hellogl2/logo.py
+++ b/examples/opengl/hellogl2/logo.py
@@ -1,6 +1,7 @@
# Copyright (C) 2023 The Qt Company Ltd.
# Copyright (C) 2013 Riverbank Computing Limited.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import math
diff --git a/examples/opengl/hellogl2/main.py b/examples/opengl/hellogl2/main.py
index c7eb78a82..41884ab12 100644
--- a/examples/opengl/hellogl2/main.py
+++ b/examples/opengl/hellogl2/main.py
@@ -1,6 +1,7 @@
# Copyright (C) 2023 The Qt Company Ltd.
# Copyright (C) 2013 Riverbank Computing Limited.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the opengl/hellogl2 example from Qt v6.x"""
diff --git a/examples/opengl/hellogl2/mainwindow.py b/examples/opengl/hellogl2/mainwindow.py
index 69b9b66fe..d5fba7e26 100644
--- a/examples/opengl/hellogl2/mainwindow.py
+++ b/examples/opengl/hellogl2/mainwindow.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import Slot, Qt
from PySide6.QtGui import QKeySequence
diff --git a/examples/opengl/hellogl2/window.py b/examples/opengl/hellogl2/window.py
index ad61d2f97..12c4508b3 100644
--- a/examples/opengl/hellogl2/window.py
+++ b/examples/opengl/hellogl2/window.py
@@ -1,6 +1,7 @@
# Copyright (C) 2023 The Qt Company Ltd.
# Copyright (C) 2013 Riverbank Computing Limited.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import Slot, Qt
from PySide6.QtWidgets import (QHBoxLayout, QMainWindow,
diff --git a/examples/opengl/textures/textures.py b/examples/opengl/textures/textures.py
index 87c1164b7..55517d33e 100644
--- a/examples/opengl/textures/textures.py
+++ b/examples/opengl/textures/textures.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 opengl/textures example from Qt v6.x showing the use
of legacy OpenGL functions with QOpenGLVersionFunctionsFactory."""
diff --git a/examples/opengl/threadedqopenglwidget/glwidget.py b/examples/opengl/threadedqopenglwidget/glwidget.py
index edb88e77c..70efc2814 100644
--- a/examples/opengl/threadedqopenglwidget/glwidget.py
+++ b/examples/opengl/threadedqopenglwidget/glwidget.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.QtOpenGLWidgets import QOpenGLWidget
diff --git a/examples/opengl/threadedqopenglwidget/main.py b/examples/opengl/threadedqopenglwidget/main.py
index 2a379da27..0d4c14ccf 100644
--- a/examples/opengl/threadedqopenglwidget/main.py
+++ b/examples/opengl/threadedqopenglwidget/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 Threaded QOpenGLWidget Example from Qt v6.x"""
diff --git a/examples/opengl/threadedqopenglwidget/mainwindow.py b/examples/opengl/threadedqopenglwidget/mainwindow.py
index 4999b799d..cf6dbeecc 100644
--- a/examples/opengl/threadedqopenglwidget/mainwindow.py
+++ b/examples/opengl/threadedqopenglwidget/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.QtWidgets import QWidget, QHBoxLayout
diff --git a/examples/opengl/threadedqopenglwidget/renderer.py b/examples/opengl/threadedqopenglwidget/renderer.py
index 81ec63cbb..5461123c8 100644
--- a/examples/opengl/threadedqopenglwidget/renderer.py
+++ b/examples/opengl/threadedqopenglwidget/renderer.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 ctypes
import math
diff --git a/examples/pdf/quickpdfviewer/main.py b/examples/pdf/quickpdfviewer/main.py
index ee7b882c2..388c590c3 100644
--- a/examples/pdf/quickpdfviewer/main.py
+++ b/examples/pdf/quickpdfviewer/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 os
import sys
diff --git a/examples/pdfwidgets/pdfviewer/main.py b/examples/pdfwidgets/pdfviewer/main.py
index c4765fdda..55ac454ed 100644
--- a/examples/pdfwidgets/pdfviewer/main.py
+++ b/examples/pdfwidgets/pdfviewer/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
from argparse import ArgumentParser, RawTextHelpFormatter
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.py b/examples/pdfwidgets/pdfviewer/mainwindow.py
index d37475aca..154c87706 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.py
+++ b/examples/pdfwidgets/pdfviewer/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 math
import sys
diff --git a/examples/pdfwidgets/pdfviewer/zoomselector.py b/examples/pdfwidgets/pdfviewer/zoomselector.py
index 6f9f972e0..3fa64cd34 100644
--- a/examples/pdfwidgets/pdfviewer/zoomselector.py
+++ b/examples/pdfwidgets/pdfviewer/zoomselector.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.QtPdfWidgets import QPdfView
from PySide6.QtWidgets import QComboBox
diff --git a/examples/qml/editingmodel/main.py b/examples/qml/editingmodel/main.py
index 5240a9de0..aa39460aa 100644
--- a/examples/qml/editingmodel/main.py
+++ b/examples/qml/editingmodel/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
from pathlib import Path
diff --git a/examples/qml/editingmodel/model.py b/examples/qml/editingmodel/model.py
index 02a1e5717..08feb6408 100644
--- a/examples/qml/editingmodel/model.py
+++ b/examples/qml/editingmodel/model.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 QAbstractListModel, QByteArray, QModelIndex, Qt, Slot
diff --git a/examples/qml/signals/pytoqml1/main.py b/examples/qml/signals/pytoqml1/main.py
index 5bc27a521..bb4311e54 100644
--- a/examples/qml/signals/pytoqml1/main.py
+++ b/examples/qml/signals/pytoqml1/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 os
from pathlib import Path
diff --git a/examples/qml/signals/pytoqml2/main.py b/examples/qml/signals/pytoqml2/main.py
index 3a3650aba..9868656e9 100644
--- a/examples/qml/signals/pytoqml2/main.py
+++ b/examples/qml/signals/pytoqml2/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 os
from pathlib import Path
diff --git a/examples/qml/signals/qmltopy1/main.py b/examples/qml/signals/qmltopy1/main.py
index 83966903c..1849f343f 100644
--- a/examples/qml/signals/qmltopy1/main.py
+++ b/examples/qml/signals/qmltopy1/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 os
from pathlib import Path
diff --git a/examples/qml/signals/qmltopy2/main.py b/examples/qml/signals/qmltopy2/main.py
index bc2e8d3ed..3b692e3c7 100644
--- a/examples/qml/signals/qmltopy2/main.py
+++ b/examples/qml/signals/qmltopy2/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 os
from pathlib import Path
diff --git a/examples/qml/signals/qmltopy3/main.py b/examples/qml/signals/qmltopy3/main.py
index 6a5554842..34f2896a3 100644
--- a/examples/qml/signals/qmltopy3/main.py
+++ b/examples/qml/signals/qmltopy3/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 os
from pathlib import Path
diff --git a/examples/qml/signals/qmltopy4/main.py b/examples/qml/signals/qmltopy4/main.py
index 8a56073d1..a5ea78f48 100644
--- a/examples/qml/signals/qmltopy4/main.py
+++ b/examples/qml/signals/qmltopy4/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 os
from pathlib import Path
diff --git a/examples/qml/textproperties/main.py b/examples/qml/textproperties/main.py
index 4e6afc9ff..ce644f754 100644
--- a/examples/qml/textproperties/main.py
+++ b/examples/qml/textproperties/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
from pathlib import Path
diff --git a/examples/qml/tutorials/extending-qml-advanced/adding/main.py b/examples/qml/tutorials/extending-qml-advanced/adding/main.py
index ec703dbf3..4c556c631 100644
--- a/examples/qml/tutorials/extending-qml-advanced/adding/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/adding/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 qml/examples/qml/referenceexamples/adding example from Qt v6.x"""
diff --git a/examples/qml/tutorials/extending-qml-advanced/adding/person.py b/examples/qml/tutorials/extending-qml-advanced/adding/person.py
index 526eae714..90e82082a 100644
--- a/examples/qml/tutorials/extending-qml-advanced/adding/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/adding/person.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 QObject, Property
from PySide6.QtQml import QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/birthdayparty.py
index 764815175..875e98a27 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/birthdayparty.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Property, Signal
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py
index 560db6602..eccb9ff8c 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the
qml/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project example from Qt v6.x"""
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/person.py b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/person.py
index 60dc9d882..89a669251 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced1-Base-project/person.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Property, Signal
from PySide6.QtQml import QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/birthdayparty.py
index 764815175..875e98a27 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/birthdayparty.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QObject, Property, Signal
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py
index cc77e2b40..ba9063e2c 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/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
qml/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion example
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/person.py b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/person.py
index 57e73e6f5..3d7e0271a 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced2-Inheritance-and-coercion/person.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 QObject, Property, Signal
from PySide6.QtQml import QmlElement, QmlUncreatable
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/birthdayparty.py
index 3f6102c66..1ef5ae511 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/birthdayparty.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 QObject, ClassInfo, Property, Signal
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py
index 020974c9b..977a44c4c 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/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
qml/examples/qml/tutorials/extending-qml-advanced/default advanced3-Default-properties example
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/person.py b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/person.py
index 503aaf65e..8deb7d0bf 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced3-Default-properties/person.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 QObject, Property, Signal
from PySide6.QtQml import QmlAnonymous, QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/birthdayparty.py
index 3f6102c66..1ef5ae511 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/birthdayparty.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 QObject, ClassInfo, Property, Signal
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py
index 9757b6daa..f15620549 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/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
qml/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties example
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/person.py b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/person.py
index ccd439e88..db3b8d5bd 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced4-Grouped-properties/person.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 QObject, Property, Signal
from PySide6.QtGui import QColor
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/birthdayparty.py
index f38bfd305..8e6628f7c 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/birthdayparty.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 QDate, QObject, ClassInfo, Property, Signal
from PySide6.QtQml import QmlAnonymous, QmlAttached, QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py
index 9a92afeb5..c914fe7d2 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/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
qml/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties example
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/person.py b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/person.py
index 503aaf65e..8deb7d0bf 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced5-Attached-properties/person.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 QObject, Property, Signal
from PySide6.QtQml import QmlAnonymous, QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/birthdayparty.py
index eacb5201d..e946242fd 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/birthdayparty.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 QDate, QObject, ClassInfo, Property, QTime, Signal
from PySide6.QtQml import QmlAnonymous, QmlAttached, QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/happybirthdaysong.py b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/happybirthdaysong.py
index c35f9bffa..b76d06ad6 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/happybirthdaysong.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/happybirthdaysong.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 QTimer, Property, Signal, Slot
from PySide6.QtQml import QmlElement, QPyQmlPropertyValueSource
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py
index ea412a547..eb693134a 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/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
qml/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source example
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/person.py b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/person.py
index 503aaf65e..8deb7d0bf 100644
--- a/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/advanced6-Property-value-source/person.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 QObject, Property, Signal
from PySide6.QtQml import QmlAnonymous, QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/binding/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/binding/birthdayparty.py
index a337d4a16..958a35236 100644
--- a/examples/qml/tutorials/extending-qml-advanced/binding/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/binding/birthdayparty.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 QDate, QObject, ClassInfo, Property, QTime, Signal
from PySide6.QtQml import QmlAnonymous, QmlAttached, QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/binding/happybirthdaysong.py b/examples/qml/tutorials/extending-qml-advanced/binding/happybirthdaysong.py
index 59ebfe4c6..31d477e89 100644
--- a/examples/qml/tutorials/extending-qml-advanced/binding/happybirthdaysong.py
+++ b/examples/qml/tutorials/extending-qml-advanced/binding/happybirthdaysong.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 QTimer, Property, Slot
from PySide6.QtQml import QmlElement, QPyQmlPropertyValueSource
diff --git a/examples/qml/tutorials/extending-qml-advanced/binding/main.py b/examples/qml/tutorials/extending-qml-advanced/binding/main.py
index 64929a807..45d0fd3f9 100644
--- a/examples/qml/tutorials/extending-qml-advanced/binding/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/binding/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 qml/examples/qml/referenceexamples/binding example from Qt v6.x"""
diff --git a/examples/qml/tutorials/extending-qml-advanced/binding/person.py b/examples/qml/tutorials/extending-qml-advanced/binding/person.py
index a6942763a..69ae48c88 100644
--- a/examples/qml/tutorials/extending-qml-advanced/binding/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/binding/person.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 QObject, Property, Signal
from PySide6.QtQml import QmlAnonymous, QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/extended/main.py b/examples/qml/tutorials/extending-qml-advanced/extended/main.py
index 6ee386401..694a042f5 100644
--- a/examples/qml/tutorials/extending-qml-advanced/extended/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/extended/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 qml/examples/qml/referenceexamples/extended example from Qt v6.x"""
diff --git a/examples/qml/tutorials/extending-qml-advanced/methods/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/methods/birthdayparty.py
index a3942b671..a00347671 100644
--- a/examples/qml/tutorials/extending-qml-advanced/methods/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/methods/birthdayparty.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 QObject, Property, Slot
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/methods/main.py b/examples/qml/tutorials/extending-qml-advanced/methods/main.py
index fb656f266..e23476b4d 100644
--- a/examples/qml/tutorials/extending-qml-advanced/methods/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/methods/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 qml/examples/qml/referenceexamples/methods example from Qt v6.x"""
diff --git a/examples/qml/tutorials/extending-qml-advanced/methods/person.py b/examples/qml/tutorials/extending-qml-advanced/methods/person.py
index 526eae714..90e82082a 100644
--- a/examples/qml/tutorials/extending-qml-advanced/methods/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/methods/person.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 QObject, Property
from PySide6.QtQml import QmlElement
diff --git a/examples/qml/tutorials/extending-qml-advanced/properties/birthdayparty.py b/examples/qml/tutorials/extending-qml-advanced/properties/birthdayparty.py
index 47dddc85d..be7a2143e 100644
--- a/examples/qml/tutorials/extending-qml-advanced/properties/birthdayparty.py
+++ b/examples/qml/tutorials/extending-qml-advanced/properties/birthdayparty.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 QObject, Property
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml-advanced/properties/main.py b/examples/qml/tutorials/extending-qml-advanced/properties/main.py
index 11757d5f3..f481be165 100644
--- a/examples/qml/tutorials/extending-qml-advanced/properties/main.py
+++ b/examples/qml/tutorials/extending-qml-advanced/properties/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 qml/examples/qml/referenceexamples/properties example from Qt v6.x"""
diff --git a/examples/qml/tutorials/extending-qml-advanced/properties/person.py b/examples/qml/tutorials/extending-qml-advanced/properties/person.py
index 526eae714..90e82082a 100644
--- a/examples/qml/tutorials/extending-qml-advanced/properties/person.py
+++ b/examples/qml/tutorials/extending-qml-advanced/properties/person.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 QObject, Property
from PySide6.QtQml import QmlElement
diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py b/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py
index 47d0a0e0c..9ff5fa318 100644
--- a/examples/qml/tutorials/extending-qml/chapter1-basics/basics.py
+++ b/examples/qml/tutorials/extending-qml/chapter1-basics/basics.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 qml/tutorials/extending-qml/chapter1-basics example from Qt v5.x"""
diff --git a/examples/qml/tutorials/extending-qml/chapter2-methods/methods.py b/examples/qml/tutorials/extending-qml/chapter2-methods/methods.py
index d455c317b..a02384ad7 100644
--- a/examples/qml/tutorials/extending-qml/chapter2-methods/methods.py
+++ b/examples/qml/tutorials/extending-qml/chapter2-methods/methods.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 qml/tutorials/extending-qml/chapter2-methods example from Qt v5.x"""
diff --git a/examples/qml/tutorials/extending-qml/chapter3-bindings/bindings.py b/examples/qml/tutorials/extending-qml/chapter3-bindings/bindings.py
index a9b61e7f1..91d3abe50 100644
--- a/examples/qml/tutorials/extending-qml/chapter3-bindings/bindings.py
+++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/bindings.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 qml/tutorials/extending-qml/chapter3-bindings example from Qt v5.x"""
diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py
index 659850f38..74dfa1871 100644
--- a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.py
+++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/customPropertyTypes.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 qml/tutorials/extending-qml/chapter4-customPropertyTypes example
from Qt v5.x"""
diff --git a/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py b/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py
index 98952cef1..f52d84820 100644
--- a/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.py
+++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/listproperties.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 qml/tutorials/extending-qml/chapter5-listproperties example from Qt v5.x"""
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.py b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.py
index 3ab8bcc08..d406fd758 100644
--- a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.py
+++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/piechart.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 Property
from PySide6.QtQml import QmlElement, ListProperty
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.py b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.py
index 6f82f1f10..6a4a69731 100644
--- a/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.py
+++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/Charts/pieslice.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 Property, QRectF
from PySide6.QtGui import QColor, QPainter, QPen
diff --git a/examples/qml/usingmodel/usingmodel.py b/examples/qml/usingmodel/usingmodel.py
index 008a1b94b..d02fb8524 100644
--- a/examples/qml/usingmodel/usingmodel.py
+++ b/examples/qml/usingmodel/usingmodel.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 os
from dataclasses import dataclass
diff --git a/examples/quick/models/objectlistmodel/objectlistmodel.py b/examples/quick/models/objectlistmodel/objectlistmodel.py
index 968761e5c..65eac2354 100644
--- a/examples/quick/models/objectlistmodel/objectlistmodel.py
+++ b/examples/quick/models/objectlistmodel/objectlistmodel.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/quick/models/stringlistmodel/stringlistmodel.py b/examples/quick/models/stringlistmodel/stringlistmodel.py
index 3982b1ffc..a1614b41c 100644
--- a/examples/quick/models/stringlistmodel/stringlistmodel.py
+++ b/examples/quick/models/stringlistmodel/stringlistmodel.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/quick/painteditem/painteditem.py b/examples/quick/painteditem/painteditem.py
index cf5a05ada..f6c3f0bf2 100644
--- a/examples/quick/painteditem/painteditem.py
+++ b/examples/quick/painteditem/painteditem.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 argparse import ArgumentParser, RawTextHelpFormatter
from pathlib import Path
diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/cuberenderer.py b/examples/quick/rendercontrol/rendercontrol_opengl/cuberenderer.py
index 69e7321f9..b094584a1 100644
--- a/examples/quick/rendercontrol/rendercontrol_opengl/cuberenderer.py
+++ b/examples/quick/rendercontrol/rendercontrol_opengl/cuberenderer.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 ctypes
import numpy
diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/main.py b/examples/quick/rendercontrol/rendercontrol_opengl/main.py
index ee885ae6d..ede663bb5 100644
--- a/examples/quick/rendercontrol/rendercontrol_opengl/main.py
+++ b/examples/quick/rendercontrol/rendercontrol_opengl/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
from PySide6.QtGui import QGuiApplication
diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.py b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.py
index 6f1e61f94..ef489a2c7 100644
--- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.py
+++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.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 numpy
from pathlib import Path
diff --git a/examples/quick/scenegraph/openglunderqml/main.py b/examples/quick/scenegraph/openglunderqml/main.py
index 0e24877bd..e452f6907 100644
--- a/examples/quick/scenegraph/openglunderqml/main.py
+++ b/examples/quick/scenegraph/openglunderqml/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
from pathlib import Path
diff --git a/examples/quick/scenegraph/openglunderqml/squircle.py b/examples/quick/scenegraph/openglunderqml/squircle.py
index d2900198b..2cfb9f41c 100644
--- a/examples/quick/scenegraph/openglunderqml/squircle.py
+++ b/examples/quick/scenegraph/openglunderqml/squircle.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 Property, QRunnable, Qt, Signal, Slot
from PySide6.QtQml import QmlElement
diff --git a/examples/quick/scenegraph/openglunderqml/squirclerenderer.py b/examples/quick/scenegraph/openglunderqml/squirclerenderer.py
index d824f96ab..f70702e2f 100644
--- a/examples/quick/scenegraph/openglunderqml/squirclerenderer.py
+++ b/examples/quick/scenegraph/openglunderqml/squirclerenderer.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/quick/scenegraph/scenegraph_customgeometry/main.py b/examples/quick/scenegraph/scenegraph_customgeometry/main.py
index 60a904065..79281afd4 100644
--- a/examples/quick/scenegraph/scenegraph_customgeometry/main.py
+++ b/examples/quick/scenegraph/scenegraph_customgeometry/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 Qt Quick customgeometry example from Qt v6.x"""
diff --git a/examples/quick/window/main.py b/examples/quick/window/main.py
index 62ba6a5e9..f12fa88d2 100644
--- a/examples/quick/window/main.py
+++ b/examples/quick/window/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 os
from pathlib import Path
diff --git a/examples/quick3d/customgeometry/examplepoint.py b/examples/quick3d/customgeometry/examplepoint.py
index 0360806ae..6f0bfe0e1 100644
--- a/examples/quick3d/customgeometry/examplepoint.py
+++ b/examples/quick3d/customgeometry/examplepoint.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 random
diff --git a/examples/quick3d/customgeometry/exampletriangle.py b/examples/quick3d/customgeometry/exampletriangle.py
index 854430c46..0f9e025a0 100644
--- a/examples/quick3d/customgeometry/exampletriangle.py
+++ b/examples/quick3d/customgeometry/exampletriangle.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 numpy as np
from PySide6.QtCore import Property, Signal
diff --git a/examples/quick3d/customgeometry/main.py b/examples/quick3d/customgeometry/main.py
index 148330d91..985943208 100644
--- a/examples/quick3d/customgeometry/main.py
+++ b/examples/quick3d/customgeometry/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 os
diff --git a/examples/quick3d/intro/main.py b/examples/quick3d/intro/main.py
index 827434038..a35ec6a45 100644
--- a/examples/quick3d/intro/main.py
+++ b/examples/quick3d/intro/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 os
import sys
diff --git a/examples/quick3d/proceduraltexture/gradienttexture.py b/examples/quick3d/proceduraltexture/gradienttexture.py
index a577f7ebd..a02849f1c 100644
--- a/examples/quick3d/proceduraltexture/gradienttexture.py
+++ b/examples/quick3d/proceduraltexture/gradienttexture.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import Signal, Property, QSize
from PySide6.QtGui import QColor
diff --git a/examples/quick3d/proceduraltexture/main.py b/examples/quick3d/proceduraltexture/main.py
index a732cc015..292acfe61 100644
--- a/examples/quick3d/proceduraltexture/main.py
+++ b/examples/quick3d/proceduraltexture/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine
diff --git a/examples/quickcontrols/contactslist/contactmodel.py b/examples/quickcontrols/contactslist/contactmodel.py
index 5d2746c2e..5f65b9045 100644
--- a/examples/quickcontrols/contactslist/contactmodel.py
+++ b/examples/quickcontrols/contactslist/contactmodel.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import bisect
from dataclasses import dataclass
diff --git a/examples/quickcontrols/contactslist/main.py b/examples/quickcontrols/contactslist/main.py
index d501bbdb4..41c7142b3 100644
--- a/examples/quickcontrols/contactslist/main.py
+++ b/examples/quickcontrols/contactslist/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""
PySide6 port of Qt Quick Controls Contact List example from Qt v6.x
diff --git a/examples/quickcontrols/filesystemexplorer/editormodels.py b/examples/quickcontrols/filesystemexplorer/editormodels.py
index 688147726..f317fb48a 100644
--- a/examples/quickcontrols/filesystemexplorer/editormodels.py
+++ b/examples/quickcontrols/filesystemexplorer/editormodels.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
from PySide6.QtWidgets import QFileSystemModel
from PySide6.QtQuick import QQuickTextDocument
diff --git a/examples/quickcontrols/filesystemexplorer/main.py b/examples/quickcontrols/filesystemexplorer/main.py
index 8fad951cb..97bf9852d 100644
--- a/examples/quickcontrols/filesystemexplorer/main.py
+++ b/examples/quickcontrols/filesystemexplorer/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
"""
This example shows how to customize Qt Quick Controls by implementing a simple filesystem explorer.
diff --git a/examples/quickcontrols/gallery/gallery.py b/examples/quickcontrols/gallery/gallery.py
index 6c2a3612e..7e93e083c 100644
--- a/examples/quickcontrols/gallery/gallery.py
+++ b/examples/quickcontrols/gallery/gallery.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
"""
The gallery example is a simple application with a drawer menu that contains
diff --git a/examples/remoteobjects/modelview/modelviewclient.py b/examples/remoteobjects/modelview/modelviewclient.py
index 38409c998..c311d1fe1 100644
--- a/examples/remoteobjects/modelview/modelviewclient.py
+++ b/examples/remoteobjects/modelview/modelviewclient.py
@@ -1,6 +1,7 @@
# Copyright (C) 2017 Ford Motor Company
# 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 remoteobjects/modelviewclient example from Qt v5.x"""
diff --git a/examples/remoteobjects/modelview/modelviewserver.py b/examples/remoteobjects/modelview/modelviewserver.py
index 0e213fb57..518dc72c8 100644
--- a/examples/remoteobjects/modelview/modelviewserver.py
+++ b/examples/remoteobjects/modelview/modelviewserver.py
@@ -1,6 +1,7 @@
# Copyright (C) 2017 Ford Motor Company
# 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 remoteobjects/modelviewserver example from Qt v5.x"""
diff --git a/examples/samplebinding/doc/samplebinding.rst b/examples/samplebinding/doc/samplebinding.rst
index defb55d6b..f28798d52 100644
--- a/examples/samplebinding/doc/samplebinding.rst
+++ b/examples/samplebinding/doc/samplebinding.rst
@@ -165,23 +165,28 @@ Using CMake
You can build and run this example by executing the following commands
(slightly adapted to your file system layout) in a terminal:
-macOS/Linux:
+Run CMake on macOS/Linux:
.. code-block:: bash
cd ~/pyside-setup/examples/samplebinding
+ mkdir build
+ cd build
+ cmake .. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release
-On Windows:
+Run CMake on Windows:
.. code-block:: bash
cd C:\pyside-setup\examples\samplebinding
+ mkdir build
+ cd build
+ cmake .. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl.exe
+
+To build:
.. code-block:: bash
- mkdir build
- cd build
- cmake -S.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl.exe
ninja
ninja install
cd ..
diff --git a/examples/samplebinding/main.py b/examples/samplebinding/main.py
index cb9f116ee..125073d29 100644
--- a/examples/samplebinding/main.py
+++ b/examples/samplebinding/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
"""An example showcasing how to use bindings for a custom non-Qt C++ library"""
diff --git a/examples/scriptableapplication/doc/scriptableapplication.rst b/examples/scriptableapplication/doc/scriptableapplication.rst
index 146911f13..bbabb1247 100644
--- a/examples/scriptableapplication/doc/scriptableapplication.rst
+++ b/examples/scriptableapplication/doc/scriptableapplication.rst
@@ -72,21 +72,22 @@ macOS/Linux:
.. code-block:: bash
cd ~/pyside-setup/examples/scriptableapplication
+ mkdir build
+ cd build
+ cmake .. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release
+ ninja
+ ./scriptableapplication
On Windows:
.. code-block:: bash
cd C:\pyside-setup\examples\scriptableapplication
-
-
-.. code-block:: bash
-
mkdir build
cd build
- cmake -S.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release
+ cmake .. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl.exe
ninja
- ./scriptableapplication
+ .\scriptableapplication.exe
Using QMake
+++++++++++
diff --git a/examples/serialbus/can/bitratebox.py b/examples/serialbus/can/bitratebox.py
index 68c70baac..952967c17 100644
--- a/examples/serialbus/can/bitratebox.py
+++ b/examples/serialbus/can/bitratebox.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 QComboBox
from PySide6.QtGui import QIntValidator
diff --git a/examples/serialbus/can/canbusdeviceinfobox.py b/examples/serialbus/can/canbusdeviceinfobox.py
index 5e6049265..4028970e7 100644
--- a/examples/serialbus/can/canbusdeviceinfobox.py
+++ b/examples/serialbus/can/canbusdeviceinfobox.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
from PySide6.QtWidgets import QGroupBox
diff --git a/examples/serialbus/can/canbusdeviceinfodialog.py b/examples/serialbus/can/canbusdeviceinfodialog.py
index dfb4e6025..ced446b0a 100644
--- a/examples/serialbus/can/canbusdeviceinfodialog.py
+++ b/examples/serialbus/can/canbusdeviceinfodialog.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 QDialog
diff --git a/examples/serialbus/can/connectdialog.py b/examples/serialbus/can/connectdialog.py
index a6d5ac378..84021da4a 100644
--- a/examples/serialbus/can/connectdialog.py
+++ b/examples/serialbus/can/connectdialog.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 QSettings, Qt, Slot
from PySide6.QtGui import QIntValidator
diff --git a/examples/serialbus/can/main.py b/examples/serialbus/can/main.py
index 97cdcc908..0e4aefd3c 100644
--- a/examples/serialbus/can/main.py
+++ b/examples/serialbus/can/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/serialbus/can/mainwindow.py b/examples/serialbus/can/mainwindow.py
index ae2a08f1f..dda655888 100644
--- a/examples/serialbus/can/mainwindow.py
+++ b/examples/serialbus/can/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 QTimer, QUrl, Slot
from PySide6.QtGui import QDesktopServices
diff --git a/examples/serialbus/can/receivedframesmodel.py b/examples/serialbus/can/receivedframesmodel.py
index 7953f3750..0d0f19c39 100644
--- a/examples/serialbus/can/receivedframesmodel.py
+++ b/examples/serialbus/can/receivedframesmodel.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 enum import IntEnum
diff --git a/examples/serialbus/can/receivedframesview.py b/examples/serialbus/can/receivedframesview.py
index 0f99a1e77..02d52d1c6 100644
--- a/examples/serialbus/can/receivedframesview.py
+++ b/examples/serialbus/can/receivedframesview.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, Slot
from PySide6.QtGui import QAction, QKeySequence
diff --git a/examples/serialbus/can/sendframebox.py b/examples/serialbus/can/sendframebox.py
index 6472fc473..b151b79ab 100644
--- a/examples/serialbus/can/sendframebox.py
+++ b/examples/serialbus/can/sendframebox.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
diff --git a/examples/serialbus/modbus/modbusclient/main.py b/examples/serialbus/modbus/modbusclient/main.py
index 1bad75c49..de3e946b6 100644
--- a/examples/serialbus/modbus/modbusclient/main.py
+++ b/examples/serialbus/modbus/modbusclient/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 examples/serialbus/modbus/client example from Qt v6.x"""
diff --git a/examples/serialbus/modbus/modbusclient/mainwindow.py b/examples/serialbus/modbus/modbusclient/mainwindow.py
index 02f9d478b..027410bfb 100644
--- a/examples/serialbus/modbus/modbusclient/mainwindow.py
+++ b/examples/serialbus/modbus/modbusclient/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 functools
from enum import IntEnum
diff --git a/examples/serialbus/modbus/modbusclient/settingsdialog.py b/examples/serialbus/modbus/modbusclient/settingsdialog.py
index a5e4a37ca..44c59bac2 100644
--- a/examples/serialbus/modbus/modbusclient/settingsdialog.py
+++ b/examples/serialbus/modbus/modbusclient/settingsdialog.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.QtWidgets import QDialog
diff --git a/examples/serialbus/modbus/modbusclient/writeregistermodel.py b/examples/serialbus/modbus/modbusclient/writeregistermodel.py
index 07b1226de..e88f4a835 100644
--- a/examples/serialbus/modbus/modbusclient/writeregistermodel.py
+++ b/examples/serialbus/modbus/modbusclient/writeregistermodel.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 enum import IntEnum
diff --git a/examples/serialport/terminal/console.py b/examples/serialport/terminal/console.py
index 125951374..bedb1ed96 100644
--- a/examples/serialport/terminal/console.py
+++ b/examples/serialport/terminal/console.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, Signal, Slot
from PySide6.QtGui import QPalette
diff --git a/examples/serialport/terminal/main.py b/examples/serialport/terminal/main.py
index 0d2ce0a01..feff5da1a 100644
--- a/examples/serialport/terminal/main.py
+++ b/examples/serialport/terminal/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/serialport/terminal/mainwindow.py b/examples/serialport/terminal/mainwindow.py
index bdfb0fb0e..c6cf95d29 100644
--- a/examples/serialport/terminal/mainwindow.py
+++ b/examples/serialport/terminal/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 QIODeviceBase, Slot
from PySide6.QtWidgets import QLabel, QMainWindow, QMessageBox
diff --git a/examples/serialport/terminal/settingsdialog.py b/examples/serialport/terminal/settingsdialog.py
index c9373d5b0..cc8bbb2aa 100644
--- a/examples/serialport/terminal/settingsdialog.py
+++ b/examples/serialport/terminal/settingsdialog.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/spatialaudio/audiopanning/main.py b/examples/spatialaudio/audiopanning/main.py
index 19b6c3bbd..db879610f 100644
--- a/examples/spatialaudio/audiopanning/main.py
+++ b/examples/spatialaudio/audiopanning/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 math
import sys
diff --git a/examples/speech/hello_speak/main.py b/examples/speech/hello_speak/main.py
index b025dd6c0..309e7ef1b 100644
--- a/examples/speech/hello_speak/main.py
+++ b/examples/speech/hello_speak/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the hello_speak example from Qt v6.x"""
diff --git a/examples/speech/hello_speak/mainwindow.py b/examples/speech/hello_speak/mainwindow.py
index 7790fec8c..cb46b55f3 100644
--- a/examples/speech/hello_speak/mainwindow.py
+++ b/examples/speech/hello_speak/mainwindow.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtCore import QLocale, QSignalBlocker, Slot
from PySide6.QtWidgets import QMainWindow
diff --git a/examples/sql/books/bookdelegate.py b/examples/sql/books/bookdelegate.py
index 78295adf1..742b1fb46 100644
--- a/examples/sql/books/bookdelegate.py
+++ b/examples/sql/books/bookdelegate.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 copy
from PySide6.QtSql import QSqlRelationalDelegate
diff --git a/examples/sql/books/bookwindow.py b/examples/sql/books/bookwindow.py
index 7f9e0f94b..6aa82992b 100644
--- a/examples/sql/books/bookwindow.py
+++ b/examples/sql/books/bookwindow.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 (QAbstractItemView, QDataWidgetMapper,
QHeaderView, QMainWindow, QMessageBox)
diff --git a/examples/sql/books/createdb.py b/examples/sql/books/createdb.py
index 5ee0f148e..471148c61 100644
--- a/examples/sql/books/createdb.py
+++ b/examples/sql/books/createdb.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.QtSql import QSqlDatabase, QSqlQuery
from datetime import date
diff --git a/examples/sql/books/main.py b/examples/sql/books/main.py
index 025b55884..4b4aee1a3 100644
--- a/examples/sql/books/main.py
+++ b/examples/sql/books/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
from PySide6.QtWidgets import QApplication
diff --git a/examples/sql/relationaltablemodel/connection.py b/examples/sql/relationaltablemodel/connection.py
index 6bfc828c8..61c154ba4 100644
--- a/examples/sql/relationaltablemodel/connection.py
+++ b/examples/sql/relationaltablemodel/connection.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 relationaltablemodel example from Qt v6.x"""
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.py b/examples/sql/relationaltablemodel/relationaltablemodel.py
index d2efac2dc..520390666 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.py
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.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 relationaltablemodel example from Qt v6.x"""
diff --git a/examples/statemachine/moveblocks/moveblocks.py b/examples/statemachine/moveblocks/moveblocks.py
index 0d52c5b00..42a79b507 100644
--- a/examples/statemachine/moveblocks/moveblocks.py
+++ b/examples/statemachine/moveblocks/moveblocks.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the examples/statemachine/moveblocks example from Qt v6.x"""
diff --git a/examples/statemachine/ping_pong/ping_pong.py b/examples/statemachine/ping_pong/ping_pong.py
index d5c18eb28..e2ea9fd67 100644
--- a/examples/statemachine/ping_pong/ping_pong.py
+++ b/examples/statemachine/ping_pong/ping_pong.py
@@ -1,6 +1,7 @@
# Copyright (C) 2010 velociraptor Genjix <aphidia@hotmail.com>
# 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/statemachine/rogue/rogue.py b/examples/statemachine/rogue/rogue.py
index f0ce9c28c..bca4ccb84 100644
--- a/examples/statemachine/rogue/rogue.py
+++ b/examples/statemachine/rogue/rogue.py
@@ -1,6 +1,7 @@
# Copyright (C) 2010 velociraptor Genjix <aphidia@hotmail.com>
# 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/statemachine/trafficlight/trafficlight.py b/examples/statemachine/trafficlight/trafficlight.py
index 1e58384f9..fb3384f1e 100644
--- a/examples/statemachine/trafficlight/trafficlight.py
+++ b/examples/statemachine/trafficlight/trafficlight.py
@@ -1,6 +1,7 @@
# Copyright (C) 2010 velociraptor Genjix <aphidia@hotmail.com>
# 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/uitools/uiloader/uiloader.py b/examples/uitools/uiloader/uiloader.py
index 265c93837..fa19816e7 100644
--- a/examples/uitools/uiloader/uiloader.py
+++ b/examples/uitools/uiloader/uiloader.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
"""QUiLoader example, showing how to dynamically load a Qt Designer form
from a UI file."""
diff --git a/examples/utils/pyside_config.py b/examples/utils/pyside_config.py
index d3067eec1..40885dfdb 100644
--- a/examples/utils/pyside_config.py
+++ b/examples/utils/pyside_config.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 sysconfig
from enum import Enum
diff --git a/examples/webchannel/standalone/core.py b/examples/webchannel/standalone/core.py
index 2d0cb0286..987a4ee1a 100644
--- a/examples/webchannel/standalone/core.py
+++ b/examples/webchannel/standalone/core.py
@@ -1,6 +1,7 @@
# Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.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 QObject, Signal, Slot
diff --git a/examples/webchannel/standalone/dialog.py b/examples/webchannel/standalone/dialog.py
index 7f2413e6c..27cef86a7 100644
--- a/examples/webchannel/standalone/dialog.py
+++ b/examples/webchannel/standalone/dialog.py
@@ -1,6 +1,7 @@
# Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.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 Signal, Slot
diff --git a/examples/webchannel/standalone/main.py b/examples/webchannel/standalone/main.py
index 8c04aa64f..8459b1a92 100644
--- a/examples/webchannel/standalone/main.py
+++ b/examples/webchannel/standalone/main.py
@@ -1,6 +1,7 @@
# Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import os
diff --git a/examples/webchannel/standalone/websocketclientwrapper.py b/examples/webchannel/standalone/websocketclientwrapper.py
index 00b410891..a14672f25 100644
--- a/examples/webchannel/standalone/websocketclientwrapper.py
+++ b/examples/webchannel/standalone/websocketclientwrapper.py
@@ -1,6 +1,7 @@
# Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.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 QObject, Signal, Slot
diff --git a/examples/webchannel/standalone/websockettransport.py b/examples/webchannel/standalone/websockettransport.py
index ab60e8448..96e9b822a 100644
--- a/examples/webchannel/standalone/websockettransport.py
+++ b/examples/webchannel/standalone/websockettransport.py
@@ -1,6 +1,7 @@
# Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWebChannel import QWebChannelAbstractTransport
from PySide6.QtCore import QByteArray, QJsonDocument, Slot
diff --git a/examples/webenginequick/nanobrowser/quicknanobrowser.py b/examples/webenginequick/nanobrowser/quicknanobrowser.py
index aee79c2aa..b246ac167 100644
--- a/examples/webenginequick/nanobrowser/quicknanobrowser.py
+++ b/examples/webenginequick/nanobrowser/quicknanobrowser.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 WebEngine QtQuick 2 Example"""
diff --git a/examples/webenginewidgets/markdowneditor/document.py b/examples/webenginewidgets/markdowneditor/document.py
index 331fbc0ca..10ed57523 100644
--- a/examples/webenginewidgets/markdowneditor/document.py
+++ b/examples/webenginewidgets/markdowneditor/document.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 QObject, Property, Signal
diff --git a/examples/webenginewidgets/markdowneditor/main.py b/examples/webenginewidgets/markdowneditor/main.py
index 4d787f0f0..8a92abf8d 100644
--- a/examples/webenginewidgets/markdowneditor/main.py
+++ b/examples/webenginewidgets/markdowneditor/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 Markdown Editor Example"""
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.py b/examples/webenginewidgets/markdowneditor/mainwindow.py
index 6f74cf93d..be65483d3 100644
--- a/examples/webenginewidgets/markdowneditor/mainwindow.py
+++ b/examples/webenginewidgets/markdowneditor/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 QDir, QFile, QIODevice, QUrl, Qt, Slot
diff --git a/examples/webenginewidgets/markdowneditor/previewpage.py b/examples/webenginewidgets/markdowneditor/previewpage.py
index 35ac80be4..75c8e317f 100644
--- a/examples/webenginewidgets/markdowneditor/previewpage.py
+++ b/examples/webenginewidgets/markdowneditor/previewpage.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.QtGui import QDesktopServices
from PySide6.QtWebEngineCore import QWebEnginePage
diff --git a/examples/webenginewidgets/notifications/main.py b/examples/webenginewidgets/notifications/main.py
index b59aead97..c51af957b 100644
--- a/examples/webenginewidgets/notifications/main.py
+++ b/examples/webenginewidgets/notifications/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 WebEngineWidgets Notifications Example"""
diff --git a/examples/webenginewidgets/notifications/notificationpopup.py b/examples/webenginewidgets/notifications/notificationpopup.py
index e68ce3d6f..803bfef92 100644
--- a/examples/webenginewidgets/notifications/notificationpopup.py
+++ b/examples/webenginewidgets/notifications/notificationpopup.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, QTimer, QPoint, Slot
from PySide6.QtWidgets import (QWidget, QHBoxLayout, QLabel, QVBoxLayout, QSpacerItem, QSizePolicy,
diff --git a/examples/webenginewidgets/simplebrowser/browser.py b/examples/webenginewidgets/simplebrowser/browser.py
index a124ea084..cf3afa3d9 100644
--- a/examples/webenginewidgets/simplebrowser/browser.py
+++ b/examples/webenginewidgets/simplebrowser/browser.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWebEngineCore import (qWebEngineChromiumVersion,
QWebEngineProfile, QWebEngineSettings)
diff --git a/examples/webenginewidgets/simplebrowser/browserwindow.py b/examples/webenginewidgets/simplebrowser/browserwindow.py
index 43b811200..c09e12842 100644
--- a/examples/webenginewidgets/simplebrowser/browserwindow.py
+++ b/examples/webenginewidgets/simplebrowser/browserwindow.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
import sys
diff --git a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.py b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.py
index 7096b8b57..09dc00611 100644
--- a/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.py
+++ b/examples/webenginewidgets/simplebrowser/downloadmanagerwidget.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWebEngineCore import QWebEngineDownloadRequest
from PySide6.QtWidgets import QWidget, QFileDialog
diff --git a/examples/webenginewidgets/simplebrowser/downloadwidget.py b/examples/webenginewidgets/simplebrowser/downloadwidget.py
index 3b4973cb8..39a110538 100644
--- a/examples/webenginewidgets/simplebrowser/downloadwidget.py
+++ b/examples/webenginewidgets/simplebrowser/downloadwidget.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from ui_downloadwidget import Ui_DownloadWidget
diff --git a/examples/webenginewidgets/simplebrowser/main.py b/examples/webenginewidgets/simplebrowser/main.py
index 781ec29eb..f072b430b 100644
--- a/examples/webenginewidgets/simplebrowser/main.py
+++ b/examples/webenginewidgets/simplebrowser/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""PySide6 port of the Qt WebEngineWidgets Simple Browser example from Qt v6.x"""
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.py b/examples/webenginewidgets/simplebrowser/tabwidget.py
index bda321ac1..b0eb865d9 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.py
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from functools import partial
diff --git a/examples/webenginewidgets/simplebrowser/webpage.py b/examples/webenginewidgets/simplebrowser/webpage.py
index 2f2800a17..e5d9bc6ab 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.py
+++ b/examples/webenginewidgets/simplebrowser/webpage.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from functools import partial
diff --git a/examples/webenginewidgets/simplebrowser/webpopupwindow.py b/examples/webenginewidgets/simplebrowser/webpopupwindow.py
index fac27a61a..0b2263c4c 100644
--- a/examples/webenginewidgets/simplebrowser/webpopupwindow.py
+++ b/examples/webenginewidgets/simplebrowser/webpopupwindow.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from PySide6.QtWidgets import QLineEdit, QSizePolicy, QWidget, QVBoxLayout
from PySide6.QtGui import QAction
diff --git a/examples/webenginewidgets/simplebrowser/webview.py b/examples/webenginewidgets/simplebrowser/webview.py
index e1282c1dd..1ad4b493e 100644
--- a/examples/webenginewidgets/simplebrowser/webview.py
+++ b/examples/webenginewidgets/simplebrowser/webview.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
from functools import partial
diff --git a/examples/webenginewidgets/widgetsnanobrowser/widgetsnanobrowser.py b/examples/webenginewidgets/widgetsnanobrowser/widgetsnanobrowser.py
index 2db865996..b8477112a 100644
--- a/examples/webenginewidgets/widgetsnanobrowser/widgetsnanobrowser.py
+++ b/examples/webenginewidgets/widgetsnanobrowser/widgetsnanobrowser.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 WebEngineWidgets Example"""
diff --git a/examples/widgetbinding/dialog.py b/examples/widgetbinding/dialog.py
index 1bd127804..b7bd74ce4 100644
--- a/examples/widgetbinding/dialog.py
+++ b/examples/widgetbinding/dialog.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 QDialog, QLineEdit, QVBoxLayout
diff --git a/examples/widgetbinding/doc/widgetbinding.md b/examples/widgetbinding/doc/widgetbinding.md
index 6355ea311..910961b1e 100644
--- a/examples/widgetbinding/doc/widgetbinding.md
+++ b/examples/widgetbinding/doc/widgetbinding.md
@@ -40,20 +40,24 @@ The most important files are:
Now create a `build/` directory, and from inside run `cmake` to use
the provided `CMakeLists.txt`:
-macOS/Linux:
+Run CMake on macOS/Linux:
```bash
cd ~/pyside-setup/examples/widgetbinding
+cd build
+cmake .. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release
```
-On Windows:
+Run CMake on Windows:
```bash
cd C:\pyside-setup\examples\widgetbinding
+mkdir build
+cd build
+cmake .. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl.exe
```
+To build:
```bash
-mkdir build
-cd build
-cmake -S.. -B. -G Ninja -DCMAKE_BUILD_TYPE=Release
+
ninja
ninja install
cd ..
diff --git a/examples/widgetbinding/main.py b/examples/widgetbinding/main.py
index 2b24018b1..3876b4c63 100644
--- a/examples/widgetbinding/main.py
+++ b/examples/widgetbinding/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/widgetbinding/registerwigglywidget.py b/examples/widgetbinding/registerwigglywidget.py
index c5560ba6b..f172a94cb 100644
--- a/examples/widgetbinding/registerwigglywidget.py
+++ b/examples/widgetbinding/registerwigglywidget.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.QtDesigner import QPyDesignerCustomWidgetCollection
from wigglywidget import WigglyWidget
diff --git a/examples/widgetbinding/wigglywidget.py b/examples/widgetbinding/wigglywidget.py
index 3362eab6b..08c64a28c 100644
--- a/examples/widgetbinding/wigglywidget.py
+++ b/examples/widgetbinding/wigglywidget.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 QBasicTimer, Property
from PySide6.QtGui import QColor, QFontMetrics, QPainter, QPalette
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
diff --git a/examples/xml/dombookmarks/dombookmarks.py b/examples/xml/dombookmarks/dombookmarks.py
index a35aeb0f2..9283ca4d2 100644
--- a/examples/xml/dombookmarks/dombookmarks.py
+++ b/examples/xml/dombookmarks/dombookmarks.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 xml/dombookmarks example from Qt v5.x"""