aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside-tools/android_deploy.py1
-rw-r--r--sources/pyside-tools/deploy.py24
-rw-r--r--sources/pyside-tools/deploy_lib/__init__.py1
-rw-r--r--sources/pyside-tools/deploy_lib/android/__init__.py1
-rw-r--r--sources/pyside-tools/deploy_lib/android/android_config.py15
-rw-r--r--sources/pyside-tools/deploy_lib/android/android_helper.py12
-rw-r--r--sources/pyside-tools/deploy_lib/android/buildozer.py13
-rw-r--r--sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py1
-rw-r--r--sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py1
-rw-r--r--sources/pyside-tools/deploy_lib/commands.py4
-rw-r--r--sources/pyside-tools/deploy_lib/config.py42
-rw-r--r--sources/pyside-tools/deploy_lib/default.spec7
-rw-r--r--sources/pyside-tools/deploy_lib/dependency_util.py12
-rw-r--r--sources/pyside-tools/deploy_lib/deploy_util.py17
-rw-r--r--sources/pyside-tools/deploy_lib/nuitka_helper.py30
-rw-r--r--sources/pyside-tools/deploy_lib/python_helper.py1
-rw-r--r--sources/pyside-tools/metaobjectdump.py47
-rw-r--r--sources/pyside-tools/project.py12
-rw-r--r--sources/pyside-tools/project/__init__.py1
-rw-r--r--sources/pyside-tools/project/newproject.py4
-rw-r--r--sources/pyside-tools/project/project_data.py24
-rw-r--r--sources/pyside-tools/project/utils.py14
-rw-r--r--sources/pyside-tools/pyside_tool.py6
-rw-r--r--sources/pyside-tools/qml.py6
-rw-r--r--sources/pyside-tools/qtpy2cpp.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/astdump.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/formatter.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/nodedump.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/qt.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/tests/baseline/basic_test.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/tests/test_qtpy2cpp.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/tokenizer.py1
-rw-r--r--sources/pyside-tools/qtpy2cpp_lib/visitor.py1
-rw-r--r--sources/pyside6/PySide6/QtAsyncio/__init__.py1
-rw-r--r--sources/pyside6/PySide6/QtAsyncio/events.py25
-rw-r--r--sources/pyside6/PySide6/QtAsyncio/futures.py1
-rw-r--r--sources/pyside6/PySide6/QtAsyncio/tasks.py1
-rw-r--r--sources/pyside6/PySide6/QtCore/typesystem_core_common.xml10
-rw-r--r--sources/pyside6/PySide6/QtGui/CMakeLists.txt10
-rw-r--r--sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml1
-rw-r--r--sources/pyside6/PySide6/QtNetwork/typesystem_network.xml5
-rw-r--r--sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp6
-rw-r--r--sources/pyside6/PySide6/QtQml/typesystem_qml.xml9
-rw-r--r--sources/pyside6/PySide6/QtWebEngineQuick/CMakeLists.txt13
-rw-r--r--sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml1
-rw-r--r--sources/pyside6/PySide6/QtWidgets/typesystem_widgets_common.xml3
-rw-r--r--sources/pyside6/PySide6/glue/qtcore.cpp8
-rw-r--r--sources/pyside6/PySide6/qtdatavisualization_helper.h4
-rw-r--r--sources/pyside6/PySide6/qtgraphs_helper.h4
-rw-r--r--sources/pyside6/PySide6/support/__init__.py1
-rw-r--r--sources/pyside6/PySide6/support/deprecated.py1
-rw-r--r--sources/pyside6/PySide6/support/generate_pyi.py1
-rw-r--r--sources/pyside6/cmake/Macros/PySideModules.cmake33
-rw-r--r--sources/pyside6/cmake/PySideHelpers.cmake19
-rw-r--r--sources/pyside6/doc/commercial/index.rst2
-rw-r--r--sources/pyside6/doc/deployment/deployment-nuitka.rst13
-rw-r--r--sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst35
-rw-r--r--sources/pyside6/doc/gettingstarted/index.rst4
-rw-r--r--sources/pyside6/doc/gettingstarted/linux.rst20
-rw-r--r--sources/pyside6/doc/gettingstarted/macOS.rst18
-rw-r--r--sources/pyside6/doc/gettingstarted/windows.rst14
-rw-r--r--sources/pyside6/doc/inheritance_graph.py1
-rw-r--r--sources/pyside6/doc/json_inheritance.py1
-rw-r--r--sources/pyside6/doc/qtattributionsscannertorst.py1
-rw-r--r--sources/pyside6/doc/tools/pyside-qml.rst20
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py1
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/main_snake_prop.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py1
-rw-r--r--sources/pyside6/doc/tutorials/extendedexplorer/editormodels.py1
-rw-r--r--sources/pyside6/doc/tutorials/extendedexplorer/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py1
-rw-r--r--sources/pyside6/doc/tutorials/modelviewprogramming/qlistview-dnd.py1
-rw-r--r--sources/pyside6/doc/tutorials/modelviewprogramming/simplemodel-use.py1
-rw-r--r--sources/pyside6/doc/tutorials/modelviewprogramming/stringlistmodel.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py1
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/main.py1
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py1
-rw-r--r--sources/pyside6/libpyside/globalreceiverv2.cpp3
-rw-r--r--sources/pyside6/libpyside/pyside.cpp51
-rw-r--r--sources/pyside6/libpyside/pysideproperty.cpp1
-rw-r--r--sources/pyside6/libpyside/pysidesignal.cpp25
-rw-r--r--sources/pyside6/libpyside/pysidesignal.h4
-rw-r--r--sources/pyside6/libpyside/signalmanager.cpp29
-rw-r--r--sources/pyside6/libpyside/signalmanager.h2
-rw-r--r--sources/pyside6/plugins/designer/CMakeLists.txt3
-rw-r--r--sources/pyside6/plugins/designer/designercustomwidgets.cpp38
-rw-r--r--sources/pyside6/pyside_version.py1
-rw-r--r--sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_task.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_taskgroup.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_chain.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_executor.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_queues.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_threadsafe.py1
-rw-r--r--sources/pyside6/tests/QtAsyncio/qasyncio_test_time.py1
-rw-r--r--sources/pyside6/tests/QtBluetooth/localdevice.py1
-rw-r--r--sources/pyside6/tests/QtBluetooth/lowenergy_characteristics.py1
-rw-r--r--sources/pyside6/tests/QtCharts/qcharts_numpy_test.py1
-rw-r--r--sources/pyside6/tests/QtCharts/qcharts_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/CMakeLists.txt1
-rw-r--r--sources/pyside6/tests/QtCore/attr_cache_py3k.py1
-rw-r--r--sources/pyside6/tests/QtCore/blocking_signals_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_1019.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_1063.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_1069.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_1313.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_278_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_300_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_324.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_332.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_408.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_428.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_462.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_505.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_515.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_606.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_656.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_686.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_699.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_706.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_820.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_826.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_829.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_835.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_920.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_927.py9
-rw-r--r--sources/pyside6/tests/QtCore/bug_931.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_938.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_953.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_987.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_994.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-164.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-2745.py38
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-41.py1
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-42.py1
-rw-r--r--sources/pyside6/tests/QtCore/child_event_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/classinfo_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/deepcopy_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/deletelater_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/destroysignal_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/duck_punching_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/emoji_string_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/errormessages_with_features_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/feature_with_uic/window.py1
-rw-r--r--sources/pyside6/tests/QtCore/feature_with_uic_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/hash_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/inherits_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/loggingcategorymacros_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/max_signals.py1
-rw-r--r--sources/pyside6/tests/QtCore/missing_symbols_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/mockclass_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/multiple_feature_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/python_conversion.py1
-rw-r--r--sources/pyside6/tests/QtCore/qabs_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qabstractitemmodel_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qanimationgroup_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qbitarray_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_operator_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcalendar_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcbor_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcollator_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcommandlineparser_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qcoreapplication_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qdatastream_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qdate_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qdatetime_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qdir_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qeasingcurve_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qenum_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qevent_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qfile_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qfileinfo_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qfileread_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qflags_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qhandle_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qinstallmsghandler_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qiodevice_buffered_read_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qiopipe_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qjsondocument_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qlinef_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qlocale_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qlockfile_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qmetaobject_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qmetatype_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qmimedatabase_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_children_segfault_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_connect_notify_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_destructor.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_event_filter_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_inherits_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_objectproperty_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_parent_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_property_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_protected_methods_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_timer_event_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qpoint_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qprocess_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qproperty_decorator.py1
-rw-r--r--sources/pyside6/tests/QtCore/qrandomgenerator_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qrect_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qregularexpression_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qresource_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qrunnable_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsettings_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsharedmemory_client.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsharedmemory_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsize_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qslot_object_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsocketnotifier_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsrand_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qstandardpaths_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qstorageinfo_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qstring_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qsysinfo_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qtextstream_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qthread_prod_cons_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qthread_signal_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qthread_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qtimer_singleshot_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qtimer_timeout_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qtimezone_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qtnamespace_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qurl_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qurlquery_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/quuid_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/qversionnumber_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/repr_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/resources_mc.py1
-rw-r--r--sources/pyside6/tests/QtCore/setprop_on_ctor_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/signal_sender.py1
-rw-r--r--sources/pyside6/tests/QtCore/snake_prop_feature_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/staticMetaObject_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/static_method_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/thread_signals_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/tr_noop_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/translation_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/unaryoperator_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/unicode_test.py1
-rw-r--r--sources/pyside6/tests/QtCore/versioninfo_test.py1
-rw-r--r--sources/pyside6/tests/QtDBus/test_dbus.py1
-rw-r--r--sources/pyside6/tests/QtDataVisualization/datavisualization_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_1091.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_367.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_493.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_606.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_617.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_652.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_660.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_716.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_740.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_743.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_785.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_991.py1
-rw-r--r--sources/pyside6/tests/QtGui/bug_PYSIDE-344.py1
-rw-r--r--sources/pyside6/tests/QtGui/deepcopy_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/event_filter_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/pyside_reload_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qbrush_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qcolor_reduce_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qcolor_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qcursor_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qdesktopservices_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qfont_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qfontmetrics_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qguiapplication_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qicon_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qimage_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qimage_win_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qitemselection_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qkeysequence_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpainter_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpdfwriter_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpen_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpixelformat_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpixmap_constructor.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpixmap_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpixmapcache_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qpolygonf_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qradialgradient_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qrasterwindow_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qregion_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qshortcut_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qstandarditemmodel_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qstring_qkeysequence_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qstylehints_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qtextdocument_functions.py1
-rw-r--r--sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qtextline_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/qtransform_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/repr_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/timed_app_and_patching_test.py1
-rw-r--r--sources/pyside6/tests/QtGui/xpm_data.py1
-rw-r--r--sources/pyside6/tests/QtHelp/help_test.py1
-rw-r--r--sources/pyside6/tests/QtHelp/helpsearchengine_test.py1
-rw-r--r--sources/pyside6/tests/QtLocation/location.py1
-rw-r--r--sources/pyside6/tests/QtMultimedia/audio_test.py1
-rw-r--r--sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/accessManager_test.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/bug_1084.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/bug_446.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/dnslookup_test.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/qhostinfo_test.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/qipv6address_test.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/tcpserver_test.py1
-rw-r--r--sources/pyside6/tests/QtNetwork/udpsocket_test.py1
-rw-r--r--sources/pyside6/tests/QtNfc/test_nfc.py1
-rw-r--r--sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py1
-rw-r--r--sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py1
-rw-r--r--sources/pyside6/tests/QtPositioning/positioning.py1
-rw-r--r--sources/pyside6/tests/QtPrintSupport/bug_500.py1
-rw-r--r--sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_1029.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_451.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_456.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_557.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_726.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_814.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_825.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_825_old.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_847.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_915.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_926.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_951.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_995.py1
-rw-r--r--sources/pyside6/tests/QtQml/bug_997.py1
-rw-r--r--sources/pyside6/tests/QtQml/connect_python_qml.py1
-rw-r--r--sources/pyside6/tests/QtQml/groupedproperty.py1
-rw-r--r--sources/pyside6/tests/QtQml/javascript_exceptions.py1
-rw-r--r--sources/pyside6/tests/QtQml/listproperty.py1
-rw-r--r--sources/pyside6/tests/QtQml/qmlregistertype_test.py1
-rw-r--r--sources/pyside6/tests/QtQml/qqmlapplicationengine_test.py1
-rw-r--r--sources/pyside6/tests/QtQml/qqmlcomponent_test.py1
-rw-r--r--sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py1
-rw-r--r--sources/pyside6/tests/QtQml/qqmlnetwork_test.py1
-rw-r--r--sources/pyside6/tests/QtQml/qquickitem_grabToImage.py1
-rw-r--r--sources/pyside6/tests/QtQml/qquickview_test.py1
-rw-r--r--sources/pyside6/tests/QtQml/registerattached.py1
-rw-r--r--sources/pyside6/tests/QtQml/registerextended.py1
-rw-r--r--sources/pyside6/tests/QtQml/registerforeign.py1
-rw-r--r--sources/pyside6/tests/QtQml/registerparserstatus.py1
-rw-r--r--sources/pyside6/tests/QtQml/registerqmlfile.py1
-rw-r--r--sources/pyside6/tests/QtQml/registersingletontype.py1
-rw-r--r--sources/pyside6/tests/QtQml/registertype.py1
-rw-r--r--sources/pyside6/tests/QtQml/registeruncreatabletype.py1
-rw-r--r--sources/pyside6/tests/QtQml/signal_arguments.py1
-rw-r--r--sources/pyside6/tests/QtQml/signal_types.py1
-rw-r--r--sources/pyside6/tests/QtQuickTest/quicktestmainwithsetup/tst_quicktestmainwithsetup.py1
-rw-r--r--sources/pyside6/tests/QtScxml/test_dynamic.py1
-rw-r--r--sources/pyside6/tests/QtSensors/sensors.py1
-rw-r--r--sources/pyside6/tests/QtSerialPort/serial.py1
-rw-r--r--sources/pyside6/tests/QtSql/bug_1013.py1
-rw-r--r--sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py1
-rw-r--r--sources/pyside6/tests/QtSql/qvarianttype_test.py1
-rw-r--r--sources/pyside6/tests/QtStateMachine/bug_1031.py1
-rw-r--r--sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py1
-rw-r--r--sources/pyside6/tests/QtStateMachine/qstate_test.py1
-rw-r--r--sources/pyside6/tests/QtStateMachine/qstatemachine_test.py1
-rw-r--r--sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py1
-rw-r--r--sources/pyside6/tests/QtSvg/qsvggenerator_test.py1
-rw-r--r--sources/pyside6/tests/QtSvg/qsvgrenderer_test.py1
-rw-r--r--sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py1
-rw-r--r--sources/pyside6/tests/QtTest/click_test.py1
-rw-r--r--sources/pyside6/tests/QtTest/eventfilter_test.py1
-rw-r--r--sources/pyside6/tests/QtTest/qsignalspy_test.py1
-rw-r--r--sources/pyside6/tests/QtTest/qvalidator_test.py1
-rw-r--r--sources/pyside6/tests/QtTest/touchevent_test.py1
-rw-r--r--sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_1060.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_360.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_376.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_392.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_426.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_552.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_797.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_909.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_913.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_958.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_965.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/loadUiType_test.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/ui_test.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/uiloader_test.py1
-rw-r--r--sources/pyside6/tests/QtWebEngineCore/qwebenginecookiestore_test.py1
-rw-r--r--sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py1
-rw-r--r--sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/action_clear.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/add_action_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/api2_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/application_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1002.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1006.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1048.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1077.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_172.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_243.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_307.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_338.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_389.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_400.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_429.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_430.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_433.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_467.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_480.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_512.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_525.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_546.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_547.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_549.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_569.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_575.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_576.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_585.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_589.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_635.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_640.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_653.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_662.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_667.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_668.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_674.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_675.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_688.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_693.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_696.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_711.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_722.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_728.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_736.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_750.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_778.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_793.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_811.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_834.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_836.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_844.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_854.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_860.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_862.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_871.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_879.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_919.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_921.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_941.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_964.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_967.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_972.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_979.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_988.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_998.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/customproxywidget_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/grandparent_method_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/hashabletype_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/keep_reference_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/missing_symbols_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/paint_event_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/parent_method_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/private_mangle_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/python_properties_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qaccessible_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qaction_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qapp_issue_585.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qapp_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qapplication_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qcolormap_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qdialog_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qdynamic_signal.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qfontdialog_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qformlayout_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qlabel_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qlayout_ref_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qlayout_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qlcdnumber_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qlistwidget_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qmainwindow_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qmenu_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qmenuadd_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qobject_mi_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qpicture_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qpushbutton_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qsplitter_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qstyle_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qstyleoption_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtableview_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtabwidget_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtextedit_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtoolbar_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtoolbox_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtreeview_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtreewidget_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qvariant_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/qwidget_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/reference_count_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/signature_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/standardpixmap_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/test_module_template.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py1
-rw-r--r--sources/pyside6/tests/QtWidgets/wrong_return_test.py1
-rw-r--r--sources/pyside6/tests/QtXml/qdomdocument_test.py1
-rw-r--r--sources/pyside6/tests/init_paths.py1
-rw-r--r--sources/pyside6/tests/mac/qmacstyle_test.py1
-rw-r--r--sources/pyside6/tests/manually/bug_841.py1
-rw-r--r--sources/pyside6/tests/manually/lazytiming.py1
-rw-r--r--sources/pyside6/tests/pysidetest/all_modules_load_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/bug_1016.py1
-rw-r--r--sources/pyside6/tests/pysidetest/constructor_properties_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/container_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/decoratedslot_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/enum_test.py42
-rw-r--r--sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/iterable_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/list_signal_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/mock_as_slot_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/modelview_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/multiple_inheritance_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/new_inherited_functions_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/notify_id.py1
-rw-r--r--sources/pyside6/tests/pysidetest/properties_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/property_python_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/pyenum_relax_options_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/qvariant_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/repr_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/shared_pointer_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/signal_slot_warning.py1
-rw-r--r--sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/signalandnamespace_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/signalinstance_equality_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/snake_case_sub.py1
-rw-r--r--sources/pyside6/tests/pysidetest/snake_case_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/true_property_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/typedef_signal_test.py1
-rw-r--r--sources/pyside6/tests/pysidetest/version_test.py1
-rw-r--r--sources/pyside6/tests/registry/existence_test.py1
-rw-r--r--sources/pyside6/tests/registry/init_platform.py2
-rw-r--r--sources/pyside6/tests/registry/scrape_testresults.py1
-rw-r--r--sources/pyside6/tests/registry/util.py1
-rw-r--r--sources/pyside6/tests/signals/anonymous_slot_leak_test.py1
-rw-r--r--sources/pyside6/tests/signals/args_dont_match_test.py1
-rw-r--r--sources/pyside6/tests/signals/bug_189.py1
-rw-r--r--sources/pyside6/tests/signals/bug_311.py1
-rw-r--r--sources/pyside6/tests/signals/bug_312.py1
-rw-r--r--sources/pyside6/tests/signals/bug_319.py1
-rw-r--r--sources/pyside6/tests/signals/bug_79.py1
-rw-r--r--sources/pyside6/tests/signals/decorators_test.py1
-rw-r--r--sources/pyside6/tests/signals/disconnect_test.py1
-rw-r--r--sources/pyside6/tests/signals/invalid_callback_test.py1
-rw-r--r--sources/pyside6/tests/signals/lambda_gui_test.py1
-rw-r--r--sources/pyside6/tests/signals/lambda_test.py1
-rw-r--r--sources/pyside6/tests/signals/leaking_signal_test.py1
-rw-r--r--sources/pyside6/tests/signals/multiple_connections_gui_test.py1
-rw-r--r--sources/pyside6/tests/signals/multiple_connections_test.py1
-rw-r--r--sources/pyside6/tests/signals/pysignal_test.py1
-rw-r--r--sources/pyside6/tests/signals/qobject_callable_connect_test.py1
-rw-r--r--sources/pyside6/tests/signals/qobject_destroyed_test.py1
-rw-r--r--sources/pyside6/tests/signals/qobject_receivers_test.py1
-rw-r--r--sources/pyside6/tests/signals/qobject_sender_test.py1
-rw-r--r--sources/pyside6/tests/signals/ref01_test.py1
-rw-r--r--sources/pyside6/tests/signals/ref02_test.py1
-rw-r--r--sources/pyside6/tests/signals/ref03_test.py1
-rw-r--r--sources/pyside6/tests/signals/ref04_test.py1
-rw-r--r--sources/pyside6/tests/signals/ref05_test.py1
-rw-r--r--sources/pyside6/tests/signals/ref06_test.py1
-rw-r--r--sources/pyside6/tests/signals/segfault_proxyparent_test.py1
-rw-r--r--sources/pyside6/tests/signals/self_connect_test.py1
-rw-r--r--sources/pyside6/tests/signals/short_circuit_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal2signal_connect_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_across_threads.py1
-rw-r--r--sources/pyside6/tests/signals/signal_autoconnect_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_connectiontype_support_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_emission_gui_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_emission_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_enum_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_func_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_manager_refcount_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_newenum_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_number_limit_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_object_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_signature_test.py1
-rw-r--r--sources/pyside6/tests/signals/signal_with_primitive_type_test.py1
-rw-r--r--sources/pyside6/tests/signals/slot_reference_count_test.py1
-rw-r--r--sources/pyside6/tests/signals/static_metaobject_test.py1
-rw-r--r--sources/pyside6/tests/support/voidptr_test.py1
-rw-r--r--sources/pyside6/tests/tools/list-class-hierarchy.py1
-rw-r--r--sources/pyside6/tests/tools/metaobjectdump/test_metaobjectdump.py1
-rw-r--r--sources/pyside6/tests/tools/pyside6-android-deploy/extensive_android_deploy_test.py1
-rw-r--r--sources/pyside6/tests/tools/pyside6-android-deploy/test_pyside6_android_deploy.py1
-rw-r--r--sources/pyside6/tests/tools/pyside6-deploy/extensive_deploy_test.py1
-rw-r--r--sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py24
-rw-r--r--sources/pyside6/tests/tools/pyside6-qml/test_pyside6_qml.py1
-rw-r--r--sources/pyside6/tests/util/color.py1
-rw-r--r--sources/pyside6/tests/util/helper/basicpyslotcase.py1
-rw-r--r--sources/pyside6/tests/util/helper/docmodifier.py1
-rw-r--r--sources/pyside6/tests/util/helper/helper.py1
-rw-r--r--sources/pyside6/tests/util/helper/timedqapplication.py1
-rw-r--r--sources/pyside6/tests/util/helper/timedqguiapplication.py1
-rw-r--r--sources/pyside6/tests/util/helper/usesqapplication.py1
-rw-r--r--sources/pyside6/tests/util/httpd.py1
-rw-r--r--sources/pyside6/tests/util/processtimer.py1
-rw-r--r--sources/pyside6/tests/util/test_processtimer.py1
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp129
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.h7
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h28
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang_typedefs.h1
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractor.cpp22
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractor.h3
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractorflags.h8
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractorresult.cpp13
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractorresult.h3
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp7
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangparser.h4
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp34
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/compilersupport.h2
-rw-r--r--sources/shiboken6/ApiExtractor/messages.cpp7
-rw-r--r--sources/shiboken6/ApiExtractor/messages.h3
-rw-r--r--sources/shiboken6/ApiExtractor/typedatabase.cpp3
-rw-r--r--sources/shiboken6/cmake/ShibokenHelpers.cmake17
-rw-r--r--sources/shiboken6/doc/scripts/patch_qhp.py1
-rw-r--r--sources/shiboken6/doc/shibokenmodule.rst5
-rw-r--r--sources/shiboken6/doc/typesystem_specifying_types.rst3
-rw-r--r--sources/shiboken6/generator/generator.cpp5
-rw-r--r--sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp29
-rw-r--r--sources/shiboken6/generator/qtdoc/qtdocgenerator.h1
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp54
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinxinterface.h9
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp126
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.h12
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator_smartpointer.cpp22
-rw-r--r--sources/shiboken6/generator/shiboken/headergenerator.cpp7
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.cpp3
-rw-r--r--sources/shiboken6/libshiboken/basewrapper.cpp78
-rw-r--r--sources/shiboken6/libshiboken/basewrapper.h1
-rw-r--r--sources/shiboken6/libshiboken/bindingmanager.cpp10
-rw-r--r--sources/shiboken6/libshiboken/embed/embedding_generator.py1
-rw-r--r--sources/shiboken6/libshiboken/embed/module_collector.py1
-rw-r--r--sources/shiboken6/libshiboken/embed/signature_bootstrap.py1
-rw-r--r--sources/shiboken6/libshiboken/pep384impl.cpp82
-rw-r--r--sources/shiboken6/libshiboken/pep384impl.h11
-rw-r--r--sources/shiboken6/libshiboken/sbkarrayconverter.h2
-rw-r--r--sources/shiboken6/libshiboken/sbkconverter.cpp149
-rw-r--r--sources/shiboken6/libshiboken/sbkconverter.h42
-rw-r--r--sources/shiboken6/libshiboken/sbkconverter_p.h6
-rw-r--r--sources/shiboken6/libshiboken/sbkcpptonumpy.cpp6
-rw-r--r--sources/shiboken6/libshiboken/sbkenum.cpp9
-rw-r--r--sources/shiboken6/libshiboken/sbkerrors.cpp47
-rw-r--r--sources/shiboken6/libshiboken/sbkerrors.h5
-rw-r--r--sources/shiboken6/libshiboken/sbkfeature_base.cpp21
-rw-r--r--sources/shiboken6/libshiboken/sbkmodule.cpp186
-rw-r--r--sources/shiboken6/libshiboken/sbkmodule.h12
-rw-r--r--sources/shiboken6/libshiboken/sbkstring.cpp6
-rw-r--r--sources/shiboken6/libshiboken/sbkstring.h12
-rw-r--r--sources/shiboken6/libshiboken/shiboken.h1
-rw-r--r--sources/shiboken6/libshiboken/shibokenbuffer.h8
-rw-r--r--sources/shiboken6/libshiboken/signature/signature.cpp13
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_extend.cpp24
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_globals.cpp10
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_helper.cpp23
-rw-r--r--sources/shiboken6/libshiboken/voidptr.cpp3
-rwxr-xr-xsources/shiboken6/shiboken_tool.py1
-rw-r--r--sources/shiboken6/shiboken_version.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/__init__.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/fix-complaints.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/__init__.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/layout.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/__init__.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py1
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py1
-rw-r--r--sources/shiboken6/shibokenmodule/shibokenmodule.cpp4
-rw-r--r--sources/shiboken6/shibokenmodule/typesystem_shiboken.xml5
-rw-r--r--sources/shiboken6/tests/libother/othermultiplederived.h1
-rw-r--r--sources/shiboken6/tests/libsample/derived.h2
-rw-r--r--sources/shiboken6/tests/libsample/point.cpp2
-rw-r--r--sources/shiboken6/tests/libsample/point.h2
-rw-r--r--sources/shiboken6/tests/libsample/pointf.cpp2
-rw-r--r--sources/shiboken6/tests/libsample/pointf.h2
-rw-r--r--sources/shiboken6/tests/libsmart/stdsharedptrtestbench.cpp40
-rw-r--r--sources/shiboken6/tests/libsmart/stdsharedptrtestbench.h9
-rw-r--r--sources/shiboken6/tests/minimalbinding/brace_pattern_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/containeruser_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/listuser_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/minbool_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/obj_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/spanuser_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/typedef_test.py1
-rw-r--r--sources/shiboken6/tests/minimalbinding/val_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/collector_external_operator_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/conversion_operator_for_class_without_implicit_conversions_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/extended_multiply_operator_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/module_reload_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/new_ctor_operator_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/objtypehashes_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/otherderived_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/othertypesystypedef_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/signature_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/smartptr_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/star_import_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/test_module_template.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/typediscovery_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/usersprimitivefromothermodule_test.py1
-rw-r--r--sources/shiboken6/tests/otherbinding/wrongctor_test.py1
-rw-r--r--sources/shiboken6/tests/qtxmltosphinx/main.cpp10
-rw-r--r--sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.cpp6
-rw-r--r--sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.h1
-rw-r--r--sources/shiboken6/tests/samplebinding/__del___test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/abstract_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/addedfunction_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/addedfunction_with_container_args_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/argumentmodifications_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/array_numpy_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/array_sequence_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/bug_554_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/bug_704_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/bytearray_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/child_return_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/class_fields_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/collector_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/complex_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/conversion_operator_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/copy_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ctorconvrule_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/cyclic_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/date_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/decisor_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/delete_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/deprecated_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/derived_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/duck_punching_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/echo_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/enum_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/event_loop_call_virtual_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/event_loop_thread_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/exception_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/filter_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/handleholder_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/hashabletype_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ignorederefop_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/implicitconv_numerical_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/implicitconv_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/inheritanceandscope_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/injectcode_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/innerclass_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/intlist_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/intwrapper_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/invalid_virtual_return_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/keep_reference_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/list_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/lock_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/map_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/metaclass_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/mi_virtual_methods_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/mixed_mi_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/modelindex_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/modelview_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/modifications_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/modified_constructor_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/modifiedvirtualmethods_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/multi_cpp_inheritance_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/multiple_derived_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/namespace_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/newdivision_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/nondefaultctor_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/nontypetemplate_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/nonzero_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/numericaltypedef_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/numpy_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttype_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttype_with_named_args_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttypebyvalue_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttypelayout_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttypeoperators_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttypereferenceasvirtualmethodargument_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/oddbool_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/onlycopyclass_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/overflow_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/overload_sorting_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/overload_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/overloadwithdefault_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_argument_invalidation_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_delete_child_in_cpp_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_delete_child_in_python_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_delete_parent_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_invalidate_after_use_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_invalidate_child_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_invalidate_parent_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_reparenting_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/ownership_transference_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pair_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pen_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/point_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pointerholder_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pointerprimitivetype_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pointf_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/primitivereferenceargument_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/privatector_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/privatedtor_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/protected_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pstrlist_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/pystr_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/python_thread_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/receive_null_cstring_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/reference_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/referencetopointer_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/renaming_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/return_null_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/richcompare_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/sample_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/simplefile_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/size_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/snakecase_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/static_nonstatic_methods_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/stdcomplex_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/str_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/strlist_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/templateinheritingclass_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/time_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/transform_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/typeconverters_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/typedealloc_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/typedtordoublefree_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/typesystypedef_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/unsafe_parent_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/useraddedctor_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/virtualdtor_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/virtualmethods_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/visibilitychange_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/voidholder_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/weakref_test.py1
-rw-r--r--sources/shiboken6/tests/samplebinding/writableclassdict_test.py1
-rw-r--r--sources/shiboken6/tests/shiboken_paths.py1
-rw-r--r--sources/shiboken6/tests/shiboken_test_helper.py1
-rw-r--r--sources/shiboken6/tests/shibokenmodule/module_test.py1
-rw-r--r--sources/shiboken6/tests/smartbinding/CMakeLists.txt2
-rw-r--r--sources/shiboken6/tests/smartbinding/smart_pointer_test.py1
-rw-r--r--sources/shiboken6/tests/smartbinding/std_optional_test.py1
-rw-r--r--sources/shiboken6/tests/smartbinding/std_shared_ptr_test.py21
-rw-r--r--sources/shiboken6/tests/smartbinding/std_unique_ptr_test.py1
-rw-r--r--sources/shiboken6/tests/smartbinding/typesystem_smart.xml2
918 files changed, 2308 insertions, 768 deletions
diff --git a/sources/pyside-tools/android_deploy.py b/sources/pyside-tools/android_deploy.py
index 75269d622..ca6775b7c 100644
--- a/sources/pyside-tools/android_deploy.py
+++ b/sources/pyside-tools/android_deploy.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import argparse
import logging
diff --git a/sources/pyside-tools/deploy.py b/sources/pyside-tools/deploy.py
index aa03d13d0..a9d2b9d67 100644
--- a/sources/pyside-tools/deploy.py
+++ b/sources/pyside-tools/deploy.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
""" pyside6-deploy deployment tool
@@ -49,10 +50,20 @@ TOOL_DESCRIPTION = dedent(f"""
Linux = .bin
""")
+HELP_MODE = dedent("""
+ The mode in which the application is deployed. The options are: onefile,
+ standalone. The default value is onefile.
+
+ This options translates to the mode Nuitka uses to create the executable.
+
+ macOS by default uses the --standalone option.
+ """)
+
def main(main_file: Path = None, name: str = None, config_file: Path = None, init: bool = False,
loglevel=logging.WARNING, dry_run: bool = False, keep_deployment_files: bool = False,
- force: bool = False, extra_ignore_dirs: str = None, extra_modules_grouped: str = None):
+ force: bool = False, extra_ignore_dirs: str = None, extra_modules_grouped: str = None,
+ mode: bool = False):
logging.basicConfig(level=loglevel)
if config_file and not config_file.exists() and not main_file.exists():
@@ -91,7 +102,7 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
config = DesktopConfig(config_file=config_file, source_file=main_file, python_exe=python.exe,
dry_run=dry_run, existing_config_file=config_file_exists,
- extra_ignore_dirs=extra_ignore_dirs)
+ extra_ignore_dirs=extra_ignore_dirs, mode=mode)
# set application name
if name:
@@ -135,7 +146,8 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
excluded_qml_plugins=config.excluded_qml_plugins,
icon=config.icon,
dry_run=dry_run,
- permissions=config.permissions)
+ permissions=config.permissions,
+ mode=config.mode)
except Exception:
print(f"[DEPLOY] Exception occurred: {traceback.format_exc()}")
finally:
@@ -182,7 +194,11 @@ if __name__ == "__main__":
parser.add_argument("--extra-modules", type=str, help=HELP_EXTRA_MODULES)
+ parser.add_argument("--mode", choices=["onefile", "standalone"], default="onefile",
+ help=HELP_MODE)
+
args = parser.parse_args()
main(args.main_file, args.name, args.config_file, args.init, args.loglevel, args.dry_run,
- args.keep_deployment_files, args.force, args.extra_ignore_dirs, args.extra_modules)
+ args.keep_deployment_files, args.force, args.extra_ignore_dirs, args.extra_modules,
+ args.mode)
diff --git a/sources/pyside-tools/deploy_lib/__init__.py b/sources/pyside-tools/deploy_lib/__init__.py
index a40d0838b..b8f9ba659 100644
--- a/sources/pyside-tools/deploy_lib/__init__.py
+++ b/sources/pyside-tools/deploy_lib/__init__.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
from pathlib import Path
from textwrap import dedent
diff --git a/sources/pyside-tools/deploy_lib/android/__init__.py b/sources/pyside-tools/deploy_lib/android/__init__.py
index c3027762c..80ba6dee3 100644
--- a/sources/pyside-tools/deploy_lib/android/__init__.py
+++ b/sources/pyside-tools/deploy_lib/android/__init__.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# maps instruction set to Android platform names
platform_map = {"aarch64": "arm64-v8a",
diff --git a/sources/pyside-tools/deploy_lib/android/android_config.py b/sources/pyside-tools/deploy_lib/android/android_config.py
index ad818c2ff..4cca7dfb6 100644
--- a/sources/pyside-tools/deploy_lib/android/android_config.py
+++ b/sources/pyside-tools/deploy_lib/android/android_config.py
@@ -1,12 +1,13 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import re
+import sys
import tempfile
import logging
import zipfile
import xml.etree.ElementTree as ET
-from typing import List
from pathlib import Path
from pkginfo import Wheel
@@ -15,6 +16,7 @@ from . import (extract_and_copy_jar, get_wheel_android_arch, find_lib_dependenci
from .. import (Config, find_pyside_modules, get_all_pyside_modules, MAJOR_VERSION)
ANDROID_NDK_VERSION = "26b"
+ANDROID_NDK_VERSION_NUMBER_SUFFIX = "10909125"
ANDROID_DEPLOY_CACHE = Path.home() / ".pyside6_android_deploy"
@@ -24,7 +26,7 @@ class AndroidConfig(Config):
"""
def __init__(self, config_file: Path, source_file: Path, python_exe: Path, dry_run: bool,
android_data, existing_config_file: bool = False,
- extra_ignore_dirs: List[str] = None):
+ extra_ignore_dirs: list[str] = None):
super().__init__(config_file=config_file, source_file=source_file, python_exe=python_exe,
dry_run=dry_run, existing_config_file=existing_config_file)
@@ -58,6 +60,11 @@ class AndroidConfig(Config):
else:
ndk_path_temp = (ANDROID_DEPLOY_CACHE / "android-ndk"
/ f"android-ndk-r{ANDROID_NDK_VERSION}")
+ if sys.platform == "darwin":
+ ndk_path_temp = (
+ ANDROID_DEPLOY_CACHE / "android-ndk"
+ / f"AndroidNDK{ANDROID_NDK_VERSION_NUMBER_SUFFIX}.app/Contents/NDK"
+ )
if ndk_path_temp.exists():
self.ndk_path = ndk_path_temp
@@ -328,7 +335,7 @@ class AndroidConfig(Config):
return dependent_modules
- def _find_and_set_dependency_files(self) -> List[zipfile.Path]:
+ def _find_and_set_dependency_files(self) -> list[zipfile.Path]:
"""
Based on `modules`, returns the Qt6{module}_{arch}-android-dependencies.xml file, which
contains the various dependencies of the module, like permissions, plugins etc
@@ -377,7 +384,7 @@ class AndroidConfig(Config):
return list(local_libs), list(plugins)
- def _find_plugin_dependencies(self, dependent_plugins: List[str]):
+ def _find_plugin_dependencies(self, dependent_plugins: list[str]):
# The `bundled` element in the dependency xml files points to the folder where
# additional dependencies for the application exists. Inspecting the depenency files
# in android, this always points to the specific Qt plugin dependency folder.
diff --git a/sources/pyside-tools/deploy_lib/android/android_helper.py b/sources/pyside-tools/deploy_lib/android/android_helper.py
index 7d2f5d575..f9398d7ed 100644
--- a/sources/pyside-tools/deploy_lib/android/android_helper.py
+++ b/sources/pyside-tools/deploy_lib/android/android_helper.py
@@ -1,11 +1,11 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
+from __future__ import annotations
+import sys
import logging
import zipfile
from dataclasses import dataclass
from pathlib import Path
-from typing import List, Set
from zipfile import ZipFile
from jinja2 import Environment, FileSystemLoader
@@ -25,8 +25,8 @@ class AndroidData:
def create_recipe(version: str, component: str, wheel_path: str, generated_files_path: Path,
- qt_modules: List[str] = None, local_libs: List[str] = None,
- plugins: List[str] = None):
+ qt_modules: list[str] = None, local_libs: list[str] = None,
+ plugins: list[str] = None):
'''
Create python_for_android recipe for PySide6 and shiboken6
'''
@@ -91,10 +91,10 @@ def get_llvm_readobj(ndk_path: Path) -> Path:
'''
# TODO: Requires change if Windows platform supports Android Deployment or if we
# support host other than linux-x86_64
- return (ndk_path / "toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readobj")
+ return (ndk_path / f"toolchains/llvm/prebuilt/{sys.platform}-x86_64/bin/llvm-readobj")
-def find_lib_dependencies(llvm_readobj: Path, lib_path: Path, used_dependencies: Set[str] = None,
+def find_lib_dependencies(llvm_readobj: Path, lib_path: Path, used_dependencies: set[str] = None,
dry_run: bool = False):
"""
Find all the Qt dependencies of a library using llvm_readobj
diff --git a/sources/pyside-tools/deploy_lib/android/buildozer.py b/sources/pyside-tools/deploy_lib/android/buildozer.py
index 828982b5b..36d8313e5 100644
--- a/sources/pyside-tools/deploy_lib/android/buildozer.py
+++ b/sources/pyside-tools/deploy_lib/android/buildozer.py
@@ -1,12 +1,12 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
import logging
import xml.etree.ElementTree as ET
import zipfile
from pathlib import Path
-from typing import List
from . import AndroidConfig
from .. import BaseConfig, run_command
@@ -39,6 +39,13 @@ class BuildozerConfig(BaseConfig):
self.set_value("app", "p4a.bootstrap", "qt")
self.set_value('app', "p4a.local_recipes", str(pysidedeploy_config.recipe_dir))
+ # add p4a branch
+ # by default the master branch is used
+ # https://github.com/kivy/python-for-android/commit/b92522fab879dbfc0028966ca3c59ef46ab7767d
+ # has not been merged to master yet. So, we use the develop branch for now
+ # TODO: remove this once the above commit is merged to master
+ self.set_value("app", "p4a.branch", "develop")
+
# add permissions
permissions = self.__find_permissions(pysidedeploy_config.dependency_files)
permissions = ", ".join(permissions)
@@ -69,7 +76,7 @@ class BuildozerConfig(BaseConfig):
self.update_config()
- def __find_permissions(self, dependency_files: List[zipfile.Path]):
+ def __find_permissions(self, dependency_files: list[zipfile.Path]):
permissions = set()
for dependency_file in dependency_files:
xml_content = dependency_file.read_text()
@@ -78,7 +85,7 @@ class BuildozerConfig(BaseConfig):
permissions.add(permission.attrib['name'])
return permissions
- def __find_jars(self, dependency_files: List[zipfile.Path], jars_dir: Path):
+ def __find_jars(self, dependency_files: list[zipfile.Path], jars_dir: Path):
jars, init_classes = set(), set()
for dependency_file in dependency_files:
xml_content = dependency_file.read_text()
diff --git a/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py b/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py
index 8a8615798..375dadf38 100644
--- a/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py
+++ b/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import shutil
import zipfile
diff --git a/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py b/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py
index d6ab037bf..0b822d4d1 100644
--- a/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py
+++ b/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import shutil
import zipfile
diff --git a/sources/pyside-tools/deploy_lib/commands.py b/sources/pyside-tools/deploy_lib/commands.py
index 3a7e2a2e2..ee1abcb15 100644
--- a/sources/pyside-tools/deploy_lib/commands.py
+++ b/sources/pyside-tools/deploy_lib/commands.py
@@ -1,11 +1,11 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
-from typing import List
"""
All utility functions for deployment
@@ -37,7 +37,7 @@ def run_command(command, dry_run: bool, fetch_output: bool = False):
return command_str, output
-def run_qmlimportscanner(qml_files: List[Path], dry_run: bool):
+def run_qmlimportscanner(qml_files: list[Path], dry_run: bool):
"""
Runs pyside6-qmlimportscanner to find all the imported qml modules
"""
diff --git a/sources/pyside-tools/deploy_lib/config.py b/sources/pyside-tools/deploy_lib/config.py
index d59dd92ad..23d037dca 100644
--- a/sources/pyside-tools/deploy_lib/config.py
+++ b/sources/pyside-tools/deploy_lib/config.py
@@ -1,13 +1,14 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
import configparser
import logging
import warnings
from configparser import ConfigParser
-from typing import List
from pathlib import Path
+from enum import Enum
from project import ProjectData
from . import (DEFAULT_APP_ICON, find_pyside_modules, find_permission_categories,
@@ -74,7 +75,7 @@ class Config(BaseConfig):
"""
def __init__(self, config_file: Path, source_file: Path, python_exe: Path, dry_run: bool,
- existing_config_file: bool = False, extra_ignore_dirs: List[str] = None):
+ existing_config_file: bool = False, extra_ignore_dirs: list[str] = None):
super().__init__(config_file=config_file, existing_config_file=existing_config_file)
self.extra_ignore_dirs = extra_ignore_dirs
@@ -141,19 +142,20 @@ class Config(BaseConfig):
def set_or_fetch(self, config_property_val, config_property_key, config_property_group="app"):
"""
- Write to config_file if 'config_property_key' is known without config_file
- Fetch and return from config_file if 'config_property_key' is unknown, but
- config_file exists
+ If the value corresponding to the key exists in the config file, then return it.
+ Otherwise, set the value to the config file and return it.
Otherwise, raise an exception
"""
- if config_property_val:
+ existing_value = self.get_value(config_property_group, config_property_key)
+ if existing_value:
+ return existing_value
+ elif config_property_val:
self.set_value(config_property_group, config_property_key, str(config_property_val))
return config_property_val
- elif self.get_value(config_property_group, config_property_key):
- return self.get_value(config_property_group, config_property_key)
else:
raise RuntimeError(
- f"[DEPLOY] No {config_property_key} specified in config file or as cli option"
+ f"[DEPLOY] No value for {config_property_key} specified in config file or as cli"
+ " option"
)
@property
@@ -375,8 +377,13 @@ class Config(BaseConfig):
class DesktopConfig(Config):
"""Wrapper class around pysidedeploy.spec, but specific to Desktop deployment
"""
+ class NuitkaMode(Enum):
+ ONEFILE = "onefile"
+ STANDALONE = "standalone"
+
def __init__(self, config_file: Path, source_file: Path, python_exe: Path, dry_run: bool,
- existing_config_file: bool = False, extra_ignore_dirs: List[str] = None):
+ existing_config_file: bool = False, extra_ignore_dirs: list[str] = None,
+ mode: str = "onefile"):
super().__init__(config_file, source_file, python_exe, dry_run, existing_config_file,
extra_ignore_dirs)
self.dependency_reader = QtDependencyReader(dry_run=self.dry_run)
@@ -402,6 +409,12 @@ class DesktopConfig(Config):
else:
self._find_and_set_permissions()
+ self._mode = self.NuitkaMode.ONEFILE
+ if self.get_value("nuitka", "mode") == self.NuitkaMode.STANDALONE.value:
+ self._mode = self.NuitkaMode.STANDALONE
+ elif mode == self.NuitkaMode.STANDALONE.value:
+ self.mode = self.NuitkaMode.STANDALONE
+
@property
def qt_plugins(self):
return self._qt_plugins
@@ -420,6 +433,15 @@ class DesktopConfig(Config):
self._permissions = permissions
self.set_value("nuitka", "macos.permissions", ",".join(permissions))
+ @property
+ def mode(self):
+ return self._mode
+
+ @mode.setter
+ def mode(self, mode: NuitkaMode):
+ self._mode = mode
+ self.set_value("nuitka", "mode", mode.value)
+
def _find_dependent_qt_modules(self):
"""
Given pysidedeploy_config.modules, find all the other dependent Qt modules.
diff --git a/sources/pyside-tools/deploy_lib/default.spec b/sources/pyside-tools/deploy_lib/default.spec
index 0a729d585..6f466c24d 100644
--- a/sources/pyside-tools/deploy_lib/default.spec
+++ b/sources/pyside-tools/deploy_lib/default.spec
@@ -25,9 +25,7 @@ icon =
python_path =
# python packages to install
-# ordered-set: increase compile time performance of nuitka packaging
-# zstandard: provides final executable size optimization
-packages = Nuitka==2.1
+packages = Nuitka==2.3.2
# buildozer: for deploying Android application
android_packages = buildozer==1.5.0,cython==0.29.33
@@ -65,6 +63,9 @@ plugins =
# eg: NSCameraUsageDescription:CameraAccess
macos.permissions =
+# mode of using Nuitka. Accepts standalone or onefile. Default is onefile.
+mode = onefile
+
# (str) specify any extra nuitka arguments
# eg: extra_args = --show-modules --follow-stdlib
extra_args = --quiet --noinclude-qt-translations
diff --git a/sources/pyside-tools/deploy_lib/dependency_util.py b/sources/pyside-tools/deploy_lib/dependency_util.py
index 2d5b188d3..30a336f0a 100644
--- a/sources/pyside-tools/deploy_lib/dependency_util.py
+++ b/sources/pyside-tools/deploy_lib/dependency_util.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import ast
import re
@@ -11,14 +12,13 @@ import logging
import shutil
import sys
from pathlib import Path
-from typing import List, Set
from functools import lru_cache
from . import IMPORT_WARNING_PYSIDE, run_command
@lru_cache(maxsize=None)
-def get_py_files(project_dir: Path, extra_ignore_dirs: List[Path] = None, project_data=None):
+def get_py_files(project_dir: Path, extra_ignore_dirs: list[Path] = None, project_data=None):
"""Finds and returns all the Python files in the project
"""
py_candidates = []
@@ -78,7 +78,7 @@ def get_ast(py_file: Path):
return tree
-def find_permission_categories(project_dir: Path, extra_ignore_dirs: List[Path] = None,
+def find_permission_categories(project_dir: Path, extra_ignore_dirs: list[Path] = None,
project_data=None):
"""Given the project directory, finds all the permission categories required by the
project. eg: Camera, Bluetooth, Contacts etc.
@@ -126,7 +126,7 @@ def find_permission_categories(project_dir: Path, extra_ignore_dirs: List[Path]
return all_perm_categories
-def find_pyside_modules(project_dir: Path, extra_ignore_dirs: List[Path] = None,
+def find_pyside_modules(project_dir: Path, extra_ignore_dirs: list[Path] = None,
project_data=None):
"""
Searches all the python files in the project to find all the PySide modules used by
@@ -234,7 +234,7 @@ class QtDependencyReader:
def lib_reader(self):
return self._lib_reader
- def find_dependencies(self, module: str, used_modules: Set[str] = None):
+ def find_dependencies(self, module: str, used_modules: set[str] = None):
"""
Given a Qt module, find all the other Qt modules it is dependent on and add it to the
'used_modules' set
@@ -285,7 +285,7 @@ class QtDependencyReader:
else:
logging.info(f"[DEPLOY] No Qt dependencies found for {module}")
- def find_plugin_dependencies(self, used_modules: List[str], python_exe: Path) -> List[str]:
+ def find_plugin_dependencies(self, used_modules: list[str], python_exe: Path) -> list[str]:
"""
Given the modules used by the application, returns all the required plugins
"""
diff --git a/sources/pyside-tools/deploy_lib/deploy_util.py b/sources/pyside-tools/deploy_lib/deploy_util.py
index e8b05e990..724c10bc0 100644
--- a/sources/pyside-tools/deploy_lib/deploy_util.py
+++ b/sources/pyside-tools/deploy_lib/deploy_util.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import logging
import shutil
@@ -7,7 +8,7 @@ import sys
from pathlib import Path
from . import EXE_FORMAT
-from .config import Config
+from .config import Config, DesktopConfig
def config_option_exists():
@@ -61,17 +62,21 @@ def create_config_file(dry_run: bool = False, config_file: Path = None, main_fil
return config_file
-def finalize(config: Config):
+def finalize(config: DesktopConfig):
"""
Copy the executable into the final location
For Android deployment, this is done through buildozer
"""
- generated_exec_path = config.generated_files_path / (config.source_file.stem + EXE_FORMAT)
+ dist_format = EXE_FORMAT
+ if config.mode == DesktopConfig.NuitkaMode.STANDALONE and sys.platform != "darwin":
+ dist_format = ".dist"
+
+ generated_exec_path = config.generated_files_path / (config.source_file.stem + dist_format)
if generated_exec_path.exists() and config.exe_dir:
- if sys.platform == "darwin":
- shutil.copytree(generated_exec_path, config.exe_dir / (config.title + EXE_FORMAT),
+ if sys.platform == "darwin" or config.mode == DesktopConfig.NuitkaMode.STANDALONE:
+ shutil.copytree(generated_exec_path, config.exe_dir / (config.title + dist_format),
dirs_exist_ok=True)
else:
shutil.copy(generated_exec_path, config.exe_dir)
print("[DEPLOY] Executed file created in "
- f"{str(config.exe_dir / (config.source_file.stem + EXE_FORMAT))}")
+ f"{str(config.exe_dir / (config.source_file.stem + dist_format))}")
diff --git a/sources/pyside-tools/deploy_lib/nuitka_helper.py b/sources/pyside-tools/deploy_lib/nuitka_helper.py
index d202db25e..06dba84f5 100644
--- a/sources/pyside-tools/deploy_lib/nuitka_helper.py
+++ b/sources/pyside-tools/deploy_lib/nuitka_helper.py
@@ -1,13 +1,17 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
+# enables to use typehints for classes that has not been defined yet or imported
+# used for resolving circular imports
+from __future__ import annotations
import logging
import os
import sys
from pathlib import Path
-from typing import List
from . import MAJOR_VERSION, run_command
+from .config import DesktopConfig
class Nuitka:
@@ -35,6 +39,12 @@ class Nuitka:
"generic" # plugins that error with Nuitka
]
+ # .webp are considered to be dlls by Nuitka instead of data files causing
+ # the packaging to fail
+ # https://github.com/Nuitka/Nuitka/issues/2854
+ # TODO: Remove .webp when the issue is fixed
+ self.files_to_ignore = [".cpp.o", ".qsb", ".webp"]
+
@staticmethod
def icon_option():
if sys.platform == "linux":
@@ -44,12 +54,14 @@ class Nuitka:
else:
return "--macos-app-icon"
- def create_executable(self, source_file: Path, extra_args: str, qml_files: List[Path],
- qt_plugins: List[str], excluded_qml_plugins: List[str], icon: str,
- dry_run: bool, permissions: List[str]):
+ def create_executable(self, source_file: Path, extra_args: str, qml_files: list[Path],
+ qt_plugins: list[str], excluded_qml_plugins: list[str], icon: str,
+ dry_run: bool, permissions: list[str],
+ mode: DesktopConfig.NuitkaMode):
qt_plugins = [plugin for plugin in qt_plugins if plugin not in self.qt_plugins_to_ignore]
extra_args = extra_args.split()
+ # macOS uses the --standalone option by default to create an app bundle
if sys.platform == "darwin":
# create an app bundle
extra_args.extend(["--standalone", "--macos-create-app-bundle"])
@@ -57,7 +69,7 @@ class Nuitka:
for permission in permissions:
extra_args.append(permission_pattern.format(permission=permission))
else:
- extra_args.append("--onefile")
+ extra_args.append(f"--{mode.value}")
qml_args = []
if qml_files:
@@ -81,6 +93,14 @@ class Nuitka:
dll_name = plugin.replace("Qt", f"Qt{MAJOR_VERSION}")
qml_args.append(f"--noinclude-dlls={prefix}{dll_name}*")
+ # Exclude .qen json files from QtQuickEffectMaker
+ # These files are not relevant for PySide6 applications
+ qml_args.append("--noinclude-dlls=*/qml/QtQuickEffectMaker/*")
+
+ # Exclude files that cannot be processed by Nuitka
+ for file in self.files_to_ignore:
+ extra_args.append(f"--noinclude-dlls=*{file}")
+
output_dir = source_file.parent / "deployment"
if not dry_run:
output_dir.mkdir(parents=True, exist_ok=True)
diff --git a/sources/pyside-tools/deploy_lib/python_helper.py b/sources/pyside-tools/deploy_lib/python_helper.py
index 7cbf323ed..f234f9378 100644
--- a/sources/pyside-tools/deploy_lib/python_helper.py
+++ b/sources/pyside-tools/deploy_lib/python_helper.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import logging
import os
diff --git a/sources/pyside-tools/metaobjectdump.py b/sources/pyside-tools/metaobjectdump.py
index 0970f9974..bab4e1c46 100644
--- a/sources/pyside-tools/metaobjectdump.py
+++ b/sources/pyside-tools/metaobjectdump.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import ast
import json
@@ -8,7 +9,7 @@ import sys
import tokenize
from argparse import ArgumentParser, RawTextHelpFormatter
from pathlib import Path
-from typing import Dict, List, Optional, Set, Tuple, Union
+from typing import Union
DESCRIPTION = """Parses Python source code to create QObject metatype
@@ -38,32 +39,38 @@ ITEM_MODELS = ["QAbstractListModel", "QAbstractProxyModel",
QOBJECT_DERIVED = ["QObject", "QQuickItem", "QQuickPaintedItem"] + ITEM_MODELS
+# Python 3.9 does not support this syntax, yet
+# AstDecorator = ast.Name | ast.Call
+# AstPySideTypeSpec = ast.Name | ast.Constant
AstDecorator = Union[ast.Name, ast.Call]
AstPySideTypeSpec = Union[ast.Name, ast.Constant]
-ClassList = List[dict]
+ClassList = list[dict]
-PropertyEntry = Dict[str, Union[str, int, bool]]
+# PropertyEntry = dict[str, str | int | bool]
+PropertyEntry = dict[str, Union[str, int, bool]]
-Argument = Dict[str, str]
-Arguments = List[Argument]
-Signal = Dict[str, Union[str, Arguments]]
-Slot = Dict[str, Union[str, Arguments]]
+Argument = dict[str, str]
+Arguments = list[Argument]
+# Signal = dict[str, str | Arguments]
+# Slot = dict[str, str | Arguments]
+Signal = dict[str, Union[str, Arguments]]
+Slot = dict[str, Union[str, Arguments]]
-def _decorator(name: str, value: str) -> Dict[str, str]:
+def _decorator(name: str, value: str) -> dict[str, str]:
"""Create a QML decorator JSON entry"""
return {"name": name, "value": value}
-def _attribute(node: ast.Attribute) -> Tuple[str, str]:
+def _attribute(node: ast.Attribute) -> tuple[str, str]:
"""Split an attribute."""
return node.value.id, node.attr
-def _name(node: Union[ast.Name, ast.Attribute]) -> str:
+def _name(node: ast.Name | ast.Attribute) -> str:
"""Return the name of something that is either an attribute or a name,
such as base classes or call.func"""
if isinstance(node, ast.Attribute):
@@ -82,14 +89,14 @@ def _python_to_cpp_type(type: str) -> str:
return c if c else type
-def _parse_property_kwargs(keywords: List[ast.keyword], prop: PropertyEntry):
+def _parse_property_kwargs(keywords: list[ast.keyword], prop: PropertyEntry):
"""Parse keyword arguments of @Property"""
for k in keywords:
if k.arg == "notify":
prop["notify"] = _name(k.value)
-def _parse_assignment(node: ast.Assign) -> Tuple[Optional[str], Optional[ast.AST]]:
+def _parse_assignment(node: ast.Assign) -> tuple[str | None, ast.AST | None]:
"""Parse an assignment and return a tuple of name, value."""
if len(node.targets) == 1 and isinstance(node.targets[0], ast.Name):
var_name = node.targets[0].id
@@ -144,10 +151,10 @@ class MetaObjectDumpVisitor(ast.NodeVisitor):
self._context = context
self._json_class_list: ClassList = []
# Property by name, which will be turned into the JSON List later
- self._properties: List[PropertyEntry] = []
- self._signals: List[Signal] = []
+ self._properties: list[PropertyEntry] = []
+ self._signals: list[Signal] = []
self._within_class: bool = False
- self._qt_modules: Set[str] = set()
+ self._qt_modules: set[str] = set()
self._qml_import_name = ""
self._qml_import_major_version = 0
self._qml_import_minor_version = 0
@@ -158,7 +165,7 @@ class MetaObjectDumpVisitor(ast.NodeVisitor):
def qml_import_name(self) -> str:
return self._qml_import_name
- def qml_import_version(self) -> Tuple[int, int]:
+ def qml_import_version(self) -> tuple[int, int]:
return (self._qml_import_major_version, self._qml_import_minor_version)
def qt_modules(self):
@@ -215,7 +222,7 @@ class MetaObjectDumpVisitor(ast.NodeVisitor):
if bases:
data["superClasses"] = bases
- class_decorators: List[dict] = []
+ class_decorators: list[dict] = []
for d in node.decorator_list:
self._parse_class_decorator(d, class_decorators)
@@ -247,7 +254,7 @@ class MetaObjectDumpVisitor(ast.NodeVisitor):
self._parse_function_decorator(node.name, d)
def _parse_class_decorator(self, node: AstDecorator,
- class_decorators: List[dict]):
+ class_decorators: list[dict]):
"""Parse ClassInfo decorators."""
if isinstance(node, ast.Call):
name = _func_name(node)
@@ -298,7 +305,7 @@ class MetaObjectDumpVisitor(ast.NodeVisitor):
return -1
def _create_property_entry(self, name: str, type: str,
- getter: Optional[str] = None) -> PropertyEntry:
+ getter: str | None = None) -> PropertyEntry:
"""Create a property JSON entry."""
result: PropertyEntry = {"name": name, "type": type,
"index": len(self._properties)}
@@ -390,7 +397,7 @@ def create_arg_parser(desc: str) -> ArgumentParser:
def parse_file(file: Path, context: VisitorContext,
- suppress_file: bool = False) -> Optional[Dict]:
+ suppress_file: bool = False) -> dict | None:
"""Parse a file and return its json data"""
ast_tree = MetaObjectDumpVisitor.create_ast(file)
visitor = MetaObjectDumpVisitor(context)
diff --git a/sources/pyside-tools/project.py b/sources/pyside-tools/project.py
index 3706a2985..3821c5f2e 100644
--- a/sources/pyside-tools/project.py
+++ b/sources/pyside-tools/project.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
@@ -21,7 +22,6 @@ handled per project file.
"""
import sys
import os
-from typing import List, Tuple, Optional
from pathlib import Path
from argparse import ArgumentParser, RawTextHelpFormatter
@@ -57,7 +57,7 @@ NEW_PROJECT_TYPES = {"new-quick": ProjectType.QUICK,
"new-widget": ProjectType.WIDGET}
-def _sort_sources(files: List[Path]) -> List[Path]:
+def _sort_sources(files: list[Path]) -> list[Path]:
"""Sort the sources for building, ensure .qrc is last since it might depend
on generated files."""
@@ -76,9 +76,9 @@ class Project:
self.cl_options = ClOptions()
# Files for QML modules using the QmlElement decorators
- self._qml_module_sources: List[Path] = []
- self._qml_module_dir: Optional[Path] = None
- self._qml_dir_file: Optional[Path] = None
+ self._qml_module_sources: list[Path] = []
+ self._qml_module_dir: Path | None = None
+ self._qml_dir_file: Path | None = None
self._qml_project_data = QmlProjectData()
self._qml_module_check()
@@ -113,7 +113,7 @@ class Project:
print(f"{self.project.project_file.name}, {count} QML file(s),"
f" {self._qml_project_data}")
- def _get_artifacts(self, file: Path) -> Tuple[List[Path], Optional[List[str]]]:
+ def _get_artifacts(self, file: Path) -> tuple[list[Path], list[str] | None]:
"""Return path and command for a file's artifact"""
if file.suffix == ".ui": # Qt form files
py_file = f"{file.parent}/ui_{file.stem}.py"
diff --git a/sources/pyside-tools/project/__init__.py b/sources/pyside-tools/project/__init__.py
index e57a9ff88..926a1fc9a 100644
--- a/sources/pyside-tools/project/__init__.py
+++ b/sources/pyside-tools/project/__init__.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
from dataclasses import dataclass
diff --git a/sources/pyside-tools/project/newproject.py b/sources/pyside-tools/project/newproject.py
index c363a9fc0..80ed5a75e 100644
--- a/sources/pyside-tools/project/newproject.py
+++ b/sources/pyside-tools/project/newproject.py
@@ -1,17 +1,17 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import json
import os
import sys
from enum import Enum
from pathlib import Path
-from typing import List, Tuple
"""New project generation code."""
-Project = List[Tuple[str, str]] # tuple of (filename, contents).
+Project = list[tuple[str, str]] # tuple of (filename, contents).
class ProjectType(Enum):
diff --git a/sources/pyside-tools/project/project_data.py b/sources/pyside-tools/project/project_data.py
index 52e20be3f..20a8daef1 100644
--- a/sources/pyside-tools/project/project_data.py
+++ b/sources/pyside-tools/project/project_data.py
@@ -1,11 +1,11 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import json
import os
import subprocess
import sys
-from typing import List, Tuple
from pathlib import Path
from . import (METATYPES_JSON_SUFFIX, PROJECT_FILE_SUFFIX, TRANSLATION_SUFFIX,
qt_metatype_json_dir, MOD_CMD, QML_IMPORT_MAJOR_VERSION,
@@ -21,21 +21,21 @@ class ProjectData:
def __init__(self, project_file: Path) -> None:
"""Parse the project."""
self._project_file = project_file
- self._sub_projects_files: List[Path] = []
+ self._sub_projects_files: list[Path] = []
# All sources except subprojects
- self._files: List[Path] = []
+ self._files: list[Path] = []
# QML files
- self._qml_files: List[Path] = []
+ self._qml_files: list[Path] = []
# Python files
self.main_file: Path = None
- self._python_files: List[Path] = []
+ self._python_files: list[Path] = []
# ui files
- self._ui_files: List[Path] = []
+ self._ui_files: list[Path] = []
# qrc files
- self._qrc_files: List[Path] = []
+ self._qrc_files: list[Path] = []
# ts files
- self._ts_files: List[Path] = []
+ self._ts_files: list[Path] = []
with project_file.open("r") as pyf:
pyproject = json.load(pyf)
@@ -128,7 +128,7 @@ class QmlProjectData:
self._import_name: str = ""
self._import_major_version: int = 0
self._import_minor_version: int = 0
- self._qt_modules: List[str] = []
+ self._qt_modules: list[str] = []
def registrar_options(self):
result = [
@@ -141,7 +141,7 @@ class QmlProjectData:
]
if self._qt_modules:
# Add Qt modules as foreign types
- foreign_files: List[str] = []
+ foreign_files: list[str] = []
meta_dir = qt_metatype_json_dir()
for mod in self._qt_modules:
mod_id = mod[2:].lower()
@@ -198,7 +198,7 @@ class QmlProjectData:
return len(self._import_name) > 0 and self._import_major_version > 0
-def _has_qml_decorated_class(class_list: List) -> bool:
+def _has_qml_decorated_class(class_list: list) -> bool:
"""Check for QML-decorated classes in the moc json output."""
for d in class_list:
class_infos = d.get("classInfos")
@@ -209,7 +209,7 @@ def _has_qml_decorated_class(class_list: List) -> bool:
return False
-def check_qml_decorators(py_file: Path) -> Tuple[bool, QmlProjectData]:
+def check_qml_decorators(py_file: Path) -> tuple[bool, QmlProjectData]:
"""Check if a Python file has QML-decorated classes by running a moc check
and return whether a class was found and the QML data."""
data = None
diff --git a/sources/pyside-tools/project/utils.py b/sources/pyside-tools/project/utils.py
index d2bff65af..a2d91375b 100644
--- a/sources/pyside-tools/project/utils.py
+++ b/sources/pyside-tools/project/utils.py
@@ -1,15 +1,15 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
import subprocess
from pathlib import Path
-from typing import List, Dict, Optional
from . import QTPATHS_CMD, PROJECT_FILE_SUFFIX, ClOptions
-def run_command(command: List[str], cwd: str = None, ignore_fail: bool = False):
+def run_command(command: list[str], cwd: str = None, ignore_fail: bool = False):
"""Run a command observing quiet/dry run"""
cloptions = ClOptions()
if not cloptions.quiet or cloptions.dry_run:
@@ -20,7 +20,7 @@ def run_command(command: List[str], cwd: str = None, ignore_fail: bool = False):
sys.exit(ex)
-def requires_rebuild(sources: List[Path], artifact: Path) -> bool:
+def requires_rebuild(sources: list[Path], artifact: Path) -> bool:
"""Returns whether artifact needs to be rebuilt depending on sources"""
if not artifact.is_file():
return True
@@ -58,10 +58,10 @@ def package_dir() -> Path:
return Path(__file__).resolve().parents[2]
-_qtpaths_info: Dict[str, str] = {}
+_qtpaths_info: dict[str, str] = {}
-def qtpaths() -> Dict[str, str]:
+def qtpaths() -> dict[str, str]:
"""Run qtpaths and return a dict of values."""
global _qtpaths_info
if not _qtpaths_info:
@@ -73,7 +73,7 @@ def qtpaths() -> Dict[str, str]:
return _qtpaths_info
-_qt_metatype_json_dir: Optional[Path] = None
+_qt_metatype_json_dir: Path | None = None
def qt_metatype_json_dir() -> Path:
@@ -95,7 +95,7 @@ def qt_metatype_json_dir() -> Path:
return _qt_metatype_json_dir
-def resolve_project_file(cmdline: str) -> Optional[Path]:
+def resolve_project_file(cmdline: str) -> Path | None:
"""Return the project file from the command line value, either
from the file argument or directory"""
project_file = Path(cmdline).resolve() if cmdline else Path.cwd()
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py
index b369be8a2..47283516c 100644
--- a/sources/pyside-tools/pyside_tool.py
+++ b/sources/pyside-tools/pyside_tool.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import importlib
import os
@@ -214,8 +215,9 @@ def deploy():
def android_deploy():
- if not sys.platform == "linux":
- print("pyside6-android-deploy only works from a Linux host")
+ if sys.platform == "win32":
+ print("pyside6-android-deploy only works from a Unix host and not a Windows host",
+ file=sys.stderr)
else:
android_requirements_file = Path(__file__).parent / "requirements-android.txt"
with open(android_requirements_file, 'r', encoding='UTF-8') as file:
diff --git a/sources/pyside-tools/qml.py b/sources/pyside-tools/qml.py
index 5d029f93d..d36e86347 100644
--- a/sources/pyside-tools/qml.py
+++ b/sources/pyside-tools/qml.py
@@ -1,5 +1,6 @@
# Copyright (C) 2018 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""pyside6-qml tool implementation. This tool mimics the capabilities of qml runtime utility
for python and enables quick protyping with python modules"""
@@ -11,7 +12,6 @@ import sys
import os
from pathlib import Path
from pprint import pprint
-from typing import List, Set
from PySide6.QtCore import QCoreApplication, Qt, QLibraryInfo, QUrl, SignalInstance
from PySide6.QtGui import QGuiApplication, QSurfaceFormat
@@ -20,7 +20,7 @@ from PySide6.QtQuick import QQuickView, QQuickItem
from PySide6.QtWidgets import QApplication
-def import_qml_modules(qml_parent_path: Path, module_paths: List[Path] = []):
+def import_qml_modules(qml_parent_path: Path, module_paths: list[Path] = []):
'''
Import all the python modules in the qml_parent_path. This way all the classes
containing the @QmlElement/@QmlNamedElement are also imported
@@ -42,7 +42,7 @@ def import_qml_modules(qml_parent_path: Path, module_paths: List[Path] = []):
elif module_path.exists() and module_path.suffix == ".py":
search_file_paths.append(module_path)
- def import_module(import_module_paths: Set[Path]):
+ def import_module(import_module_paths: set[Path]):
"""Import the modules in 'import_module_paths'"""
for module_path in import_module_paths:
module_name = module_path.name[:-3]
diff --git a/sources/pyside-tools/qtpy2cpp.py b/sources/pyside-tools/qtpy2cpp.py
index 857b12b67..bed933cab 100644
--- a/sources/pyside-tools/qtpy2cpp.py
+++ b/sources/pyside-tools/qtpy2cpp.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import logging
import os
diff --git a/sources/pyside-tools/qtpy2cpp_lib/astdump.py b/sources/pyside-tools/qtpy2cpp_lib/astdump.py
index d92fb7589..469b0368a 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/astdump.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/astdump.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""Tool to dump a Python AST"""
diff --git a/sources/pyside-tools/qtpy2cpp_lib/formatter.py b/sources/pyside-tools/qtpy2cpp_lib/formatter.py
index 9a38e803d..ad4903717 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/formatter.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/formatter.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""C++ formatting helper functions and formatter class"""
diff --git a/sources/pyside-tools/qtpy2cpp_lib/nodedump.py b/sources/pyside-tools/qtpy2cpp_lib/nodedump.py
index de62e9700..c101f1fdf 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/nodedump.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/nodedump.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""Helper to dump AST nodes for debugging"""
diff --git a/sources/pyside-tools/qtpy2cpp_lib/qt.py b/sources/pyside-tools/qtpy2cpp_lib/qt.py
index 69bd54aeb..4827a09ac 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/qt.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/qt.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""Provides some type information on Qt classes"""
diff --git a/sources/pyside-tools/qtpy2cpp_lib/tests/baseline/basic_test.py b/sources/pyside-tools/qtpy2cpp_lib/tests/baseline/basic_test.py
index 1466ac6b1..62805cd15 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/tests/baseline/basic_test.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/tests/baseline/basic_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
diff --git a/sources/pyside-tools/qtpy2cpp_lib/tests/test_qtpy2cpp.py b/sources/pyside-tools/qtpy2cpp_lib/tests/test_qtpy2cpp.py
index 894b2a958..73dbd2e58 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/tests/test_qtpy2cpp.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/tests/test_qtpy2cpp.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import subprocess
import tempfile
diff --git a/sources/pyside-tools/qtpy2cpp_lib/tokenizer.py b/sources/pyside-tools/qtpy2cpp_lib/tokenizer.py
index d5e26c2a8..4f81ba5a2 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/tokenizer.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/tokenizer.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""Tool to dump Python Tokens"""
diff --git a/sources/pyside-tools/qtpy2cpp_lib/visitor.py b/sources/pyside-tools/qtpy2cpp_lib/visitor.py
index 2056951ae..e3f39e997 100644
--- a/sources/pyside-tools/qtpy2cpp_lib/visitor.py
+++ b/sources/pyside-tools/qtpy2cpp_lib/visitor.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""AST visitor printing out C++"""
diff --git a/sources/pyside6/PySide6/QtAsyncio/__init__.py b/sources/pyside6/PySide6/QtAsyncio/__init__.py
index 60d1846d1..08332f621 100644
--- a/sources/pyside6/PySide6/QtAsyncio/__init__.py
+++ b/sources/pyside6/PySide6/QtAsyncio/__init__.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
from .events import (
QAsyncioEventLoopPolicy, QAsyncioEventLoop, QAsyncioHandle, QAsyncioTimerHandle
diff --git a/sources/pyside6/PySide6/QtAsyncio/events.py b/sources/pyside6/PySide6/QtAsyncio/events.py
index b87d7a309..1f838226d 100644
--- a/sources/pyside6/PySide6/QtAsyncio/events.py
+++ b/sources/pyside6/PySide6/QtAsyncio/events.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
from PySide6.QtCore import (QCoreApplication, QDateTime, QDeadlineTimer,
QEventLoop, QObject, QTimer, QThread, Slot)
@@ -50,17 +51,24 @@ class QAsyncioExecutorWrapper(QObject):
def _cb(self):
try:
- # Call the synchronous callable that we submitted with submit() or map().
+ # Call the synchronous callable that we submitted with submit() or
+ # map().
self._result = self._func(*self._args)
except BaseException as e:
self._exception = e
self._loop.exit()
def do(self):
- # This creates a new event loop and dispatcher for the thread, if not already created.
+ # This creates a new event loop and dispatcher for the thread, if not
+ # already created.
self._loop = QEventLoop()
asyncio.events._set_running_loop(self._loop)
- QTimer.singleShot(0, self._loop, lambda: self._cb())
+
+ # The do() function will always be executed from the new executor
+ # thread and never from outside, so using the overload without the
+ # context argument is sufficient.
+ QTimer.singleShot(0, lambda: self._cb())
+
self._loop.exec()
if self._exception is not None:
raise self._exception
@@ -656,19 +664,24 @@ class QAsyncioHandle():
self._state = QAsyncioHandle.HandleState.PENDING
self._start()
+ def _start(self) -> None:
+ self._schedule_event(self._timeout, lambda: self._cb())
+
def _schedule_event(self, timeout: int, func: typing.Callable) -> None:
# Do not schedule events from asyncio when the app is quit from outside
# the event loop, as this would cause events to be enqueued after the
# event loop was destroyed.
if not self._loop.is_closed() and not self._loop._quit_from_outside:
if self._is_threadsafe:
+ # This singleShot overload will push func into self._loop
+ # instead of the current thread's loop. This allows scheduling
+ # a callback from a different thread, which is necessary for
+ # thread-safety.
+ # https://docs.python.org/3/library/asyncio-dev.html#asyncio-multithreading
QTimer.singleShot(timeout, self._loop, func)
else:
QTimer.singleShot(timeout, func)
- def _start(self) -> None:
- self._schedule_event(self._timeout, lambda: self._cb())
-
@Slot()
def _cb(self) -> None:
"""
diff --git a/sources/pyside6/PySide6/QtAsyncio/futures.py b/sources/pyside6/PySide6/QtAsyncio/futures.py
index cbb005fc9..29d86ad3c 100644
--- a/sources/pyside6/PySide6/QtAsyncio/futures.py
+++ b/sources/pyside6/PySide6/QtAsyncio/futures.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
from . import events
diff --git a/sources/pyside6/PySide6/QtAsyncio/tasks.py b/sources/pyside6/PySide6/QtAsyncio/tasks.py
index 7edc15093..9b6b2c22b 100644
--- a/sources/pyside6/PySide6/QtAsyncio/tasks.py
+++ b/sources/pyside6/PySide6/QtAsyncio/tasks.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
from . import events
from . import futures
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
index 9b306c088..110f86f25 100644
--- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
+++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
@@ -1289,6 +1289,7 @@
qRegisterMetaType<QList<QPersistentModelIndex> >("QList_QPersistentModelIndex");
</inject-code>
<modify-function signature="internalPointer()const">
+ <modify-argument index="return" pyi-type="Any"/>
<inject-code class="target" position="beginning">
<insert-template name="return_internal_pointer" />
</inject-code>
@@ -1677,8 +1678,9 @@
<add-function signature="operator==(const QItemSelection&amp;)" return-type="bool"/>
<add-function signature="operator!=(const QItemSelection&amp;)" return-type="bool"/>
<!-- For some reason, the empty selection is not seen. Maybe related to the new [default]
- tag in Qt6? -->
- <declare-function signature="QItemSelection()" return-type="QItemSelection" />
+ tag in Qt6?
+ PYSIDE-2756: The return-type attribute is unnecessary -->
+ <declare-function signature="QItemSelection()"/>
<!-- The __add__ function creates a result list, instead of using the inherited type.
Fixed by adding with the correct type. -->
<add-function signature="operator+(QItemSelection)" return-type="QItemSelection">
@@ -1759,9 +1761,6 @@
</modify-function>
<!-- End of Invalidate-after-use fix -->
<modify-function signature="parent()const">
- <modify-argument index="this">
- <parent index="return" action="add"/>
- </modify-argument>
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
@@ -3108,6 +3107,7 @@
</object-type>
<value-type name="QModelIndex">
<modify-function signature="internalPointer()const">
+ <modify-argument index="return" pyi-type="Any"/>
<inject-code class="target" position="beginning">
<insert-template name="return_internal_pointer" />
</inject-code>
diff --git a/sources/pyside6/PySide6/QtGui/CMakeLists.txt b/sources/pyside6/PySide6/QtGui/CMakeLists.txt
index 7cd7871f3..c868b6c88 100644
--- a/sources/pyside6/PySide6/QtGui/CMakeLists.txt
+++ b/sources/pyside6/PySide6/QtGui/CMakeLists.txt
@@ -88,6 +88,7 @@ ${QtGui_GEN_DIR}/qaccessibleactioninterface_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibleeditabletextinterface_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibleevent_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibleobject_wrapper.cpp
+${QtGui_GEN_DIR}/qaccessibleselectioninterface_wrapper.cpp
${QtGui_GEN_DIR}/qaccessiblestatechangeevent_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibletablecellinterface_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibletablemodelchangeevent_wrapper.cpp
@@ -312,6 +313,15 @@ set(QtGui_private_include_dirs
${Qt${QT_MAJOR_VERSION}Core_PRIVATE_INCLUDE_DIRS}
${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+ if (QT_FEATURE_opengles2)
+ # add openGL ES 2.0
+ find_package(GLESv2 REQUIRED)
+ else()
+ message(FATAL_ERROR "QtGui requires OpenGL ES 2.0 on Android")
+ endif()
+endif()
+
configure_file("${QtGui_SOURCE_DIR}/QtGui_global.post.h.in"
"${QtGui_BINARY_DIR}/QtGui_global.post.h" @ONLY)
diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
index 3eee63ba4..feb2dc11b 100644
--- a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
@@ -122,6 +122,7 @@
<object-type name="QAccessibleEditableTextInterface"/>
<object-type name="QAccessibleInterface"/>
<object-type name="QAccessibleObject" qt-register-metatype="base"/>
+ <object-type name="QAccessibleSelectionInterface" since="6.7"/>
<object-type name="QAccessibleTableCellInterface"/>
<object-type name="QAccessibleTextInterface"/>
<object-type name="QAccessibleValueInterface"/>
diff --git a/sources/pyside6/PySide6/QtNetwork/typesystem_network.xml b/sources/pyside6/PySide6/QtNetwork/typesystem_network.xml
index 508043626..4dc7c9b0a 100644
--- a/sources/pyside6/PySide6/QtNetwork/typesystem_network.xml
+++ b/sources/pyside6/PySide6/QtNetwork/typesystem_network.xml
@@ -179,6 +179,11 @@
<modify-function signature="put(const QNetworkRequest &amp;,QIODevice*)" allow-thread="yes"/>
<modify-function signature="put(const QNetworkRequest &amp;,const QByteArray &amp;)" allow-thread="yes"/>
<modify-function signature="sendCustomRequest(const QNetworkRequest &amp;,const QByteArray &amp;,QIODevice*)" allow-thread="yes" since="4.7"/>
+ <modify-function signature="setCache(QAbstractNetworkCache*)">
+ <modify-argument index="1">
+ <define-ownership class="target" owner="c++"/>
+ </modify-argument>
+ </modify-function>
<modify-function signature="setCookieJar(QNetworkCookieJar*)">
<modify-argument index="1">
<define-ownership class="target" owner="c++"/>
diff --git a/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp b/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp
index 52a45e026..2cab76b47 100644
--- a/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp
+++ b/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp
@@ -5,6 +5,7 @@
#include <pep384ext.h>
#include <signature.h>
+#include <sbktypefactory.h>
#include <QtCore/QDebug>
@@ -49,7 +50,10 @@ static void QtQml_VolatileBoolObject_dealloc(PyObject *self)
static PyObject *
QtQml_VolatileBoolObject_get(QtQml_VolatileBoolObject *self)
{
- return *self->flag ? Py_True : Py_False;
+ if (*self->flag) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
}
static PyObject *
diff --git a/sources/pyside6/PySide6/QtQml/typesystem_qml.xml b/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
index 6a739bbdf..3392ef379 100644
--- a/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
+++ b/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
@@ -124,9 +124,12 @@
<function signature="qmlProtectModule(const char*,int)" doc-file="qqmlengine"/>
<function signature="qmlRegisterModule(const char*,int,int)" doc-file="qqmlengine"/>
<function signature="qmlTypeId(const char*,int,int,const char*)" doc-file="qqmlengine"/>
- <function signature="qmlRegisterType(const QUrl &amp;,const char *,int,int,const char *)"/>
- <function signature="qmlRegisterSingletonType(const QUrl &amp;,const char *,int,int,const char *)"/>
- <function signature="qmlRegisterUncreatableMetaObject(const QMetaObject&amp;,const char*,int,int, const char*,const QString&amp;)"/>
+ <function signature="qmlRegisterType(const QUrl &amp;,const char *,int,int,const char *)"
+ doc-file="qqmlengine"/>
+ <function signature="qmlRegisterSingletonType(const QUrl &amp;,const char *,int,int,const char *)"
+ doc-file="qqmlengine"/>
+ <function signature="qmlRegisterUncreatableMetaObject(const QMetaObject&amp;,const char*,int,int, const char*,const QString&amp;)"
+ doc-file="qqmlengine"/>
<enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES">
<extra-includes>
diff --git a/sources/pyside6/PySide6/QtWebEngineQuick/CMakeLists.txt b/sources/pyside6/PySide6/QtWebEngineQuick/CMakeLists.txt
index 5aedc1147..d87dc55a4 100644
--- a/sources/pyside6/PySide6/QtWebEngineQuick/CMakeLists.txt
+++ b/sources/pyside6/PySide6/QtWebEngineQuick/CMakeLists.txt
@@ -14,17 +14,26 @@ set(QtWebEngineQuick_include_dirs
${QtWebEngineQuick_SOURCE_DIR}
${QtWebEngineQuick_BINARY_DIR}
${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Widgets_INCLUDE_DIRS}
${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}PrintSupport_INCLUDE_DIRS}
${Qt${QT_MAJOR_VERSION}Qml_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}WebChannel_INCLUDE_DIRS}
${libpyside_SOURCE_DIR}
${QtCore_GEN_DIR}
+ ${QtGui_GEN_DIR}
+ ${QtWidgets_GEN_DIR}
${QtNetwork_GEN_DIR}
- ${QtQml_GEN_DIR})
+ ${QtWebEngineCore_GEN_DIR}
+ ${QtPrintSupport_GEN_DIR}
+ ${QtQml_GEN_DIR}
+ ${QtWebChannel_GEN_DIR})
set(QtWebEngineQuick_libraries pyside6
${Qt${QT_MAJOR_VERSION}WebEngineQuick_LIBRARIES})
-set(QtWebEngineQuick_deps QtQml QtNetwork QtCore)
+set(QtWebEngineQuick_deps QtQml QtWebEngineCore)
create_pyside_module(NAME QtWebEngineQuick
INCLUDE_DIRS QtWebEngineQuick_include_dirs
diff --git a/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml b/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml
index 108ba5fae..2e7d22334 100644
--- a/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml
+++ b/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml
@@ -6,6 +6,7 @@
<typesystem package="PySide6.QtWebEngineQuick"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtQml/typesystem_qml.xml" generate="no"/>
+ <load-typesystem name="QtWebEngineCore/typesystem_webenginecore.xml" generate="no"/>
<namespace-type name="QtWebEngineQuick"/> <!-- initialize() -->
diff --git a/sources/pyside6/PySide6/QtWidgets/typesystem_widgets_common.xml b/sources/pyside6/PySide6/QtWidgets/typesystem_widgets_common.xml
index 774f9dd64..b1188a514 100644
--- a/sources/pyside6/PySide6/QtWidgets/typesystem_widgets_common.xml
+++ b/sources/pyside6/PySide6/QtWidgets/typesystem_widgets_common.xml
@@ -2032,9 +2032,6 @@
</modify-function>
<modify-function signature="parentWidget()const">
- <modify-argument index="this">
- <parent index="return" action="add"/>
- </modify-argument>
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp
index a8afc9b6a..0c206db72 100644
--- a/sources/pyside6/PySide6/glue/qtcore.cpp
+++ b/sources/pyside6/PySide6/glue/qtcore.cpp
@@ -84,11 +84,9 @@ static PyObject *convertToPrimitiveType(const QVariant &out, int metaTypeId)
return PyFloat_FromDouble(out.toFloat());
case QMetaType::Bool:
if (out.toBool()) {
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
default:
break;
}
@@ -1024,6 +1022,8 @@ void QSingleShotTimerFunctor::operator()()
Shiboken::GilState state;
Shiboken::AutoDecRef arglist(PyTuple_New(0));
Shiboken::AutoDecRef ret(PyObject_CallObject(object(), arglist));
+ if (Shiboken::Errors::occurred())
+ Shiboken::Errors::storeErrorOrPrint();
release(); // single shot
}
// @snippet qtimer-singleshot-functorclass
diff --git a/sources/pyside6/PySide6/qtdatavisualization_helper.h b/sources/pyside6/PySide6/qtdatavisualization_helper.h
index 6884900ee..8fee4492d 100644
--- a/sources/pyside6/PySide6/qtdatavisualization_helper.h
+++ b/sources/pyside6/PySide6/qtdatavisualization_helper.h
@@ -6,8 +6,8 @@
#include <sbkpython.h>
-#include <QtDataVisualization/QSurfaceDataProxy>
-#include <QtCore/QList>
+#include <QtDataVisualization/qsurfacedataproxy.h>
+#include <QtCore/qlist.h>
namespace QtDataVisualizationHelper {
diff --git a/sources/pyside6/PySide6/qtgraphs_helper.h b/sources/pyside6/PySide6/qtgraphs_helper.h
index 726f5fb37..e488fc7d3 100644
--- a/sources/pyside6/PySide6/qtgraphs_helper.h
+++ b/sources/pyside6/PySide6/qtgraphs_helper.h
@@ -6,8 +6,8 @@
#include <sbkpython.h>
-#include <QtGraphs/QSurfaceDataProxy>
-#include <QtCore/QList>
+#include <QtGraphs/qsurfacedataproxy.h>
+#include <QtCore/qlist.h>
namespace QtGraphsHelper {
diff --git a/sources/pyside6/PySide6/support/__init__.py b/sources/pyside6/PySide6/support/__init__.py
index 5127df0f4..e64ee57c0 100644
--- a/sources/pyside6/PySide6/support/__init__.py
+++ b/sources/pyside6/PySide6/support/__init__.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
from shiboken6.Shiboken import VoidPtr
diff --git a/sources/pyside6/PySide6/support/deprecated.py b/sources/pyside6/PySide6/support/deprecated.py
index 263dd3ed7..bacafce70 100644
--- a/sources/pyside6/PySide6/support/deprecated.py
+++ b/sources/pyside6/PySide6/support/deprecated.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
deprecated.py
diff --git a/sources/pyside6/PySide6/support/generate_pyi.py b/sources/pyside6/PySide6/support/generate_pyi.py
index 92808e2a5..39a916655 100644
--- a/sources/pyside6/PySide6/support/generate_pyi.py
+++ b/sources/pyside6/PySide6/support/generate_pyi.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
generate_pyi.py
diff --git a/sources/pyside6/cmake/Macros/PySideModules.cmake b/sources/pyside6/cmake/Macros/PySideModules.cmake
index 1e434f9f6..fb279c60c 100644
--- a/sources/pyside6/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside6/cmake/Macros/PySideModules.cmake
@@ -194,6 +194,35 @@ macro(create_pyside_module)
--lean-headers
--api-version=${SUPPORTED_QT_VERSION})
+ # check if building for Android with a macOS host
+ # This is not needed for Linux because OpenGLES2 development binaries in
+ # linux can be installed by installing 'libgles2-mesa-dev' package which
+ # comes as a default requirement for building PySide6. As such for
+ # cross-compiling in linux, we use the clang compiler from the installed
+ # libclang itself.
+ if(CMAKE_ANDROID_ARCH_LLVM_TRIPLE AND CMAKE_HOST_APPLE)
+ message(STATUS "Building for Android with arch ${CMAKE_ANDROID_ARCH_LLVM_TRIPLE}")
+ list(APPEND shiboken_command "--clang-option=--target=${CMAKE_ANDROID_ARCH_LLVM_TRIPLE}")
+
+ # CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX does not contain the ANDROID_PLATFORM i.e. it ends with
+ # the form 'aarch64-linux-android-'. Remove the last '-' and add the corresponding clang
+ # based on ANDROID_PLATFORM making it 'aarch64-linux-android26-clang++'
+
+ # Get the length of the string
+ string(LENGTH "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}" _length)
+
+ # Subtract 1 from the length to get the characters till '-'
+ math(EXPR _last_index "${_length} - 1")
+
+ # Get the substring from the start to the character before the last one
+ string(SUBSTRING "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}" 0 "${_last_index}"
+ SHIBOKEN_ANDROID_COMPILER_PREFIX)
+
+ # use the compiler from the Android NDK
+ list(APPEND shiboken_command
+ "--compiler-path=${SHIBOKEN_ANDROID_COMPILER_PREFIX}${CMAKE_ANDROID_API}-clang++")
+ endif()
+
if(CMAKE_HOST_APPLE)
set(shiboken_framework_include_dir_list ${QT_FRAMEWORK_INCLUDE_DIR})
make_path(shiboken_framework_include_dirs ${shiboken_framework_include_dir_list})
@@ -311,6 +340,10 @@ macro(create_pyside_module)
${generate_pyi_options})
add_dependencies("${module_NAME}_pyi" ${module_NAME})
+ if(TARGET shibokenmodule)
+ add_dependencies("${module_NAME}_pyi" shibokenmodule)
+ endif()
+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../${module_NAME}.pyi"
DESTINATION "${PYTHON_SITE_PACKAGES}/PySide6")
endif()
diff --git a/sources/pyside6/cmake/PySideHelpers.cmake b/sources/pyside6/cmake/PySideHelpers.cmake
index 23ceda6bd..01c438107 100644
--- a/sources/pyside6/cmake/PySideHelpers.cmake
+++ b/sources/pyside6/cmake/PySideHelpers.cmake
@@ -138,13 +138,18 @@ macro(check_os)
set(ENABLE_MAC "0")
set(ENABLE_WIN "0")
- if(CMAKE_HOST_APPLE)
- set(ENABLE_MAC "1")
- elseif(CMAKE_HOST_WIN32)
- set(ENABLE_WIN "1")
- set(ENABLE_UNIX "0")
- elseif(NOT CMAKE_HOST_UNIX)
- message(FATAL_ERROR "OS not supported")
+ # check if Android, if so, set ENABLE_UNIX=1
+ # this is needed to avoid including the wrapper specific to macOS when building for Android
+ # from a macOS host
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
+ if(CMAKE_HOST_APPLE)
+ set(ENABLE_MAC "1")
+ elseif(CMAKE_HOST_WIN32)
+ set(ENABLE_WIN "1")
+ set(ENABLE_UNIX "0")
+ elseif(NOT CMAKE_HOST_UNIX)
+ message(FATAL_ERROR "OS not supported")
+ endif()
endif()
endmacro()
diff --git a/sources/pyside6/doc/commercial/index.rst b/sources/pyside6/doc/commercial/index.rst
index e74419d6a..de135730e 100644
--- a/sources/pyside6/doc/commercial/index.rst
+++ b/sources/pyside6/doc/commercial/index.rst
@@ -109,7 +109,7 @@ simplify the installation step::
Complementary to the wheels, you will be able to download the sources
as well.
-.. note:: Wheels installed this way will be detectable by `*Qt Creator*`_, which
+.. note:: Wheels installed this way will be detectable by `Qt Creator`_, which
will offer you to install them for your current Python interpreter.
Using account.qt.io
diff --git a/sources/pyside6/doc/deployment/deployment-nuitka.rst b/sources/pyside6/doc/deployment/deployment-nuitka.rst
index 8b0afa56c..ceac2065a 100644
--- a/sources/pyside6/doc/deployment/deployment-nuitka.rst
+++ b/sources/pyside6/doc/deployment/deployment-nuitka.rst
@@ -117,16 +117,3 @@ for data compression. Then you can run::
This process takes a bit longer, but in the end you have one executable ``hello.bin``::
./hello.bin
-
-
-Some Caveats
-============
-
-
-Nuitka issue on macOS
----------------------
-
-Nuitka currently has a problem with the macOS bundle files on current macOS versions.
-That has the effect that ``--standalone`` and ``--onefile`` create a crashing application.
-Older versions which don't have the recent macOS API changes from 2020 will work.
-We are currently trying to fix that problem.
diff --git a/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst b/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst
index 980fe2dd1..fab9965fe 100644
--- a/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst
+++ b/sources/pyside6/doc/deployment/deployment-pyside6-deploy.rst
@@ -14,6 +14,9 @@ macOS.
not add the virtual environment to the application directory you are trying to deploy.
``pyside6-deploy`` will try to package this venv folder and will eventually fail.
+.. note:: The default version of Nuitka used with the tool is version ``2.3.2``. This can be
+ updated to a newer version by updating your ``pysidedeploy.spec`` file.
+
.. _how_pysidedeploy:
How to use it?
@@ -144,6 +147,12 @@ The relevant parameters for ``pyside6-deploy`` are:
NSCameraUsageDescription:CameraAccess
+ * ``mode``: Accepts one of the options: ``onefile`` or ``standalone``. The default is ``onefile``.
+ This option corresponds to the mode in which Nuitka is run. The onefile mode creates a single
+ executable file, while the standalone mode creates a directory with the executable and all the
+ necessary files. The standalone mode is useful when you want to distribute the application as a
+ directory with dependencies and other files required by the app.
+
* ``extra_args``: Any extra Nuitka arguments specified. It is specified as space-separated
command line arguments i.e. just like how you would specify it when you use Nuitka through
the command line. By default, it contains the following arguments::
@@ -215,3 +224,29 @@ are required to be installed on the system:
* - macOS
- dyld_info
- Available by default from macOS 12 and upwards
+
+Creating a bug report
+=====================
+
+If you are unsure if the bug is from ``pyside6-deploy`` or ``Nuitka``:
+
+#. Create a bug report in Qt for Python. See instructions
+ `here <https://wiki.qt.io/Qt_for_Python/Reporting_Bugs/>`_.
+
+#. Run ``pyside6-deploy`` command with the ``--verbose`` option and replace ``--quiet`` with
+ ``--verbose`` in the ``extra_args`` parameter in the ``pysidedeploy.spec`` file. Attach the
+ output from stdout to the bug report.
+
+#. Attach a minimal example that reproduces the bug with the bug report.
+
+If you think the bug originates from ``Nuitka``:
+
+#. Try using a newer version of ``Nuitka``. You can change this from the ``packages`` parameter in
+ your generated ``pysidedeploy.spec`` file.
+
+#. If the bug persists, create a bug report on the
+ `Nuitka GitHub page <https://github.com/Nuitka/Nuitka/issues>`_.
+
+ * Run ``pyside6-deploy`` with the ``--dry-run`` option to see the actual ``Nuitka`` command
+ generated. Attach the ``Nuitka`` command ran to the bug report.
+ * Follow the Nuitka bug report template to create a bug report.
diff --git a/sources/pyside6/doc/gettingstarted/index.rst b/sources/pyside6/doc/gettingstarted/index.rst
index 9d36061ad..51d8bea26 100644
--- a/sources/pyside6/doc/gettingstarted/index.rst
+++ b/sources/pyside6/doc/gettingstarted/index.rst
@@ -18,10 +18,10 @@ you might get them with ``brew``, and on **Windows** you can download the instal
website.
* **Python**: 3.9+ `[official Python website] <https://www.python.org/downloads/>`_
-* **Qt:** 6.4+ `[online installer] <https://download.qt.io/official_releases/online_installers/>`_
+* **Qt:** 6.8+ `[online installer] <https://download.qt.io/official_releases/online_installers/>`_
* **CMake:** 3.18+ `[official CMake website] <https://cmake.org/download/>`_
* **Git:** 2.0+. `[official Git website] <https://git-scm.com/downloads>`_
-* **libclang:** The libclang library, recommended: version 10 for 6.0+.
+* **libclang:** The libclang library, recommended: version 16+ for 6.8+.
Prebuilt versions for each OS can be `downloaded here`_.
* Check the `Supported Platforms of Qt`_
diff --git a/sources/pyside6/doc/gettingstarted/linux.rst b/sources/pyside6/doc/gettingstarted/linux.rst
index 912105ef8..eb1b5869d 100644
--- a/sources/pyside6/doc/gettingstarted/linux.rst
+++ b/sources/pyside6/doc/gettingstarted/linux.rst
@@ -30,12 +30,12 @@ Setting up CLANG
If you don't have libclang already in your system, you can download from the Qt servers::
- wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_140-based-linux-Rhel8.2-gcc9.2-x86_64.7z
+ wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_18.1.5-based-linux-Rhel8.6-gcc10.3-x86_64.7z
Extract the files, and leave it on any desired path, and set the environment
variable required::
- 7z x libclang-release_140-based-linux-Rhel8.2-gcc9.2-x86_64.7z
+ 7z x libclang-release_18.1.5-based-linux-Rhel8.6-gcc10.3-x86_64.7z
export LLVM_INSTALL_DIR=$PWD/libclang
Getting the source
@@ -45,16 +45,20 @@ Cloning the official repository can be done by::
git clone https://code.qt.io/pyside/pyside-setup
-Checking out the version that we want to build, for example 6.5::
+Checking out the version that we want to build, for example 6.8::
- cd pyside-setup && git checkout 6.5
+ cd pyside-setup && git checkout 6.8
Install the general dependencies::
pip install -r requirements.txt
+For building the documentation::
+
+ pip install -r requirements-doc.txt
+
.. note:: Keep in mind you need to use the same version as your Qt installation.
- Additionally, :command:`git checkout -b 6.5 --track origin/6.5` could be a better option
+ Additionally, :command:`git checkout -b 6.8 --track origin/6.8` could be a better option
in case you want to work on it.
Building and Installing (setuptools)
@@ -64,15 +68,15 @@ The ``setuptools`` approach uses the ``setup.py`` file to execute the build,
install, and packaging steps.
Check your Qt installation path, to specifically use that version of qtpaths to build PySide.
-for example, :command:`/opt/Qt/6.5.0/gcc_64/bin/qtpaths`.
+for example, :command:`/opt/Qt/6.8.0/gcc_64/bin/qtpaths`.
Build can take a few minutes, so it is recommended to use more than one CPU core::
- python setup.py build --qtpaths=/opt/Qt/6.5.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
+ python setup.py build --qtpaths=/opt/Qt/6.8.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
To install on the current directory, just run::
- python setup.py install --qtpaths=/opt/Qt/6.5.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
+ python setup.py install --qtpaths=/opt/Qt/6.8.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
Building and Installing (cmake)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/sources/pyside6/doc/gettingstarted/macOS.rst b/sources/pyside6/doc/gettingstarted/macOS.rst
index ff457a4e2..accffbe92 100644
--- a/sources/pyside6/doc/gettingstarted/macOS.rst
+++ b/sources/pyside6/doc/gettingstarted/macOS.rst
@@ -34,12 +34,12 @@ Setting up CLANG
If you don't have libclang already in your system, you can download from the Qt servers::
- wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_140-based-macos-universal.7z
+ wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_18.1.5-based-macos-universal.7z
Extract the files, and leave it on any desired path, and set the environment
variable required::
- 7z x libclang-release_140-based-macos-universal.7z
+ 7z x libclang-release_18.1.5-based-macos-universal.7z
export LLVM_INSTALL_DIR=$PWD/libclang
Getting PySide
@@ -49,32 +49,36 @@ Cloning the official repository can be done by::
git clone https://code.qt.io/pyside/pyside-setup
-Checking out the version that we want to build, for example, 6.5::
+Checking out the version that we want to build, for example, 6.8::
- cd pyside-setup && git checkout 6.5
+ cd pyside-setup && git checkout 6.8
Install the general dependencies::
pip install -r requirements.txt
+For building the documentation::
+
+ pip install -r requirements-doc.txt
+
.. note:: Keep in mind you need to use the same version as your Qt installation
Building PySide
~~~~~~~~~~~~~~~
Check your Qt installation path, to specifically use that version of qtpaths to build PySide.
-for example, ``/opt/Qt/6.5.0/gcc_64/bin/qtpaths``.
+for example, ``/opt/Qt/6.8.0/gcc_64/bin/qtpaths``.
Build can take a few minutes, so it is recommended to use more than one CPU core::
- python setup.py build --qtpaths=/opt/Qt/6.5.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
+ python setup.py build --qtpaths=/opt/Qt/6.8.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
Installing PySide
~~~~~~~~~~~~~~~~~
To install on the current directory, just run::
- python setup.py install --qtpaths=/opt/Qt/6.5.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
+ python setup.py install --qtpaths=/opt/Qt/6.8.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8
Test installation
~~~~~~~~~~~~~~~~~
diff --git a/sources/pyside6/doc/gettingstarted/windows.rst b/sources/pyside6/doc/gettingstarted/windows.rst
index f688acd90..4451bb1fd 100644
--- a/sources/pyside6/doc/gettingstarted/windows.rst
+++ b/sources/pyside6/doc/gettingstarted/windows.rst
@@ -7,7 +7,7 @@ selected when using the online installer.
Requirements
------------
-* `MSVC2022`_ or (MSVC2019) for Python 3 on Windows,
+* `MSVC2022`_ for Python 3 on Windows,
* `OpenSSL`_ (optional for SSL support, Qt must have been configured using the same SSL library).
* ``sphinx`` package for the documentation (optional).
* Check the platform dependencies of `Qt for Windows`_.
@@ -38,7 +38,7 @@ Setting up CLANG
libclang can be downloaded from the
`Qt servers <https://download.qt.io/development_releases/prebuilt/libclang>`_.
-for example, ``libclang-release_140-based-windows-vs2019_64.7z``.
+for example, ``libclang-release_18.1.5-based-windows-vs2019_64.7z``.
Note that from version 12 onwards, the prebuilt Windows binaries from
`LLVM <https://www.llvm.org>`_ no longer contain CMake configuration files; so
@@ -57,21 +57,25 @@ Cloning the official repository can be done by::
git clone https://code.qt.io/pyside/pyside-setup
-Checking out the version that we want to build, for example, 6.5::
+Checking out the version that we want to build, for example, 6.8::
- cd pyside-setup && git checkout 6.5
+ cd pyside-setup && git checkout 6.8
Install the general dependencies::
pip install -r requirements.txt
+For building the documentation::
+
+ pip install -r requirements-doc.txt
+
.. note:: Keep in mind you need to use the same version as your Qt installation
Building PySide
~~~~~~~~~~~~~~~
Check your Qt installation path, to specifically use that version of qtpaths to build PySide.
-for example, ``C:\Qt\6.5.0\msvc2019_64\bin\qtpaths.exe``.
+for example, ``C:\Qt\6.8.0\msvc2019_64\bin\qtpaths.exe``.
Build can take a few minutes, so it is recommended to use more than one CPU core::
diff --git a/sources/pyside6/doc/inheritance_graph.py b/sources/pyside6/doc/inheritance_graph.py
index 00e0ac486..c45791ba5 100644
--- a/sources/pyside6/doc/inheritance_graph.py
+++ b/sources/pyside6/doc/inheritance_graph.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
diff --git a/sources/pyside6/doc/json_inheritance.py b/sources/pyside6/doc/json_inheritance.py
index 06be33ea4..221114680 100644
--- a/sources/pyside6/doc/json_inheritance.py
+++ b/sources/pyside6/doc/json_inheritance.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import json
import os
diff --git a/sources/pyside6/doc/qtattributionsscannertorst.py b/sources/pyside6/doc/qtattributionsscannertorst.py
index 677371c45..1a46cb032 100644
--- a/sources/pyside6/doc/qtattributionsscannertorst.py
+++ b/sources/pyside6/doc/qtattributionsscannertorst.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
Tool to run qtattributionsscanner and convert its output to rst
diff --git a/sources/pyside6/doc/tools/pyside-qml.rst b/sources/pyside6/doc/tools/pyside-qml.rst
index 0502dd94a..6279aad2b 100644
--- a/sources/pyside6/doc/tools/pyside-qml.rst
+++ b/sources/pyside6/doc/tools/pyside-qml.rst
@@ -3,16 +3,16 @@
pyside6-qml
===========
-``pyside6-qml`` mimics some capabilities of Qt's `qml <qml_runtime>`_ runtime utility by directly
+``pyside6-qml`` mimics some capabilities of Qt's `qml`_ runtime utility by directly
invoking QQmlEngine/QQuickView. It enables prototyping with QML/QtQuick without the need to write
-any Python code that loads the QML files either through `QQmlApplicationEngine <qqmlappengine>`_ or
-the `QQuickView <qquickview>`_ class. The tool also detects the QML classes implemented in Python
+any Python code that loads the QML files either through `QQmlApplicationEngine`_ or
+the `QQuickView`_ class. The tool also detects the QML classes implemented in Python
and registers them with the QML type system.
Usage
-----
-Consider the example `Extending QML - Plugins Example <extending_qml_example>`_. This example does
+Consider the example `Extending QML - Plugins Example`_. This example does
not have a Python file with a ``main`` function that initializes a QmlEngine to load the QML file
``app.qml``. You can run the example by running
@@ -50,8 +50,8 @@ Options
* **--verbose/-v**: Run ``pyside6-qml`` in verbose mode. When run in this mode, pyside6-qml prints
log messages during various stages of processing.
-Options that align with `QML <qml_runtime>`_ runtime utility
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Options that align with the `qml`_ runtime utility
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* **--app-typ/-a**: Specifies which application class to use. It takes one of the three values -
``core, gui, widget``. The default value is *gui*.
@@ -78,7 +78,7 @@ Options that align with `QML <qml_runtime>`_ runtime utility
* **--disable-context-sharing**: Disable the use of a shared GL context for QtQuick Windows".
-.. _`qml_runtime`: https://doc.qt.io/qt-6/qtquick-qml-runtime.html
-.. _`qqmlappengine`: https://doc.qt.io/qt-6/qqmlapplicationengine.html
-.. _`qquickview`: https://doc.qt.io/qt-6/qquickview.html
-.. _`extending_qml_example`: https://doc.qt.io/qtforpython-6/examples/example_qml_tutorials_extending-qml_chapter6-plugins.html
+.. _`qml`: https://doc.qt.io/qt-6/qtquick-qml-runtime.html
+.. _`QQmlApplicationEngine`: https://doc.qt.io/qt-6/qqmlapplicationengine.html
+.. _`QQuickView`: https://doc.qt.io/qt-6/qquickview.html
+.. _`Extending QML - Plugins Example`: https://doc.qt.io/qtforpython-6/examples/example_qml_tutorials_extending-qml_chapter6-plugins.html
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
index 106483b7b..a17824b06 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
@@ -1,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/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py
index 995b9906a..626f3ae3a 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize1/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 argparse
import pandas as pd
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py
index 9ea96097c..03304e1db 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize2/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 argparse
import pandas as pd
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
index bbf85e17d..dd240516a 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/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
import argparse
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py
index 745f2fefe..8ce8f9ace 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_window.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main_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, QKeySequence
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
index 87b962bd3..ee8350362 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/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
import argparse
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py
index 2a2bfeb09..b299e785c 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_widget.py
@@ -1,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 (QHBoxLayout, QHeaderView, QSizePolicy,
QTableView, QWidget)
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py
index ebe2997a1..69753656d 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_window.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main_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, QKeySequence
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py
index 08eeeeed6..730697c29 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_model.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/table_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 Qt, QAbstractTableModel, QModelIndex
from PySide6.QtGui import QColor
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
index 87b962bd3..ee8350362 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/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
import argparse
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py
index 15b7e97e5..40954ea34 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_widget.py
@@ -1,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 QDateTime, Qt
from PySide6.QtGui import QPainter
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py
index ed12c1f8f..e686ce093 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_window.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main_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, QKeySequence
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py
index 08eeeeed6..730697c29 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_model.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/table_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 Qt, QAbstractTableModel, QModelIndex
from PySide6.QtGui import QColor
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
index 2d851cc14..ffc81d89c 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/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
import argparse
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py
index cbcc126a1..501d7b268 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_widget.py
@@ -1,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 QDateTime, Qt
from PySide6.QtGui import QPainter
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py
index 116e53dc3..21842cff1 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_window.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main_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, QKeySequence, QScreen
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py
index 4952c0c38..3201e5887 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_model.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/table_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 Qt, QAbstractTableModel, QModelIndex
from PySide6.QtGui import QColor
diff --git a/sources/pyside6/doc/tutorials/expenses/main.py b/sources/pyside6/doc/tutorials/expenses/main.py
index a3a998470..eefe5192a 100644
--- a/sources/pyside6/doc/tutorials/expenses/main.py
+++ b/sources/pyside6/doc/tutorials/expenses/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.QtCore import Qt, Slot
diff --git a/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py b/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
index 055544409..0817fae25 100644
--- a/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
+++ b/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
@@ -1,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 QMargins, Qt, Slot, QSize
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
index 27f2aef65..917d069bd 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
@@ -1,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, QMainWindow
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
index 039b818df..e82b5e76b 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
@@ -1,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, QMainWindow
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
index 039b818df..e82b5e76b 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
@@ -1,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, QMainWindow
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
index 6723690a8..6bf5ad8cc 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
@@ -1,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, QMainWindow, QWidget
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
index df0362fde..dc111d75d 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
@@ -1,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, QHeaderView, QHBoxLayout,
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
index d19a6220f..f905e980e 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
@@ -1,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, QFormLayout, QHeaderView,
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
index b1ed3fecc..56634ae0a 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
@@ -1,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 Slot
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
index 0e7e21a32..45b37a671 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
@@ -1,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 Slot
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
index 279a46512..99362817d 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
@@ -1,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 Slot
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
index a3a998470..eefe5192a 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
@@ -1,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 Qt, Slot
diff --git a/sources/pyside6/doc/tutorials/extendedexplorer/editormodels.py b/sources/pyside6/doc/tutorials/extendedexplorer/editormodels.py
index 688147726..f317fb48a 100644
--- a/sources/pyside6/doc/tutorials/extendedexplorer/editormodels.py
+++ b/sources/pyside6/doc/tutorials/extendedexplorer/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/sources/pyside6/doc/tutorials/extendedexplorer/main.py b/sources/pyside6/doc/tutorials/extendedexplorer/main.py
index f1e6e7d93..4afb08b6d 100644
--- a/sources/pyside6/doc/tutorials/extendedexplorer/main.py
+++ b/sources/pyside6/doc/tutorials/extendedexplorer/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/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py b/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py
index 8d732093c..f4228a8b4 100644
--- a/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.py
+++ b/sources/pyside6/doc/tutorials/extendedexplorer/scheme_manager.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
from pathlib import Path
diff --git a/sources/pyside6/doc/tutorials/modelviewprogramming/qlistview-dnd.py b/sources/pyside6/doc/tutorials/modelviewprogramming/qlistview-dnd.py
index 3a37cc0f3..15e9c81dc 100644
--- a/sources/pyside6/doc/tutorials/modelviewprogramming/qlistview-dnd.py
+++ b/sources/pyside6/doc/tutorials/modelviewprogramming/qlistview-dnd.py
@@ -1,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/sources/pyside6/doc/tutorials/modelviewprogramming/simplemodel-use.py b/sources/pyside6/doc/tutorials/modelviewprogramming/simplemodel-use.py
index 1bacfd829..41b168cef 100644
--- a/sources/pyside6/doc/tutorials/modelviewprogramming/simplemodel-use.py
+++ b/sources/pyside6/doc/tutorials/modelviewprogramming/simplemodel-use.py
@@ -1,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/sources/pyside6/doc/tutorials/modelviewprogramming/stringlistmodel.py b/sources/pyside6/doc/tutorials/modelviewprogramming/stringlistmodel.py
index 2c8493aa9..6818c1aa3 100644
--- a/sources/pyside6/doc/tutorials/modelviewprogramming/stringlistmodel.py
+++ b/sources/pyside6/doc/tutorials/modelviewprogramming/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
import sys
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py b/sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py
index da7d201a8..46b5c312a 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter1/createdb.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/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, QSqlError, QSqlQuery
from datetime import date
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
index c1293bcbd..3e8562872 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/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/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py
index 2c2b80157..5e926baca 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter2/bookdelegate.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/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
import os
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py
index da7d201a8..46b5c312a 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter2/createdb.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/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, QSqlError, QSqlQuery
from datetime import date
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
index 3cc55fa46..735d8e021 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/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/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py
index b3187e054..cfe52bba8 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate-old.py
@@ -1,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
import os
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py
index 145d6b73e..6aba9dd93 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookdelegate.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/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, os
from PySide6.QtSql import QSqlRelationalDelegate
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py
index bb033c6d2..e115c321d 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/bookwindow.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/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.QtGui import QAction
from PySide6.QtWidgets import (QAbstractItemView, QDataWidgetMapper,
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py
index da7d201a8..46b5c312a 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/createdb.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/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, QSqlError, QSqlQuery
from datetime import date
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
index 164fc589a..7d1aea78c 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
@@ -1,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/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
index 9a6575dc2..9af868772 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/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/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py b/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
index d67906fa7..3b234bdf8 100644
--- a/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
+++ b/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
@@ -1,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
import random
diff --git a/sources/pyside6/doc/tutorials/qmlapp/main.py b/sources/pyside6/doc/tutorials/qmlapp/main.py
index 8b1b25440..c532e8d26 100644
--- a/sources/pyside6/doc/tutorials/qmlapp/main.py
+++ b/sources/pyside6/doc/tutorials/qmlapp/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
import urllib.request
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/main.py b/sources/pyside6/doc/tutorials/qmlintegration/main.py
index 0a751d7d1..6e7897acd 100644
--- a/sources/pyside6/doc/tutorials/qmlintegration/main.py
+++ b/sources/pyside6/doc/tutorials/qmlintegration/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/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
index 314fd5aa5..f038505e5 100644
--- a/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
import logging
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py b/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py
index d728aee59..be839bcba 100644
--- a/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/sqlDialog.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import datetime
import logging
diff --git a/sources/pyside6/libpyside/globalreceiverv2.cpp b/sources/pyside6/libpyside/globalreceiverv2.cpp
index 51070b4ad..2c75e39e1 100644
--- a/sources/pyside6/libpyside/globalreceiverv2.cpp
+++ b/sources/pyside6/libpyside/globalreceiverv2.cpp
@@ -274,9 +274,8 @@ int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void **args)
if (setSenderDynamicProperty)
m_receiver->setProperty(senderDynamicProperty, QVariant::fromValue(sender()));
- const bool isShortCuit = std::strchr(slot.methodSignature(), '(') == nullptr;
Shiboken::AutoDecRef callback(m_data->callback());
- SignalManager::callPythonMetaMethod(slot, args, callback, isShortCuit);
+ SignalManager::callPythonMetaMethod(slot, args, callback);
if (setSenderDynamicProperty)
m_receiver->setProperty(senderDynamicProperty, QVariant{});
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp
index cff74c260..9e12e3cd7 100644
--- a/sources/pyside6/libpyside/pyside.cpp
+++ b/sources/pyside6/libpyside/pyside.cpp
@@ -43,6 +43,7 @@
#include <QtCore/QMutex>
#include <QtCore/QStack>
#include <QtCore/QThread>
+#include <QtCore/private/qobject_p.h>
#include <algorithm>
#include <cstring>
@@ -63,6 +64,20 @@ QT_END_NAMESPACE
Q_LOGGING_CATEGORY(lcPySide, "qt.pyside.libpyside", QtCriticalMsg)
+static QObjectData *qt_object_private(const QObject *o)
+{
+ class FriendlyQObject : public QObject {
+ public:
+ using QObject::d_ptr;
+ };
+ return static_cast<const FriendlyQObject *>(o)->d_ptr.data();
+}
+
+static bool hasDynamicMetaObject(const QObject *o)
+{
+ return qt_object_private(o)->metaObject != nullptr;
+}
+
namespace PySide
{
@@ -675,6 +690,32 @@ static void invalidatePtr(any_t *object)
static const char invalidatePropertyName[] = "_PySideInvalidatePtr";
+// PYSIDE-2749: Skip over internal QML classes and classes
+// with dynamic meta objects when looking for the best matching
+// type to avoid unnessarily triggering the lazy load mechanism
+// for classes that do not have a binding from things like eventFilter().
+static inline bool isInternalObject(const char *name)
+{
+ return std::strstr(name, "QMLTYPE") != nullptr || std::strstr(name, "QQmlPrivate") != nullptr;
+}
+
+static const QMetaObject *metaObjectCandidate(const QObject *o)
+{
+ auto *metaObject = o->metaObject();
+ // Skip QML helper types and Python objects
+ if (hasDynamicMetaObject(o)) {
+ if (auto *super = metaObject->superClass())
+ metaObject = super;
+ }
+ for (auto *candidate = metaObject; candidate != nullptr; candidate = candidate->superClass()) {
+ if (!isInternalObject(candidate->className())) {
+ metaObject = candidate;
+ break;
+ }
+ }
+ return metaObject;
+}
+
// PYSIDE-1214, when creating new wrappers for classes inheriting QObject but
// not exposed to Python, try to find the best-matching (most-derived) Qt
// class by walking up the meta objects.
@@ -682,19 +723,13 @@ static const char *typeName(const QObject *cppSelf)
{
const char *typeName = typeid(*cppSelf).name();
if (!Shiboken::Conversions::getConverter(typeName)) {
- for (auto metaObject = cppSelf->metaObject(); metaObject; metaObject = metaObject->superClass()) {
+ auto *metaObject = metaObjectCandidate(cppSelf);
+ for (; metaObject != nullptr; metaObject = metaObject->superClass()) {
const char *name = metaObject->className();
if (Shiboken::Conversions::getConverter(name)) {
typeName = name;
break;
}
- // PYSIDE-2404: Did not find the name. Load the lazy classes
- // which have this name and try again.
- Shiboken::Module::loadLazyClassesWithName(name);
- if (Shiboken::Conversions::getConverter(name)) {
- typeName = name;
- break;
- }
}
}
return typeName;
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp
index 457415479..3720815db 100644
--- a/sources/pyside6/libpyside/pysideproperty.cpp
+++ b/sources/pyside6/libpyside/pysideproperty.cpp
@@ -475,6 +475,7 @@ static const char *Property_SignatureStrings[] = {
"PySide6.QtCore.Property.read(self,fget:typing.Callable)->PySide6.QtCore.Property",
"PySide6.QtCore.Property.setter(self,fset:typing.Callable)->PySide6.QtCore.Property",
"PySide6.QtCore.Property.write(self,fset:typing.Callable)->PySide6.QtCore.Property",
+ "PySide6.QtCore.Property.__call__(self, func:typing.Callable)->PySide6.QtCore.Property",
nullptr}; // Sentinel
void init(PyObject *module)
diff --git a/sources/pyside6/libpyside/pysidesignal.cpp b/sources/pyside6/libpyside/pysidesignal.cpp
index d9dd14ad5..ed0cc5d0a 100644
--- a/sources/pyside6/libpyside/pysidesignal.cpp
+++ b/sources/pyside6/libpyside/pysidesignal.cpp
@@ -653,8 +653,11 @@ static PyObject *signalInstanceGetItem(PyObject *self, PyObject *key)
static inline void warnDisconnectFailed(PyObject *aSlot, const QByteArray &signature)
{
if (PyErr_Occurred() != nullptr) { // avoid "%S" invoking str() when an error is set.
+ PyObject *exc{}, *inst{}, *tb{};
+ PyErr_Fetch(&exc, &inst, &tb);
PyErr_WarnFormat(PyExc_RuntimeWarning, 0, "Failed to disconnect (%s) from signal \"%s\".",
Py_TYPE(aSlot)->tp_name, signature.constData());
+ PyErr_Restore(exc, inst, tb);
} else {
PyErr_WarnFormat(PyExc_RuntimeWarning, 0, "Failed to disconnect (%S) from signal \"%s\".",
aSlot, signature.constData());
@@ -713,8 +716,7 @@ static PyObject *signalInstanceDisconnect(PyObject *self, PyObject *args)
}
warnDisconnectFailed(slot, source->d->signature);
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
// PYSIDE-68: Supply the missing __get__ function
@@ -1188,13 +1190,11 @@ EmitterData getEmitterData(PySideSignalInstance *signal)
return result;
}
-QByteArrayList getArgsFromSignature(const char *signature, bool *isShortCircuit)
+QByteArrayList getArgsFromSignature(const char *signature)
{
QByteArray qsignature = QByteArray(signature).trimmed();
QByteArrayList result;
- if (isShortCircuit)
- *isShortCircuit = !qsignature.contains(u'(');
if (qsignature.contains("()") || qsignature.contains("(void)"))
return result;
if (qsignature.endsWith(')')) {
@@ -1278,24 +1278,21 @@ QByteArray getCallbackSignature(const char *signal, QObject *receiver,
functionName = Shiboken::String::toCString(slotArgs.functionName);
Q_ASSERT(!functionName.isEmpty());
- bool isShortCircuit = false;
-
if (functionName.startsWith('<') && functionName.endsWith('>')) { // fix "<lambda>"
functionName[0] = '_';
functionName[functionName.size() - 1] = '_';
}
QByteArray signature = encodeName ? codeCallbackName(callback, functionName) : functionName;
- QByteArrayList args = getArgsFromSignature(signal, &isShortCircuit);
+ QByteArrayList args = getArgsFromSignature(signal);
- if (!isShortCircuit) {
- signature.append(u'(');
- if (numArgs == -1)
- numArgs = std::numeric_limits<qsizetype>::max();
+ signature.append(u'(');
+ if (numArgs != -1) {
while (!args.isEmpty() && (args.size() > (numArgs - useSelf)))
args.removeLast();
- signature.append(args.join(','));
- signature.append(')');
}
+ signature.append(args.join(','));
+ signature.append(')');
+
return signature;
}
diff --git a/sources/pyside6/libpyside/pysidesignal.h b/sources/pyside6/libpyside/pysidesignal.h
index 589fc2c92..7493f94b5 100644
--- a/sources/pyside6/libpyside/pysidesignal.h
+++ b/sources/pyside6/libpyside/pysidesignal.h
@@ -142,12 +142,10 @@ PYSIDE_API QByteArray getCallbackSignature(const char *signal, QObject *receiver
* This function parses the signature and then returns a list of argument types.
*
* @param signature The signal signature
- * @param isShortCircuit If this is a shortCircuit(python<->python) signal
* @return Return true if this is a Qt Signal, otherwise return false
* @todo replace return type by QList<QByteArray>
**/
-QByteArrayList getArgsFromSignature(const char *signature,
- bool *isShortCircuit = nullptr);
+QByteArrayList getArgsFromSignature(const char *signature);
} // namespace PySide::Signal
diff --git a/sources/pyside6/libpyside/signalmanager.cpp b/sources/pyside6/libpyside/signalmanager.cpp
index 557f130e0..f4c2bbf43 100644
--- a/sources/pyside6/libpyside/signalmanager.cpp
+++ b/sources/pyside6/libpyside/signalmanager.cpp
@@ -43,7 +43,6 @@ using namespace Qt::StringLiterals;
static PyObject *metaObjectAttr = nullptr;
static PyObject *parseArguments(const QMetaMethod &method, void **args);
-static bool emitShortCircuitSignal(QObject *source, int signalIndex, PyObject *args);
static bool qAppRunning = false;
@@ -474,16 +473,7 @@ bool SignalManager::emitSignal(QObject *source, const char *signal, PyObject *ar
signal++;
int signalIndex = source->metaObject()->indexOfSignal(signal);
- if (signalIndex != -1) {
- // cryptic but works!
- // if the signature doesn't have a '(' it's a shor circuited signal, i.e. std::find
- // returned the string null terminator.
- bool isShortCircuit = !*std::find(signal, signal + std::strlen(signal), '(');
- return isShortCircuit
- ? emitShortCircuitSignal(source, signalIndex, args)
- : MetaFunction::call(source, signalIndex, args);
- }
- return false;
+ return signalIndex != -1 && MetaFunction::call(source, signalIndex, args);
}
// Handle errors from meta calls. Requires GIL and PyErr_Occurred()
@@ -589,7 +579,7 @@ int SignalManager::SignalManagerPrivate::qtMethodMetacall(QObject *object,
PyErr_Format(PyExc_AttributeError, "Slot '%s::%s' not found.",
metaObject->className(), method.methodSignature().constData());
} else {
- SignalManager::callPythonMetaMethod(method, args, pyMethod, false);
+ SignalManager::callPythonMetaMethod(method, args, pyMethod);
}
}
// WARNING Isn't safe to call any metaObject and/or object methods beyond this point
@@ -635,13 +625,12 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id,
return id;
}
-int SignalManager::callPythonMetaMethod(const QMetaMethod &method, void **args, PyObject *pyMethod, bool isShortCuit)
+int SignalManager::callPythonMetaMethod(const QMetaMethod &method, void **args, PyObject *pyMethod)
{
Q_ASSERT(pyMethod);
Shiboken::GilState gil;
- PyObject *pyArguments = isShortCuit
- ? reinterpret_cast<PyObject *>(args[1]) : parseArguments(method, args);
+ PyObject *pyArguments = parseArguments(method, args);
if (pyArguments) {
QScopedPointer<Shiboken::Conversions::SpecificConverter> retConverter;
@@ -656,8 +645,7 @@ int SignalManager::callPythonMetaMethod(const QMetaMethod &method, void **args,
Shiboken::AutoDecRef retval(PyObject_CallObject(pyMethod, pyArguments));
- if (!isShortCuit && pyArguments)
- Py_DECREF(pyArguments);
+ Py_DECREF(pyArguments);
if (!retval.isNull() && retval != Py_None && !PyErr_Occurred() && retConverter)
retConverter->toCpp(retval, args[0]);
@@ -824,11 +812,4 @@ static PyObject *parseArguments(const QMetaMethod &method, void **args)
return preparedArgs;
}
-static bool emitShortCircuitSignal(QObject *source, int signalIndex, PyObject *args)
-{
- void *signalArgs[2] = {nullptr, args};
- source->qt_metacall(QMetaObject::InvokeMetaMethod, signalIndex, signalArgs);
- return true;
-}
-
#include "signalmanager.moc"
diff --git a/sources/pyside6/libpyside/signalmanager.h b/sources/pyside6/libpyside/signalmanager.h
index c531d6630..397700df1 100644
--- a/sources/pyside6/libpyside/signalmanager.h
+++ b/sources/pyside6/libpyside/signalmanager.h
@@ -81,7 +81,7 @@ public:
void purgeEmptyGlobalReceivers();
// Utility function to call a python method usign args received in qt_metacall
- static int callPythonMetaMethod(const QMetaMethod& method, void** args, PyObject* obj, bool isShortCuit);
+ static int callPythonMetaMethod(const QMetaMethod& method, void** args, PyObject* obj);
static void deleteGlobalReceiver(const QObject *globalReceiver);
diff --git a/sources/pyside6/plugins/designer/CMakeLists.txt b/sources/pyside6/plugins/designer/CMakeLists.txt
index c86d328cf..717652314 100644
--- a/sources/pyside6/plugins/designer/CMakeLists.txt
+++ b/sources/pyside6/plugins/designer/CMakeLists.txt
@@ -19,6 +19,9 @@ target_sources(PySidePlugin PRIVATE
)
# See libshiboken/CMakeLists.txt
+
+target_compile_definitions(PySidePlugin PRIVATE -DQT_NO_KEYWORDS=1)
+
if(PYTHON_LIMITED_API)
target_compile_definitions(PySidePlugin PRIVATE "-DPy_LIMITED_API=0x03050000")
endif()
diff --git a/sources/pyside6/plugins/designer/designercustomwidgets.cpp b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
index d23156a9d..dc8bdf435 100644
--- a/sources/pyside6/plugins/designer/designercustomwidgets.cpp
+++ b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
@@ -17,6 +17,7 @@
#include <QtCore/QVariant>
#include <string_view>
+#include <utility>
using namespace Qt::StringLiterals;
@@ -123,26 +124,29 @@ static bool runPyScriptFile(const QString &fileName, QString *errorMessage)
return ok;
}
+static std::pair<int, int> pythonVersion()
+{
+ // read environment set by pyside_tool.py
+ bool majorOk{};
+ bool minorOk{};
+ const int majorVersion = qEnvironmentVariableIntValue("PY_MAJOR_VERSION", &majorOk);
+ const int minorVersion = qEnvironmentVariableIntValue("PY_MINOR_VERSION", &minorOk);
+ if (majorOk && minorVersion)
+ return {majorVersion, minorVersion};
+ return {PY_MAJOR_VERSION, PY_MINOR_VERSION};
+}
+
static void initVirtualEnvironment()
{
static const char virtualEnvVar[] = "VIRTUAL_ENV";
- // As of Python 3.8/Windows, Python is no longer able to run stand-alone in
- // a virtualenv due to missing libraries. Add the path to the modules
- // instead. macOS seems to be showing the same issues.
+ // Since Python 3.8 (Windows, macOS), Python is no longer able to run stand
+ // -alone in a virtualenv due to missing libraries. Add the path to the modules
+ // instead.
const auto os = QOperatingSystemVersion::currentType();
- bool ok;
- int majorVersion = qEnvironmentVariableIntValue("PY_MAJOR_VERSION", &ok);
- int minorVersion = qEnvironmentVariableIntValue("PY_MINOR_VERSION", &ok);
- if (!ok) {
- majorVersion = PY_MAJOR_VERSION;
- minorVersion = PY_MINOR_VERSION;
- }
-
if (!qEnvironmentVariableIsSet(virtualEnvVar)
- || (os != QOperatingSystemVersion::MacOS && os != QOperatingSystemVersion::Windows)
- || (majorVersion == 3 && minorVersion < 8)) {
+ || (os != QOperatingSystemVersion::MacOS && os != QOperatingSystemVersion::Windows)) {
return;
}
@@ -155,11 +159,13 @@ static void initVirtualEnvironment()
case QOperatingSystemVersion::Windows:
pythonPath.append(virtualEnvPath + R"(\Lib\site-packages)");
break;
- case QOperatingSystemVersion::MacOS:
+ case QOperatingSystemVersion::MacOS: {
+ const auto version = pythonVersion();
pythonPath.append(virtualEnvPath + "/lib/python"_ba +
- QByteArray::number(majorVersion) + '.'
- + QByteArray::number(minorVersion)
+ QByteArray::number(version.first) + '.'
+ + QByteArray::number(version.second)
+ "/site-packages"_ba);
+ }
break;
default:
break;
diff --git a/sources/pyside6/pyside_version.py b/sources/pyside6/pyside_version.py
index bd78d3316..830b31e91 100644
--- a/sources/pyside6/pyside_version.py
+++ b/sources/pyside6/pyside_version.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
major_version = "@pyside_MAJOR_VERSION@"
minor_version = "@pyside_MINOR_VERSION@"
diff --git a/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py b/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py
index 23e2d6e7e..e44cab0ce 100644
--- a/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py
+++ b/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Q3DExtras'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test.py
index f3c971285..80c5107ac 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_task.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_task.py
index 7ef2bb90d..c2f56d01a 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_task.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_task.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_taskgroup.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_taskgroup.py
index aa8ce4718..5f8579bac 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_taskgroup.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_cancel_taskgroup.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_chain.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_chain.py
index a0a949720..a8e5bb198 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_chain.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_chain.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_executor.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_executor.py
index 25e680b39..641d374df 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_executor.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_executor.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_queues.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_queues.py
index 0bd98c361..2df39ee02 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_queues.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_queues.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_threadsafe.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_threadsafe.py
index 5b52db239..489354349 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_threadsafe.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_threadsafe.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtAsyncio/qasyncio_test_time.py b/sources/pyside6/tests/QtAsyncio/qasyncio_test_time.py
index 07a126644..66f0433df 100644
--- a/sources/pyside6/tests/QtAsyncio/qasyncio_test_time.py
+++ b/sources/pyside6/tests/QtAsyncio/qasyncio_test_time.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtAsyncio'''
diff --git a/sources/pyside6/tests/QtBluetooth/localdevice.py b/sources/pyside6/tests/QtBluetooth/localdevice.py
index 21801106f..0627333e6 100644
--- a/sources/pyside6/tests/QtBluetooth/localdevice.py
+++ b/sources/pyside6/tests/QtBluetooth/localdevice.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QBluetoothLocalDevice'''
diff --git a/sources/pyside6/tests/QtBluetooth/lowenergy_characteristics.py b/sources/pyside6/tests/QtBluetooth/lowenergy_characteristics.py
index 0f7298fec..2bc623b7e 100644
--- a/sources/pyside6/tests/QtBluetooth/lowenergy_characteristics.py
+++ b/sources/pyside6/tests/QtBluetooth/lowenergy_characteristics.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QLowEnergyServiceData'''
diff --git a/sources/pyside6/tests/QtCharts/qcharts_numpy_test.py b/sources/pyside6/tests/QtCharts/qcharts_numpy_test.py
index 8154020c0..7c88d364e 100644
--- a/sources/pyside6/tests/QtCharts/qcharts_numpy_test.py
+++ b/sources/pyside6/tests/QtCharts/qcharts_numpy_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QCharts/numpy'''
diff --git a/sources/pyside6/tests/QtCharts/qcharts_test.py b/sources/pyside6/tests/QtCharts/qcharts_test.py
index 8d57c07eb..fbb93cb8b 100644
--- a/sources/pyside6/tests/QtCharts/qcharts_test.py
+++ b/sources/pyside6/tests/QtCharts/qcharts_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QCharts'''
diff --git a/sources/pyside6/tests/QtCore/CMakeLists.txt b/sources/pyside6/tests/QtCore/CMakeLists.txt
index f584bfde6..f0228d943 100644
--- a/sources/pyside6/tests/QtCore/CMakeLists.txt
+++ b/sources/pyside6/tests/QtCore/CMakeLists.txt
@@ -34,6 +34,7 @@ PYSIDE_TEST(bug_1313.py)
PYSIDE_TEST(bug_PYSIDE-41.py)
PYSIDE_TEST(bug_PYSIDE-42.py)
PYSIDE_TEST(bug_PYSIDE-164.py)
+PYSIDE_TEST(bug_PYSIDE-2745.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(classinfo_test.py)
PYSIDE_TEST(child_event_test.py)
diff --git a/sources/pyside6/tests/QtCore/attr_cache_py3k.py b/sources/pyside6/tests/QtCore/attr_cache_py3k.py
index c82dbbea3..ca66e0e17 100644
--- a/sources/pyside6/tests/QtCore/attr_cache_py3k.py
+++ b/sources/pyside6/tests/QtCore/attr_cache_py3k.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
'''
Unit tests for attribute cache in Python 3
diff --git a/sources/pyside6/tests/QtCore/blocking_signals_test.py b/sources/pyside6/tests/QtCore/blocking_signals_test.py
index 493abb071..48d8ab7b9 100644
--- a/sources/pyside6/tests/QtCore/blocking_signals_test.py
+++ b/sources/pyside6/tests/QtCore/blocking_signals_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for QObject.signalsBlocked() and blockSignal()'''
diff --git a/sources/pyside6/tests/QtCore/bug_1019.py b/sources/pyside6/tests/QtCore/bug_1019.py
index 4a35956b1..0257dda94 100644
--- a/sources/pyside6/tests/QtCore/bug_1019.py
+++ b/sources/pyside6/tests/QtCore/bug_1019.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_1063.py b/sources/pyside6/tests/QtCore/bug_1063.py
index 88c4bb51e..fec6836a1 100644
--- a/sources/pyside6/tests/QtCore/bug_1063.py
+++ b/sources/pyside6/tests/QtCore/bug_1063.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1063 '''
diff --git a/sources/pyside6/tests/QtCore/bug_1069.py b/sources/pyside6/tests/QtCore/bug_1069.py
index 760918cd9..746897a80 100644
--- a/sources/pyside6/tests/QtCore/bug_1069.py
+++ b/sources/pyside6/tests/QtCore/bug_1069.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1069 '''
diff --git a/sources/pyside6/tests/QtCore/bug_1313.py b/sources/pyside6/tests/QtCore/bug_1313.py
index ecc22c43b..3d66a6d2c 100644
--- a/sources/pyside6/tests/QtCore/bug_1313.py
+++ b/sources/pyside6/tests/QtCore/bug_1313.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1313 '''
diff --git a/sources/pyside6/tests/QtCore/bug_278_test.py b/sources/pyside6/tests/QtCore/bug_278_test.py
index 8d2f4b47e..d929dc10c 100644
--- a/sources/pyside6/tests/QtCore/bug_278_test.py
+++ b/sources/pyside6/tests/QtCore/bug_278_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_300_test.py b/sources/pyside6/tests/QtCore/bug_300_test.py
index b9768bf9d..1862dc56a 100644
--- a/sources/pyside6/tests/QtCore/bug_300_test.py
+++ b/sources/pyside6/tests/QtCore/bug_300_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_324.py b/sources/pyside6/tests/QtCore/bug_324.py
index 0aa17c465..a93f94089 100644
--- a/sources/pyside6/tests/QtCore/bug_324.py
+++ b/sources/pyside6/tests/QtCore/bug_324.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 324: http://bugs.openbossa.org/show_bug.cgi?id=324'''
diff --git a/sources/pyside6/tests/QtCore/bug_332.py b/sources/pyside6/tests/QtCore/bug_332.py
index 8d55bc87f..9e910de1f 100644
--- a/sources/pyside6/tests/QtCore/bug_332.py
+++ b/sources/pyside6/tests/QtCore/bug_332.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_408.py b/sources/pyside6/tests/QtCore/bug_408.py
index 30459172c..e8bc45636 100644
--- a/sources/pyside6/tests/QtCore/bug_408.py
+++ b/sources/pyside6/tests/QtCore/bug_408.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_428.py b/sources/pyside6/tests/QtCore/bug_428.py
index 8fb5d4827..11617aaf7 100644
--- a/sources/pyside6/tests/QtCore/bug_428.py
+++ b/sources/pyside6/tests/QtCore/bug_428.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_462.py b/sources/pyside6/tests/QtCore/bug_462.py
index 04a42fe08..830a4c148 100644
--- a/sources/pyside6/tests/QtCore/bug_462.py
+++ b/sources/pyside6/tests/QtCore/bug_462.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_505.py b/sources/pyside6/tests/QtCore/bug_505.py
index e8655a84e..8c4a045df 100644
--- a/sources/pyside6/tests/QtCore/bug_505.py
+++ b/sources/pyside6/tests/QtCore/bug_505.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtCore/bug_515.py b/sources/pyside6/tests/QtCore/bug_515.py
index 4e270a441..f63e86c95 100644
--- a/sources/pyside6/tests/QtCore/bug_515.py
+++ b/sources/pyside6/tests/QtCore/bug_515.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
""" Unittest for bug #515 """
""" http://bugs.openbossa.org/show_bug.cgi?id=515 """
diff --git a/sources/pyside6/tests/QtCore/bug_606.py b/sources/pyside6/tests/QtCore/bug_606.py
index 4fed16b6e..8e6a9384a 100644
--- a/sources/pyside6/tests/QtCore/bug_606.py
+++ b/sources/pyside6/tests/QtCore/bug_606.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_656.py b/sources/pyside6/tests/QtCore/bug_656.py
index 066dc1a02..75131326c 100644
--- a/sources/pyside6/tests/QtCore/bug_656.py
+++ b/sources/pyside6/tests/QtCore/bug_656.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_686.py b/sources/pyside6/tests/QtCore/bug_686.py
index 6425a4b86..808e42b72 100644
--- a/sources/pyside6/tests/QtCore/bug_686.py
+++ b/sources/pyside6/tests/QtCore/bug_686.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_699.py b/sources/pyside6/tests/QtCore/bug_699.py
index 02da46ff1..dbd686cdd 100644
--- a/sources/pyside6/tests/QtCore/bug_699.py
+++ b/sources/pyside6/tests/QtCore/bug_699.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_706.py b/sources/pyside6/tests/QtCore/bug_706.py
index 7db773240..1fa04f77f 100644
--- a/sources/pyside6/tests/QtCore/bug_706.py
+++ b/sources/pyside6/tests/QtCore/bug_706.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_820.py b/sources/pyside6/tests/QtCore/bug_820.py
index ba0d33068..182fea41c 100644
--- a/sources/pyside6/tests/QtCore/bug_820.py
+++ b/sources/pyside6/tests/QtCore/bug_820.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import functools
import os
diff --git a/sources/pyside6/tests/QtCore/bug_826.py b/sources/pyside6/tests/QtCore/bug_826.py
index 95edc0a7c..0e639e697 100644
--- a/sources/pyside6/tests/QtCore/bug_826.py
+++ b/sources/pyside6/tests/QtCore/bug_826.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_829.py b/sources/pyside6/tests/QtCore/bug_829.py
index 9a57e0399..89790c001 100644
--- a/sources/pyside6/tests/QtCore/bug_829.py
+++ b/sources/pyside6/tests/QtCore/bug_829.py
@@ -1,6 +1,7 @@
# Copyright (C) 2022 The Qt Company Ltd.
# Copyright (C) 2011 Thomas Perl <thp.io/about>
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# Test case for PySide bug 829
diff --git a/sources/pyside6/tests/QtCore/bug_835.py b/sources/pyside6/tests/QtCore/bug_835.py
index 6d91b6e0a..ffc599ee9 100644
--- a/sources/pyside6/tests/QtCore/bug_835.py
+++ b/sources/pyside6/tests/QtCore/bug_835.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_920.py b/sources/pyside6/tests/QtCore/bug_920.py
index 23c8d6201..d39c44547 100644
--- a/sources/pyside6/tests/QtCore/bug_920.py
+++ b/sources/pyside6/tests/QtCore/bug_920.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_927.py b/sources/pyside6/tests/QtCore/bug_927.py
index 1ecea61b2..fb1ffdde1 100644
--- a/sources/pyside6/tests/QtCore/bug_927.py
+++ b/sources/pyside6/tests/QtCore/bug_927.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
@@ -24,7 +25,7 @@ class thread_function():
class Task(QRunnable):
def run(self):
- QThread.sleep(2) # Sleep 2 seconds
+ QThread.msleep(100)
class QThreadPoolTest(unittest.TestCase):
@@ -34,15 +35,15 @@ class QThreadPoolTest(unittest.TestCase):
for i in range(3):
task = Task()
QThreadPool.globalInstance().start(task)
- time.sleep(1) # Sleep 1 second
+ time.sleep(0.05)
- QThreadPool.globalInstance().waitForDone()
+ self.assertTrue(QThreadPool.globalInstance().waitForDone())
def testCallable(self):
global thread_function_called
tp = QThreadPool.globalInstance()
tp.start(thread_function)
- tp.waitForDone()
+ self.assertTrue(tp.waitForDone())
self.assertTrue(thread_function_called)
diff --git a/sources/pyside6/tests/QtCore/bug_931.py b/sources/pyside6/tests/QtCore/bug_931.py
index f233c2a26..f710e1fbb 100644
--- a/sources/pyside6/tests/QtCore/bug_931.py
+++ b/sources/pyside6/tests/QtCore/bug_931.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_938.py b/sources/pyside6/tests/QtCore/bug_938.py
index 3aca25947..63607cd40 100644
--- a/sources/pyside6/tests/QtCore/bug_938.py
+++ b/sources/pyside6/tests/QtCore/bug_938.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_953.py b/sources/pyside6/tests/QtCore/bug_953.py
index a9cacc97e..b772b8536 100644
--- a/sources/pyside6/tests/QtCore/bug_953.py
+++ b/sources/pyside6/tests/QtCore/bug_953.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtCore/bug_987.py b/sources/pyside6/tests/QtCore/bug_987.py
index a8c9799e0..82494fe4b 100644
--- a/sources/pyside6/tests/QtCore/bug_987.py
+++ b/sources/pyside6/tests/QtCore/bug_987.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_994.py b/sources/pyside6/tests/QtCore/bug_994.py
index 464fe3120..258d40dd8 100644
--- a/sources/pyside6/tests/QtCore/bug_994.py
+++ b/sources/pyside6/tests/QtCore/bug_994.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
index 84859af84..2a082eeb6 100644
--- a/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-2745.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-2745.py
new file mode 100644
index 000000000..99f2e498f
--- /dev/null
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-2745.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
+
+import os
+import sys
+import unittest
+
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide6.QtCore import QTimer
+
+from helper.usesqapplication import UsesQApplication
+
+
+class TestBugPYSIDE2745(UsesQApplication):
+
+ def setUp(self):
+ UsesQApplication.setUp(self)
+ self.counter = 0
+
+ def fail(self):
+ self.counter += 1
+ raise Exception()
+
+ def test_fail(self):
+ QTimer.singleShot(0, self.fail)
+ QTimer.singleShot(0, self.fail)
+ QTimer.singleShot(1, self.app.quit)
+ self.app.exec()
+ self.assertEqual(self.counter, 2)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-41.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-41.py
index 2830f8050..02a43d83a 100644
--- a/sources/pyside6/tests/QtCore/bug_PYSIDE-41.py
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-41.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py
index b602b7569..1572e6de3 100644
--- a/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/child_event_test.py b/sources/pyside6/tests/QtCore/child_event_test.py
index 6b17ddc93..a6b8d3d50 100644
--- a/sources/pyside6/tests/QtCore/child_event_test.py
+++ b/sources/pyside6/tests/QtCore/child_event_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for QObject.childEvent and QTimer.childEvent overloading'''
diff --git a/sources/pyside6/tests/QtCore/classinfo_test.py b/sources/pyside6/tests/QtCore/classinfo_test.py
index 0b0a0b4b6..626ae308e 100644
--- a/sources/pyside6/tests/QtCore/classinfo_test.py
+++ b/sources/pyside6/tests/QtCore/classinfo_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
import os
diff --git a/sources/pyside6/tests/QtCore/deepcopy_test.py b/sources/pyside6/tests/QtCore/deepcopy_test.py
index e130628e3..c41f7bbb0 100644
--- a/sources/pyside6/tests/QtCore/deepcopy_test.py
+++ b/sources/pyside6/tests/QtCore/deepcopy_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from copy import deepcopy
import os
diff --git a/sources/pyside6/tests/QtCore/deletelater_test.py b/sources/pyside6/tests/QtCore/deletelater_test.py
index 0ee078428..5d31ef367 100644
--- a/sources/pyside6/tests/QtCore/deletelater_test.py
+++ b/sources/pyside6/tests/QtCore/deletelater_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QTimer.singleShot'''
diff --git a/sources/pyside6/tests/QtCore/destroysignal_test.py b/sources/pyside6/tests/QtCore/destroysignal_test.py
index ad087b489..5c743fe4d 100644
--- a/sources/pyside6/tests/QtCore/destroysignal_test.py
+++ b/sources/pyside6/tests/QtCore/destroysignal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtCore/duck_punching_test.py b/sources/pyside6/tests/QtCore/duck_punching_test.py
index 145863c3e..e2204eca8 100644
--- a/sources/pyside6/tests/QtCore/duck_punching_test.py
+++ b/sources/pyside6/tests/QtCore/duck_punching_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for duck punching new implementations of C++ virtual methods into object instances.'''
diff --git a/sources/pyside6/tests/QtCore/emoji_string_test.py b/sources/pyside6/tests/QtCore/emoji_string_test.py
index 78dee1893..6b4db7d99 100644
--- a/sources/pyside6/tests/QtCore/emoji_string_test.py
+++ b/sources/pyside6/tests/QtCore/emoji_string_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
emoji-string-test.py
diff --git a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
index 97c4f942e..6ed1a665f 100644
--- a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
+++ b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/feature_with_uic/window.py b/sources/pyside6/tests/QtCore/feature_with_uic/window.py
index c55bcaf92..0a94d2ecd 100644
--- a/sources/pyside6/tests/QtCore/feature_with_uic/window.py
+++ b/sources/pyside6/tests/QtCore/feature_with_uic/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 (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
diff --git a/sources/pyside6/tests/QtCore/feature_with_uic_test.py b/sources/pyside6/tests/QtCore/feature_with_uic_test.py
index 2ffc9970e..ff8ac2147 100644
--- a/sources/pyside6/tests/QtCore/feature_with_uic_test.py
+++ b/sources/pyside6/tests/QtCore/feature_with_uic_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+from __future__ import annotations
"""
feature_with_uic_test.py
diff --git a/sources/pyside6/tests/QtCore/hash_test.py b/sources/pyside6/tests/QtCore/hash_test.py
index aee2f516c..91edc5a09 100644
--- a/sources/pyside6/tests/QtCore/hash_test.py
+++ b/sources/pyside6/tests/QtCore/hash_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/inherits_test.py b/sources/pyside6/tests/QtCore/inherits_test.py
index 1422616d8..9008c2161 100644
--- a/sources/pyside6/tests/QtCore/inherits_test.py
+++ b/sources/pyside6/tests/QtCore/inherits_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py b/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py
index a808f0c3d..2879b8874 100644
--- a/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py
+++ b/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""Tests for category logging macros qCDebug, qCInfo, qCWarning, qCCritical"""
diff --git a/sources/pyside6/tests/QtCore/max_signals.py b/sources/pyside6/tests/QtCore/max_signals.py
index 95952dfbf..64f3c0bb3 100644
--- a/sources/pyside6/tests/QtCore/max_signals.py
+++ b/sources/pyside6/tests/QtCore/max_signals.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/missing_symbols_test.py b/sources/pyside6/tests/QtCore/missing_symbols_test.py
index 7cf6d3e3e..020a0263a 100644
--- a/sources/pyside6/tests/QtCore/missing_symbols_test.py
+++ b/sources/pyside6/tests/QtCore/missing_symbols_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''(Very) Simple test case for missing names from QtCore'''
diff --git a/sources/pyside6/tests/QtCore/mockclass_test.py b/sources/pyside6/tests/QtCore/mockclass_test.py
index c7e465b24..57d1ddd58 100644
--- a/sources/pyside6/tests/QtCore/mockclass_test.py
+++ b/sources/pyside6/tests/QtCore/mockclass_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# Test case for PySide bug 634
# http://bugs.pyside.org/show_bug.cgi?id=634
diff --git a/sources/pyside6/tests/QtCore/multiple_feature_test.py b/sources/pyside6/tests/QtCore/multiple_feature_test.py
index 0f51ace6b..1a31dda22 100644
--- a/sources/pyside6/tests/QtCore/multiple_feature_test.py
+++ b/sources/pyside6/tests/QtCore/multiple_feature_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/python_conversion.py b/sources/pyside6/tests/QtCore/python_conversion.py
index 28a271b61..e023ee5b5 100644
--- a/sources/pyside6/tests/QtCore/python_conversion.py
+++ b/sources/pyside6/tests/QtCore/python_conversion.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QLineF'''
diff --git a/sources/pyside6/tests/QtCore/qabs_test.py b/sources/pyside6/tests/QtCore/qabs_test.py
index 2b22b1e17..5f08fe4bc 100644
--- a/sources/pyside6/tests/QtCore/qabs_test.py
+++ b/sources/pyside6/tests/QtCore/qabs_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py b/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py
index bb9a2222a..20d070a03 100644
--- a/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py
+++ b/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qanimationgroup_test.py b/sources/pyside6/tests/QtCore/qanimationgroup_test.py
index 9b9b0e622..f3eec76bf 100644
--- a/sources/pyside6/tests/QtCore/qanimationgroup_test.py
+++ b/sources/pyside6/tests/QtCore/qanimationgroup_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qbitarray_test.py b/sources/pyside6/tests/QtCore/qbitarray_test.py
index 70452eab1..239453da7 100644
--- a/sources/pyside6/tests/QtCore/qbitarray_test.py
+++ b/sources/pyside6/tests/QtCore/qbitarray_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators'''
diff --git a/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py b/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py
index aea9778d7..9c508d381 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QByteArray concatenation with '+' operator'''
diff --git a/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py b/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py
index a2201a716..cd14941bc 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qbytearray_operator_test.py b/sources/pyside6/tests/QtCore/qbytearray_operator_test.py
index 0064e4dd6..c0e8b55e3 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_operator_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_operator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QByteArray operators'''
diff --git a/sources/pyside6/tests/QtCore/qbytearray_test.py b/sources/pyside6/tests/QtCore/qbytearray_test.py
index cb8f9a431..6f130ad6e 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QByteArray'''
diff --git a/sources/pyside6/tests/QtCore/qcalendar_test.py b/sources/pyside6/tests/QtCore/qcalendar_test.py
index 0137677f3..0861cd269 100644
--- a/sources/pyside6/tests/QtCore/qcalendar_test.py
+++ b/sources/pyside6/tests/QtCore/qcalendar_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QCalendar (5.14)'''
diff --git a/sources/pyside6/tests/QtCore/qcbor_test.py b/sources/pyside6/tests/QtCore/qcbor_test.py
index 312c9e5c7..8d49c7151 100644
--- a/sources/pyside6/tests/QtCore/qcbor_test.py
+++ b/sources/pyside6/tests/QtCore/qcbor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QCbor'''
diff --git a/sources/pyside6/tests/QtCore/qcollator_test.py b/sources/pyside6/tests/QtCore/qcollator_test.py
index 9d1052b24..1be545582 100644
--- a/sources/pyside6/tests/QtCore/qcollator_test.py
+++ b/sources/pyside6/tests/QtCore/qcollator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QCollator'''
diff --git a/sources/pyside6/tests/QtCore/qcommandlineparser_test.py b/sources/pyside6/tests/QtCore/qcommandlineparser_test.py
index c562065ae..df17f95ee 100644
--- a/sources/pyside6/tests/QtCore/qcommandlineparser_test.py
+++ b/sources/pyside6/tests/QtCore/qcommandlineparser_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QCommandLineParser and QCommandLineOption'''
diff --git a/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py b/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py
index 3c8500923..9871eb97f 100644
--- a/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py
+++ b/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py b/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py
index 968765020..4daab45bb 100644
--- a/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py
+++ b/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QCoreApplication.instance static method'''
diff --git a/sources/pyside6/tests/QtCore/qcoreapplication_test.py b/sources/pyside6/tests/QtCore/qcoreapplication_test.py
index edd4dc8e2..f8ea5a0f1 100644
--- a/sources/pyside6/tests/QtCore/qcoreapplication_test.py
+++ b/sources/pyside6/tests/QtCore/qcoreapplication_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qdatastream_test.py b/sources/pyside6/tests/QtCore/qdatastream_test.py
index 517f466aa..5850974a1 100644
--- a/sources/pyside6/tests/QtCore/qdatastream_test.py
+++ b/sources/pyside6/tests/QtCore/qdatastream_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QDataStream'''
diff --git a/sources/pyside6/tests/QtCore/qdate_test.py b/sources/pyside6/tests/QtCore/qdate_test.py
index 611292227..6979c62fb 100644
--- a/sources/pyside6/tests/QtCore/qdate_test.py
+++ b/sources/pyside6/tests/QtCore/qdate_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QDate'''
diff --git a/sources/pyside6/tests/QtCore/qdatetime_test.py b/sources/pyside6/tests/QtCore/qdatetime_test.py
index 96e353112..fa9a988be 100644
--- a/sources/pyside6/tests/QtCore/qdatetime_test.py
+++ b/sources/pyside6/tests/QtCore/qdatetime_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import datetime
import os
diff --git a/sources/pyside6/tests/QtCore/qdir_test.py b/sources/pyside6/tests/QtCore/qdir_test.py
index 702c7f13a..ba360629b 100644
--- a/sources/pyside6/tests/QtCore/qdir_test.py
+++ b/sources/pyside6/tests/QtCore/qdir_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qeasingcurve_test.py b/sources/pyside6/tests/QtCore/qeasingcurve_test.py
index b202dbefb..b39563bb9 100644
--- a/sources/pyside6/tests/QtCore/qeasingcurve_test.py
+++ b/sources/pyside6/tests/QtCore/qeasingcurve_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qenum_test.py b/sources/pyside6/tests/QtCore/qenum_test.py
index 45a8e9124..e064ea40d 100644
--- a/sources/pyside6/tests/QtCore/qenum_test.py
+++ b/sources/pyside6/tests/QtCore/qenum_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QEnum and QFlags'''
diff --git a/sources/pyside6/tests/QtCore/qevent_test.py b/sources/pyside6/tests/QtCore/qevent_test.py
index 244a14f13..d2ab7d1eb 100644
--- a/sources/pyside6/tests/QtCore/qevent_test.py
+++ b/sources/pyside6/tests/QtCore/qevent_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtCore.QEvent'''
diff --git a/sources/pyside6/tests/QtCore/qfile_test.py b/sources/pyside6/tests/QtCore/qfile_test.py
index 0af5c2650..4535159de 100644
--- a/sources/pyside6/tests/QtCore/qfile_test.py
+++ b/sources/pyside6/tests/QtCore/qfile_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qfileinfo_test.py b/sources/pyside6/tests/QtCore/qfileinfo_test.py
index dfdfd7fa2..1836ca8a3 100644
--- a/sources/pyside6/tests/QtCore/qfileinfo_test.py
+++ b/sources/pyside6/tests/QtCore/qfileinfo_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qfileread_test.py b/sources/pyside6/tests/QtCore/qfileread_test.py
index c66a27f8a..250f16ce1 100644
--- a/sources/pyside6/tests/QtCore/qfileread_test.py
+++ b/sources/pyside6/tests/QtCore/qfileread_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qflags_test.py b/sources/pyside6/tests/QtCore/qflags_test.py
index 2a5306685..31b6f60f0 100644
--- a/sources/pyside6/tests/QtCore/qflags_test.py
+++ b/sources/pyside6/tests/QtCore/qflags_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QFlags'''
diff --git a/sources/pyside6/tests/QtCore/qhandle_test.py b/sources/pyside6/tests/QtCore/qhandle_test.py
index e0f4f3f7a..2b59a2d8b 100644
--- a/sources/pyside6/tests/QtCore/qhandle_test.py
+++ b/sources/pyside6/tests/QtCore/qhandle_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QEnum and QFlags'''
diff --git a/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py b/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py
index 9c5ae4370..041b006ca 100644
--- a/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py
+++ b/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for qInstallMsgHandler'''
diff --git a/sources/pyside6/tests/QtCore/qiodevice_buffered_read_test.py b/sources/pyside6/tests/QtCore/qiodevice_buffered_read_test.py
index ea735112a..a20e41be8 100644
--- a/sources/pyside6/tests/QtCore/qiodevice_buffered_read_test.py
+++ b/sources/pyside6/tests/QtCore/qiodevice_buffered_read_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for buffered read methods of QIODevice'''
diff --git a/sources/pyside6/tests/QtCore/qiopipe_test.py b/sources/pyside6/tests/QtCore/qiopipe_test.py
index 53a6ba70a..908a3a892 100644
--- a/sources/pyside6/tests/QtCore/qiopipe_test.py
+++ b/sources/pyside6/tests/QtCore/qiopipe_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for the QIOPipe class'''
diff --git a/sources/pyside6/tests/QtCore/qjsondocument_test.py b/sources/pyside6/tests/QtCore/qjsondocument_test.py
index a50f185ff..63683fd3f 100644
--- a/sources/pyside6/tests/QtCore/qjsondocument_test.py
+++ b/sources/pyside6/tests/QtCore/qjsondocument_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QJsonDocument/nullptr_t'''
diff --git a/sources/pyside6/tests/QtCore/qlinef_test.py b/sources/pyside6/tests/QtCore/qlinef_test.py
index 90ae50159..7c9e668df 100644
--- a/sources/pyside6/tests/QtCore/qlinef_test.py
+++ b/sources/pyside6/tests/QtCore/qlinef_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QLineF'''
diff --git a/sources/pyside6/tests/QtCore/qlocale_test.py b/sources/pyside6/tests/QtCore/qlocale_test.py
index 05b0d3219..6ad933d8f 100644
--- a/sources/pyside6/tests/QtCore/qlocale_test.py
+++ b/sources/pyside6/tests/QtCore/qlocale_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QLocale'''
diff --git a/sources/pyside6/tests/QtCore/qlockfile_test.py b/sources/pyside6/tests/QtCore/qlockfile_test.py
index 6dca9235c..e6e614b26 100644
--- a/sources/pyside6/tests/QtCore/qlockfile_test.py
+++ b/sources/pyside6/tests/QtCore/qlockfile_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QLockFile'''
diff --git a/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py b/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py
index 74e6bceb9..92778a78b 100644
--- a/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py
+++ b/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QMessageAuthenticationCode'''
diff --git a/sources/pyside6/tests/QtCore/qmetaobject_test.py b/sources/pyside6/tests/QtCore/qmetaobject_test.py
index 4b3051711..ff8ed859e 100644
--- a/sources/pyside6/tests/QtCore/qmetaobject_test.py
+++ b/sources/pyside6/tests/QtCore/qmetaobject_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for static methos conflicts with class methods'''
diff --git a/sources/pyside6/tests/QtCore/qmetatype_test.py b/sources/pyside6/tests/QtCore/qmetatype_test.py
index f8e0ba1c0..cdd02e5ba 100644
--- a/sources/pyside6/tests/QtCore/qmetatype_test.py
+++ b/sources/pyside6/tests/QtCore/qmetatype_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for QMetaType'''
diff --git a/sources/pyside6/tests/QtCore/qmimedatabase_test.py b/sources/pyside6/tests/QtCore/qmimedatabase_test.py
index 6a63edb85..c2b967a26 100644
--- a/sources/pyside6/tests/QtCore/qmimedatabase_test.py
+++ b/sources/pyside6/tests/QtCore/qmimedatabase_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QMimeDatabase'''
diff --git a/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py b/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py
index ec37ca6a0..e3dfce8b9 100644
--- a/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py
+++ b/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for QAbstractListModel.createIndex and QModelIndex.internalPointer'''
diff --git a/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py b/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py
index 508526cca..4bdd3922b 100644
--- a/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for parent-child relationship'''
diff --git a/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py b/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py
index b3bfaf007..af9e081d9 100644
--- a/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for QObject::connectNotify()'''
diff --git a/sources/pyside6/tests/QtCore/qobject_destructor.py b/sources/pyside6/tests/QtCore/qobject_destructor.py
index 2b7b40f25..9bb80459a 100644
--- a/sources/pyside6/tests/QtCore/qobject_destructor.py
+++ b/sources/pyside6/tests/QtCore/qobject_destructor.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qobject_event_filter_test.py b/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
index ab7a1b6ad..a011f7240 100644
--- a/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QObject.eventFilter'''
diff --git a/sources/pyside6/tests/QtCore/qobject_inherits_test.py b/sources/pyside6/tests/QtCore/qobject_inherits_test.py
index 0bd4fba75..bdd927fe2 100644
--- a/sources/pyside6/tests/QtCore/qobject_inherits_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_inherits_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QObject methods'''
diff --git a/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py b/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py
index f1a4cb0b5..b12c3c77e 100644
--- a/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for the bug #378
http://bugs.openbossa.org/show_bug.cgi?id=378
diff --git a/sources/pyside6/tests/QtCore/qobject_parent_test.py b/sources/pyside6/tests/QtCore/qobject_parent_test.py
index 6265f77b1..103a3eb03 100644
--- a/sources/pyside6/tests/QtCore/qobject_parent_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_parent_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for parent-child relationship'''
diff --git a/sources/pyside6/tests/QtCore/qobject_property_test.py b/sources/pyside6/tests/QtCore/qobject_property_test.py
index 4efb25cb4..37936205e 100644
--- a/sources/pyside6/tests/QtCore/qobject_property_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_property_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QObject property and setProperty'''
diff --git a/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py b/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py
index 926698b4b..5ab5d12c3 100644
--- a/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QObject protected methods'''
diff --git a/sources/pyside6/tests/QtCore/qobject_test.py b/sources/pyside6/tests/QtCore/qobject_test.py
index ecfc3dff0..176ab34b8 100644
--- a/sources/pyside6/tests/QtCore/qobject_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QObject methods'''
diff --git a/sources/pyside6/tests/QtCore/qobject_timer_event_test.py b/sources/pyside6/tests/QtCore/qobject_timer_event_test.py
index 9e657c27f..ce0c12b2d 100644
--- a/sources/pyside6/tests/QtCore/qobject_timer_event_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_timer_event_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for QObject.timerEvent overloading'''
diff --git a/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py b/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py
index 9123c5155..f3df03a0c 100644
--- a/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QObject's tr static methods.'''
diff --git a/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py b/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py
index d887029ac..7365e7212 100644
--- a/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py
+++ b/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qpoint_test.py b/sources/pyside6/tests/QtCore/qpoint_test.py
index b9d5afa37..9770b5662 100644
--- a/sources/pyside6/tests/QtCore/qpoint_test.py
+++ b/sources/pyside6/tests/QtCore/qpoint_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QPoint and QPointF'''
diff --git a/sources/pyside6/tests/QtCore/qprocess_test.py b/sources/pyside6/tests/QtCore/qprocess_test.py
index ba4d29102..6466b8575 100644
--- a/sources/pyside6/tests/QtCore/qprocess_test.py
+++ b/sources/pyside6/tests/QtCore/qprocess_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QProcess'''
diff --git a/sources/pyside6/tests/QtCore/qproperty_decorator.py b/sources/pyside6/tests/QtCore/qproperty_decorator.py
index 19f2bd251..7d6fbc91d 100644
--- a/sources/pyside6/tests/QtCore/qproperty_decorator.py
+++ b/sources/pyside6/tests/QtCore/qproperty_decorator.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtCore/qrandomgenerator_test.py b/sources/pyside6/tests/QtCore/qrandomgenerator_test.py
index c13a8b24a..6ae69b6b3 100644
--- a/sources/pyside6/tests/QtCore/qrandomgenerator_test.py
+++ b/sources/pyside6/tests/QtCore/qrandomgenerator_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qrect_test.py b/sources/pyside6/tests/QtCore/qrect_test.py
index 8a14abc5a..fb91654f2 100644
--- a/sources/pyside6/tests/QtCore/qrect_test.py
+++ b/sources/pyside6/tests/QtCore/qrect_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QRect'''
diff --git a/sources/pyside6/tests/QtCore/qregularexpression_test.py b/sources/pyside6/tests/QtCore/qregularexpression_test.py
index a88c2dc24..ae7281d75 100644
--- a/sources/pyside6/tests/QtCore/qregularexpression_test.py
+++ b/sources/pyside6/tests/QtCore/qregularexpression_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QRegularExpression'''
diff --git a/sources/pyside6/tests/QtCore/qresource_test.py b/sources/pyside6/tests/QtCore/qresource_test.py
index 1cdd2c785..0f7b920e8 100644
--- a/sources/pyside6/tests/QtCore/qresource_test.py
+++ b/sources/pyside6/tests/QtCore/qresource_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QResource usage'''
diff --git a/sources/pyside6/tests/QtCore/qrunnable_test.py b/sources/pyside6/tests/QtCore/qrunnable_test.py
index d52f50ce1..1b743a8e9 100644
--- a/sources/pyside6/tests/QtCore/qrunnable_test.py
+++ b/sources/pyside6/tests/QtCore/qrunnable_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QRunnable'''
diff --git a/sources/pyside6/tests/QtCore/qsettings_test.py b/sources/pyside6/tests/QtCore/qsettings_test.py
index 64ceffd70..5f86c9fbb 100644
--- a/sources/pyside6/tests/QtCore/qsettings_test.py
+++ b/sources/pyside6/tests/QtCore/qsettings_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QDate'''
diff --git a/sources/pyside6/tests/QtCore/qsharedmemory_client.py b/sources/pyside6/tests/QtCore/qsharedmemory_client.py
index d16c36da9..05640d7fe 100644
--- a/sources/pyside6/tests/QtCore/qsharedmemory_client.py
+++ b/sources/pyside6/tests/QtCore/qsharedmemory_client.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Client for the unit test of QSharedMemory'''
diff --git a/sources/pyside6/tests/QtCore/qsharedmemory_test.py b/sources/pyside6/tests/QtCore/qsharedmemory_test.py
index ed8a47939..9ec976ac6 100644
--- a/sources/pyside6/tests/QtCore/qsharedmemory_test.py
+++ b/sources/pyside6/tests/QtCore/qsharedmemory_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QSharedMemory'''
diff --git a/sources/pyside6/tests/QtCore/qsize_test.py b/sources/pyside6/tests/QtCore/qsize_test.py
index bc324ba73..3de779bd6 100644
--- a/sources/pyside6/tests/QtCore/qsize_test.py
+++ b/sources/pyside6/tests/QtCore/qsize_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QSize'''
diff --git a/sources/pyside6/tests/QtCore/qslot_object_test.py b/sources/pyside6/tests/QtCore/qslot_object_test.py
index a95afb090..5412680df 100644
--- a/sources/pyside6/tests/QtCore/qslot_object_test.py
+++ b/sources/pyside6/tests/QtCore/qslot_object_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qsocketnotifier_test.py b/sources/pyside6/tests/QtCore/qsocketnotifier_test.py
index 2e812947c..beb90314a 100644
--- a/sources/pyside6/tests/QtCore/qsocketnotifier_test.py
+++ b/sources/pyside6/tests/QtCore/qsocketnotifier_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QUuid'''
diff --git a/sources/pyside6/tests/QtCore/qsrand_test.py b/sources/pyside6/tests/QtCore/qsrand_test.py
index fef44261b..d0e071dcf 100644
--- a/sources/pyside6/tests/QtCore/qsrand_test.py
+++ b/sources/pyside6/tests/QtCore/qsrand_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtCore/qstandardpaths_test.py b/sources/pyside6/tests/QtCore/qstandardpaths_test.py
index b8274769b..0846e2a68 100644
--- a/sources/pyside6/tests/QtCore/qstandardpaths_test.py
+++ b/sources/pyside6/tests/QtCore/qstandardpaths_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QStandardPaths'''
diff --git a/sources/pyside6/tests/QtCore/qstorageinfo_test.py b/sources/pyside6/tests/QtCore/qstorageinfo_test.py
index 5869d9f00..44b3ce303 100644
--- a/sources/pyside6/tests/QtCore/qstorageinfo_test.py
+++ b/sources/pyside6/tests/QtCore/qstorageinfo_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QStorageInfo'''
diff --git a/sources/pyside6/tests/QtCore/qstring_test.py b/sources/pyside6/tests/QtCore/qstring_test.py
index d740eeeef..397dceb1e 100644
--- a/sources/pyside6/tests/QtCore/qstring_test.py
+++ b/sources/pyside6/tests/QtCore/qstring_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QString'''
diff --git a/sources/pyside6/tests/QtCore/qsysinfo_test.py b/sources/pyside6/tests/QtCore/qsysinfo_test.py
index 602852fab..71a39bb5d 100644
--- a/sources/pyside6/tests/QtCore/qsysinfo_test.py
+++ b/sources/pyside6/tests/QtCore/qsysinfo_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qtextstream_test.py b/sources/pyside6/tests/QtCore/qtextstream_test.py
index d4ed94e14..99aae2187 100644
--- a/sources/pyside6/tests/QtCore/qtextstream_test.py
+++ b/sources/pyside6/tests/QtCore/qtextstream_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QTextStream'''
diff --git a/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py b/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py
index a179c936f..6fbc8432e 100644
--- a/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py
+++ b/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Producer-Consumer test/example with QThread'''
diff --git a/sources/pyside6/tests/QtCore/qthread_signal_test.py b/sources/pyside6/tests/QtCore/qthread_signal_test.py
index 4e312dcc8..93c83ea6e 100644
--- a/sources/pyside6/tests/QtCore/qthread_signal_test.py
+++ b/sources/pyside6/tests/QtCore/qthread_signal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for connecting signals between threads'''
diff --git a/sources/pyside6/tests/QtCore/qthread_test.py b/sources/pyside6/tests/QtCore/qthread_test.py
index 4d26e0597..856283a23 100644
--- a/sources/pyside6/tests/QtCore/qthread_test.py
+++ b/sources/pyside6/tests/QtCore/qthread_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QThread'''
diff --git a/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py b/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py
index 2ccaa300e..9b187104c 100644
--- a/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py
+++ b/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QTimer.singleShot'''
diff --git a/sources/pyside6/tests/QtCore/qtimer_timeout_test.py b/sources/pyside6/tests/QtCore/qtimer_timeout_test.py
index 70f151989..985ba9d76 100644
--- a/sources/pyside6/tests/QtCore/qtimer_timeout_test.py
+++ b/sources/pyside6/tests/QtCore/qtimer_timeout_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for timeout() signals from QTimer object.'''
diff --git a/sources/pyside6/tests/QtCore/qtimezone_test.py b/sources/pyside6/tests/QtCore/qtimezone_test.py
index ad953f1cc..3bfadc662 100644
--- a/sources/pyside6/tests/QtCore/qtimezone_test.py
+++ b/sources/pyside6/tests/QtCore/qtimezone_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/qtnamespace_test.py b/sources/pyside6/tests/QtCore/qtnamespace_test.py
index c08c727ec..3e41a87b5 100644
--- a/sources/pyside6/tests/QtCore/qtnamespace_test.py
+++ b/sources/pyside6/tests/QtCore/qtnamespace_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test suite for QtCore.Qt namespace'''
diff --git a/sources/pyside6/tests/QtCore/qurl_test.py b/sources/pyside6/tests/QtCore/qurl_test.py
index df16c74e0..1e9310fe7 100644
--- a/sources/pyside6/tests/QtCore/qurl_test.py
+++ b/sources/pyside6/tests/QtCore/qurl_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test suite for QtCore.QUrl'''
diff --git a/sources/pyside6/tests/QtCore/qurlquery_test.py b/sources/pyside6/tests/QtCore/qurlquery_test.py
index 36eb29475..d510908d9 100644
--- a/sources/pyside6/tests/QtCore/qurlquery_test.py
+++ b/sources/pyside6/tests/QtCore/qurlquery_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QUrlQuery'''
diff --git a/sources/pyside6/tests/QtCore/quuid_test.py b/sources/pyside6/tests/QtCore/quuid_test.py
index 45c6fc89d..c4a3f8311 100644
--- a/sources/pyside6/tests/QtCore/quuid_test.py
+++ b/sources/pyside6/tests/QtCore/quuid_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QUuid'''
diff --git a/sources/pyside6/tests/QtCore/qversionnumber_test.py b/sources/pyside6/tests/QtCore/qversionnumber_test.py
index 23f6ba639..db259646b 100644
--- a/sources/pyside6/tests/QtCore/qversionnumber_test.py
+++ b/sources/pyside6/tests/QtCore/qversionnumber_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QVersionNumber'''
diff --git a/sources/pyside6/tests/QtCore/repr_test.py b/sources/pyside6/tests/QtCore/repr_test.py
index 87cceaa82..cf3ebd6a6 100644
--- a/sources/pyside6/tests/QtCore/repr_test.py
+++ b/sources/pyside6/tests/QtCore/repr_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/resources_mc.py b/sources/pyside6/tests/QtCore/resources_mc.py
index 05766a22a..36f596cc1 100644
--- a/sources/pyside6/tests/QtCore/resources_mc.py
+++ b/sources/pyside6/tests/QtCore/resources_mc.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# Resource object code
#
diff --git a/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py b/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py
index de8f67bb3..2fda6640c 100644
--- a/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py
+++ b/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/signal_sender.py b/sources/pyside6/tests/QtCore/signal_sender.py
index 2552591e5..464c50e3d 100644
--- a/sources/pyside6/tests/QtCore/signal_sender.py
+++ b/sources/pyside6/tests/QtCore/signal_sender.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
index 82087ab9a..f14cf21e2 100644
--- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
+++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/staticMetaObject_test.py b/sources/pyside6/tests/QtCore/staticMetaObject_test.py
index 223c334d3..0fd207b41 100644
--- a/sources/pyside6/tests/QtCore/staticMetaObject_test.py
+++ b/sources/pyside6/tests/QtCore/staticMetaObject_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtCore/static_method_test.py b/sources/pyside6/tests/QtCore/static_method_test.py
index bbf96e44a..7515c5f6f 100644
--- a/sources/pyside6/tests/QtCore/static_method_test.py
+++ b/sources/pyside6/tests/QtCore/static_method_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for overloads involving static and non-static versions of a method.'''
diff --git a/sources/pyside6/tests/QtCore/thread_signals_test.py b/sources/pyside6/tests/QtCore/thread_signals_test.py
index a453d1ac1..ffef4cda0 100644
--- a/sources/pyside6/tests/QtCore/thread_signals_test.py
+++ b/sources/pyside6/tests/QtCore/thread_signals_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for QObject.signalsBlocked() and blockSignal()'''
diff --git a/sources/pyside6/tests/QtCore/tr_noop_test.py b/sources/pyside6/tests/QtCore/tr_noop_test.py
index a3b2e257f..7340660be 100644
--- a/sources/pyside6/tests/QtCore/tr_noop_test.py
+++ b/sources/pyside6/tests/QtCore/tr_noop_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtCore/translation_test.py b/sources/pyside6/tests/QtCore/translation_test.py
index da09e47b6..07f1fa580 100644
--- a/sources/pyside6/tests/QtCore/translation_test.py
+++ b/sources/pyside6/tests/QtCore/translation_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests to test QTranslator and translation in general.'''
diff --git a/sources/pyside6/tests/QtCore/unaryoperator_test.py b/sources/pyside6/tests/QtCore/unaryoperator_test.py
index 7b38685c8..2a935afc2 100644
--- a/sources/pyside6/tests/QtCore/unaryoperator_test.py
+++ b/sources/pyside6/tests/QtCore/unaryoperator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests the presence of unary operator __neg__ on the QPoint class'''
diff --git a/sources/pyside6/tests/QtCore/unicode_test.py b/sources/pyside6/tests/QtCore/unicode_test.py
index 73ce96c77..b45c8bedf 100644
--- a/sources/pyside6/tests/QtCore/unicode_test.py
+++ b/sources/pyside6/tests/QtCore/unicode_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QString conversion to/from Python Unicode'''
diff --git a/sources/pyside6/tests/QtCore/versioninfo_test.py b/sources/pyside6/tests/QtCore/versioninfo_test.py
index 63414378a..342c3adf0 100644
--- a/sources/pyside6/tests/QtCore/versioninfo_test.py
+++ b/sources/pyside6/tests/QtCore/versioninfo_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtDBus/test_dbus.py b/sources/pyside6/tests/QtDBus/test_dbus.py
index a37db9421..452934271 100644
--- a/sources/pyside6/tests/QtDBus/test_dbus.py
+++ b/sources/pyside6/tests/QtDBus/test_dbus.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QDBus'''
diff --git a/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py b/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py
index 98ada6d47..bfa497eb4 100644
--- a/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py
+++ b/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtDataVisualization'''
diff --git a/sources/pyside6/tests/QtGui/bug_1091.py b/sources/pyside6/tests/QtGui/bug_1091.py
index 9b9f35807..b1e2f0b09 100644
--- a/sources/pyside6/tests/QtGui/bug_1091.py
+++ b/sources/pyside6/tests/QtGui/bug_1091.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1091 '''
diff --git a/sources/pyside6/tests/QtGui/bug_367.py b/sources/pyside6/tests/QtGui/bug_367.py
index 771fa5a4b..1b447be72 100644
--- a/sources/pyside6/tests/QtGui/bug_367.py
+++ b/sources/pyside6/tests/QtGui/bug_367.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=367'''
diff --git a/sources/pyside6/tests/QtGui/bug_493.py b/sources/pyside6/tests/QtGui/bug_493.py
index ba8b67bbb..faf265755 100644
--- a/sources/pyside6/tests/QtGui/bug_493.py
+++ b/sources/pyside6/tests/QtGui/bug_493.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_606.py b/sources/pyside6/tests/QtGui/bug_606.py
index 80b79f640..332c207c6 100644
--- a/sources/pyside6/tests/QtGui/bug_606.py
+++ b/sources/pyside6/tests/QtGui/bug_606.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_617.py b/sources/pyside6/tests/QtGui/bug_617.py
index d90d1e754..fb793e6ee 100644
--- a/sources/pyside6/tests/QtGui/bug_617.py
+++ b/sources/pyside6/tests/QtGui/bug_617.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_652.py b/sources/pyside6/tests/QtGui/bug_652.py
index 17d6c3b77..77b5d5251 100644
--- a/sources/pyside6/tests/QtGui/bug_652.py
+++ b/sources/pyside6/tests/QtGui/bug_652.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtGui/bug_660.py b/sources/pyside6/tests/QtGui/bug_660.py
index 4ab8e9f19..e45b40596 100644
--- a/sources/pyside6/tests/QtGui/bug_660.py
+++ b/sources/pyside6/tests/QtGui/bug_660.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_716.py b/sources/pyside6/tests/QtGui/bug_716.py
index 90d78ea89..fd5745078 100644
--- a/sources/pyside6/tests/QtGui/bug_716.py
+++ b/sources/pyside6/tests/QtGui/bug_716.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_740.py b/sources/pyside6/tests/QtGui/bug_740.py
index ece314cc8..c1b41c2ab 100644
--- a/sources/pyside6/tests/QtGui/bug_740.py
+++ b/sources/pyside6/tests/QtGui/bug_740.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_743.py b/sources/pyside6/tests/QtGui/bug_743.py
index a870e4bf1..127981f1f 100644
--- a/sources/pyside6/tests/QtGui/bug_743.py
+++ b/sources/pyside6/tests/QtGui/bug_743.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_785.py b/sources/pyside6/tests/QtGui/bug_785.py
index 04425f063..a218398a9 100644
--- a/sources/pyside6/tests/QtGui/bug_785.py
+++ b/sources/pyside6/tests/QtGui/bug_785.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_991.py b/sources/pyside6/tests/QtGui/bug_991.py
index e74adc198..2bac8f542 100644
--- a/sources/pyside6/tests/QtGui/bug_991.py
+++ b/sources/pyside6/tests/QtGui/bug_991.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py b/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py
index 6519eef61..bd5ab4ba0 100644
--- a/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py
+++ b/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for PYSIDE-344, imul/idiv are used instead of mul/div, modifying the argument passed in'''
diff --git a/sources/pyside6/tests/QtGui/deepcopy_test.py b/sources/pyside6/tests/QtGui/deepcopy_test.py
index 9a13eb485..b53b34ade 100644
--- a/sources/pyside6/tests/QtGui/deepcopy_test.py
+++ b/sources/pyside6/tests/QtGui/deepcopy_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from copy import deepcopy
import os
diff --git a/sources/pyside6/tests/QtGui/event_filter_test.py b/sources/pyside6/tests/QtGui/event_filter_test.py
index 01d8fbc02..ff894dbd0 100644
--- a/sources/pyside6/tests/QtGui/event_filter_test.py
+++ b/sources/pyside6/tests/QtGui/event_filter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py b/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py
index ba438f8e0..e26d43254 100644
--- a/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py
+++ b/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QImage'''
diff --git a/sources/pyside6/tests/QtGui/pyside_reload_test.py b/sources/pyside6/tests/QtGui/pyside_reload_test.py
index 1ac65f709..1045dd5be 100644
--- a/sources/pyside6/tests/QtGui/pyside_reload_test.py
+++ b/sources/pyside6/tests/QtGui/pyside_reload_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import importlib
import importlib.util
diff --git a/sources/pyside6/tests/QtGui/qbrush_test.py b/sources/pyside6/tests/QtGui/qbrush_test.py
index 69262328b..997ffc152 100644
--- a/sources/pyside6/tests/QtGui/qbrush_test.py
+++ b/sources/pyside6/tests/QtGui/qbrush_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QBrush'''
diff --git a/sources/pyside6/tests/QtGui/qcolor_reduce_test.py b/sources/pyside6/tests/QtGui/qcolor_reduce_test.py
index 609951be6..a99ad6458 100644
--- a/sources/pyside6/tests/QtGui/qcolor_reduce_test.py
+++ b/sources/pyside6/tests/QtGui/qcolor_reduce_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import pickle
diff --git a/sources/pyside6/tests/QtGui/qcolor_test.py b/sources/pyside6/tests/QtGui/qcolor_test.py
index bbd558f10..d98fcc9b4 100644
--- a/sources/pyside6/tests/QtGui/qcolor_test.py
+++ b/sources/pyside6/tests/QtGui/qcolor_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import colorsys
import gc
diff --git a/sources/pyside6/tests/QtGui/qcursor_test.py b/sources/pyside6/tests/QtGui/qcursor_test.py
index 1494fe370..80964efb8 100644
--- a/sources/pyside6/tests/QtGui/qcursor_test.py
+++ b/sources/pyside6/tests/QtGui/qcursor_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test for Bug 630 - Fails to resolve overload for QCursor(QBitmap, QBitmap, int, int)
http://bugs.openbossa.org/show_bug.cgi?id=630
diff --git a/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py b/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py
index f2c86abf7..8de7160e9 100644
--- a/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py
+++ b/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qdesktopservices_test.py b/sources/pyside6/tests/QtGui/qdesktopservices_test.py
index 8d578152d..668a16a80 100644
--- a/sources/pyside6/tests/QtGui/qdesktopservices_test.py
+++ b/sources/pyside6/tests/QtGui/qdesktopservices_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QDesktopServices'''
diff --git a/sources/pyside6/tests/QtGui/qfont_test.py b/sources/pyside6/tests/QtGui/qfont_test.py
index f81d47ec6..1971cc555 100644
--- a/sources/pyside6/tests/QtGui/qfont_test.py
+++ b/sources/pyside6/tests/QtGui/qfont_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qfontmetrics_test.py b/sources/pyside6/tests/QtGui/qfontmetrics_test.py
index 98c4c8f96..257a3dae3 100644
--- a/sources/pyside6/tests/QtGui/qfontmetrics_test.py
+++ b/sources/pyside6/tests/QtGui/qfontmetrics_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for inject codes and modifications on QFontMetrics
and QFontMetricsF'''
diff --git a/sources/pyside6/tests/QtGui/qguiapplication_test.py b/sources/pyside6/tests/QtGui/qguiapplication_test.py
index a3d0942aa..4112cd695 100644
--- a/sources/pyside6/tests/QtGui/qguiapplication_test.py
+++ b/sources/pyside6/tests/QtGui/qguiapplication_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qicon_test.py b/sources/pyside6/tests/QtGui/qicon_test.py
index 18ef3d815..ac83ee297 100644
--- a/sources/pyside6/tests/QtGui/qicon_test.py
+++ b/sources/pyside6/tests/QtGui/qicon_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qimage_test.py b/sources/pyside6/tests/QtGui/qimage_test.py
index 5912bf318..c87cfcf4b 100644
--- a/sources/pyside6/tests/QtGui/qimage_test.py
+++ b/sources/pyside6/tests/QtGui/qimage_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QImage'''
diff --git a/sources/pyside6/tests/QtGui/qimage_win_test.py b/sources/pyside6/tests/QtGui/qimage_win_test.py
index 2d9cb96f1..f8ceb4aa9 100644
--- a/sources/pyside6/tests/QtGui/qimage_win_test.py
+++ b/sources/pyside6/tests/QtGui/qimage_win_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QImage/Windows'''
diff --git a/sources/pyside6/tests/QtGui/qitemselection_test.py b/sources/pyside6/tests/QtGui/qitemselection_test.py
index 179bff745..26fd76ad8 100644
--- a/sources/pyside6/tests/QtGui/qitemselection_test.py
+++ b/sources/pyside6/tests/QtGui/qitemselection_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qkeysequence_test.py b/sources/pyside6/tests/QtGui/qkeysequence_test.py
index 3d72fb50a..a6f3188d4 100644
--- a/sources/pyside6/tests/QtGui/qkeysequence_test.py
+++ b/sources/pyside6/tests/QtGui/qkeysequence_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qpainter_test.py b/sources/pyside6/tests/QtGui/qpainter_test.py
index 103b91ad6..e03bcfa63 100644
--- a/sources/pyside6/tests/QtGui/qpainter_test.py
+++ b/sources/pyside6/tests/QtGui/qpainter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtGui/qpdfwriter_test.py b/sources/pyside6/tests/QtGui/qpdfwriter_test.py
index 2dca2aca2..1379f8e80 100644
--- a/sources/pyside6/tests/QtGui/qpdfwriter_test.py
+++ b/sources/pyside6/tests/QtGui/qpdfwriter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qpen_test.py b/sources/pyside6/tests/QtGui/qpen_test.py
index 7e8604606..2f4d48e16 100644
--- a/sources/pyside6/tests/QtGui/qpen_test.py
+++ b/sources/pyside6/tests/QtGui/qpen_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qpixelformat_test.py b/sources/pyside6/tests/QtGui/qpixelformat_test.py
index 869d15952..32d34a577 100644
--- a/sources/pyside6/tests/QtGui/qpixelformat_test.py
+++ b/sources/pyside6/tests/QtGui/qpixelformat_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for QPixelFormat'''
diff --git a/sources/pyside6/tests/QtGui/qpixmap_constructor.py b/sources/pyside6/tests/QtGui/qpixmap_constructor.py
index dd658af52..e78774eec 100644
--- a/sources/pyside6/tests/QtGui/qpixmap_constructor.py
+++ b/sources/pyside6/tests/QtGui/qpixmap_constructor.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qpixmap_test.py b/sources/pyside6/tests/QtGui/qpixmap_test.py
index b80ae2ad5..b83831ba9 100644
--- a/sources/pyside6/tests/QtGui/qpixmap_test.py
+++ b/sources/pyside6/tests/QtGui/qpixmap_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qpixmapcache_test.py b/sources/pyside6/tests/QtGui/qpixmapcache_test.py
index 2ecb439d3..b9328bc05 100644
--- a/sources/pyside6/tests/QtGui/qpixmapcache_test.py
+++ b/sources/pyside6/tests/QtGui/qpixmapcache_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qpolygonf_test.py b/sources/pyside6/tests/QtGui/qpolygonf_test.py
index 8a283fddc..ea5a73db8 100644
--- a/sources/pyside6/tests/QtGui/qpolygonf_test.py
+++ b/sources/pyside6/tests/QtGui/qpolygonf_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qradialgradient_test.py b/sources/pyside6/tests/QtGui/qradialgradient_test.py
index ebab42b15..5c48cf3eb 100644
--- a/sources/pyside6/tests/QtGui/qradialgradient_test.py
+++ b/sources/pyside6/tests/QtGui/qradialgradient_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qrasterwindow_test.py b/sources/pyside6/tests/QtGui/qrasterwindow_test.py
index 4920902d5..038ce8836 100644
--- a/sources/pyside6/tests/QtGui/qrasterwindow_test.py
+++ b/sources/pyside6/tests/QtGui/qrasterwindow_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for QBackingStore, QRasterWindow and QStaticText'''
diff --git a/sources/pyside6/tests/QtGui/qregion_test.py b/sources/pyside6/tests/QtGui/qregion_test.py
index df14fc3e0..97410f925 100644
--- a/sources/pyside6/tests/QtGui/qregion_test.py
+++ b/sources/pyside6/tests/QtGui/qregion_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qshortcut_test.py b/sources/pyside6/tests/QtGui/qshortcut_test.py
index f2650589a..91bf1cd18 100644
--- a/sources/pyside6/tests/QtGui/qshortcut_test.py
+++ b/sources/pyside6/tests/QtGui/qshortcut_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test the QShortcut constructor'''
diff --git a/sources/pyside6/tests/QtGui/qstandarditemmodel_test.py b/sources/pyside6/tests/QtGui/qstandarditemmodel_test.py
index 55aca9113..05cf5db10 100644
--- a/sources/pyside6/tests/QtGui/qstandarditemmodel_test.py
+++ b/sources/pyside6/tests/QtGui/qstandarditemmodel_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtGui/qstring_qkeysequence_test.py b/sources/pyside6/tests/QtGui/qstring_qkeysequence_test.py
index f68374263..f5410b367 100644
--- a/sources/pyside6/tests/QtGui/qstring_qkeysequence_test.py
+++ b/sources/pyside6/tests/QtGui/qstring_qkeysequence_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests conversions of QString to and from QKeySequence.'''
diff --git a/sources/pyside6/tests/QtGui/qstylehints_test.py b/sources/pyside6/tests/QtGui/qstylehints_test.py
index d2b21d30d..213bdf8b1 100644
--- a/sources/pyside6/tests/QtGui/qstylehints_test.py
+++ b/sources/pyside6/tests/QtGui/qstylehints_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for QStyleHints'''
diff --git a/sources/pyside6/tests/QtGui/qtextdocument_functions.py b/sources/pyside6/tests/QtGui/qtextdocument_functions.py
index 2ac72df56..0350c93ac 100644
--- a/sources/pyside6/tests/QtGui/qtextdocument_functions.py
+++ b/sources/pyside6/tests/QtGui/qtextdocument_functions.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py b/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py
index b74c6704f..e96c14a22 100644
--- a/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py
+++ b/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py b/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py
index 4f72b98e7..b8401d960 100644
--- a/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py
+++ b/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qtextline_test.py b/sources/pyside6/tests/QtGui/qtextline_test.py
index c34a4c98a..7b8032e9b 100644
--- a/sources/pyside6/tests/QtGui/qtextline_test.py
+++ b/sources/pyside6/tests/QtGui/qtextline_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/qtransform_test.py b/sources/pyside6/tests/QtGui/qtransform_test.py
index dc51a74e6..0bc28c330 100644
--- a/sources/pyside6/tests/QtGui/qtransform_test.py
+++ b/sources/pyside6/tests/QtGui/qtransform_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/repr_test.py b/sources/pyside6/tests/QtGui/repr_test.py
index 2858e7175..5bf8ade37 100644
--- a/sources/pyside6/tests/QtGui/repr_test.py
+++ b/sources/pyside6/tests/QtGui/repr_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py b/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py
index 6e9a661ce..232f90c92 100644
--- a/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py
+++ b/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtGui/xpm_data.py b/sources/pyside6/tests/QtGui/xpm_data.py
index 3603d8190..d5502d170 100644
--- a/sources/pyside6/tests/QtGui/xpm_data.py
+++ b/sources/pyside6/tests/QtGui/xpm_data.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test data for QImage'''
diff --git a/sources/pyside6/tests/QtHelp/help_test.py b/sources/pyside6/tests/QtHelp/help_test.py
index 4ded7763c..9e5c879da 100644
--- a/sources/pyside6/tests/QtHelp/help_test.py
+++ b/sources/pyside6/tests/QtHelp/help_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtHelp/helpsearchengine_test.py b/sources/pyside6/tests/QtHelp/helpsearchengine_test.py
index b25e643f6..fed84febf 100644
--- a/sources/pyside6/tests/QtHelp/helpsearchengine_test.py
+++ b/sources/pyside6/tests/QtHelp/helpsearchengine_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtLocation/location.py b/sources/pyside6/tests/QtLocation/location.py
index 8fbd55f02..d2297af63 100644
--- a/sources/pyside6/tests/QtLocation/location.py
+++ b/sources/pyside6/tests/QtLocation/location.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for Location'''
diff --git a/sources/pyside6/tests/QtMultimedia/audio_test.py b/sources/pyside6/tests/QtMultimedia/audio_test.py
index af359e525..4469e9ab2 100644
--- a/sources/pyside6/tests/QtMultimedia/audio_test.py
+++ b/sources/pyside6/tests/QtMultimedia/audio_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QHttp'''
diff --git a/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py b/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py
index 968558a13..a25ab3e3f 100644
--- a/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py
+++ b/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtMultimediaWidgets'''
diff --git a/sources/pyside6/tests/QtNetwork/accessManager_test.py b/sources/pyside6/tests/QtNetwork/accessManager_test.py
index 87711b278..3aab2fee5 100644
--- a/sources/pyside6/tests/QtNetwork/accessManager_test.py
+++ b/sources/pyside6/tests/QtNetwork/accessManager_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QHttp'''
diff --git a/sources/pyside6/tests/QtNetwork/bug_1084.py b/sources/pyside6/tests/QtNetwork/bug_1084.py
index 515220c80..892bf0324 100644
--- a/sources/pyside6/tests/QtNetwork/bug_1084.py
+++ b/sources/pyside6/tests/QtNetwork/bug_1084.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1084 '''
diff --git a/sources/pyside6/tests/QtNetwork/bug_446.py b/sources/pyside6/tests/QtNetwork/bug_446.py
index f28ddb369..861cff77b 100644
--- a/sources/pyside6/tests/QtNetwork/bug_446.py
+++ b/sources/pyside6/tests/QtNetwork/bug_446.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtNetwork/dnslookup_test.py b/sources/pyside6/tests/QtNetwork/dnslookup_test.py
index c50a6b5d4..d05f614fd 100644
--- a/sources/pyside6/tests/QtNetwork/dnslookup_test.py
+++ b/sources/pyside6/tests/QtNetwork/dnslookup_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QDnsLookup'''
diff --git a/sources/pyside6/tests/QtNetwork/qhostinfo_test.py b/sources/pyside6/tests/QtNetwork/qhostinfo_test.py
index 8d8d2cae4..19aac4f30 100644
--- a/sources/pyside6/tests/QtNetwork/qhostinfo_test.py
+++ b/sources/pyside6/tests/QtNetwork/qhostinfo_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for QHostInfo.'''
diff --git a/sources/pyside6/tests/QtNetwork/qipv6address_test.py b/sources/pyside6/tests/QtNetwork/qipv6address_test.py
index 67b103d3c..6cd3f1993 100644
--- a/sources/pyside6/tests/QtNetwork/qipv6address_test.py
+++ b/sources/pyside6/tests/QtNetwork/qipv6address_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QIPv6Address'''
diff --git a/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py b/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py
index db7a90da9..dfeaea86a 100644
--- a/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py
+++ b/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QPasswordDigestor'''
diff --git a/sources/pyside6/tests/QtNetwork/tcpserver_test.py b/sources/pyside6/tests/QtNetwork/tcpserver_test.py
index 845afdfae..7d1b127d2 100644
--- a/sources/pyside6/tests/QtNetwork/tcpserver_test.py
+++ b/sources/pyside6/tests/QtNetwork/tcpserver_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QTCPServer'''
diff --git a/sources/pyside6/tests/QtNetwork/udpsocket_test.py b/sources/pyside6/tests/QtNetwork/udpsocket_test.py
index 950849801..fc92c6f2c 100644
--- a/sources/pyside6/tests/QtNetwork/udpsocket_test.py
+++ b/sources/pyside6/tests/QtNetwork/udpsocket_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QUdpSocket'''
diff --git a/sources/pyside6/tests/QtNfc/test_nfc.py b/sources/pyside6/tests/QtNfc/test_nfc.py
index a73c52153..2a2053a97 100644
--- a/sources/pyside6/tests/QtNfc/test_nfc.py
+++ b/sources/pyside6/tests/QtNfc/test_nfc.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtNfc'''
diff --git a/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py b/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py
index e4ff6feb4..a1433ca4c 100644
--- a/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py
+++ b/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit tests for QOpenGLBuffer'''
diff --git a/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py b/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py
index 3e6bc4c9d..88ae85a2e 100644
--- a/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py
+++ b/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for QOpenGLContext, QOpenGLTexture, QOpenGLWindow and related classes'''
diff --git a/sources/pyside6/tests/QtPositioning/positioning.py b/sources/pyside6/tests/QtPositioning/positioning.py
index d8e670247..4538895eb 100644
--- a/sources/pyside6/tests/QtPositioning/positioning.py
+++ b/sources/pyside6/tests/QtPositioning/positioning.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for Positioning'''
diff --git a/sources/pyside6/tests/QtPrintSupport/bug_500.py b/sources/pyside6/tests/QtPrintSupport/bug_500.py
index 1ba5b35e2..aaeb249fa 100644
--- a/sources/pyside6/tests/QtPrintSupport/bug_500.py
+++ b/sources/pyside6/tests/QtPrintSupport/bug_500.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py b/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
index 97b3505da..cac218b26 100644
--- a/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
+++ b/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_1029.py b/sources/pyside6/tests/QtQml/bug_1029.py
index 69ca5c18d..21896a899 100644
--- a/sources/pyside6/tests/QtQml/bug_1029.py
+++ b/sources/pyside6/tests/QtQml/bug_1029.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtQml/bug_451.py b/sources/pyside6/tests/QtQml/bug_451.py
index d81a99d94..81537b4a5 100644
--- a/sources/pyside6/tests/QtQml/bug_451.py
+++ b/sources/pyside6/tests/QtQml/bug_451.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''
Test bug 451: http://bugs.openbossa.org/show_bug.cgi?id=451
diff --git a/sources/pyside6/tests/QtQml/bug_456.py b/sources/pyside6/tests/QtQml/bug_456.py
index 7743ee3fd..02ab16ebf 100644
--- a/sources/pyside6/tests/QtQml/bug_456.py
+++ b/sources/pyside6/tests/QtQml/bug_456.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_557.py b/sources/pyside6/tests/QtQml/bug_557.py
index eb43973f6..e1e2b1cb4 100644
--- a/sources/pyside6/tests/QtQml/bug_557.py
+++ b/sources/pyside6/tests/QtQml/bug_557.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_726.py b/sources/pyside6/tests/QtQml/bug_726.py
index 56c1e70f1..b0a2fb4ed 100644
--- a/sources/pyside6/tests/QtQml/bug_726.py
+++ b/sources/pyside6/tests/QtQml/bug_726.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_814.py b/sources/pyside6/tests/QtQml/bug_814.py
index 0e7858b6c..2a3f5aa6f 100644
--- a/sources/pyside6/tests/QtQml/bug_814.py
+++ b/sources/pyside6/tests/QtQml/bug_814.py
@@ -2,6 +2,7 @@
# Copyright (C) 2022 The Qt Company Ltd.
# Copyright (C) 2011 Thomas Perl <m@thp.io>
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# Test case for PySide bug 814
# http://bugs.pyside.org/show_bug.cgi?id=814
diff --git a/sources/pyside6/tests/QtQml/bug_825.py b/sources/pyside6/tests/QtQml/bug_825.py
index a8bd304ec..66e278796 100644
--- a/sources/pyside6/tests/QtQml/bug_825.py
+++ b/sources/pyside6/tests/QtQml/bug_825.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
This is the corrected version for Python 3.
diff --git a/sources/pyside6/tests/QtQml/bug_825_old.py b/sources/pyside6/tests/QtQml/bug_825_old.py
index c44fa75f4..c87651d72 100644
--- a/sources/pyside6/tests/QtQml/bug_825_old.py
+++ b/sources/pyside6/tests/QtQml/bug_825_old.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
This is the now incorrect old version from Python 2.
diff --git a/sources/pyside6/tests/QtQml/bug_847.py b/sources/pyside6/tests/QtQml/bug_847.py
index 947eb494e..55e3d1d9b 100644
--- a/sources/pyside6/tests/QtQml/bug_847.py
+++ b/sources/pyside6/tests/QtQml/bug_847.py
@@ -2,6 +2,7 @@
# Copyright (C) 2022 The Qt Company Ltd.
# Copyright (C) 2011 Thomas Perl <m@thp.io>
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# Testcase for PySide bug 847
# Released under the same terms as PySide itself
diff --git a/sources/pyside6/tests/QtQml/bug_915.py b/sources/pyside6/tests/QtQml/bug_915.py
index 3095eba2a..1962db120 100644
--- a/sources/pyside6/tests/QtQml/bug_915.py
+++ b/sources/pyside6/tests/QtQml/bug_915.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_926.py b/sources/pyside6/tests/QtQml/bug_926.py
index 085e9a68f..f15860c46 100644
--- a/sources/pyside6/tests/QtQml/bug_926.py
+++ b/sources/pyside6/tests/QtQml/bug_926.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
import os
diff --git a/sources/pyside6/tests/QtQml/bug_951.py b/sources/pyside6/tests/QtQml/bug_951.py
index 8a512d06f..5cb4bb538 100644
--- a/sources/pyside6/tests/QtQml/bug_951.py
+++ b/sources/pyside6/tests/QtQml/bug_951.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_995.py b/sources/pyside6/tests/QtQml/bug_995.py
index 868c584e2..490f0ccc1 100644
--- a/sources/pyside6/tests/QtQml/bug_995.py
+++ b/sources/pyside6/tests/QtQml/bug_995.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/bug_997.py b/sources/pyside6/tests/QtQml/bug_997.py
index 501c221c3..af489036d 100644
--- a/sources/pyside6/tests/QtQml/bug_997.py
+++ b/sources/pyside6/tests/QtQml/bug_997.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/connect_python_qml.py b/sources/pyside6/tests/QtQml/connect_python_qml.py
index 2e60aec4f..8b2a51127 100644
--- a/sources/pyside6/tests/QtQml/connect_python_qml.py
+++ b/sources/pyside6/tests/QtQml/connect_python_qml.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''
Test case for bug #442
diff --git a/sources/pyside6/tests/QtQml/groupedproperty.py b/sources/pyside6/tests/QtQml/groupedproperty.py
index 4554d4b31..d3ddb625c 100644
--- a/sources/pyside6/tests/QtQml/groupedproperty.py
+++ b/sources/pyside6/tests/QtQml/groupedproperty.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""Test grouped properties (PYSIDE-1836)."""
diff --git a/sources/pyside6/tests/QtQml/javascript_exceptions.py b/sources/pyside6/tests/QtQml/javascript_exceptions.py
index e2b530aaf..290a0e957 100644
--- a/sources/pyside6/tests/QtQml/javascript_exceptions.py
+++ b/sources/pyside6/tests/QtQml/javascript_exceptions.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/listproperty.py b/sources/pyside6/tests/QtQml/listproperty.py
index 884600d29..0ffa8fd21 100644
--- a/sources/pyside6/tests/QtQml/listproperty.py
+++ b/sources/pyside6/tests/QtQml/listproperty.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/qmlregistertype_test.py b/sources/pyside6/tests/QtQml/qmlregistertype_test.py
index 0042d6fd3..587a3b9b0 100644
--- a/sources/pyside6/tests/QtQml/qmlregistertype_test.py
+++ b/sources/pyside6/tests/QtQml/qmlregistertype_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/qqmlapplicationengine_test.py b/sources/pyside6/tests/QtQml/qqmlapplicationengine_test.py
index ea54e9e25..7a44d95bf 100644
--- a/sources/pyside6/tests/QtQml/qqmlapplicationengine_test.py
+++ b/sources/pyside6/tests/QtQml/qqmlapplicationengine_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for QQmlApplicationEngine'''
diff --git a/sources/pyside6/tests/QtQml/qqmlcomponent_test.py b/sources/pyside6/tests/QtQml/qqmlcomponent_test.py
index 5521c64fa..c507603a6 100644
--- a/sources/pyside6/tests/QtQml/qqmlcomponent_test.py
+++ b/sources/pyside6/tests/QtQml/qqmlcomponent_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py b/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py
index 12a73e398..e5b6418a2 100644
--- a/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py
+++ b/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtQml/qqmlnetwork_test.py b/sources/pyside6/tests/QtQml/qqmlnetwork_test.py
index abdb4529e..51e97567e 100644
--- a/sources/pyside6/tests/QtQml/qqmlnetwork_test.py
+++ b/sources/pyside6/tests/QtQml/qqmlnetwork_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QQmlNetwork'''
diff --git a/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py b/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py
index 25341b0b2..f53b4f5a3 100644
--- a/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py
+++ b/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/qquickview_test.py b/sources/pyside6/tests/QtQml/qquickview_test.py
index 226509669..9e4b45c5c 100644
--- a/sources/pyside6/tests/QtQml/qquickview_test.py
+++ b/sources/pyside6/tests/QtQml/qquickview_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QQuickView'''
diff --git a/sources/pyside6/tests/QtQml/registerattached.py b/sources/pyside6/tests/QtQml/registerattached.py
index dd300dc89..f6784f516 100644
--- a/sources/pyside6/tests/QtQml/registerattached.py
+++ b/sources/pyside6/tests/QtQml/registerattached.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registerextended.py b/sources/pyside6/tests/QtQml/registerextended.py
index b87b5aaaf..ee8cb45f2 100644
--- a/sources/pyside6/tests/QtQml/registerextended.py
+++ b/sources/pyside6/tests/QtQml/registerextended.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registerforeign.py b/sources/pyside6/tests/QtQml/registerforeign.py
index d9a982d95..5b280bf2c 100644
--- a/sources/pyside6/tests/QtQml/registerforeign.py
+++ b/sources/pyside6/tests/QtQml/registerforeign.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registerparserstatus.py b/sources/pyside6/tests/QtQml/registerparserstatus.py
index bbcc14635..9c2b93ca9 100644
--- a/sources/pyside6/tests/QtQml/registerparserstatus.py
+++ b/sources/pyside6/tests/QtQml/registerparserstatus.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registerqmlfile.py b/sources/pyside6/tests/QtQml/registerqmlfile.py
index 335652e5d..39e5ab75a 100644
--- a/sources/pyside6/tests/QtQml/registerqmlfile.py
+++ b/sources/pyside6/tests/QtQml/registerqmlfile.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registersingletontype.py b/sources/pyside6/tests/QtQml/registersingletontype.py
index 6beca1131..7136a751d 100644
--- a/sources/pyside6/tests/QtQml/registersingletontype.py
+++ b/sources/pyside6/tests/QtQml/registersingletontype.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registertype.py b/sources/pyside6/tests/QtQml/registertype.py
index 6c9874f32..4d59386f9 100644
--- a/sources/pyside6/tests/QtQml/registertype.py
+++ b/sources/pyside6/tests/QtQml/registertype.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/registeruncreatabletype.py b/sources/pyside6/tests/QtQml/registeruncreatabletype.py
index 3a4df69f6..86fd4801b 100644
--- a/sources/pyside6/tests/QtQml/registeruncreatabletype.py
+++ b/sources/pyside6/tests/QtQml/registeruncreatabletype.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/signal_arguments.py b/sources/pyside6/tests/QtQml/signal_arguments.py
index f5b0f8bd3..485ec2b4f 100644
--- a/sources/pyside6/tests/QtQml/signal_arguments.py
+++ b/sources/pyside6/tests/QtQml/signal_arguments.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtQml/signal_types.py b/sources/pyside6/tests/QtQml/signal_types.py
index 240c0fd6e..4ecc19da1 100644
--- a/sources/pyside6/tests/QtQml/signal_types.py
+++ b/sources/pyside6/tests/QtQml/signal_types.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import json
import os
diff --git a/sources/pyside6/tests/QtQuickTest/quicktestmainwithsetup/tst_quicktestmainwithsetup.py b/sources/pyside6/tests/QtQuickTest/quicktestmainwithsetup/tst_quicktestmainwithsetup.py
index 33b2db08f..2e45960cd 100644
--- a/sources/pyside6/tests/QtQuickTest/quicktestmainwithsetup/tst_quicktestmainwithsetup.py
+++ b/sources/pyside6/tests/QtQuickTest/quicktestmainwithsetup/tst_quicktestmainwithsetup.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtScxml/test_dynamic.py b/sources/pyside6/tests/QtScxml/test_dynamic.py
index 212d6f7c1..9ba2fa704 100644
--- a/sources/pyside6/tests/QtScxml/test_dynamic.py
+++ b/sources/pyside6/tests/QtScxml/test_dynamic.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtSensors/sensors.py b/sources/pyside6/tests/QtSensors/sensors.py
index 84bd1a92f..b92b9173e 100644
--- a/sources/pyside6/tests/QtSensors/sensors.py
+++ b/sources/pyside6/tests/QtSensors/sensors.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QSensor'''
diff --git a/sources/pyside6/tests/QtSerialPort/serial.py b/sources/pyside6/tests/QtSerialPort/serial.py
index f1e54f2ac..6107b2a92 100644
--- a/sources/pyside6/tests/QtSerialPort/serial.py
+++ b/sources/pyside6/tests/QtSerialPort/serial.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QSerialPort'''
diff --git a/sources/pyside6/tests/QtSql/bug_1013.py b/sources/pyside6/tests/QtSql/bug_1013.py
index b47aecb77..40f74fac9 100644
--- a/sources/pyside6/tests/QtSql/bug_1013.py
+++ b/sources/pyside6/tests/QtSql/bug_1013.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py b/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py
index a3e70a3a7..3a20833c3 100644
--- a/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py
+++ b/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QtSql database creation, destruction and queries'''
diff --git a/sources/pyside6/tests/QtSql/qvarianttype_test.py b/sources/pyside6/tests/QtSql/qvarianttype_test.py
index 3999be20e..7d4646ab1 100644
--- a/sources/pyside6/tests/QtSql/qvarianttype_test.py
+++ b/sources/pyside6/tests/QtSql/qvarianttype_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QVariant::Type converter'''
import os
diff --git a/sources/pyside6/tests/QtStateMachine/bug_1031.py b/sources/pyside6/tests/QtStateMachine/bug_1031.py
index 7fe5fc1e6..8552d5e8e 100644
--- a/sources/pyside6/tests/QtStateMachine/bug_1031.py
+++ b/sources/pyside6/tests/QtStateMachine/bug_1031.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py b/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py
index 9c52bfd59..09d3a9d3d 100644
--- a/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py
+++ b/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtStateMachine/qstate_test.py b/sources/pyside6/tests/QtStateMachine/qstate_test.py
index 4a33141c8..cd0be1620 100644
--- a/sources/pyside6/tests/QtStateMachine/qstate_test.py
+++ b/sources/pyside6/tests/QtStateMachine/qstate_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py b/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py
index 5e17b3a1f..43e9311cd 100644
--- a/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py
+++ b/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py b/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py
index 48f397282..273a31df2 100644
--- a/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py
+++ b/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtSvg/qsvggenerator_test.py b/sources/pyside6/tests/QtSvg/qsvggenerator_test.py
index a06cefb37..9c926d367 100644
--- a/sources/pyside6/tests/QtSvg/qsvggenerator_test.py
+++ b/sources/pyside6/tests/QtSvg/qsvggenerator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py
index b4422001f..9e850d5d2 100644
--- a/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py
+++ b/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py b/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py
index 552d6f49a..e43008ca3 100644
--- a/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py
+++ b/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtTest/click_test.py b/sources/pyside6/tests/QtTest/click_test.py
index da8b2dcf6..311ffd4e6 100644
--- a/sources/pyside6/tests/QtTest/click_test.py
+++ b/sources/pyside6/tests/QtTest/click_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''QtTest mouse click functionalities'''
diff --git a/sources/pyside6/tests/QtTest/eventfilter_test.py b/sources/pyside6/tests/QtTest/eventfilter_test.py
index c57974c0d..07b8c4eb0 100644
--- a/sources/pyside6/tests/QtTest/eventfilter_test.py
+++ b/sources/pyside6/tests/QtTest/eventfilter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for QKeyEvent'''
diff --git a/sources/pyside6/tests/QtTest/qsignalspy_test.py b/sources/pyside6/tests/QtTest/qsignalspy_test.py
index 06f05b4b8..b4bc0397f 100644
--- a/sources/pyside6/tests/QtTest/qsignalspy_test.py
+++ b/sources/pyside6/tests/QtTest/qsignalspy_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''QtTest QSignalSpy'''
diff --git a/sources/pyside6/tests/QtTest/qvalidator_test.py b/sources/pyside6/tests/QtTest/qvalidator_test.py
index 2382b8605..081b77b55 100644
--- a/sources/pyside6/tests/QtTest/qvalidator_test.py
+++ b/sources/pyside6/tests/QtTest/qvalidator_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtTest/touchevent_test.py b/sources/pyside6/tests/QtTest/touchevent_test.py
index bc07c25ed..2e72ec00b 100644
--- a/sources/pyside6/tests/QtTest/touchevent_test.py
+++ b/sources/pyside6/tests/QtTest/touchevent_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py b/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py
index 6ff66c047..544dba269 100644
--- a/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py
+++ b/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QTextToSpeech methods'''
diff --git a/sources/pyside6/tests/QtUiTools/bug_1060.py b/sources/pyside6/tests/QtUiTools/bug_1060.py
index 52624a2a9..64522946e 100644
--- a/sources/pyside6/tests/QtUiTools/bug_1060.py
+++ b/sources/pyside6/tests/QtUiTools/bug_1060.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1060 '''
diff --git a/sources/pyside6/tests/QtUiTools/bug_360.py b/sources/pyside6/tests/QtUiTools/bug_360.py
index 8ca764eae..4ad1b926a 100644
--- a/sources/pyside6/tests/QtUiTools/bug_360.py
+++ b/sources/pyside6/tests/QtUiTools/bug_360.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_376.py b/sources/pyside6/tests/QtUiTools/bug_376.py
index eefc1fe05..4f0e7f427 100644
--- a/sources/pyside6/tests/QtUiTools/bug_376.py
+++ b/sources/pyside6/tests/QtUiTools/bug_376.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_392.py b/sources/pyside6/tests/QtUiTools/bug_392.py
index 4d69fdbec..2d70d1c6b 100644
--- a/sources/pyside6/tests/QtUiTools/bug_392.py
+++ b/sources/pyside6/tests/QtUiTools/bug_392.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_426.py b/sources/pyside6/tests/QtUiTools/bug_426.py
index 3a568e4e2..41c22f99e 100644
--- a/sources/pyside6/tests/QtUiTools/bug_426.py
+++ b/sources/pyside6/tests/QtUiTools/bug_426.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_552.py b/sources/pyside6/tests/QtUiTools/bug_552.py
index 06a6b72a4..abcd122d5 100644
--- a/sources/pyside6/tests/QtUiTools/bug_552.py
+++ b/sources/pyside6/tests/QtUiTools/bug_552.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_797.py b/sources/pyside6/tests/QtUiTools/bug_797.py
index 3dae7afb7..22dd55387 100644
--- a/sources/pyside6/tests/QtUiTools/bug_797.py
+++ b/sources/pyside6/tests/QtUiTools/bug_797.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_909.py b/sources/pyside6/tests/QtUiTools/bug_909.py
index cd4d50a0b..e1a1df8f6 100644
--- a/sources/pyside6/tests/QtUiTools/bug_909.py
+++ b/sources/pyside6/tests/QtUiTools/bug_909.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_913.py b/sources/pyside6/tests/QtUiTools/bug_913.py
index 85df29d11..47cbfd706 100644
--- a/sources/pyside6/tests/QtUiTools/bug_913.py
+++ b/sources/pyside6/tests/QtUiTools/bug_913.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_958.py b/sources/pyside6/tests/QtUiTools/bug_958.py
index 2f8dfab62..3f0ba8d99 100644
--- a/sources/pyside6/tests/QtUiTools/bug_958.py
+++ b/sources/pyside6/tests/QtUiTools/bug_958.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/bug_965.py b/sources/pyside6/tests/QtUiTools/bug_965.py
index 2308cbeed..ee11f1d2c 100644
--- a/sources/pyside6/tests/QtUiTools/bug_965.py
+++ b/sources/pyside6/tests/QtUiTools/bug_965.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/loadUiType_test.py b/sources/pyside6/tests/QtUiTools/loadUiType_test.py
index b0842318c..34233d362 100644
--- a/sources/pyside6/tests/QtUiTools/loadUiType_test.py
+++ b/sources/pyside6/tests/QtUiTools/loadUiType_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/ui_test.py b/sources/pyside6/tests/QtUiTools/ui_test.py
index 4e2fa808b..f2fbea1a1 100644
--- a/sources/pyside6/tests/QtUiTools/ui_test.py
+++ b/sources/pyside6/tests/QtUiTools/ui_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtUiTools/uiloader_test.py b/sources/pyside6/tests/QtUiTools/uiloader_test.py
index 19e26912e..c69364189 100644
--- a/sources/pyside6/tests/QtUiTools/uiloader_test.py
+++ b/sources/pyside6/tests/QtUiTools/uiloader_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWebEngineCore/qwebenginecookiestore_test.py b/sources/pyside6/tests/QtWebEngineCore/qwebenginecookiestore_test.py
index a30c72a8e..beadda0a5 100644
--- a/sources/pyside6/tests/QtWebEngineCore/qwebenginecookiestore_test.py
+++ b/sources/pyside6/tests/QtWebEngineCore/qwebenginecookiestore_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
import unittest
diff --git a/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py b/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py
index 10c8e88d7..4d1cb6b0b 100644
--- a/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py
+++ b/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py b/sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
index 3739e956a..13a970deb 100644
--- a/sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
+++ b/sources/pyside6/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from functools import partial
import os
diff --git a/sources/pyside6/tests/QtWidgets/action_clear.py b/sources/pyside6/tests/QtWidgets/action_clear.py
index 5563a4899..c81871df4 100644
--- a/sources/pyside6/tests/QtWidgets/action_clear.py
+++ b/sources/pyside6/tests/QtWidgets/action_clear.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/add_action_test.py b/sources/pyside6/tests/QtWidgets/add_action_test.py
index 3ca1660a9..5d74356fd 100644
--- a/sources/pyside6/tests/QtWidgets/add_action_test.py
+++ b/sources/pyside6/tests/QtWidgets/add_action_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for QMenuBar.addAction(identifier, callback) calls'''
diff --git a/sources/pyside6/tests/QtWidgets/api2_test.py b/sources/pyside6/tests/QtWidgets/api2_test.py
index e38672016..1df67d002 100644
--- a/sources/pyside6/tests/QtWidgets/api2_test.py
+++ b/sources/pyside6/tests/QtWidgets/api2_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for PySide API2 support'''
diff --git a/sources/pyside6/tests/QtWidgets/application_test.py b/sources/pyside6/tests/QtWidgets/application_test.py
index 1b2477fd7..fecebe0bf 100644
--- a/sources/pyside6/tests/QtWidgets/application_test.py
+++ b/sources/pyside6/tests/QtWidgets/application_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_1002.py b/sources/pyside6/tests/QtWidgets/bug_1002.py
index 98ae66c47..a8f836ce5 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1002.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1002.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/bug_1006.py b/sources/pyside6/tests/QtWidgets/bug_1006.py
index 74bf5e2da..87d73c4ec 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1006.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1006.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/bug_1048.py b/sources/pyside6/tests/QtWidgets/bug_1048.py
index 9d83e2f30..4edad1870 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1048.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1048.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_1077.py b/sources/pyside6/tests/QtWidgets/bug_1077.py
index c9559609f..66226b480 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1077.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1077.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' unit test for BUG #1077 '''
diff --git a/sources/pyside6/tests/QtWidgets/bug_172.py b/sources/pyside6/tests/QtWidgets/bug_172.py
index 2637d6d61..6f2895e47 100644
--- a/sources/pyside6/tests/QtWidgets/bug_172.py
+++ b/sources/pyside6/tests/QtWidgets/bug_172.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_243.py b/sources/pyside6/tests/QtWidgets/bug_243.py
index af189837f..7987be96e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_243.py
+++ b/sources/pyside6/tests/QtWidgets/bug_243.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 243: http://bugs.openbossa.org/show_bug.cgi?id=243'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_307.py b/sources/pyside6/tests/QtWidgets/bug_307.py
index 673d5183d..90a80073e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_307.py
+++ b/sources/pyside6/tests/QtWidgets/bug_307.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import colorsys
import os
diff --git a/sources/pyside6/tests/QtWidgets/bug_338.py b/sources/pyside6/tests/QtWidgets/bug_338.py
index 695b4238a..463c20527 100644
--- a/sources/pyside6/tests/QtWidgets/bug_338.py
+++ b/sources/pyside6/tests/QtWidgets/bug_338.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 338: http://bugs.openbossa.org/show_bug.cgi?id=338'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_389.py b/sources/pyside6/tests/QtWidgets/bug_389.py
index 024908e85..39e0aa5d6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_389.py
+++ b/sources/pyside6/tests/QtWidgets/bug_389.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_400.py b/sources/pyside6/tests/QtWidgets/bug_400.py
index 79dfa49fc..da446fe04 100644
--- a/sources/pyside6/tests/QtWidgets/bug_400.py
+++ b/sources/pyside6/tests/QtWidgets/bug_400.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 400: http://bugs.openbossa.org/show_bug.cgi?id=400'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_429.py b/sources/pyside6/tests/QtWidgets/bug_429.py
index e95c113f3..8b37d9332 100644
--- a/sources/pyside6/tests/QtWidgets/bug_429.py
+++ b/sources/pyside6/tests/QtWidgets/bug_429.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_430.py b/sources/pyside6/tests/QtWidgets/bug_430.py
index 6ef9ec7f4..a0fac6189 100644
--- a/sources/pyside6/tests/QtWidgets/bug_430.py
+++ b/sources/pyside6/tests/QtWidgets/bug_430.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_433.py b/sources/pyside6/tests/QtWidgets/bug_433.py
index c7fbe4b3e..5adcacccc 100644
--- a/sources/pyside6/tests/QtWidgets/bug_433.py
+++ b/sources/pyside6/tests/QtWidgets/bug_433.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_467.py b/sources/pyside6/tests/QtWidgets/bug_467.py
index af383e811..a71a06c8d 100644
--- a/sources/pyside6/tests/QtWidgets/bug_467.py
+++ b/sources/pyside6/tests/QtWidgets/bug_467.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=467'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_480.py b/sources/pyside6/tests/QtWidgets/bug_480.py
index 2fc955561..89976ac50 100644
--- a/sources/pyside6/tests/QtWidgets/bug_480.py
+++ b/sources/pyside6/tests/QtWidgets/bug_480.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_512.py b/sources/pyside6/tests/QtWidgets/bug_512.py
index dab367727..e8cfecd60 100644
--- a/sources/pyside6/tests/QtWidgets/bug_512.py
+++ b/sources/pyside6/tests/QtWidgets/bug_512.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 512: http://bugs.openbossa.org/show_bug.cgi?id=512'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_525.py b/sources/pyside6/tests/QtWidgets/bug_525.py
index 3c49cd377..7775ed1b6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_525.py
+++ b/sources/pyside6/tests/QtWidgets/bug_525.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_546.py b/sources/pyside6/tests/QtWidgets/bug_546.py
index fcec2f6d7..c5e054c3f 100644
--- a/sources/pyside6/tests/QtWidgets/bug_546.py
+++ b/sources/pyside6/tests/QtWidgets/bug_546.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_547.py b/sources/pyside6/tests/QtWidgets/bug_547.py
index dcbe20ee8..d2b393950 100644
--- a/sources/pyside6/tests/QtWidgets/bug_547.py
+++ b/sources/pyside6/tests/QtWidgets/bug_547.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
""" Unittest for bug #547 """
""" http://bugs.openbossa.org/show_bug.cgi?id=547 """
diff --git a/sources/pyside6/tests/QtWidgets/bug_549.py b/sources/pyside6/tests/QtWidgets/bug_549.py
index 8efa6e679..b0cd683f3 100644
--- a/sources/pyside6/tests/QtWidgets/bug_549.py
+++ b/sources/pyside6/tests/QtWidgets/bug_549.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_569.py b/sources/pyside6/tests/QtWidgets/bug_569.py
index 0f95aed02..4da978f6c 100644
--- a/sources/pyside6/tests/QtWidgets/bug_569.py
+++ b/sources/pyside6/tests/QtWidgets/bug_569.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_575.py b/sources/pyside6/tests/QtWidgets/bug_575.py
index f9a927817..d1d529168 100644
--- a/sources/pyside6/tests/QtWidgets/bug_575.py
+++ b/sources/pyside6/tests/QtWidgets/bug_575.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
""" Unittest for bug #575 """
""" http://bugs.openbossa.org/show_bug.cgi?id=575 """
diff --git a/sources/pyside6/tests/QtWidgets/bug_576.py b/sources/pyside6/tests/QtWidgets/bug_576.py
index 4a17e7aa8..7f546df1d 100644
--- a/sources/pyside6/tests/QtWidgets/bug_576.py
+++ b/sources/pyside6/tests/QtWidgets/bug_576.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
""" Unittest for bug #576 """
""" http://bugs.openbossa.org/show_bug.cgi?id=576 """
diff --git a/sources/pyside6/tests/QtWidgets/bug_585.py b/sources/pyside6/tests/QtWidgets/bug_585.py
index e26ca9ce0..0c85a7ff6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_585.py
+++ b/sources/pyside6/tests/QtWidgets/bug_585.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test bug 585: http://bugs.openbossa.org/show_bug.cgi?id=585'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_589.py b/sources/pyside6/tests/QtWidgets/bug_589.py
index a19f544a5..d6259b865 100644
--- a/sources/pyside6/tests/QtWidgets/bug_589.py
+++ b/sources/pyside6/tests/QtWidgets/bug_589.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# trimmed down diagramscene.py to demonstrate crash in sizeHint()
diff --git a/sources/pyside6/tests/QtWidgets/bug_635.py b/sources/pyside6/tests/QtWidgets/bug_635.py
index 66a8c58c6..6c997b276 100644
--- a/sources/pyside6/tests/QtWidgets/bug_635.py
+++ b/sources/pyside6/tests/QtWidgets/bug_635.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 635: http://bugs.openbossa.org/show_bug.cgi?id=635'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_640.py b/sources/pyside6/tests/QtWidgets/bug_640.py
index b2620b541..c3e0ed83a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_640.py
+++ b/sources/pyside6/tests/QtWidgets/bug_640.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_653.py b/sources/pyside6/tests/QtWidgets/bug_653.py
index 1cf8390df..370e9474b 100644
--- a/sources/pyside6/tests/QtWidgets/bug_653.py
+++ b/sources/pyside6/tests/QtWidgets/bug_653.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_662.py b/sources/pyside6/tests/QtWidgets/bug_662.py
index e3a3130d0..36187e9aa 100644
--- a/sources/pyside6/tests/QtWidgets/bug_662.py
+++ b/sources/pyside6/tests/QtWidgets/bug_662.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 662: http://bugs.openbossa.org/show_bug.cgi?id=662'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_667.py b/sources/pyside6/tests/QtWidgets/bug_667.py
index be6700d83..1340dfba4 100644
--- a/sources/pyside6/tests/QtWidgets/bug_667.py
+++ b/sources/pyside6/tests/QtWidgets/bug_667.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_668.py b/sources/pyside6/tests/QtWidgets/bug_668.py
index 0c22436b3..0b2de8f04 100644
--- a/sources/pyside6/tests/QtWidgets/bug_668.py
+++ b/sources/pyside6/tests/QtWidgets/bug_668.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_674.py b/sources/pyside6/tests/QtWidgets/bug_674.py
index 901b29275..3326d39d5 100644
--- a/sources/pyside6/tests/QtWidgets/bug_674.py
+++ b/sources/pyside6/tests/QtWidgets/bug_674.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_675.py b/sources/pyside6/tests/QtWidgets/bug_675.py
index 221df88b0..e94410420 100644
--- a/sources/pyside6/tests/QtWidgets/bug_675.py
+++ b/sources/pyside6/tests/QtWidgets/bug_675.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_688.py b/sources/pyside6/tests/QtWidgets/bug_688.py
index 3180d08bf..20d548f91 100644
--- a/sources/pyside6/tests/QtWidgets/bug_688.py
+++ b/sources/pyside6/tests/QtWidgets/bug_688.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test bug 688: http://bugs.openbossa.org/show_bug.cgi?id=688'''
diff --git a/sources/pyside6/tests/QtWidgets/bug_693.py b/sources/pyside6/tests/QtWidgets/bug_693.py
index 95981e272..23dd752ad 100644
--- a/sources/pyside6/tests/QtWidgets/bug_693.py
+++ b/sources/pyside6/tests/QtWidgets/bug_693.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_696.py b/sources/pyside6/tests/QtWidgets/bug_696.py
index 19e9978a6..8f0201e30 100644
--- a/sources/pyside6/tests/QtWidgets/bug_696.py
+++ b/sources/pyside6/tests/QtWidgets/bug_696.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_711.py b/sources/pyside6/tests/QtWidgets/bug_711.py
index fed330fb9..b6a11196e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_711.py
+++ b/sources/pyside6/tests/QtWidgets/bug_711.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_722.py b/sources/pyside6/tests/QtWidgets/bug_722.py
index dc20e14cf..fa3670ca6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_722.py
+++ b/sources/pyside6/tests/QtWidgets/bug_722.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_728.py b/sources/pyside6/tests/QtWidgets/bug_728.py
index 531adbb25..a2bbd025c 100644
--- a/sources/pyside6/tests/QtWidgets/bug_728.py
+++ b/sources/pyside6/tests/QtWidgets/bug_728.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_736.py b/sources/pyside6/tests/QtWidgets/bug_736.py
index af4bcbda8..2e471b04a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_736.py
+++ b/sources/pyside6/tests/QtWidgets/bug_736.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_750.py b/sources/pyside6/tests/QtWidgets/bug_750.py
index 999f6a3db..ab637e8b3 100644
--- a/sources/pyside6/tests/QtWidgets/bug_750.py
+++ b/sources/pyside6/tests/QtWidgets/bug_750.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_778.py b/sources/pyside6/tests/QtWidgets/bug_778.py
index 1a7def6c7..dcbf177c4 100644
--- a/sources/pyside6/tests/QtWidgets/bug_778.py
+++ b/sources/pyside6/tests/QtWidgets/bug_778.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_793.py b/sources/pyside6/tests/QtWidgets/bug_793.py
index 94f42a5d3..3e7900679 100644
--- a/sources/pyside6/tests/QtWidgets/bug_793.py
+++ b/sources/pyside6/tests/QtWidgets/bug_793.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_811.py b/sources/pyside6/tests/QtWidgets/bug_811.py
index b3537e1f7..3e6ceb7b0 100644
--- a/sources/pyside6/tests/QtWidgets/bug_811.py
+++ b/sources/pyside6/tests/QtWidgets/bug_811.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_834.py b/sources/pyside6/tests/QtWidgets/bug_834.py
index 685f17e56..efa1a835b 100644
--- a/sources/pyside6/tests/QtWidgets/bug_834.py
+++ b/sources/pyside6/tests/QtWidgets/bug_834.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_836.py b/sources/pyside6/tests/QtWidgets/bug_836.py
index c2d3d5609..dbac5547d 100644
--- a/sources/pyside6/tests/QtWidgets/bug_836.py
+++ b/sources/pyside6/tests/QtWidgets/bug_836.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_844.py b/sources/pyside6/tests/QtWidgets/bug_844.py
index 913b4235c..271204e5b 100644
--- a/sources/pyside6/tests/QtWidgets/bug_844.py
+++ b/sources/pyside6/tests/QtWidgets/bug_844.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
import os
diff --git a/sources/pyside6/tests/QtWidgets/bug_854.py b/sources/pyside6/tests/QtWidgets/bug_854.py
index 1dbfd4b3a..40f69a272 100644
--- a/sources/pyside6/tests/QtWidgets/bug_854.py
+++ b/sources/pyside6/tests/QtWidgets/bug_854.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_860.py b/sources/pyside6/tests/QtWidgets/bug_860.py
index 779feaa14..6b47ed136 100644
--- a/sources/pyside6/tests/QtWidgets/bug_860.py
+++ b/sources/pyside6/tests/QtWidgets/bug_860.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_862.py b/sources/pyside6/tests/QtWidgets/bug_862.py
index 49d9e24b2..eb2c58711 100644
--- a/sources/pyside6/tests/QtWidgets/bug_862.py
+++ b/sources/pyside6/tests/QtWidgets/bug_862.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
#
diff --git a/sources/pyside6/tests/QtWidgets/bug_871.py b/sources/pyside6/tests/QtWidgets/bug_871.py
index 4ee9b575a..c5abdba84 100644
--- a/sources/pyside6/tests/QtWidgets/bug_871.py
+++ b/sources/pyside6/tests/QtWidgets/bug_871.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_879.py b/sources/pyside6/tests/QtWidgets/bug_879.py
index 31c656543..a2b49d954 100644
--- a/sources/pyside6/tests/QtWidgets/bug_879.py
+++ b/sources/pyside6/tests/QtWidgets/bug_879.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_919.py b/sources/pyside6/tests/QtWidgets/bug_919.py
index 67387ed26..3094d7483 100644
--- a/sources/pyside6/tests/QtWidgets/bug_919.py
+++ b/sources/pyside6/tests/QtWidgets/bug_919.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_921.py b/sources/pyside6/tests/QtWidgets/bug_921.py
index dafc1faef..5e9dcd05a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_921.py
+++ b/sources/pyside6/tests/QtWidgets/bug_921.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/bug_941.py b/sources/pyside6/tests/QtWidgets/bug_941.py
index 336aa2f58..6e09b8ed7 100644
--- a/sources/pyside6/tests/QtWidgets/bug_941.py
+++ b/sources/pyside6/tests/QtWidgets/bug_941.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_964.py b/sources/pyside6/tests/QtWidgets/bug_964.py
index 86bbddf16..146873259 100644
--- a/sources/pyside6/tests/QtWidgets/bug_964.py
+++ b/sources/pyside6/tests/QtWidgets/bug_964.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_967.py b/sources/pyside6/tests/QtWidgets/bug_967.py
index 03af030ca..d254f2877 100644
--- a/sources/pyside6/tests/QtWidgets/bug_967.py
+++ b/sources/pyside6/tests/QtWidgets/bug_967.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_972.py b/sources/pyside6/tests/QtWidgets/bug_972.py
index 895cea128..1450cc16b 100644
--- a/sources/pyside6/tests/QtWidgets/bug_972.py
+++ b/sources/pyside6/tests/QtWidgets/bug_972.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_979.py b/sources/pyside6/tests/QtWidgets/bug_979.py
index a6c17385e..0e780c044 100644
--- a/sources/pyside6/tests/QtWidgets/bug_979.py
+++ b/sources/pyside6/tests/QtWidgets/bug_979.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_988.py b/sources/pyside6/tests/QtWidgets/bug_988.py
index f82ba6d27..0fd582206 100644
--- a/sources/pyside6/tests/QtWidgets/bug_988.py
+++ b/sources/pyside6/tests/QtWidgets/bug_988.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/bug_998.py b/sources/pyside6/tests/QtWidgets/bug_998.py
index 0f6311515..d2d236dbb 100644
--- a/sources/pyside6/tests/QtWidgets/bug_998.py
+++ b/sources/pyside6/tests/QtWidgets/bug_998.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/customproxywidget_test.py b/sources/pyside6/tests/QtWidgets/customproxywidget_test.py
index f7a1a1b1d..f1e9bb6ec 100644
--- a/sources/pyside6/tests/QtWidgets/customproxywidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/customproxywidget_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/grandparent_method_test.py b/sources/pyside6/tests/QtWidgets/grandparent_method_test.py
index ef848e22d..5cdc5c5af 100644
--- a/sources/pyside6/tests/QtWidgets/grandparent_method_test.py
+++ b/sources/pyside6/tests/QtWidgets/grandparent_method_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for calling methods further than the direct parent'''
diff --git a/sources/pyside6/tests/QtWidgets/hashabletype_test.py b/sources/pyside6/tests/QtWidgets/hashabletype_test.py
index f12cceb5a..47c60fe53 100644
--- a/sources/pyside6/tests/QtWidgets/hashabletype_test.py
+++ b/sources/pyside6/tests/QtWidgets/hashabletype_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for __hash__'''
diff --git a/sources/pyside6/tests/QtWidgets/keep_reference_test.py b/sources/pyside6/tests/QtWidgets/keep_reference_test.py
index 9d21c4580..8f00208cf 100644
--- a/sources/pyside6/tests/QtWidgets/keep_reference_test.py
+++ b/sources/pyside6/tests/QtWidgets/keep_reference_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/missing_symbols_test.py b/sources/pyside6/tests/QtWidgets/missing_symbols_test.py
index 076c9e7e1..904bdd894 100644
--- a/sources/pyside6/tests/QtWidgets/missing_symbols_test.py
+++ b/sources/pyside6/tests/QtWidgets/missing_symbols_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''(Very) Simple test case for missing names from QtGui and QtWidgets'''
diff --git a/sources/pyside6/tests/QtWidgets/paint_event_test.py b/sources/pyside6/tests/QtWidgets/paint_event_test.py
index d995c2a37..8597af524 100644
--- a/sources/pyside6/tests/QtWidgets/paint_event_test.py
+++ b/sources/pyside6/tests/QtWidgets/paint_event_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test paint event override in python'''
diff --git a/sources/pyside6/tests/QtWidgets/parent_method_test.py b/sources/pyside6/tests/QtWidgets/parent_method_test.py
index 0ab09eead..a287792e5 100644
--- a/sources/pyside6/tests/QtWidgets/parent_method_test.py
+++ b/sources/pyside6/tests/QtWidgets/parent_method_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/private_mangle_test.py b/sources/pyside6/tests/QtWidgets/private_mangle_test.py
index 67ad14d68..c535a4bf9 100644
--- a/sources/pyside6/tests/QtWidgets/private_mangle_test.py
+++ b/sources/pyside6/tests/QtWidgets/private_mangle_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
This is the example from https://bugreports.qt.io/browse/PYSIDE-772
diff --git a/sources/pyside6/tests/QtWidgets/python_properties_test.py b/sources/pyside6/tests/QtWidgets/python_properties_test.py
index ee8a38014..478031aea 100644
--- a/sources/pyside6/tests/QtWidgets/python_properties_test.py
+++ b/sources/pyside6/tests/QtWidgets/python_properties_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py b/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py
index 1ae3b0a35..091adfc39 100644
--- a/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qaccessible_test.py b/sources/pyside6/tests/QtWidgets/qaccessible_test.py
index 021cf9c6b..66c68fa27 100644
--- a/sources/pyside6/tests/QtWidgets/qaccessible_test.py
+++ b/sources/pyside6/tests/QtWidgets/qaccessible_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QAccessible::installFactory().'''
diff --git a/sources/pyside6/tests/QtWidgets/qaction_test.py b/sources/pyside6/tests/QtWidgets/qaction_test.py
index a0049421f..629d60f33 100644
--- a/sources/pyside6/tests/QtWidgets/qaction_test.py
+++ b/sources/pyside6/tests/QtWidgets/qaction_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qapp_issue_585.py b/sources/pyside6/tests/QtWidgets/qapp_issue_585.py
index 0b5453af5..ec8a47569 100644
--- a/sources/pyside6/tests/QtWidgets/qapp_issue_585.py
+++ b/sources/pyside6/tests/QtWidgets/qapp_issue_585.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
The bug was caused by this commit:
diff --git a/sources/pyside6/tests/QtWidgets/qapp_test.py b/sources/pyside6/tests/QtWidgets/qapp_test.py
index 5a66b8e33..86e7c60dd 100644
--- a/sources/pyside6/tests/QtWidgets/qapp_test.py
+++ b/sources/pyside6/tests/QtWidgets/qapp_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test the presence of qApp Macro'''
diff --git a/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py b/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py
index 8bb47bc1c..a06d81ef8 100644
--- a/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py
+++ b/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qapplication_test.py b/sources/pyside6/tests/QtWidgets/qapplication_test.py
index 7c5b61fd9..47a3c4371 100644
--- a/sources/pyside6/tests/QtWidgets/qapplication_test.py
+++ b/sources/pyside6/tests/QtWidgets/qapplication_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qcolormap_test.py b/sources/pyside6/tests/QtWidgets/qcolormap_test.py
index f63a9486f..90c96372d 100644
--- a/sources/pyside6/tests/QtWidgets/qcolormap_test.py
+++ b/sources/pyside6/tests/QtWidgets/qcolormap_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qdialog_test.py b/sources/pyside6/tests/QtWidgets/qdialog_test.py
index cb85ce7e2..6d36dfb20 100644
--- a/sources/pyside6/tests/QtWidgets/qdialog_test.py
+++ b/sources/pyside6/tests/QtWidgets/qdialog_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qdynamic_signal.py b/sources/pyside6/tests/QtWidgets/qdynamic_signal.py
index 83d6af383..6d903f85c 100644
--- a/sources/pyside6/tests/QtWidgets/qdynamic_signal.py
+++ b/sources/pyside6/tests/QtWidgets/qdynamic_signal.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qfontdialog_test.py b/sources/pyside6/tests/QtWidgets/qfontdialog_test.py
index 764329732..dd4209d10 100644
--- a/sources/pyside6/tests/QtWidgets/qfontdialog_test.py
+++ b/sources/pyside6/tests/QtWidgets/qfontdialog_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qformlayout_test.py b/sources/pyside6/tests/QtWidgets/qformlayout_test.py
index f87ea6935..bcdaed8f7 100644
--- a/sources/pyside6/tests/QtWidgets/qformlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qformlayout_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py
index cb4115b55..4bbe6b0eb 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py
index 1114ad4fe..eb366e3c0 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test cases related to QGraphicsItem and subclasses'''
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py
index a3d28b4d3..71aba9941 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test cases related to QGraphicsItem and subclasses'''
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py
index dee616bbe..29841a7d0 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py
index 86604f27b..985bf94d2 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Basic test cases for QGraphicsScene'''
diff --git a/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py b/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py
index 260653ae7..ce6e07d40 100644
--- a/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py
+++ b/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py b/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py
index bcb4c7a61..4936260ef 100644
--- a/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py
+++ b/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QKeySequenceEdit.'''
diff --git a/sources/pyside6/tests/QtWidgets/qlabel_test.py b/sources/pyside6/tests/QtWidgets/qlabel_test.py
index aba90b7b8..5f60d0568 100644
--- a/sources/pyside6/tests/QtWidgets/qlabel_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlabel_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QLabel'''
diff --git a/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py b/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py
index df9bd7f90..94e4b9554 100644
--- a/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QLayout handling of child widgets references'''
diff --git a/sources/pyside6/tests/QtWidgets/qlayout_test.py b/sources/pyside6/tests/QtWidgets/qlayout_test.py
index cc41f78b1..3df0e33dd 100644
--- a/sources/pyside6/tests/QtWidgets/qlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlayout_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py b/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py
index bc186f755..3bc0b5a3c 100644
--- a/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qlistwidget_test.py b/sources/pyside6/tests/QtWidgets/qlistwidget_test.py
index 377e63ffb..c3dd31cc4 100644
--- a/sources/pyside6/tests/QtWidgets/qlistwidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlistwidget_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py b/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py
index a85c1b48f..9bfc81d65 100644
--- a/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qmainwindow_test.py b/sources/pyside6/tests/QtWidgets/qmainwindow_test.py
index 2f245c8ff..9cea36313 100644
--- a/sources/pyside6/tests/QtWidgets/qmainwindow_test.py
+++ b/sources/pyside6/tests/QtWidgets/qmainwindow_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qmenu_test.py b/sources/pyside6/tests/QtWidgets/qmenu_test.py
index a6976a637..7d1d262e4 100644
--- a/sources/pyside6/tests/QtWidgets/qmenu_test.py
+++ b/sources/pyside6/tests/QtWidgets/qmenu_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qmenuadd_test.py b/sources/pyside6/tests/QtWidgets/qmenuadd_test.py
index 5b42e755f..b7138aaf7 100644
--- a/sources/pyside6/tests/QtWidgets/qmenuadd_test.py
+++ b/sources/pyside6/tests/QtWidgets/qmenuadd_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test the QMenu.addAction() method'''
diff --git a/sources/pyside6/tests/QtWidgets/qobject_mi_test.py b/sources/pyside6/tests/QtWidgets/qobject_mi_test.py
index d90961495..4449afd8d 100644
--- a/sources/pyside6/tests/QtWidgets/qobject_mi_test.py
+++ b/sources/pyside6/tests/QtWidgets/qobject_mi_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for multiple inheritance from 2 QObjects'''
diff --git a/sources/pyside6/tests/QtWidgets/qpicture_test.py b/sources/pyside6/tests/QtWidgets/qpicture_test.py
index b81713b57..2825c12fc 100644
--- a/sources/pyside6/tests/QtWidgets/qpicture_test.py
+++ b/sources/pyside6/tests/QtWidgets/qpicture_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qpushbutton_test.py b/sources/pyside6/tests/QtWidgets/qpushbutton_test.py
index bfc04130e..b8a10e4e2 100644
--- a/sources/pyside6/tests/QtWidgets/qpushbutton_test.py
+++ b/sources/pyside6/tests/QtWidgets/qpushbutton_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qsplitter_test.py b/sources/pyside6/tests/QtWidgets/qsplitter_test.py
index ae383f425..c00af837f 100644
--- a/sources/pyside6/tests/QtWidgets/qsplitter_test.py
+++ b/sources/pyside6/tests/QtWidgets/qsplitter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qstyle_test.py b/sources/pyside6/tests/QtWidgets/qstyle_test.py
index 5a9b29dc6..e34d266ab 100644
--- a/sources/pyside6/tests/QtWidgets/qstyle_test.py
+++ b/sources/pyside6/tests/QtWidgets/qstyle_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
import os
diff --git a/sources/pyside6/tests/QtWidgets/qstyleoption_test.py b/sources/pyside6/tests/QtWidgets/qstyleoption_test.py
index 06798b9e9..ef9b3b301 100644
--- a/sources/pyside6/tests/QtWidgets/qstyleoption_test.py
+++ b/sources/pyside6/tests/QtWidgets/qstyleoption_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
import os
diff --git a/sources/pyside6/tests/QtWidgets/qtableview_test.py b/sources/pyside6/tests/QtWidgets/qtableview_test.py
index c43666f23..07bcf6a10 100644
--- a/sources/pyside6/tests/QtWidgets/qtableview_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtableview_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qtabwidget_test.py b/sources/pyside6/tests/QtWidgets/qtabwidget_test.py
index 8db45f24b..69d308c0c 100644
--- a/sources/pyside6/tests/QtWidgets/qtabwidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtabwidget_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py b/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py
index 49e16e8d2..5661c4e79 100644
--- a/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py b/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py
index 16929f0f2..72265d9fb 100644
--- a/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qtextedit_test.py b/sources/pyside6/tests/QtWidgets/qtextedit_test.py
index b82350293..9cfc526c1 100644
--- a/sources/pyside6/tests/QtWidgets/qtextedit_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtextedit_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QTextEdit and ownership problems.'''
diff --git a/sources/pyside6/tests/QtWidgets/qtoolbar_test.py b/sources/pyside6/tests/QtWidgets/qtoolbar_test.py
index 6fa5865cf..6a328a4ce 100644
--- a/sources/pyside6/tests/QtWidgets/qtoolbar_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtoolbar_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QToolbar'''
diff --git a/sources/pyside6/tests/QtWidgets/qtoolbox_test.py b/sources/pyside6/tests/QtWidgets/qtoolbox_test.py
index d069416b7..77228a928 100644
--- a/sources/pyside6/tests/QtWidgets/qtoolbox_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtoolbox_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qtreeview_test.py b/sources/pyside6/tests/QtWidgets/qtreeview_test.py
index fd535bfad..003475d54 100644
--- a/sources/pyside6/tests/QtWidgets/qtreeview_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtreeview_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qtreewidget_test.py b/sources/pyside6/tests/QtWidgets/qtreewidget_test.py
index 6c2db32b9..1ee8c45cb 100644
--- a/sources/pyside6/tests/QtWidgets/qtreewidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtreewidget_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py b/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py
index 432aba2ed..f92bb4725 100644
--- a/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
Unit tests for QTreeWidgetItem
diff --git a/sources/pyside6/tests/QtWidgets/qvariant_test.py b/sources/pyside6/tests/QtWidgets/qvariant_test.py
index fe0266309..0e1ecc2c9 100644
--- a/sources/pyside6/tests/QtWidgets/qvariant_test.py
+++ b/sources/pyside6/tests/QtWidgets/qvariant_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py b/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py
index 1d9128789..e7f754c81 100644
--- a/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/qwidget_test.py b/sources/pyside6/tests/QtWidgets/qwidget_test.py
index 2d503f0d4..97b9c90bb 100644
--- a/sources/pyside6/tests/QtWidgets/qwidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qwidget_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
import os
diff --git a/sources/pyside6/tests/QtWidgets/reference_count_test.py b/sources/pyside6/tests/QtWidgets/reference_count_test.py
index b7d3908dd..c0944ed04 100644
--- a/sources/pyside6/tests/QtWidgets/reference_count_test.py
+++ b/sources/pyside6/tests/QtWidgets/reference_count_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Reference count when the object is created in c++ side'''
diff --git a/sources/pyside6/tests/QtWidgets/signature_test.py b/sources/pyside6/tests/QtWidgets/signature_test.py
index f156b6717..1b3363ae2 100644
--- a/sources/pyside6/tests/QtWidgets/signature_test.py
+++ b/sources/pyside6/tests/QtWidgets/signature_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import inspect
import os
diff --git a/sources/pyside6/tests/QtWidgets/standardpixmap_test.py b/sources/pyside6/tests/QtWidgets/standardpixmap_test.py
index 564f3ff2e..de993595e 100644
--- a/sources/pyside6/tests/QtWidgets/standardpixmap_test.py
+++ b/sources/pyside6/tests/QtWidgets/standardpixmap_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/test_module_template.py b/sources/pyside6/tests/QtWidgets/test_module_template.py
index 92661cdff..f194ac925 100644
--- a/sources/pyside6/tests/QtWidgets/test_module_template.py
+++ b/sources/pyside6/tests/QtWidgets/test_module_template.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py b/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py
index 911fed475..6ae792474 100644
--- a/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py
+++ b/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for overriding inherited protected virtual methods'''
diff --git a/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py b/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py
index b7d1e4f3f..0935522f0 100644
--- a/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py
+++ b/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/QtWidgets/wrong_return_test.py b/sources/pyside6/tests/QtWidgets/wrong_return_test.py
index 009078ac1..47ef489bb 100644
--- a/sources/pyside6/tests/QtWidgets/wrong_return_test.py
+++ b/sources/pyside6/tests/QtWidgets/wrong_return_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Virtual functions with wrong return type'''
diff --git a/sources/pyside6/tests/QtXml/qdomdocument_test.py b/sources/pyside6/tests/QtXml/qdomdocument_test.py
index cfc1c543d..bcb5ce67f 100644
--- a/sources/pyside6/tests/QtXml/qdomdocument_test.py
+++ b/sources/pyside6/tests/QtXml/qdomdocument_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/init_paths.py b/sources/pyside6/tests/init_paths.py
index e69ec1c15..4636aba99 100644
--- a/sources/pyside6/tests/init_paths.py
+++ b/sources/pyside6/tests/init_paths.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/mac/qmacstyle_test.py b/sources/pyside6/tests/mac/qmacstyle_test.py
index 18fc64286..d3925714a 100644
--- a/sources/pyside6/tests/mac/qmacstyle_test.py
+++ b/sources/pyside6/tests/mac/qmacstyle_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# Qt5: this is gone: from PySide6.QtGui import QMacStyle
diff --git a/sources/pyside6/tests/manually/bug_841.py b/sources/pyside6/tests/manually/bug_841.py
index 3911244ce..accadbc2d 100644
--- a/sources/pyside6/tests/manually/bug_841.py
+++ b/sources/pyside6/tests/manually/bug_841.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
diff --git a/sources/pyside6/tests/manually/lazytiming.py b/sources/pyside6/tests/manually/lazytiming.py
index 59f75bc46..78d79336c 100644
--- a/sources/pyside6/tests/manually/lazytiming.py
+++ b/sources/pyside6/tests/manually/lazytiming.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
Time a repeated Python run
diff --git a/sources/pyside6/tests/pysidetest/all_modules_load_test.py b/sources/pyside6/tests/pysidetest/all_modules_load_test.py
index 454c2b14f..16f2369a7 100644
--- a/sources/pyside6/tests/pysidetest/all_modules_load_test.py
+++ b/sources/pyside6/tests/pysidetest/all_modules_load_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/bug_1016.py b/sources/pyside6/tests/pysidetest/bug_1016.py
index 219384e66..2ec2d56ee 100644
--- a/sources/pyside6/tests/pysidetest/bug_1016.py
+++ b/sources/pyside6/tests/pysidetest/bug_1016.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/constructor_properties_test.py b/sources/pyside6/tests/pysidetest/constructor_properties_test.py
index ec6e39821..5d77a058a 100644
--- a/sources/pyside6/tests/pysidetest/constructor_properties_test.py
+++ b/sources/pyside6/tests/pysidetest/constructor_properties_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/container_test.py b/sources/pyside6/tests/pysidetest/container_test.py
index c83e1f26c..04eed83bc 100644
--- a/sources/pyside6/tests/pysidetest/container_test.py
+++ b/sources/pyside6/tests/pysidetest/container_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/decoratedslot_test.py b/sources/pyside6/tests/pysidetest/decoratedslot_test.py
index 3ec9ac9e3..5902f41fc 100644
--- a/sources/pyside6/tests/pysidetest/decoratedslot_test.py
+++ b/sources/pyside6/tests/pysidetest/decoratedslot_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py b/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py
index 8964ec1ed..665cd2ed8 100644
--- a/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py
+++ b/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/enum_test.py b/sources/pyside6/tests/pysidetest/enum_test.py
index 832834530..9816db224 100644
--- a/sources/pyside6/tests/pysidetest/enum_test.py
+++ b/sources/pyside6/tests/pysidetest/enum_test.py
@@ -1,5 +1,6 @@
-# Copyright (C) 2022 The Qt Company Ltd.
+# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
@@ -50,6 +51,8 @@ class ListConnectionTest(unittest.TestCase):
# PYSIDE-1735: We are testing that opcodes do what they are supposed to do.
# This is needed in the PyEnum forgiveness mode where we need
# to introspect the code if an Enum was called with no args.
+
+# flake8: noqa
class InvestigateOpcodesTest(unittest.TestCase):
def probe_function1(self):
@@ -162,25 +165,40 @@ class InvestigateOpcodesTest(unittest.TestCase):
self.assertEqual(self.read_code(self.probe_function2, adaptive=True), result_3)
self.assertEqual(self.get_sizes(self.probe_function2, adaptive=True), sizes_3)
- if sys.version_info[:2] >= (3, 12):
+ if sys.version_info[:2] == (3, 12):
- result_1 = [('RESUME', 151, 0),
- ('LOAD_GLOBAL', 116, 0),
- ('LOAD_ATTR', 106, 2),
- ('STORE_FAST', 125, 1),
+ result_1 = [('RESUME', 151, 0),
+ ('LOAD_GLOBAL', 116, 0),
+ ('LOAD_ATTR', 106, 2),
+ ('STORE_FAST', 125, 1),
('RETURN_CONST', 121, 0)]
- result_2 = [('RESUME', 151, 0),
- ('LOAD_GLOBAL', 116, 1),
- ('LOAD_ATTR', 106, 2),
- ('CALL', 171, 0),
- ('STORE_FAST', 125, 1),
+ result_2 = [('RESUME', 151, 0),
+ ('LOAD_GLOBAL', 116, 1),
+ ('LOAD_ATTR', 106, 2),
+ ('CALL', 171, 0),
+ ('STORE_FAST', 125, 1),
('RETURN_CONST', 121, 0)]
+ if sys.version_info[:2] >= (3, 13):
+
+ result_1 = [('RESUME', 149, 0),
+ ('LOAD_GLOBAL', 91, 0),
+ ('LOAD_ATTR', 82, 2),
+ ('STORE_FAST', 110, 1),
+ ('RETURN_CONST', 103, 0)]
+
+ result_2 = [('RESUME', 149, 0),
+ ('LOAD_GLOBAL', 91, 0),
+ ('LOAD_ATTR', 82, 2),
+ ('PUSH_NULL', 34, None),
+ ('CALL', 53, 0),
+ ('STORE_FAST', 110, 1),
+ ('RETURN_CONST', 103, 0)]
+
self.assertEqual(self.read_code(self.probe_function1), result_1)
self.assertEqual(self.read_code(self.probe_function2), result_2)
if __name__ == '__main__':
unittest.main()
-
diff --git a/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py b/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py
index b58232a1b..9bc4172ec 100644
--- a/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py
+++ b/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/pysidetest/iterable_test.py b/sources/pyside6/tests/pysidetest/iterable_test.py
index bdb2ae7be..1a54f1848 100644
--- a/sources/pyside6/tests/pysidetest/iterable_test.py
+++ b/sources/pyside6/tests/pysidetest/iterable_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
iterable_test.py
diff --git a/sources/pyside6/tests/pysidetest/list_signal_test.py b/sources/pyside6/tests/pysidetest/list_signal_test.py
index da4bc298d..42524933b 100644
--- a/sources/pyside6/tests/pysidetest/list_signal_test.py
+++ b/sources/pyside6/tests/pysidetest/list_signal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py b/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py
index 1d536c0ae..d4fb039ed 100644
--- a/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py
+++ b/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' PYSIDE-315: https://bugreports.qt.io/browse/PYSIDE-315
Test that all signals and slots of a class (including any mixin classes)
diff --git a/sources/pyside6/tests/pysidetest/mock_as_slot_test.py b/sources/pyside6/tests/pysidetest/mock_as_slot_test.py
index 39f52adea..f6504a789 100644
--- a/sources/pyside6/tests/pysidetest/mock_as_slot_test.py
+++ b/sources/pyside6/tests/pysidetest/mock_as_slot_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
""" PYSIDE-1755: https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1755
Tests that a unittest.mock.MagicMock() can be used as a slot for quick
diff --git a/sources/pyside6/tests/pysidetest/modelview_test.py b/sources/pyside6/tests/pysidetest/modelview_test.py
index 53231aebe..3bcfc9cdc 100644
--- a/sources/pyside6/tests/pysidetest/modelview_test.py
+++ b/sources/pyside6/tests/pysidetest/modelview_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py b/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py
index 49550ba55..a9808cfa3 100644
--- a/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py
+++ b/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py
index 924a2eea7..e474e5d39 100644
--- a/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py
+++ b/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/notify_id.py b/sources/pyside6/tests/pysidetest/notify_id.py
index 0c4f39f66..49ba6969f 100644
--- a/sources/pyside6/tests/pysidetest/notify_id.py
+++ b/sources/pyside6/tests/pysidetest/notify_id.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/pysidetest/properties_test.py b/sources/pyside6/tests/pysidetest/properties_test.py
index 8eb7812d1..00d7aad1b 100644
--- a/sources/pyside6/tests/pysidetest/properties_test.py
+++ b/sources/pyside6/tests/pysidetest/properties_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/property_python_test.py b/sources/pyside6/tests/pysidetest/property_python_test.py
index 1209aad4f..31c1f40c7 100644
--- a/sources/pyside6/tests/pysidetest/property_python_test.py
+++ b/sources/pyside6/tests/pysidetest/property_python_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
Test for PySide's Property
diff --git a/sources/pyside6/tests/pysidetest/pyenum_relax_options_test.py b/sources/pyside6/tests/pysidetest/pyenum_relax_options_test.py
index 625f9cdc5..c2a608868 100644
--- a/sources/pyside6/tests/pysidetest/pyenum_relax_options_test.py
+++ b/sources/pyside6/tests/pysidetest/pyenum_relax_options_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
PYSIDE-1735: Testing different relax options for Enums
diff --git a/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py b/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py
index 2a3f34014..c53b533a1 100644
--- a/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py
+++ b/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/qvariant_test.py b/sources/pyside6/tests/pysidetest/qvariant_test.py
index faefc8169..5748daee4 100644
--- a/sources/pyside6/tests/pysidetest/qvariant_test.py
+++ b/sources/pyside6/tests/pysidetest/qvariant_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import enum
import os
diff --git a/sources/pyside6/tests/pysidetest/repr_test.py b/sources/pyside6/tests/pysidetest/repr_test.py
index 863f17657..393d46967 100644
--- a/sources/pyside6/tests/pysidetest/repr_test.py
+++ b/sources/pyside6/tests/pysidetest/repr_test.py
@@ -1,6 +1,7 @@
# Copyright (C) 2022 The Qt Company Ltd.
# Copyright (C) 2019 Andreas Beckermann
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/shared_pointer_test.py b/sources/pyside6/tests/pysidetest/shared_pointer_test.py
index 6f49d69b1..a5c833647 100644
--- a/sources/pyside6/tests/pysidetest/shared_pointer_test.py
+++ b/sources/pyside6/tests/pysidetest/shared_pointer_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/pysidetest/signal_slot_warning.py b/sources/pyside6/tests/pysidetest/signal_slot_warning.py
index b94281643..06ee338fd 100644
--- a/sources/pyside6/tests/pysidetest/signal_slot_warning.py
+++ b/sources/pyside6/tests/pysidetest/signal_slot_warning.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' PYSIDE-315: https://bugreports.qt.io/browse/PYSIDE-315
Test that creating a signal in the wrong order triggers a warning. '''
diff --git a/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py b/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py
index 6025d119d..2253572b0 100644
--- a/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py
+++ b/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
PYSIDE-68: Test that signals have a `__get__` function after all.
diff --git a/sources/pyside6/tests/pysidetest/signalandnamespace_test.py b/sources/pyside6/tests/pysidetest/signalandnamespace_test.py
index 3e91ca338..7d8c711c9 100644
--- a/sources/pyside6/tests/pysidetest/signalandnamespace_test.py
+++ b/sources/pyside6/tests/pysidetest/signalandnamespace_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py b/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py
index 70c9e0082..b1b69a679 100644
--- a/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py
+++ b/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/pysidetest/signalinstance_equality_test.py b/sources/pyside6/tests/pysidetest/signalinstance_equality_test.py
index 5faaa38d4..61e59286f 100644
--- a/sources/pyside6/tests/pysidetest/signalinstance_equality_test.py
+++ b/sources/pyside6/tests/pysidetest/signalinstance_equality_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py b/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py
index 744b8c503..5b8df2f3e 100644
--- a/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py
+++ b/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/pysidetest/snake_case_sub.py b/sources/pyside6/tests/pysidetest/snake_case_sub.py
index 4a482c35a..c5b751454 100644
--- a/sources/pyside6/tests/pysidetest/snake_case_sub.py
+++ b/sources/pyside6/tests/pysidetest/snake_case_sub.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/snake_case_test.py b/sources/pyside6/tests/pysidetest/snake_case_test.py
index 14e035773..f764bc6e1 100644
--- a/sources/pyside6/tests/pysidetest/snake_case_test.py
+++ b/sources/pyside6/tests/pysidetest/snake_case_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/true_property_test.py b/sources/pyside6/tests/pysidetest/true_property_test.py
index 62f6505dc..df68cedf1 100644
--- a/sources/pyside6/tests/pysidetest/true_property_test.py
+++ b/sources/pyside6/tests/pysidetest/true_property_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/typedef_signal_test.py b/sources/pyside6/tests/pysidetest/typedef_signal_test.py
index d0bdc880b..969ebb98e 100644
--- a/sources/pyside6/tests/pysidetest/typedef_signal_test.py
+++ b/sources/pyside6/tests/pysidetest/typedef_signal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/pysidetest/version_test.py b/sources/pyside6/tests/pysidetest/version_test.py
index f47ffc6d0..a1280f14d 100644
--- a/sources/pyside6/tests/pysidetest/version_test.py
+++ b/sources/pyside6/tests/pysidetest/version_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/registry/existence_test.py b/sources/pyside6/tests/registry/existence_test.py
index 5540b6e04..2ad4c5b1b 100644
--- a/sources/pyside6/tests/registry/existence_test.py
+++ b/sources/pyside6/tests/registry/existence_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
existence_test.py
diff --git a/sources/pyside6/tests/registry/init_platform.py b/sources/pyside6/tests/registry/init_platform.py
index 8abf30216..9e70e7b49 100644
--- a/sources/pyside6/tests/registry/init_platform.py
+++ b/sources/pyside6/tests/registry/init_platform.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
init_platform.py
@@ -163,6 +164,7 @@ def enum_all():
LICENSE_TEXT = """
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
diff --git a/sources/pyside6/tests/registry/scrape_testresults.py b/sources/pyside6/tests/registry/scrape_testresults.py
index b7b6b58aa..89ff8d16b 100644
--- a/sources/pyside6/tests/registry/scrape_testresults.py
+++ b/sources/pyside6/tests/registry/scrape_testresults.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
scrape_testresults.py
diff --git a/sources/pyside6/tests/registry/util.py b/sources/pyside6/tests/registry/util.py
index 5d81926a1..97978f310 100644
--- a/sources/pyside6/tests/registry/util.py
+++ b/sources/pyside6/tests/registry/util.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
Supporting isolation of warnings
diff --git a/sources/pyside6/tests/signals/anonymous_slot_leak_test.py b/sources/pyside6/tests/signals/anonymous_slot_leak_test.py
index 560a08659..f930d7c3b 100644
--- a/sources/pyside6/tests/signals/anonymous_slot_leak_test.py
+++ b/sources/pyside6/tests/signals/anonymous_slot_leak_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/args_dont_match_test.py b/sources/pyside6/tests/signals/args_dont_match_test.py
index 4f56be348..36b905a52 100644
--- a/sources/pyside6/tests/signals/args_dont_match_test.py
+++ b/sources/pyside6/tests/signals/args_dont_match_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/bug_189.py b/sources/pyside6/tests/signals/bug_189.py
index 1c013ddea..72d604061 100644
--- a/sources/pyside6/tests/signals/bug_189.py
+++ b/sources/pyside6/tests/signals/bug_189.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/bug_311.py b/sources/pyside6/tests/signals/bug_311.py
index e27476172..b01caa952 100644
--- a/sources/pyside6/tests/signals/bug_311.py
+++ b/sources/pyside6/tests/signals/bug_311.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/bug_312.py b/sources/pyside6/tests/signals/bug_312.py
index 80d56a020..49be26382 100644
--- a/sources/pyside6/tests/signals/bug_312.py
+++ b/sources/pyside6/tests/signals/bug_312.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/bug_319.py b/sources/pyside6/tests/signals/bug_319.py
index 657733afb..2de53f8e2 100644
--- a/sources/pyside6/tests/signals/bug_319.py
+++ b/sources/pyside6/tests/signals/bug_319.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/bug_79.py b/sources/pyside6/tests/signals/bug_79.py
index 77ac621d5..99dc1bccb 100644
--- a/sources/pyside6/tests/signals/bug_79.py
+++ b/sources/pyside6/tests/signals/bug_79.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import gc
diff --git a/sources/pyside6/tests/signals/decorators_test.py b/sources/pyside6/tests/signals/decorators_test.py
index b29339ee4..431c81d11 100644
--- a/sources/pyside6/tests/signals/decorators_test.py
+++ b/sources/pyside6/tests/signals/decorators_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/disconnect_test.py b/sources/pyside6/tests/signals/disconnect_test.py
index ea3782a91..61ce4d5b8 100644
--- a/sources/pyside6/tests/signals/disconnect_test.py
+++ b/sources/pyside6/tests/signals/disconnect_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/invalid_callback_test.py b/sources/pyside6/tests/signals/invalid_callback_test.py
index 2788c1d1a..136ffa3d8 100644
--- a/sources/pyside6/tests/signals/invalid_callback_test.py
+++ b/sources/pyside6/tests/signals/invalid_callback_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for passing invalid callbacks to QObject.connect'''
diff --git a/sources/pyside6/tests/signals/lambda_gui_test.py b/sources/pyside6/tests/signals/lambda_gui_test.py
index 2123e7206..7eacab0c4 100644
--- a/sources/pyside6/tests/signals/lambda_gui_test.py
+++ b/sources/pyside6/tests/signals/lambda_gui_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Connecting lambda to gui signals'''
diff --git a/sources/pyside6/tests/signals/lambda_test.py b/sources/pyside6/tests/signals/lambda_test.py
index 23fcdf5fa..e0e016f4d 100644
--- a/sources/pyside6/tests/signals/lambda_test.py
+++ b/sources/pyside6/tests/signals/lambda_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Connecting lambda to signals'''
diff --git a/sources/pyside6/tests/signals/leaking_signal_test.py b/sources/pyside6/tests/signals/leaking_signal_test.py
index 666ae7a13..be9c4c879 100644
--- a/sources/pyside6/tests/signals/leaking_signal_test.py
+++ b/sources/pyside6/tests/signals/leaking_signal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/multiple_connections_gui_test.py b/sources/pyside6/tests/signals/multiple_connections_gui_test.py
index 295369b7d..f1ad4ffd6 100644
--- a/sources/pyside6/tests/signals/multiple_connections_gui_test.py
+++ b/sources/pyside6/tests/signals/multiple_connections_gui_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/multiple_connections_test.py b/sources/pyside6/tests/signals/multiple_connections_test.py
index 233851797..fb03dad3c 100644
--- a/sources/pyside6/tests/signals/multiple_connections_test.py
+++ b/sources/pyside6/tests/signals/multiple_connections_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from functools import partial
import os
diff --git a/sources/pyside6/tests/signals/pysignal_test.py b/sources/pyside6/tests/signals/pysignal_test.py
index d6f44edf8..9517b2fbc 100644
--- a/sources/pyside6/tests/signals/pysignal_test.py
+++ b/sources/pyside6/tests/signals/pysignal_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/qobject_callable_connect_test.py b/sources/pyside6/tests/signals/qobject_callable_connect_test.py
index a7a26d6f5..ff189332e 100644
--- a/sources/pyside6/tests/signals/qobject_callable_connect_test.py
+++ b/sources/pyside6/tests/signals/qobject_callable_connect_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/qobject_destroyed_test.py b/sources/pyside6/tests/signals/qobject_destroyed_test.py
index a21762b41..50bc9be15 100644
--- a/sources/pyside6/tests/signals/qobject_destroyed_test.py
+++ b/sources/pyside6/tests/signals/qobject_destroyed_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/qobject_receivers_test.py b/sources/pyside6/tests/signals/qobject_receivers_test.py
index 9839255ac..fb283e0cd 100644
--- a/sources/pyside6/tests/signals/qobject_receivers_test.py
+++ b/sources/pyside6/tests/signals/qobject_receivers_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for QObject.receivers()'''
diff --git a/sources/pyside6/tests/signals/qobject_sender_test.py b/sources/pyside6/tests/signals/qobject_sender_test.py
index 9c1121eb8..0e8ad2c0b 100644
--- a/sources/pyside6/tests/signals/qobject_sender_test.py
+++ b/sources/pyside6/tests/signals/qobject_sender_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for QObject.sender()'''
diff --git a/sources/pyside6/tests/signals/ref01_test.py b/sources/pyside6/tests/signals/ref01_test.py
index 1a62b2218..0a247fb3c 100644
--- a/sources/pyside6/tests/signals/ref01_test.py
+++ b/sources/pyside6/tests/signals/ref01_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/ref02_test.py b/sources/pyside6/tests/signals/ref02_test.py
index 54b6f4a52..be2cccc46 100644
--- a/sources/pyside6/tests/signals/ref02_test.py
+++ b/sources/pyside6/tests/signals/ref02_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/ref03_test.py b/sources/pyside6/tests/signals/ref03_test.py
index c43c2e549..ef2f55082 100644
--- a/sources/pyside6/tests/signals/ref03_test.py
+++ b/sources/pyside6/tests/signals/ref03_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/ref04_test.py b/sources/pyside6/tests/signals/ref04_test.py
index fce801456..25c733e47 100644
--- a/sources/pyside6/tests/signals/ref04_test.py
+++ b/sources/pyside6/tests/signals/ref04_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/ref05_test.py b/sources/pyside6/tests/signals/ref05_test.py
index fb9debf39..a7e5feac1 100644
--- a/sources/pyside6/tests/signals/ref05_test.py
+++ b/sources/pyside6/tests/signals/ref05_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/ref06_test.py b/sources/pyside6/tests/signals/ref06_test.py
index a827131db..7ec3baba2 100644
--- a/sources/pyside6/tests/signals/ref06_test.py
+++ b/sources/pyside6/tests/signals/ref06_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/segfault_proxyparent_test.py b/sources/pyside6/tests/signals/segfault_proxyparent_test.py
index cb0df0978..695959468 100644
--- a/sources/pyside6/tests/signals/segfault_proxyparent_test.py
+++ b/sources/pyside6/tests/signals/segfault_proxyparent_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/self_connect_test.py b/sources/pyside6/tests/signals/self_connect_test.py
index 08ca725f8..fdc786ddf 100644
--- a/sources/pyside6/tests/signals/self_connect_test.py
+++ b/sources/pyside6/tests/signals/self_connect_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Using self.connect(signal, method)'''
diff --git a/sources/pyside6/tests/signals/short_circuit_test.py b/sources/pyside6/tests/signals/short_circuit_test.py
index 1ad4bc24c..e0453d8ec 100644
--- a/sources/pyside6/tests/signals/short_circuit_test.py
+++ b/sources/pyside6/tests/signals/short_circuit_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/pyside6/tests/signals/signal2signal_connect_test.py b/sources/pyside6/tests/signals/signal2signal_connect_test.py
index 31129f7a1..7d9c0bf91 100644
--- a/sources/pyside6/tests/signals/signal2signal_connect_test.py
+++ b/sources/pyside6/tests/signals/signal2signal_connect_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for signal to signal connections.'''
diff --git a/sources/pyside6/tests/signals/signal_across_threads.py b/sources/pyside6/tests/signals/signal_across_threads.py
index 91b1ca986..5b18d78f7 100644
--- a/sources/pyside6/tests/signals/signal_across_threads.py
+++ b/sources/pyside6/tests/signals/signal_across_threads.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for PYSIDE-1354: Ensure that slots are invoked from the receiver's
thread context when using derived classes (and thus, a global receiver).'''
diff --git a/sources/pyside6/tests/signals/signal_autoconnect_test.py b/sources/pyside6/tests/signals/signal_autoconnect_test.py
index 51d1cea3a..5975c0bd7 100644
--- a/sources/pyside6/tests/signals/signal_autoconnect_test.py
+++ b/sources/pyside6/tests/signals/signal_autoconnect_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/signal_connectiontype_support_test.py b/sources/pyside6/tests/signals/signal_connectiontype_support_test.py
index 0a69c1e02..bab0b9717 100644
--- a/sources/pyside6/tests/signals/signal_connectiontype_support_test.py
+++ b/sources/pyside6/tests/signals/signal_connectiontype_support_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/signal_emission_gui_test.py b/sources/pyside6/tests/signals/signal_emission_gui_test.py
index 5a49b9d12..1e027c59e 100644
--- a/sources/pyside6/tests/signals/signal_emission_gui_test.py
+++ b/sources/pyside6/tests/signals/signal_emission_gui_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""Tests covering signal emission and receiving to python slots"""
diff --git a/sources/pyside6/tests/signals/signal_emission_test.py b/sources/pyside6/tests/signals/signal_emission_test.py
index b31d89c2f..769b1839a 100644
--- a/sources/pyside6/tests/signals/signal_emission_test.py
+++ b/sources/pyside6/tests/signals/signal_emission_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""Tests covering signal emission and receiving to python slots"""
diff --git a/sources/pyside6/tests/signals/signal_enum_test.py b/sources/pyside6/tests/signals/signal_enum_test.py
index a792e9b0c..bc79e2db1 100644
--- a/sources/pyside6/tests/signals/signal_enum_test.py
+++ b/sources/pyside6/tests/signals/signal_enum_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from enum import Enum
import os
diff --git a/sources/pyside6/tests/signals/signal_func_test.py b/sources/pyside6/tests/signals/signal_func_test.py
index d441d4de9..511223fcf 100644
--- a/sources/pyside6/tests/signals/signal_func_test.py
+++ b/sources/pyside6/tests/signals/signal_func_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/signal_manager_refcount_test.py b/sources/pyside6/tests/signals/signal_manager_refcount_test.py
index 955d5b65b..d11d1704f 100644
--- a/sources/pyside6/tests/signals/signal_manager_refcount_test.py
+++ b/sources/pyside6/tests/signals/signal_manager_refcount_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
diff --git a/sources/pyside6/tests/signals/signal_newenum_test.py b/sources/pyside6/tests/signals/signal_newenum_test.py
index 5fbb875af..839c9e2af 100644
--- a/sources/pyside6/tests/signals/signal_newenum_test.py
+++ b/sources/pyside6/tests/signals/signal_newenum_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/signal_number_limit_test.py b/sources/pyside6/tests/signals/signal_number_limit_test.py
index 29825fe50..959ae6f08 100644
--- a/sources/pyside6/tests/signals/signal_number_limit_test.py
+++ b/sources/pyside6/tests/signals/signal_number_limit_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/signal_object_test.py b/sources/pyside6/tests/signals/signal_object_test.py
index 607f51813..84f2aba4c 100644
--- a/sources/pyside6/tests/signals/signal_object_test.py
+++ b/sources/pyside6/tests/signals/signal_object_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/signal_signature_test.py b/sources/pyside6/tests/signals/signal_signature_test.py
index e8f08b2d9..905b5b01b 100644
--- a/sources/pyside6/tests/signals/signal_signature_test.py
+++ b/sources/pyside6/tests/signals/signal_signature_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for signal signature received by QObject::connectNotify().'''
diff --git a/sources/pyside6/tests/signals/signal_with_primitive_type_test.py b/sources/pyside6/tests/signals/signal_with_primitive_type_test.py
index 01492b333..96554c31b 100644
--- a/sources/pyside6/tests/signals/signal_with_primitive_type_test.py
+++ b/sources/pyside6/tests/signals/signal_with_primitive_type_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/signals/slot_reference_count_test.py b/sources/pyside6/tests/signals/slot_reference_count_test.py
index 9d5c73652..88c97f33d 100644
--- a/sources/pyside6/tests/signals/slot_reference_count_test.py
+++ b/sources/pyside6/tests/signals/slot_reference_count_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Forced disconnection: Delete one end of the signal connection'''
diff --git a/sources/pyside6/tests/signals/static_metaobject_test.py b/sources/pyside6/tests/signals/static_metaobject_test.py
index d7bf73e44..b48e4bc29 100644
--- a/sources/pyside6/tests/signals/static_metaobject_test.py
+++ b/sources/pyside6/tests/signals/static_metaobject_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""Tests covering signal emission and receiving to python slots"""
diff --git a/sources/pyside6/tests/support/voidptr_test.py b/sources/pyside6/tests/support/voidptr_test.py
index d9ea57a61..a5b6e48ef 100644
--- a/sources/pyside6/tests/support/voidptr_test.py
+++ b/sources/pyside6/tests/support/voidptr_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/tools/list-class-hierarchy.py b/sources/pyside6/tests/tools/list-class-hierarchy.py
index b773b7c58..2a3824f23 100644
--- a/sources/pyside6/tests/tools/list-class-hierarchy.py
+++ b/sources/pyside6/tests/tools/list-class-hierarchy.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
# This is a small script printing out Qt binding class hierarchies
# for comparison purposes.
diff --git a/sources/pyside6/tests/tools/metaobjectdump/test_metaobjectdump.py b/sources/pyside6/tests/tools/metaobjectdump/test_metaobjectdump.py
index 5e7412bf5..fbfea010e 100644
--- a/sources/pyside6/tests/tools/metaobjectdump/test_metaobjectdump.py
+++ b/sources/pyside6/tests/tools/metaobjectdump/test_metaobjectdump.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/pyside6/tests/tools/pyside6-android-deploy/extensive_android_deploy_test.py b/sources/pyside6/tests/tools/pyside6-android-deploy/extensive_android_deploy_test.py
index 271f8eebd..c189922ed 100644
--- a/sources/pyside6/tests/tools/pyside6-android-deploy/extensive_android_deploy_test.py
+++ b/sources/pyside6/tests/tools/pyside6-android-deploy/extensive_android_deploy_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
Extensive manual test of pyside6-android-deploy
diff --git a/sources/pyside6/tests/tools/pyside6-android-deploy/test_pyside6_android_deploy.py b/sources/pyside6/tests/tools/pyside6-android-deploy/test_pyside6_android_deploy.py
index ec575e923..a67f1a87a 100644
--- a/sources/pyside6/tests/tools/pyside6-android-deploy/test_pyside6_android_deploy.py
+++ b/sources/pyside6/tests/tools/pyside6-android-deploy/test_pyside6_android_deploy.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import importlib
import os
diff --git a/sources/pyside6/tests/tools/pyside6-deploy/extensive_deploy_test.py b/sources/pyside6/tests/tools/pyside6-deploy/extensive_deploy_test.py
index 40afc7f5c..d15795f4d 100644
--- a/sources/pyside6/tests/tools/pyside6-deploy/extensive_deploy_test.py
+++ b/sources/pyside6/tests/tools/pyside6-deploy/extensive_deploy_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
Extensive manual test of pyside6-deploy
diff --git a/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py b/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py
index 02293c33e..e55f82314 100644
--- a/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py
+++ b/sources/pyside6/tests/tools/pyside6-deploy/test_pyside6_deploy.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import unittest
import tempfile
@@ -63,6 +64,9 @@ class DeployTestBase(LongSortedOptionTest):
cls.deploy_lib = importlib.import_module("deploy_lib")
cls.deploy = importlib.import_module("deploy")
sys.modules["deploy"] = cls.deploy
+ files_to_ignore = [".cpp.o", ".qsb", ".webp"]
+ cls.dlls_ignore_nuitka = " ".join([f"--noinclude-dlls=*{file}"
+ for file in files_to_ignore])
# required for comparing long strings
cls.maxDiff = None
@@ -107,6 +111,7 @@ class TestPySide6DeployWidgets(DeployTestBase):
f" --enable-plugin=pyside6 --output-dir={str(self.deployment_files)} --quiet"
f" --noinclude-qt-translations"
f" --include-qt-plugins={plugins_nuitka}"
+ f" {self.dlls_ignore_nuitka}"
)
if sys.platform.startswith("linux"):
self.expected_run_cmd += f" --linux-icon={str(self.linux_icon)} --onefile"
@@ -147,7 +152,7 @@ class TestPySide6DeployWidgets(DeployTestBase):
self.assertEqual(config_obj.get_value("app", "project_dir"), ".")
self.assertEqual(config_obj.get_value("app", "exec_directory"), ".")
self.assertEqual(config_obj.get_value("python", "packages"),
- "Nuitka==2.1")
+ "Nuitka==2.3.2")
self.assertEqual(config_obj.get_value("qt", "qml_files"), "")
equ_base = "--quiet --noinclude-qt-translations"
equ_value = equ_base + " --static-libpython=no" if is_pyenv_python() else equ_base
@@ -170,6 +175,16 @@ class TestPySide6DeployWidgets(DeployTestBase):
self.deploy.main(main_file=fake_main_file, config_file=self.config_file)
self.assertTrue("Directory does not contain main.py file." in str(context.exception))
+ def testStandaloneMode(self, mock_plugins):
+ mock_plugins.return_value = self.all_plugins
+ # remove --onefile from self.expected_run_cmd and replace it with --standalone
+ self.expected_run_cmd = self.expected_run_cmd.replace(" --onefile", " --standalone")
+ # test standalone mode
+ original_output = self.deploy.main(self.main_file, mode="standalone", dry_run=True,
+ force=True)
+
+ self.assertEqual(original_output, self.expected_run_cmd)
+
@unittest.skipIf(sys.platform == "darwin" and int(platform.mac_ver()[0].split('.')[0]) <= 11,
"Test only works on macOS version 12+")
@@ -189,6 +204,7 @@ class TestPySide6DeployQml(DeployTestBase):
self.deployment_files = self.temp_example_qml / "deployment"
self.first_qml_file = "main.qml"
self.second_qml_file = "MovingRectangle.qml"
+
# All the plugins included. This is different from plugins_nuitka, because Nuitka bundles
# some plugins by default
self.all_plugins = ["accessiblebridge", "egldeviceintegrations", "generic", "iconengines",
@@ -203,6 +219,8 @@ class TestPySide6DeployQml(DeployTestBase):
f"{sys.executable} -m nuitka {str(self.main_file)} --follow-imports"
f" --enable-plugin=pyside6 --output-dir={str(self.deployment_files)} --quiet"
f" --noinclude-qt-translations"
+ f" {self.dlls_ignore_nuitka}"
+ " --noinclude-dlls=*/qml/QtQuickEffectMaker/*"
f" --include-qt-plugins={plugins_nuitka}"
f" --include-data-files={str(self.temp_example_qml / self.first_qml_file)}="
f"./main.qml --include-data-files="
@@ -250,7 +268,7 @@ class TestPySide6DeployQml(DeployTestBase):
self.assertEqual(config_obj.get_value("app", "project_dir"), ".")
self.assertEqual(config_obj.get_value("app", "exec_directory"), ".")
self.assertEqual(config_obj.get_value("python", "packages"),
- "Nuitka==2.1")
+ "Nuitka==2.3.2")
self.assertEqual(config_obj.get_value("qt", "qml_files"), "main.qml,MovingRectangle.qml")
equ_base = "--quiet --noinclude-qt-translations"
equ_value = equ_base + " --static-libpython=no" if is_pyenv_python() else equ_base
@@ -334,6 +352,8 @@ class TestPySide6DeployWebEngine(DeployTestBase):
f" --noinclude-qt-translations --include-qt-plugins=all"
f" {data_files_cmd}"
f" --include-qt-plugins={plugins_nuitka}"
+ f" {self.dlls_ignore_nuitka}"
+ " --noinclude-dlls=*/qml/QtQuickEffectMaker/*"
)
if sys.platform != "win32":
diff --git a/sources/pyside6/tests/tools/pyside6-qml/test_pyside6_qml.py b/sources/pyside6/tests/tools/pyside6-qml/test_pyside6_qml.py
index fdaf3d471..6015ebc88 100644
--- a/sources/pyside6/tests/tools/pyside6-qml/test_pyside6_qml.py
+++ b/sources/pyside6/tests/tools/pyside6-qml/test_pyside6_qml.py
@@ -1,5 +1,6 @@
# Copyright (C) 2018 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""Test for pyside6-qml
diff --git a/sources/pyside6/tests/util/color.py b/sources/pyside6/tests/util/color.py
index e85be28f3..fb91beac8 100644
--- a/sources/pyside6/tests/util/color.py
+++ b/sources/pyside6/tests/util/color.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Function to print a colored line to terminal'''
diff --git a/sources/pyside6/tests/util/helper/basicpyslotcase.py b/sources/pyside6/tests/util/helper/basicpyslotcase.py
index 500735c3a..80da149bd 100644
--- a/sources/pyside6/tests/util/helper/basicpyslotcase.py
+++ b/sources/pyside6/tests/util/helper/basicpyslotcase.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
diff --git a/sources/pyside6/tests/util/helper/docmodifier.py b/sources/pyside6/tests/util/helper/docmodifier.py
index cfb665640..b6de62abb 100644
--- a/sources/pyside6/tests/util/helper/docmodifier.py
+++ b/sources/pyside6/tests/util/helper/docmodifier.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Helper metaclass do 'decorate' docstrings from base test case classes'''
diff --git a/sources/pyside6/tests/util/helper/helper.py b/sources/pyside6/tests/util/helper/helper.py
index f80753f1f..ba742099e 100644
--- a/sources/pyside6/tests/util/helper/helper.py
+++ b/sources/pyside6/tests/util/helper/helper.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Helper classes and functions'''
diff --git a/sources/pyside6/tests/util/helper/timedqapplication.py b/sources/pyside6/tests/util/helper/timedqapplication.py
index d9250a9e0..4984ad2c0 100644
--- a/sources/pyside6/tests/util/helper/timedqapplication.py
+++ b/sources/pyside6/tests/util/helper/timedqapplication.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Helper classes and functions'''
diff --git a/sources/pyside6/tests/util/helper/timedqguiapplication.py b/sources/pyside6/tests/util/helper/timedqguiapplication.py
index 3d9a4217c..86bc8df7d 100644
--- a/sources/pyside6/tests/util/helper/timedqguiapplication.py
+++ b/sources/pyside6/tests/util/helper/timedqguiapplication.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Helper classes and functions'''
diff --git a/sources/pyside6/tests/util/helper/usesqapplication.py b/sources/pyside6/tests/util/helper/usesqapplication.py
index f62e320f4..44723d392 100644
--- a/sources/pyside6/tests/util/helper/usesqapplication.py
+++ b/sources/pyside6/tests/util/helper/usesqapplication.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Helper classes and functions'''
diff --git a/sources/pyside6/tests/util/httpd.py b/sources/pyside6/tests/util/httpd.py
index 4e6be4881..9141c191c 100644
--- a/sources/pyside6/tests/util/httpd.py
+++ b/sources/pyside6/tests/util/httpd.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import http.server as BaseHTTPServer
import os
diff --git a/sources/pyside6/tests/util/processtimer.py b/sources/pyside6/tests/util/processtimer.py
index e471cf167..8187901c6 100644
--- a/sources/pyside6/tests/util/processtimer.py
+++ b/sources/pyside6/tests/util/processtimer.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import time
diff --git a/sources/pyside6/tests/util/test_processtimer.py b/sources/pyside6/tests/util/test_processtimer.py
index cee6aa14d..417db8bec 100644
--- a/sources/pyside6/tests/util/test_processtimer.py
+++ b/sources/pyside6/tests/util/test_processtimer.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'Tests for processtimer.py'
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 29566a272..f07fb96c6 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -81,7 +81,7 @@ QTextStream &operator<<(QTextStream &str, const RejectEntry &re)
return str;
}
-static void applyCachedFunctionModifications(AbstractMetaFunction *metaFunction,
+static void applyCachedFunctionModifications(const AbstractMetaFunctionPtr &metaFunction,
const FunctionModificationList &functionMods)
{
for (const FunctionModification &mod : functionMods) {
@@ -317,7 +317,7 @@ void AbstractMetaBuilderPrivate::traverseOperatorFunction(const FunctionModelIte
return;
}
- AbstractMetaFunction *metaFunction = traverseFunction(item, baseoperandClass);
+ auto metaFunction = traverseFunction(item, baseoperandClass);
if (metaFunction == nullptr)
return;
@@ -350,7 +350,7 @@ void AbstractMetaBuilderPrivate::traverseOperatorFunction(const FunctionModelIte
}
metaFunction->setFlags(flags);
metaFunction->setAccess(Access::Public);
- AbstractMetaClass::addFunction(baseoperandClass, AbstractMetaFunctionCPtr(metaFunction));
+ AbstractMetaClass::addFunction(baseoperandClass, metaFunction);
if (!metaFunction->arguments().isEmpty()) {
const auto include = metaFunction->arguments().constFirst().type().typeEntry()->include();
baseoperandClass->typeEntry()->addArgumentInclude(include);
@@ -371,7 +371,7 @@ bool AbstractMetaBuilderPrivate::traverseStreamOperator(const FunctionModelItem
if (streamedClass == nullptr)
return false;
- AbstractMetaFunction *streamFunction = traverseFunction(item, streamedClass);
+ auto streamFunction = traverseFunction(item, streamedClass);
if (!streamFunction)
return false;
@@ -401,7 +401,7 @@ bool AbstractMetaBuilderPrivate::traverseStreamOperator(const FunctionModelItem
funcClass = streamClass;
}
- AbstractMetaClass::addFunction(funcClass, AbstractMetaFunctionCPtr(streamFunction));
+ AbstractMetaClass::addFunction(funcClass, streamFunction);
auto funcTe = funcClass->typeEntry();
if (funcClass == streamClass)
funcTe->addArgumentInclude(streamedClass->typeEntry()->include());
@@ -461,7 +461,7 @@ FileModelItem AbstractMetaBuilderPrivate::buildDom(QByteArrayList arguments,
+ clang::languageLevelOption(level));
}
FileModelItem result = clang::parse(arguments, addCompilerSupportArguments,
- clangFlags, builder)
+ level, clangFlags, builder)
? builder.dom() : FileModelItem();
const clang::BaseVisitor::Diagnostics &diagnostics = builder.diagnostics();
if (const auto diagnosticsCount = diagnostics.size()) {
@@ -555,17 +555,16 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom,
if (!funcEntry || !funcEntry->generateCode())
continue;
- AbstractMetaFunction *metaFunc = traverseFunction(func, nullptr);
- if (!metaFunc)
+ auto metaFuncPtr = traverseFunction(func, nullptr);
+ if (!metaFuncPtr)
continue;
- AbstractMetaFunctionCPtr metaFuncPtr(metaFunc);
- if (!funcEntry->hasSignature(metaFunc->minimalSignature()))
+ if (!funcEntry->hasSignature(metaFuncPtr->minimalSignature()))
continue;
- metaFunc->setTypeEntry(funcEntry);
- applyFunctionModifications(metaFunc);
- metaFunc->applyTypeModifications();
+ metaFuncPtr->setTypeEntry(funcEntry);
+ applyFunctionModifications(metaFuncPtr);
+ metaFuncPtr->applyTypeModifications();
setInclude(funcEntry, func->fileName());
@@ -1348,7 +1347,7 @@ void AbstractMetaBuilderPrivate::traverseFields(const ScopeModelItem &scope_item
}
}
-void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(AbstractMetaFunction *metaFunction)
+void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(const AbstractMetaFunctionPtr &metaFunction)
{
if (!metaFunction->isConversionOperator())
return;
@@ -1372,13 +1371,13 @@ void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(AbstractMetaF
metaFunction->setType(metaType);
}
-AbstractMetaFunctionRawPtrList
+AbstractMetaFunctionList
AbstractMetaBuilderPrivate::classFunctionList(const ScopeModelItem &scopeItem,
AbstractMetaClass::Attributes *constructorAttributes,
const AbstractMetaClassPtr &currentClass)
{
*constructorAttributes = {};
- AbstractMetaFunctionRawPtrList result;
+ AbstractMetaFunctionList result;
const FunctionList &scopeFunctionList = scopeItem->functions();
result.reserve(scopeFunctionList.size());
const bool isNamespace = currentClass->isNamespace();
@@ -1388,7 +1387,7 @@ AbstractMetaFunctionRawPtrList
} else if (function->isSpaceshipOperator() && !function->isDeleted()) {
if (currentClass)
AbstractMetaClass::addSynthesizedComparisonOperators(currentClass);
- } else if (auto *metaFunction = traverseFunction(function, currentClass)) {
+ } else if (auto metaFunction = traverseFunction(function, currentClass)) {
result.append(metaFunction);
} else if (!function->isDeleted() && function->functionType() == CodeModel::Constructor) {
auto arguments = function->arguments();
@@ -1404,11 +1403,11 @@ void AbstractMetaBuilderPrivate::traverseFunctions(const ScopeModelItem& scopeIt
const AbstractMetaClassPtr &metaClass)
{
AbstractMetaClass::Attributes constructorAttributes;
- const AbstractMetaFunctionRawPtrList functions =
+ const AbstractMetaFunctionList functions =
classFunctionList(scopeItem, &constructorAttributes, metaClass);
metaClass->setAttributes(metaClass->attributes() | constructorAttributes);
- for (AbstractMetaFunction *metaFunction : functions) {
+ for (const auto &metaFunction : functions) {
if (metaClass->isNamespace())
metaFunction->setCppAttribute(FunctionAttribute::Static);
@@ -1461,23 +1460,20 @@ void AbstractMetaBuilderPrivate::traverseFunctions(const ScopeModelItem& scopeIt
if (!metaFunction->isDestructor()
&& !(metaFunction->isPrivate() && metaFunction->functionType() == AbstractMetaFunction::ConstructorFunction)) {
- if (metaFunction->isSignal() && metaClass->hasSignal(metaFunction))
- qCWarning(lcShiboken, "%s", qPrintable(msgSignalOverloaded(metaClass, metaFunction)));
+ if (metaFunction->isSignal() && metaClass->hasSignal(metaFunction.get()))
+ qCWarning(lcShiboken, "%s", qPrintable(msgSignalOverloaded(metaClass,
+ metaFunction.get())));
if (metaFunction->isConversionOperator())
fixReturnTypeOfConversionOperator(metaFunction);
- AbstractMetaClass::addFunction(metaClass, AbstractMetaFunctionCPtr(metaFunction));
+ AbstractMetaClass::addFunction(metaClass, metaFunction);
applyFunctionModifications(metaFunction);
} else if (metaFunction->isDestructor()) {
metaClass->setHasPrivateDestructor(metaFunction->isPrivate());
metaClass->setHasProtectedDestructor(metaFunction->isProtected());
metaClass->setHasVirtualDestructor(metaFunction->isVirtual());
}
- if (!metaFunction->ownerClass()) {
- delete metaFunction;
- metaFunction = nullptr;
- }
}
fillAddedFunctions(metaClass);
@@ -1539,7 +1535,7 @@ QStringList AbstractMetaBuilder::definitionNames(const QString &name,
return result;
}
-void AbstractMetaBuilderPrivate::applyFunctionModifications(AbstractMetaFunction *func)
+void AbstractMetaBuilderPrivate::applyFunctionModifications(const AbstractMetaFunctionPtr &func)
{
AbstractMetaFunction& funcRef = *func;
for (const FunctionModification &mod : func->modifications(func->implementingClass())) {
@@ -1677,15 +1673,14 @@ static AbstractMetaFunction::FunctionType functionTypeFromName(const QString &);
bool AbstractMetaBuilderPrivate::traverseAddedGlobalFunction(const AddedFunctionPtr &addedFunc,
QString *errorMessage)
{
- AbstractMetaFunction *metaFunction =
- traverseAddedFunctionHelper(addedFunc, nullptr, errorMessage);
+ auto metaFunction = traverseAddedFunctionHelper(addedFunc, nullptr, errorMessage);
if (metaFunction == nullptr)
return false;
- m_globalFunctions << AbstractMetaFunctionCPtr(metaFunction);
+ m_globalFunctions << metaFunction;
return true;
}
-AbstractMetaFunction *
+AbstractMetaFunctionPtr
AbstractMetaBuilderPrivate::traverseAddedFunctionHelper(const AddedFunctionPtr &addedFunc,
const AbstractMetaClassPtr &metaClass /* = {} */,
QString *errorMessage)
@@ -1696,10 +1691,10 @@ AbstractMetaFunction *
msgAddedFunctionInvalidReturnType(addedFunc->name(),
addedFunc->returnType().qualifiedName(),
*errorMessage, metaClass);
- return nullptr;
+ return {};
}
- auto *metaFunction = new AbstractMetaFunction(addedFunc);
+ auto metaFunction = std::make_shared<AbstractMetaFunction>(addedFunc);
metaFunction->setType(returnType.value());
metaFunction->setFunctionType(functionTypeFromName(addedFunc->name()));
@@ -1717,8 +1712,7 @@ AbstractMetaFunction *
msgAddedFunctionInvalidArgType(addedFunc->name(),
arg.typeInfo.qualifiedName(), i + 1,
*errorMessage, metaClass);
- delete metaFunction;
- return nullptr;
+ return {};
}
type->decideUsagePattern();
@@ -1775,8 +1769,7 @@ bool AbstractMetaBuilderPrivate::traverseAddedMemberFunction(const AddedFunction
const AbstractMetaClassPtr &metaClass,
QString *errorMessage)
{
- AbstractMetaFunction *metaFunction =
- traverseAddedFunctionHelper(addedFunc, metaClass, errorMessage);
+ auto metaFunction = traverseAddedFunctionHelper(addedFunc, metaClass, errorMessage);
if (metaFunction == nullptr)
return false;
@@ -1796,12 +1789,13 @@ bool AbstractMetaBuilderPrivate::traverseAddedMemberFunction(const AddedFunction
metaFunction->setDeclaringClass(metaClass);
metaFunction->setImplementingClass(metaClass);
- AbstractMetaClass::addFunction(metaClass, AbstractMetaFunctionCPtr(metaFunction));
+ AbstractMetaClass::addFunction(metaClass, metaFunction);
metaClass->setHasNonPrivateConstructor(true);
return true;
}
-void AbstractMetaBuilderPrivate::fixArgumentNames(AbstractMetaFunction *func, const FunctionModificationList &mods)
+void AbstractMetaBuilderPrivate::fixArgumentNames(const AbstractMetaFunctionPtr &func,
+ const FunctionModificationList &mods)
{
AbstractMetaArgumentList &arguments = func->arguments();
@@ -1920,7 +1914,7 @@ static AbstractMetaFunction::FunctionType functionTypeFromName(const QString &na
// Apply the <array> modifications of the arguments
static bool applyArrayArgumentModifications(const FunctionModificationList &functionMods,
- AbstractMetaFunction *func,
+ const AbstractMetaFunctionPtr &func,
QString *errorMessage)
{
for (const FunctionModification &mod : functionMods) {
@@ -1981,13 +1975,14 @@ void AbstractMetaBuilderPrivate::rejectFunction(const FunctionModelItem &functio
m_rejectedFunctions.insert({reason, signatureWithType, sortKey, rejectReason});
}
-AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const FunctionModelItem &functionItem,
- const AbstractMetaClassPtr &currentClass)
+AbstractMetaFunctionPtr
+ AbstractMetaBuilderPrivate::traverseFunction(const FunctionModelItem &functionItem,
+ const AbstractMetaClassPtr &currentClass)
{
const auto *tdb = TypeDatabase::instance();
if (!functionItem->templateParameters().isEmpty())
- return nullptr;
+ return {};
if (functionItem->isDeleted()) {
switch (functionItem->functionType()) {
@@ -2001,7 +1996,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
default:
break;
}
- return nullptr;
+ return {};
}
const QString &functionName = functionItem->name();
const QString className = currentClass != nullptr ?
@@ -2011,7 +2006,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
// Skip enum helpers generated by Q_ENUM
if ((currentClass == nullptr || currentClass->isNamespace())
&& (functionName == u"qt_getEnumMetaObject" || functionName == u"qt_getEnumName")) {
- return nullptr;
+ return {};
}
// Clang: Skip qt_metacast(), qt_metacall(), expanded from Q_OBJECT
@@ -2019,10 +2014,10 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
if (currentClass != nullptr) {
if (functionName == u"qt_check_for_QGADGET_macro"
|| functionName.startsWith(u"qt_meta")) {
- return nullptr;
+ return {};
}
if (functionName == u"metaObject" && className != u"QObject")
- return nullptr;
+ return {};
}
} // PySide extensions
@@ -2030,7 +2025,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
if (tdb->isFunctionRejected(className, functionName, &rejectReason)) {
rejectFunction(functionItem, currentClass,
AbstractMetaBuilder::GenerationDisabled, rejectReason);
- return nullptr;
+ return {};
}
const QString &signature = functionSignature(functionItem);
@@ -2041,22 +2036,22 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
qCInfo(lcShiboken, "%s::%s was rejected by the type database (%s).",
qPrintable(className), qPrintable(signature), qPrintable(rejectReason));
}
- return nullptr;
+ return {};
}
if (functionItem->isFriend())
- return nullptr;
+ return {};
const auto cppAttributes = functionItem->attributes();
const bool deprecated = cppAttributes.testFlag(FunctionAttribute::Deprecated);
if (deprecated && m_skipDeprecated) {
rejectFunction(functionItem, currentClass,
AbstractMetaBuilder::GenerationDisabled, u" is deprecated."_s);
- return nullptr;
+ return {};
}
AbstractMetaFunction::Flags flags;
- auto *metaFunction = new AbstractMetaFunction(functionName);
+ auto metaFunction = std::make_shared<AbstractMetaFunction>(functionName);
metaFunction->setCppAttributes(cppAttributes);
const QByteArray cSignature = signature.toUtf8();
const QString unresolvedSignature =
@@ -2089,8 +2084,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
if (tdb->isReturnTypeRejected(className, returnType.toString(), &rejectReason)) {
rejectFunction(functionItem, currentClass,
AbstractMetaBuilder::GenerationDisabled, rejectReason);
- delete metaFunction;
- return nullptr;
+ return {};
}
TranslateTypeFlags flags;
@@ -2104,8 +2098,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
qPrintable(msgSkippingFunction(functionItem, signature, reason)));
rejectFunction(functionItem, currentClass,
AbstractMetaBuilder::UnmatchedReturnType, reason);
- delete metaFunction;
- return nullptr;
+ return {};
}
metaFunction->setType(type.value());
@@ -2136,8 +2129,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
if (tdb->isArgumentTypeRejected(className, arg->type().toString(), &rejectReason)) {
rejectFunction(functionItem, currentClass,
AbstractMetaBuilder::GenerationDisabled, rejectReason);
- delete metaFunction;
- return nullptr;
+ return {};
}
TranslateTypeFlags flags;
@@ -2164,8 +2156,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
qPrintable(msgSkippingFunction(functionItem, signature, reason)));
rejectFunction(functionItem, currentClass,
AbstractMetaBuilder::UnmatchedArgumentType, reason);
- delete metaFunction;
- return nullptr;
+ return {};
}
auto metaType = metaTypeO.value();
@@ -2188,8 +2179,8 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
AbstractMetaArgumentList &metaArguments = metaFunction->arguments();
const FunctionModificationList functionMods = currentClass
- ? AbstractMetaFunction::findClassModifications(metaFunction, currentClass)
- : AbstractMetaFunction::findGlobalModifications(metaFunction);
+ ? AbstractMetaFunction::findClassModifications(metaFunction.get(), currentClass)
+ : AbstractMetaFunction::findGlobalModifications(metaFunction.get());
applyCachedFunctionModifications(metaFunction, functionMods);
@@ -2214,7 +2205,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
&& metaFunction->argumentName(i + 1, false, currentClass).isEmpty()) {
qCWarning(lcShiboken, "%s",
qPrintable(msgUnnamedArgumentDefaultExpression(currentClass, i + 1,
- className, metaFunction)));
+ className, metaFunction.get())));
}
}
@@ -3129,15 +3120,14 @@ std::optional<AbstractMetaType>
AbstractMetaClassPtr
AbstractMetaBuilder::inheritTemplateClass(const ComplexTypeEntryPtr &te,
const AbstractMetaClassCPtr &templateClass,
- const AbstractMetaTypeList &templateTypes,
- InheritTemplateFlags flags)
+ const AbstractMetaTypeList &templateTypes)
{
auto result = std::make_shared<AbstractMetaClass>();
result->setTypeDef(true);
result->setTypeEntry(te);
if (!AbstractMetaBuilderPrivate::inheritTemplate(result, templateClass,
- templateTypes, flags)) {
+ templateTypes)) {
return {};
}
AbstractMetaBuilderPrivate::inheritTemplateFunctions(result);
@@ -3224,12 +3214,9 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(const AbstractMetaClassPtr &sub
bool AbstractMetaBuilderPrivate::inheritTemplate(const AbstractMetaClassPtr &subclass,
const AbstractMetaClassCPtr &templateClass,
- const AbstractMetaTypeList &templateTypes,
- InheritTemplateFlags flags)
+ const AbstractMetaTypeList &templateTypes)
{
subclass->setTemplateBaseClass(templateClass);
- if (flags.testFlag(InheritTemplateFlag::SetEnclosingClass))
- subclass->setEnclosingClass(templateClass->enclosingClass());
subclass->setTemplateBaseClassInstantiations(templateTypes);
subclass->setBaseClass(templateClass->baseClass());
return true;
@@ -3319,7 +3306,7 @@ AbstractMetaFunctionPtr
}
QString errorMessage;
- if (!applyArrayArgumentModifications(f->modifications(subclass), f.get(),
+ if (!applyArrayArgumentModifications(f->modifications(subclass), f,
&errorMessage)) {
qCWarning(lcShiboken, "While specializing %s (%s): %s",
qPrintable(subclass->name()), qPrintable(templateClass->name()),
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder.h
index cbd8c7034..20261ed3c 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.h
@@ -100,10 +100,9 @@ public:
const AbstractMetaTypeList &templateTypes);
static AbstractMetaClassPtr
- inheritTemplateClass(const ComplexTypeEntryPtr &te,
- const AbstractMetaClassCPtr &templateClass,
- const AbstractMetaTypeList &templateTypes,
- InheritTemplateFlags flags = {});
+ inheritTemplateClass(const ComplexTypeEntryPtr &te,
+ const AbstractMetaClassCPtr &templateClass,
+ const AbstractMetaTypeList &templateTypes);
/// Performs a template specialization of the member function.
/// \param function Member function
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
index d7aaba5b0..4e337339e 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
@@ -98,20 +98,21 @@ public:
const QSet<QString> &enumsDeclarations);
void traverseEnums(const ScopeModelItem &item, const AbstractMetaClassPtr &parent,
const QStringList &enumsDeclarations);
- AbstractMetaFunctionRawPtrList classFunctionList(const ScopeModelItem &scopeItem,
- AbstractMetaClass::Attributes *constructorAttributes,
- const AbstractMetaClassPtr &currentClass);
+ AbstractMetaFunctionList classFunctionList(const ScopeModelItem &scopeItem,
+ AbstractMetaClass::Attributes *constructorAttributes,
+ const AbstractMetaClassPtr &currentClass);
void traverseFunctions(const ScopeModelItem& item,
const AbstractMetaClassPtr &parent);
- static void applyFunctionModifications(AbstractMetaFunction *func);
+ static void applyFunctionModifications(const AbstractMetaFunctionPtr &func);
void traverseFields(const ScopeModelItem &item, const AbstractMetaClassPtr &parent);
bool traverseStreamOperator(const FunctionModelItem &functionItem,
const AbstractMetaClassPtr &currentClass);
void traverseOperatorFunction(const FunctionModelItem &item,
const AbstractMetaClassPtr &currentClass);
- AbstractMetaFunction *traverseAddedFunctionHelper(const AddedFunctionPtr &addedFunc,
- const AbstractMetaClassPtr &metaClass,
- QString *errorMessage);
+ AbstractMetaFunctionPtr
+ traverseAddedFunctionHelper(const AddedFunctionPtr &addedFunc,
+ const AbstractMetaClassPtr &metaClass,
+ QString *errorMessage);
bool traverseAddedGlobalFunction(const AddedFunctionPtr &addedFunc,
QString *errorMessage);
bool traverseAddedMemberFunction(const AddedFunctionPtr &addedFunc,
@@ -121,8 +122,9 @@ public:
const AbstractMetaClassPtr &currentClass,
AbstractMetaBuilder::RejectReason reason,
const QString &rejectReason);
- AbstractMetaFunction *traverseFunction(const FunctionModelItem &function,
- const AbstractMetaClassPtr &currentClass);
+ AbstractMetaFunctionPtr
+ traverseFunction(const FunctionModelItem &function,
+ const AbstractMetaClassPtr &currentClass);
std::optional<AbstractMetaField> traverseField(const VariableModelItem &field,
const AbstractMetaClassCPtr &cls);
void checkFunctionModifications() const;
@@ -142,7 +144,7 @@ public:
* said class.
* \param metaFunction conversion operator function to be fixed.
*/
- static void fixReturnTypeOfConversionOperator(AbstractMetaFunction *metaFunction);
+ static void fixReturnTypeOfConversionOperator(const AbstractMetaFunctionPtr &metaFunction);
void parseQ_Properties(const AbstractMetaClassPtr &metaClass,
const QStringList &declarations);
@@ -190,8 +192,7 @@ public:
const TypeInfo &info);
static bool inheritTemplate(const AbstractMetaClassPtr &subclass,
const AbstractMetaClassCPtr &templateClass,
- const AbstractMetaTypeList &templateTypes,
- InheritTemplateFlags flags = {});
+ const AbstractMetaTypeList &templateTypes);
static AbstractMetaFunctionPtr
inheritTemplateFunction(const AbstractMetaFunctionCPtr &function,
@@ -213,7 +214,8 @@ public:
void sortLists();
void setInclude(const TypeEntryPtr &te, const QString &path) const;
- static void fixArgumentNames(AbstractMetaFunction *func, const FunctionModificationList &mods);
+ static void fixArgumentNames(const AbstractMetaFunctionPtr &func,
+ const FunctionModificationList &mods);
void fillAddedFunctions(const AbstractMetaClassPtr &metaClass);
AbstractMetaClassCPtr resolveTypeSystemTypeDef(const AbstractMetaType &t) const;
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang_typedefs.h b/sources/shiboken6/ApiExtractor/abstractmetalang_typedefs.h
index 802f549cf..27321ca2d 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang_typedefs.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang_typedefs.h
@@ -30,6 +30,7 @@ using AbstractMetaEnumValueList = QList<AbstractMetaEnumValue>;
using AbstractMetaFieldList = QList<AbstractMetaField>;
using AbstractMetaFunctionRawPtrList = QList<AbstractMetaFunction *>;
using AbstractMetaFunctionCList = QList<AbstractMetaFunctionCPtr>;
+using AbstractMetaFunctionList = QList<AbstractMetaFunctionPtr>;
using AbstractMetaTypeList = QList<AbstractMetaType>;
using UsingMembers = QList<UsingMember>;
diff --git a/sources/shiboken6/ApiExtractor/apiextractor.cpp b/sources/shiboken6/ApiExtractor/apiextractor.cpp
index 83ee4437e..786cd0783 100644
--- a/sources/shiboken6/ApiExtractor/apiextractor.cpp
+++ b/sources/shiboken6/ApiExtractor/apiextractor.cpp
@@ -456,11 +456,10 @@ AbstractMetaFunctionPtr
AbstractMetaClassPtr ApiExtractor::inheritTemplateClass(const ComplexTypeEntryPtr &te,
const AbstractMetaClassCPtr &templateClass,
- const AbstractMetaTypeList &templateTypes,
- InheritTemplateFlags flags)
+ const AbstractMetaTypeList &templateTypes)
{
return AbstractMetaBuilder::inheritTemplateClass(te, templateClass,
- templateTypes, flags);
+ templateTypes);
}
QString ApiExtractorPrivate::getSimplifiedContainerTypeName(const AbstractMetaType &type)
@@ -606,7 +605,15 @@ void ApiExtractorPrivate::addInstantiatedSmartPointer(InstantiationCollectContex
const auto ste = std::static_pointer_cast<const SmartPointerTypeEntry>(smp.smartPointer->typeEntry());
QString name = ste->getTargetName(smp.type);
auto parentTypeEntry = ste->parent();
- InheritTemplateFlags flags;
+
+ // FIXME PYSIDE 7: Make global scope the default behavior?
+ // Note: Also requires changing SmartPointerTypeEntry::getTargetName()
+ // to not strip namespaces from unnamed instances.
+ const bool globalScope = name.startsWith("::"_L1);
+ if (globalScope) {
+ name.remove(0, 2);
+ parentTypeEntry = typeSystemTypeEntry(ste);
+ }
auto colonPos = name.lastIndexOf(u"::");
const bool withinNameSpace = colonPos != -1;
@@ -617,19 +624,18 @@ void ApiExtractorPrivate::addInstantiatedSmartPointer(InstantiationCollectContex
if (nameSpaces.isEmpty())
throw Exception(msgNamespaceNotFound(name));
parentTypeEntry = nameSpaces.constFirst();
- } else {
- flags.setFlag(InheritTemplateFlag::SetEnclosingClass);
}
TypedefEntryPtr typedefEntry(new TypedefEntry(name, ste->name(), ste->version(),
parentTypeEntry));
typedefEntry->setTargetLangPackage(ste->targetLangPackage());
auto instantiationEntry = TypeDatabase::initializeTypeDefEntry(typedefEntry, ste);
+ instantiationEntry->setParent(parentTypeEntry);
smp.specialized = ApiExtractor::inheritTemplateClass(instantiationEntry, smp.smartPointer,
- {instantiatedType}, flags);
+ {instantiatedType});
Q_ASSERT(smp.specialized);
- if (withinNameSpace) { // move class to desired namespace
+ if (parentTypeEntry->type() != TypeEntry::TypeSystemType) { // move class to desired namespace
const auto enclClass = AbstractMetaClass::findClass(m_builder->classes(), parentTypeEntry);
Q_ASSERT(enclClass);
auto specialized = std::const_pointer_cast<AbstractMetaClass>(smp.specialized);
diff --git a/sources/shiboken6/ApiExtractor/apiextractor.h b/sources/shiboken6/ApiExtractor/apiextractor.h
index feae9454c..7bff5c252 100644
--- a/sources/shiboken6/ApiExtractor/apiextractor.h
+++ b/sources/shiboken6/ApiExtractor/apiextractor.h
@@ -73,8 +73,7 @@ public:
static AbstractMetaClassPtr
inheritTemplateClass(const ComplexTypeEntryPtr &te,
const AbstractMetaClassCPtr &templateClass,
- const AbstractMetaTypeList &templateTypes,
- InheritTemplateFlags flags = {});
+ const AbstractMetaTypeList &templateTypes);
private:
ApiExtractorPrivate *d;
diff --git a/sources/shiboken6/ApiExtractor/apiextractorflags.h b/sources/shiboken6/ApiExtractor/apiextractorflags.h
index 4fe6ecc1a..6f69b8b77 100644
--- a/sources/shiboken6/ApiExtractor/apiextractorflags.h
+++ b/sources/shiboken6/ApiExtractor/apiextractorflags.h
@@ -15,12 +15,4 @@ enum class ApiExtractorFlag
Q_DECLARE_FLAGS(ApiExtractorFlags, ApiExtractorFlag)
Q_DECLARE_OPERATORS_FOR_FLAGS(ApiExtractorFlags)
-enum class InheritTemplateFlag
-{
- SetEnclosingClass = 0x1
-};
-
-Q_DECLARE_FLAGS(InheritTemplateFlags, InheritTemplateFlag)
-Q_DECLARE_OPERATORS_FOR_FLAGS(InheritTemplateFlags)
-
#endif // APIEXTRACTORFLAGS_H
diff --git a/sources/shiboken6/ApiExtractor/apiextractorresult.cpp b/sources/shiboken6/ApiExtractor/apiextractorresult.cpp
index 2a48a30d1..5a433bbeb 100644
--- a/sources/shiboken6/ApiExtractor/apiextractorresult.cpp
+++ b/sources/shiboken6/ApiExtractor/apiextractorresult.cpp
@@ -7,6 +7,7 @@
#include "enumtypeentry.h"
#include "flagstypeentry.h"
+#include "smartpointertypeentry.h"
ApiExtractorResult::ApiExtractorResult() = default;
@@ -50,6 +51,18 @@ const InstantiatedSmartPointers &ApiExtractorResult::instantiatedSmartPointers()
return m_instantiatedSmartPointers;
}
+std::optional<InstantiatedSmartPointer>
+ ApiExtractorResult::findSmartPointerInstantiation(const SmartPointerTypeEntryCPtr &pointer,
+ const TypeEntryCPtr &pointee) const
+{
+ for (const auto &smp : m_instantiatedSmartPointers) {
+ const auto &i = smp.type;
+ if (i.typeEntry() == pointer && i.instantiations().at(0).typeEntry() == pointee)
+ return smp;
+ }
+ return std::nullopt;
+}
+
const QMultiHash<QString, QString> &ApiExtractorResult::typedefTargetToName() const
{
return m_typedefTargetToName;
diff --git a/sources/shiboken6/ApiExtractor/apiextractorresult.h b/sources/shiboken6/ApiExtractor/apiextractorresult.h
index 88a2093f1..b2aae88ed 100644
--- a/sources/shiboken6/ApiExtractor/apiextractorresult.h
+++ b/sources/shiboken6/ApiExtractor/apiextractorresult.h
@@ -43,6 +43,9 @@ public:
const AbstractMetaTypeList &instantiatedContainers() const;
const InstantiatedSmartPointers &instantiatedSmartPointers() const;
+ std::optional<InstantiatedSmartPointer>
+ findSmartPointerInstantiation(const SmartPointerTypeEntryCPtr &pointer,
+ const TypeEntryCPtr &pointee) const;
const QMultiHash<QString, QString> &typedefTargetToName() const;
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp
index da6930476..6c0cf3ae2 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp
@@ -235,6 +235,7 @@ static QByteArray msgCreateTranslationUnit(const QByteArrayList &clangArgs, unsi
static CXTranslationUnit createTranslationUnit(CXIndex index,
const QByteArrayList &args,
bool addCompilerSupportArguments,
+ LanguageLevel level,
unsigned flags = 0)
{
// courtesy qdoc
@@ -255,7 +256,7 @@ static CXTranslationUnit createTranslationUnit(CXIndex index,
QByteArrayList clangArgs;
if (addCompilerSupportArguments) {
- clangArgs += emulatedCompilerOptions();
+ clangArgs += emulatedCompilerOptions(level);
clangArgs += defaultArgs;
}
clangArgs += detectVulkan();
@@ -280,7 +281,7 @@ static CXTranslationUnit createTranslationUnit(CXIndex index,
*/
bool parse(const QByteArrayList &clangArgs, bool addCompilerSupportArguments,
- unsigned clangFlags, BaseVisitor &bv)
+ LanguageLevel level, unsigned clangFlags, BaseVisitor &bv)
{
CXIndex index = clang_createIndex(0 /* excludeDeclarationsFromPCH */,
1 /* displayDiagnostics */);
@@ -291,7 +292,7 @@ bool parse(const QByteArrayList &clangArgs, bool addCompilerSupportArguments,
CXTranslationUnit translationUnit =
createTranslationUnit(index, clangArgs, addCompilerSupportArguments,
- clangFlags);
+ level, clangFlags);
if (!translationUnit)
return false;
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangparser.h b/sources/shiboken6/ApiExtractor/clangparser/clangparser.h
index 4a46248e4..22e0a50cd 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangparser.h
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangparser.h
@@ -14,6 +14,8 @@
#include <string_view>
#include <utility>
+enum class LanguageLevel;
+
namespace clang {
struct Diagnostic;
@@ -79,7 +81,7 @@ private:
bool parse(const QByteArrayList &clangArgs,
bool addCompilerSupportArguments,
- unsigned clangFlags, BaseVisitor &ctx);
+ LanguageLevel level, unsigned clangFlags, BaseVisitor &ctx);
} // namespace clang
diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
index 4c13b141f..20224020b 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
@@ -106,7 +106,7 @@ static bool runProcess(const QString &program, const QStringList &arguments,
QProcess process;
process.start(program, arguments, QProcess::ReadWrite);
if (!process.waitForStarted()) {
- qWarning().noquote().nospace() << "Unable to start "
+ qCWarning(lcShiboken).noquote().nospace() << "Unable to start "
<< process.program() << ": " << process.errorString();
return false;
}
@@ -119,18 +119,18 @@ static bool runProcess(const QString &program, const QStringList &arguments,
*stdOutIn = process.readAllStandardOutput();
if (!finished) {
- qWarning().noquote().nospace() << process.program() << " timed out: " << stdErr;
+ qCWarning(lcShiboken).noquote().nospace() << process.program() << " timed out: " << stdErr;
process.kill();
return false;
}
if (process.exitStatus() != QProcess::NormalExit) {
- qWarning().noquote().nospace() << process.program() << " crashed: " << stdErr;
+ qCWarning(lcShiboken).noquote().nospace() << process.program() << " crashed: " << stdErr;
return false;
}
if (process.exitCode() != 0) {
- qWarning().noquote().nospace() << process.program() << " exited "
+ qCWarning(lcShiboken).noquote().nospace() << process.program() << " exited "
<< process.exitCode() << ": " << stdErr;
return false;
}
@@ -263,8 +263,8 @@ static QString queryLlvmConfigDir(const QString &arg)
return {};
const QString path = QFile::decodeName(stdOut.trimmed());
if (!QFileInfo::exists(path)) {
- qWarning(R"(%s: "%s" as returned by llvm-config "%s" does not exist.)",
- __FUNCTION__, qPrintable(QDir::toNativeSeparators(path)), qPrintable(arg));
+ qCWarning(lcShiboken, R"(%s: "%s" as returned by llvm-config "%s" does not exist.)",
+ __FUNCTION__, qPrintable(QDir::toNativeSeparators(path)), qPrintable(arg));
return {};
}
return path;
@@ -277,7 +277,8 @@ static QString findClangLibDir()
const QString path = QFile::decodeName(qgetenv(envVar)) + u"/lib"_s;
if (QFileInfo::exists(path))
return path;
- qWarning("%s: %s as pointed to by %s does not exist.", __FUNCTION__, qPrintable(path), envVar);
+ qCWarning(lcShiboken, "%s: %s as pointed to by %s does not exist.",
+ __FUNCTION__, qPrintable(path), envVar);
}
}
return queryLlvmConfigDir(u"--libdir"_s);
@@ -289,13 +290,23 @@ static QString findClangBuiltInIncludesDir()
const QString clangPathLibDir = findClangLibDir();
if (!clangPathLibDir.isEmpty()) {
QString candidate;
+ QString clangDirName = clangPathLibDir + u"/clang"_s;
+ // PYSIDE-2769: llvm-config --libdir may report /usr/lib64 on manylinux_2_28_x86_64
+ // whereas the includes are under /usr/lib/clang/../include.
+ if (!QFileInfo::exists(clangDirName) && clangPathLibDir.endsWith("64"_L1)) {
+ const QString fallback = clangPathLibDir.sliced(0, clangPathLibDir.size() - 2);
+ clangDirName = fallback + u"/clang"_s;
+ qCWarning(lcShiboken, "%s: Falling back from %s to %s.",
+ __FUNCTION__, qPrintable(clangPathLibDir), qPrintable(fallback));
+ }
+
QVersionNumber lastVersionNumber(1, 0, 0);
- const QString clangDirName = clangPathLibDir + u"/clang"_s;
QDir clangDir(clangDirName);
const QFileInfoList versionDirs =
clangDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
if (versionDirs.isEmpty())
- qWarning("%s: No subdirectories found in %s.", __FUNCTION__, qPrintable(clangDirName));
+ qCWarning(lcShiboken, "%s: No subdirectories found in %s.",
+ __FUNCTION__, qPrintable(clangDirName));
for (const QFileInfo &fi : versionDirs) {
const QString fileName = fi.fileName();
if (fileName.at(0).isDigit()) {
@@ -365,14 +376,15 @@ static void appendClangBuiltinIncludes(HeaderPaths *p)
}
// Returns clang options needed for emulating the host compiler
-QByteArrayList emulatedCompilerOptions()
+QByteArrayList emulatedCompilerOptions(LanguageLevel level)
{
QByteArrayList result;
HeaderPaths headerPaths;
switch (compiler()) {
case Compiler::Msvc:
result.append("-fms-compatibility-version="_ba + msvcCompatVersion());
- result.append(QByteArrayLiteral("-fdelayed-template-parsing"));
+ if (level < LanguageLevel::Cpp20)
+ result.append("-fdelayed-template-parsing"_ba);
result.append(QByteArrayLiteral("-Wno-microsoft-enum-value"));
result.append("/Zc:__cplusplus"_ba);
// Fix yvals_core.h: STL1000: Unexpected compiler version, expected Clang 7 or newer (MSVC2017 update)
diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h
index 462e8f205..f1d63b7c3 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h
+++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h
@@ -33,7 +33,7 @@ enum class Platform {
namespace clang {
QVersionNumber libClangVersion();
-QByteArrayList emulatedCompilerOptions();
+QByteArrayList emulatedCompilerOptions(LanguageLevel level);
LanguageLevel emulatedCompilerLanguageLevel();
const char *languageLevelOption(LanguageLevel l);
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp
index b1f0b240e..170595660 100644
--- a/sources/shiboken6/ApiExtractor/messages.cpp
+++ b/sources/shiboken6/ApiExtractor/messages.cpp
@@ -995,3 +995,10 @@ QString msgInvalidLanguageLevel(const QString &l)
{
return u"Invalid argument for language level: \""_s + l + u"\"."_s;
}
+
+QString msgCannotFindImage(const QString &href, const QString &context,
+ const QString &candidate)
+{
+ return "Cannot resolve image "_L1 + href + " for "_L1 + context
+ + " (tried "_L1 + QDir::toNativeSeparators(candidate) + ")."_L1;
+}
diff --git a/sources/shiboken6/ApiExtractor/messages.h b/sources/shiboken6/ApiExtractor/messages.h
index e3f582b49..5216b26a7 100644
--- a/sources/shiboken6/ApiExtractor/messages.h
+++ b/sources/shiboken6/ApiExtractor/messages.h
@@ -261,4 +261,7 @@ QString msgMissingProjectFileMarker(const QString &name, const QByteArray &start
QString msgInvalidLanguageLevel(const QString &l);
+QString msgCannotFindImage(const QString &href, const QString &context,
+ const QString &candidate);
+
#endif // MESSAGES_H
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp
index 749c4baa3..61fd22418 100644
--- a/sources/shiboken6/ApiExtractor/typedatabase.cpp
+++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp
@@ -88,7 +88,8 @@ static const PythonTypes &builtinPythonTypes()
{u"PyObject"_s, u"true"_s, TypeSystem::CPythonType::Other},
// shiboken-specific
{u"PyPathLike"_s, u"Shiboken::String::checkPath"_s, TypeSystem::CPythonType::Other},
- {u"PySequence"_s, u"Shiboken::String::checkIterable"_s, TypeSystem::CPythonType::Other},
+ {u"PySequence"_s, u"Shiboken::String::checkIterableArgument"_s,
+ TypeSystem::CPythonType::Other},
{u"PyUnicode"_s, u"PyUnicode_Check"_s, TypeSystem::CPythonType::String},
{u"PyTypeObject"_s, u"PyType_Check"_s, TypeSystem::CPythonType::Other},
{u"str"_s, u"Shiboken::String::check"_s, TypeSystem::CPythonType::String},
diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake
index 8bc066102..cff6df95e 100644
--- a/sources/shiboken6/cmake/ShibokenHelpers.cmake
+++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake
@@ -202,12 +202,6 @@ macro(get_python_extension_suffix)
# Python_SOABI is only set by CMake 3.17+
# TODO: Lower this to CMake 3.16 if possible.
if(SHIBOKEN_IS_CROSS_BUILD)
- # For android platform armv7a FindPython module return Python_SOABI as empty because
- # it is unable to set Python_CONFIG i.e. find `python3-config` script
- # This workaround sets the Python_SOABI manually for this platform.
- if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
- set(Python_SOABI "cpython-311}")
- endif()
if(NOT Python_SOABI)
message(FATAL_ERROR "Python_SOABI variable is empty.")
endif()
@@ -320,6 +314,17 @@ macro(shiboken_find_required_python)
"${_shiboken_backup_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM}")
set(CMAKE_FIND_ROOT_PATH
"${_shiboken_backup_CMAKE_FIND_ROOT_PATH}")
+
+ # For Android platform sometimes the FindPython module returns Python_SOABI as empty in
+ # certain scenarios eg: armv7a target, macOS host etc. This is because
+ # it is unable to set Python_CONFIG i.e. `python3-config` script
+ # This workaround sets the Python_SOABI manually for this Android platform.
+ # This needs to be updated manually if the Python version for Android cross compilation
+ # changes.
+ # TODO: Find a better way to set Python_SOABI for Android platform
+ if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND NOT Python_SOABI)
+ set(Python_SOABI "cpython-311")
+ endif()
else()
find_package(
Python
diff --git a/sources/shiboken6/doc/scripts/patch_qhp.py b/sources/shiboken6/doc/scripts/patch_qhp.py
index 750789698..88befaa2d 100644
--- a/sources/shiboken6/doc/scripts/patch_qhp.py
+++ b/sources/shiboken6/doc/scripts/patch_qhp.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import fileinput
import re
diff --git a/sources/shiboken6/doc/shibokenmodule.rst b/sources/shiboken6/doc/shibokenmodule.rst
index 2f1c6d166..3bc4fa6ba 100644
--- a/sources/shiboken6/doc/shibokenmodule.rst
+++ b/sources/shiboken6/doc/shibokenmodule.rst
@@ -125,6 +125,11 @@ To import the module:
Dumps the map of wrappers existing in libshiboken to standard error.
+.. function:: dumpConverters()
+
+ Dumps the map of named converters existing in libshiboken to standard
+ error.
+
.. py:class:: VoidPtr(address, size = -1, writeable = 0)
:param address: (PyBuffer, SbkObject, int, VoidPtr)
diff --git a/sources/shiboken6/doc/typesystem_specifying_types.rst b/sources/shiboken6/doc/typesystem_specifying_types.rst
index f65b79bb4..e979c4ee2 100644
--- a/sources/shiboken6/doc/typesystem_specifying_types.rst
+++ b/sources/shiboken6/doc/typesystem_specifying_types.rst
@@ -721,6 +721,9 @@ found in the code will be generated. The type name might optionally
be followed an equal sign and the Python type name, for example
``instantiations="int=IntPtr,double=DoublePtr"``.
It is also possible to specify a namespace delimited by ``::``.
+By default, the type will be in the namespace of the smart pointer,
+for example, ``std`` for ``std::shared_ptr``. Preceding
+the type name by ``::`` causes it to be in the global namespace.
The *optional* attribute **type** specifies the type:
diff --git a/sources/shiboken6/generator/generator.cpp b/sources/shiboken6/generator/generator.cpp
index b224858c5..a01326530 100644
--- a/sources/shiboken6/generator/generator.cpp
+++ b/sources/shiboken6/generator/generator.cpp
@@ -231,10 +231,9 @@ QString Generator::getFileNameBaseForSmartPointer(const AbstractMetaType &smartP
const AbstractMetaType innerType = smartPointerType.getSmartPointerInnerType();
smartPointerType.typeEntry()->qualifiedCppName();
QString fileName = smartPointerType.typeEntry()->qualifiedCppName().toLower();
- fileName.replace(u"::"_s, u"_"_s);
- fileName.append(u"_"_s);
+ fileName.append(u'_');
fileName.append(innerType.name().toLower());
-
+ fileName.replace(u"::"_s, u"_"_s); // std::shared_ptr<std::string>
return fileName;
}
diff --git a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp
index 2797ff254..1634a7e83 100644
--- a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp
@@ -970,8 +970,10 @@ static QStringList enumListToToc(const AbstractMetaEnumList &enums)
static QChar sortKey(const QString &key)
{
const auto size = key.size();
- if (size >= 2 && (key.at(0) == u'Q' || key.at(0) == u'q') && key.at(1).isUpper())
- return key.at(1); // "QClass" -> 'C', "qSin()" -> 'S'
+ if (size >= 2 && (key.at(0) == u'Q' || key.at(0) == u'q')
+ && (key.at(1).isUpper() || key.at(1).isDigit())) {
+ return key.at(1); // "QClass" -> 'C', "qSin()" -> 'S', 'Q3DSurfaceWidget' -> '3'
+ }
if (size >= 3 && key.startsWith("Q_"_L1))
return key.at(2).toUpper(); // "Q_ARG" -> 'A'
if (size >= 4 && key.startsWith("QT_"_L1))
@@ -1564,3 +1566,26 @@ QtXmlToSphinxLink QtDocGenerator::resolveLink(const QtXmlToSphinxLink &link) con
}
return resolved;
}
+
+QtXmlToSphinxDocGeneratorInterface::Image
+ QtDocGenerator::resolveImage(const QString &href, const QString &context) const
+{
+ QString relativeSourceDir = href;
+ const QString source = m_options.parameters.docDataDir + u'/' + relativeSourceDir;
+ if (!QFileInfo::exists(source))
+ throw Exception(msgCannotFindImage(href, context,source));
+
+ // Determine target directory from context, "Pyside2.QtGui.QPainter" ->"Pyside2/QtGui".
+ // FIXME: Not perfect yet, should have knowledge about namespaces (DataVis3D) or
+ // nested classes "Pyside2.QtGui.QTouchEvent.QTouchPoint".
+ QString relativeTargetDir = context;
+ const auto lastDot = relativeTargetDir.lastIndexOf(u'.');
+ if (lastDot != -1)
+ relativeTargetDir.truncate(lastDot);
+ relativeTargetDir.replace(u'.', u'/');
+ if (!relativeTargetDir.isEmpty())
+ relativeTargetDir += u'/';
+ relativeTargetDir += href;
+
+ return {relativeSourceDir, relativeTargetDir};
+}
diff --git a/sources/shiboken6/generator/qtdoc/qtdocgenerator.h b/sources/shiboken6/generator/qtdoc/qtdocgenerator.h
index 3b1c82e74..56e15e2a1 100644
--- a/sources/shiboken6/generator/qtdoc/qtdocgenerator.h
+++ b/sources/shiboken6/generator/qtdoc/qtdocgenerator.h
@@ -48,6 +48,7 @@ public:
const QString &methodName) const override;
const QLoggingCategory &loggingCategory() const override;
QtXmlToSphinxLink resolveLink(const QtXmlToSphinxLink &) const override;
+ Image resolveImage(const QString &href, const QString &context) const override;
static QString getFuncName(const AbstractMetaFunctionCPtr &cppFunc);
static QString formatArgs(const AbstractMetaFunctionCPtr &func);
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
index 55c1d2090..b8fec836c 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
@@ -1240,36 +1240,17 @@ WebXmlTag QtXmlToSphinx::parentTag() const
// Copy images that are placed in a subdirectory "images" under the webxml files
// by qdoc to a matching subdirectory under the "rst/PySide6/<module>" directory
-static bool copyImage(const QString &href, const QString &docDataDir,
- const QString &context, const QString &outputDir,
+static bool copyImage(const QString &docDataDir, const QString &relativeSourceFile,
+ const QString &outputDir, const QString &relativeTargetFile,
const QLoggingCategory &lc, QString *errorMessage)
{
- const QChar slash = u'/';
- const auto lastSlash = href.lastIndexOf(slash);
- const QString imagePath = lastSlash != -1 ? href.left(lastSlash) : QString();
- const QString imageFileName = lastSlash != -1 ? href.right(href.size() - lastSlash - 1) : href;
- QFileInfo imageSource(docDataDir + slash + href);
- if (!imageSource.exists()) {
- QTextStream(errorMessage) << "Image " << href << " does not exist in "
- << QDir::toNativeSeparators(docDataDir);
- return false;
- }
- // Determine directory from context, "Pyside2.QtGui.QPainter" ->"Pyside2/QtGui".
- // FIXME: Not perfect yet, should have knowledge about namespaces (DataVis3D) or
- // nested classes "Pyside2.QtGui.QTouchEvent.QTouchPoint".
- QString relativeTargetDir = context;
- const auto lastDot = relativeTargetDir.lastIndexOf(u'.');
- if (lastDot != -1)
- relativeTargetDir.truncate(lastDot);
- relativeTargetDir.replace(u'.', slash);
- if (!imagePath.isEmpty())
- relativeTargetDir += slash + imagePath;
-
- const QString targetDir = outputDir + slash + relativeTargetDir;
- const QString targetFileName = targetDir + slash + imageFileName;
+ QString targetFileName = outputDir + u'/' + relativeTargetFile;
if (QFileInfo::exists(targetFileName))
return true;
- if (!QFileInfo::exists(targetDir)) {
+
+ QString relativeTargetDir = relativeTargetFile;
+ relativeTargetDir.truncate(qMax(relativeTargetDir.lastIndexOf(u'/'), qsizetype(0)));
+ if (!relativeTargetDir.isEmpty() && !QFileInfo::exists(outputDir + u'/' + relativeTargetDir)) {
const QDir outDir(outputDir);
if (!outDir.mkpath(relativeTargetDir)) {
QTextStream(errorMessage) << "Cannot create " << QDir::toNativeSeparators(relativeTargetDir)
@@ -1278,28 +1259,29 @@ static bool copyImage(const QString &href, const QString &docDataDir,
}
}
- QFile source(imageSource.absoluteFilePath());
+ QFile source(docDataDir + u'/' + relativeSourceFile);
if (!source.copy(targetFileName)) {
QTextStream(errorMessage) << "Cannot copy " << QDir::toNativeSeparators(source.fileName())
<< " to " << QDir::toNativeSeparators(targetFileName) << ": "
<< source.errorString();
return false;
}
- qCDebug(lc).noquote().nospace() << __FUNCTION__ << " href=\""
- << href << "\", context=\"" << context << "\", docDataDir=\""
- << docDataDir << "\", outputDir=\"" << outputDir << "\", copied \""
- << source.fileName() << "\"->\"" << targetFileName << '"';
+
+ qCDebug(lc).noquote().nospace() << __FUNCTION__ << " \"" << relativeSourceFile
+ << "\"->\"" << relativeTargetFile << '"';
return true;
}
bool QtXmlToSphinx::copyImage(const QString &href) const
{
QString errorMessage;
- const bool result =
- ::copyImage(href, m_parameters.docDataDir, m_context,
- m_parameters.outputDirectory,
- m_generator->loggingCategory(),
- &errorMessage);
+ const auto imagePaths = m_generator->resolveImage(href, m_context);
+ const bool result = ::copyImage(m_parameters.docDataDir,
+ imagePaths.source,
+ m_parameters.outputDirectory,
+ imagePaths.target,
+ m_generator->loggingCategory(),
+ &errorMessage);
if (!result)
throw Exception(errorMessage);
return result;
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinxinterface.h b/sources/shiboken6/generator/qtdoc/qtxmltosphinxinterface.h
index 16eefad83..d4a098a12 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinxinterface.h
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinxinterface.h
@@ -53,6 +53,15 @@ public:
virtual QtXmlToSphinxLink resolveLink(const QtXmlToSphinxLink &) const = 0;
+ // Resolve images paths relative to doc data directory/output directory.
+ struct Image
+ {
+ QString source;
+ QString target;
+ };
+
+ virtual Image resolveImage(const QString &href, const QString &context) const = 0;
+
virtual ~QtXmlToSphinxDocGeneratorInterface() = default;
};
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 6c9cc5fec..97a38a08d 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -59,6 +59,7 @@ using namespace Qt::StringLiterals;
static const char shibokenErrorsOccurred[] = "Shiboken::Errors::occurred() != nullptr";
static constexpr auto virtualMethodStaticReturnVar = "result"_L1;
+static constexpr auto initFuncPrefix = "init_"_L1;
static constexpr auto sbkObjectTypeF = "SbkObject_TypeF()"_L1;
static const char initInheritanceFunction[] = "initInheritance";
@@ -1337,7 +1338,8 @@ void CppGenerator::writeVirtualMethodPythonOverride(TextStream &s,
s << "if (" << PYTHON_RETURN_VAR << ".isNull()) {\n" << indent
<< "// An error happened in python code!\n"
- << "Shiboken::Errors::storeErrorOrPrint();\n"
+ << "Shiboken::Errors::storePythonOverrideErrorOrPrint(\""
+ << func->ownerClass()->name() << "\", funcName);\n"
<< returnStatement.statement << "\n" << outdent
<< "}\n";
@@ -1598,11 +1600,17 @@ static void writePointerToPythonConverter(TextStream &c,
c << "auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn));\n"
<< "if (pyOut) {\n" << indent
<< "Py_INCREF(pyOut);\nreturn pyOut;\n" << outdent
- << "}\n"
- << "auto *tCppIn = reinterpret_cast<const " << typeName << R"( *>(cppIn);
-const char *typeName = )";
+ << "}\n";
const QString nameFunc = metaClass->typeEntry()->polymorphicNameFunction();
+ if (nameFunc.isEmpty() && !metaClass->hasVirtualDestructor()) {
+ c << "return Shiboken::Object::newObjectWithHeuristics("
+ << cpythonType << ", const_cast<void *>(cppIn), false);\n";
+ return;
+ }
+
+ c << "auto *tCppIn = reinterpret_cast<const " << typeName << R"( *>(cppIn);
+const char *typeName = )";
if (nameFunc.isEmpty())
c << "typeid(*tCppIn).name();\n";
else
@@ -5098,6 +5106,17 @@ QList<PyMethodDefEntry>
return result;
}
+QString CppGenerator::pythonSignature(const AbstractMetaType &type) const
+{
+ if (type.isSmartPointer() && !type.instantiations().isEmpty()) {
+ const auto ste = std::static_pointer_cast<const SmartPointerTypeEntry>(type.typeEntry());
+ const auto instantiationTe = type.instantiations().constFirst().typeEntry();
+ if (auto opt = api().findSmartPointerInstantiation(ste, instantiationTe))
+ return opt->specialized->typeEntry()->qualifiedTargetLangName();
+ }
+ return type.pythonSignature();
+}
+
// Format the type signature of a function parameter
QString CppGenerator::signatureParameter(const AbstractMetaArgument &arg) const
{
@@ -5109,17 +5128,22 @@ QString CppGenerator::signatureParameter(const AbstractMetaArgument &arg) const
metaType = *viewOn;
s << arg.name() << ':';
- QStringList signatures(metaType.pythonSignature());
+ QStringList signatures(pythonSignature(metaType));
// Implicit conversions (C++): Check for converting constructors
// "QColor(Qt::GlobalColor)" or conversion operators
const AbstractMetaFunctionCList conversions =
api().implicitConversions(metaType);
for (const auto &f : conversions) {
- if (f->isConstructor() && !f->arguments().isEmpty())
- signatures << f->arguments().constFirst().type().pythonSignature();
- else if (f->isConversionOperator())
+ if (f->isConstructor() && !f->arguments().isEmpty()) {
+ // PYSIDE-2712: modified types from converting constructors are not always correct
+ // candidates if they are modified by the type system reference
+ if (!f->arguments().constFirst().isTypeModified()) {
+ signatures << pythonSignature(f->arguments().constFirst().type());
+ }
+ } else if (f->isConversionOperator()) {
signatures << f->ownerClass()->fullName();
+ }
}
const qsizetype size = signatures.size();
@@ -5176,7 +5200,7 @@ void CppGenerator::writeSignatureInfo(TextStream &s, const OverloadData &overloa
QString returnType = f->pyiTypeReplaced(0); // pyi or modified type
if (returnType.isEmpty() && !f->isVoid())
- returnType = f->type().pythonSignature();
+ returnType = pythonSignature(f->type());
if (!returnType.isEmpty())
s << "->" << returnType;
@@ -5595,6 +5619,9 @@ void CppGenerator::writeClassRegister(TextStream &s,
writeConverterRegister(s, metaClass, classContext);
s << '\n';
+ if (classContext.forSmartPointer())
+ writeSmartPointerConverterInitialization(s, classContext.preciseType());
+
// class inject-code target/beginning
if (!classTypeEntry->codeSnips().isEmpty()) {
writeClassCodeSnips(s, classTypeEntry->codeSnips(),
@@ -6030,16 +6057,20 @@ void CppGenerator::writeNbBoolFunction(const GeneratorContext &context,
// Write declaration and invocation of the init function for the module init
// function.
-void CppGenerator::writeInitFunc(TextStream &declStr, TextStream &callStr,
- const QString &initFunctionName,
- const TypeEntryCPtr &enclosingEntry,
- const QString &pythonName, bool lazy)
+static void writeInitFuncDecl(TextStream &declStr,
+ const QString &functionName)
{
- const QString functionName = "init_"_L1 + initFunctionName;
- const bool hasParent = enclosingEntry && enclosingEntry->type() != TypeEntry::TypeSystemType;
- declStr << "PyTypeObject *" << functionName << "(PyObject *"
- << (hasParent ? "enclosingClass" : "module") << ");\n";
+ declStr << "PyTypeObject *" << functionName << "(PyObject *enclosing);\n";
+}
+// Write declaration and invocation of the init function for the module init
+// function.
+void CppGenerator::writeInitFuncCall(TextStream &callStr,
+ const QString &functionName,
+ const TypeEntryCPtr &enclosingEntry,
+ const QString &pythonName, bool lazy)
+{
+ const bool hasParent = enclosingEntry && enclosingEntry->type() != TypeEntry::TypeSystemType;
if (!lazy) {
const QString enclosing = hasParent
? "reinterpret_cast<PyObject *>("_L1 + cpythonTypeNameExt(enclosingEntry) + u')'
@@ -6048,18 +6079,14 @@ void CppGenerator::writeInitFunc(TextStream &declStr, TextStream &callStr,
} else if (hasParent) {
const QString &enclosingName = enclosingEntry->name();
const auto parts = QStringView{enclosingName}.split(u"::", Qt::SkipEmptyParts);
+ const QString namePathPrefix = enclosingEntry->name().replace("::"_L1, "."_L1);
callStr << "Shiboken::Module::AddTypeCreationFunction("
- << "module, \"" << pythonName << "\", " << functionName << ", \"";
- for (qsizetype i = 0; i < parts.size(); ++i) {
- if (i > 0)
- callStr << "\", \"";
- callStr << parts.at(i);
- }
- callStr << "\");\n";
+ << "module, \"" << parts[0] << "\", "
+ << functionName << ", \"" << namePathPrefix << '.' << pythonName << "\");\n";
} else {
callStr << "Shiboken::Module::AddTypeCreationFunction("
<< "module, \"" << pythonName << "\", "
- << "init_" << initFunctionName << ");\n";
+ << functionName << ");\n";
}
}
@@ -6116,9 +6143,10 @@ bool CppGenerator::finishGeneration()
s_classInitDecl << te->configCondition() << '\n';
s_classPythonDefines << te->configCondition() << '\n';
}
- writeInitFunc(s_classInitDecl, s_classPythonDefines,
- getSimpleClassInitFunctionName(cls),
- targetLangEnclosingEntry(te), cls->name());
+ const QString initFunc = initFuncPrefix + getSimpleClassInitFunctionName(cls);
+ writeInitFuncDecl(s_classInitDecl, initFunc);
+ writeInitFuncCall(s_classPythonDefines, initFunc,
+ targetLangEnclosingEntry(te), cls->name());
if (cls->hasStaticFields()) {
s_classInitDecl << "PyTypeObject *"
<< getSimpleClassStaticFieldsInitFunctionName(cls) << "(PyObject *module);\n";
@@ -6135,13 +6163,12 @@ bool CppGenerator::finishGeneration()
for (const auto &smp : api().instantiatedSmartPointers()) {
GeneratorContext context = contextForSmartPointer(smp.specialized, smp.type);
const auto enclosingClass = context.metaClass()->enclosingClass();
- auto enclosingTypeEntry = enclosingClass
- ? enclosingClass->typeEntry()
- : targetLangEnclosingEntry(smp.type.typeEntry());
+ auto enclosingTypeEntry = targetLangEnclosingEntry(smp.specialized->typeEntry());
- writeInitFunc(s_classInitDecl, s_classPythonDefines,
- getInitFunctionName(context),
- enclosingTypeEntry, smp.type.name());
+ const QString initFunc = initFuncPrefix + getInitFunctionName(context);
+ writeInitFuncDecl(s_classInitDecl, initFunc);
+ writeInitFuncCall(s_classPythonDefines,
+ initFunc, enclosingTypeEntry, smp.specialized->name());
includes.insert(smp.type.instantiations().constFirst().typeEntry()->include());
}
@@ -6335,18 +6362,6 @@ bool CppGenerator::finishGeneration()
s << '\n';
}
- // Implicit smart pointers conversions
- const auto &smartPointersList = api().instantiatedSmartPointers();
- if (!smartPointersList.isEmpty()) {
- s << "// SmartPointers converters.\n\n";
- for (const auto &smp : smartPointersList) {
- s << "// C++ to Python conversion for smart pointer type '"
- << smp.type.cppSignature() << "'.\n";
- writeSmartPointerConverterFunctions(s, smp.type);
- }
- s << '\n';
- }
-
s << "static struct PyModuleDef moduledef = {\n"
<< " /* m_base */ PyModuleDef_HEAD_INIT,\n"
<< " /* m_name */ \"" << moduleName() << "\",\n"
@@ -6405,9 +6420,14 @@ bool CppGenerator::finishGeneration()
s << "{nullptr, nullptr}\n" << outdent << "};\n"
<< "// The new global structure consisting of (type, name) pairs.\n"
- << cppApiVariableName() << " = cppApi;\n"
- << "// The backward compatible alias with upper case indexes.\n"
- << cppApiVariableNameOld() << " = reinterpret_cast<PyTypeObject **>(cppApi);\n\n";
+ << cppApiVariableName() << " = cppApi;\n";
+ if (usePySideExtensions())
+ s << "QT_WARNING_PUSH\nQT_WARNING_DISABLE_DEPRECATED\n";
+ s << "// The backward compatible alias with upper case indexes.\n"
+ << cppApiVariableNameOld() << " = reinterpret_cast<PyTypeObject **>(cppApi);\n";
+ if (usePySideExtensions())
+ s << "QT_WARNING_POP\n";
+ s << '\n';
}
s << "// Create an array of primitive type converters for the current module.\n"
@@ -6456,14 +6476,6 @@ bool CppGenerator::finishGeneration()
s << '\n';
}
- if (!smartPointersList.isEmpty()) {
- s << '\n';
- for (const auto &smp : smartPointersList) {
- writeSmartPointerConverterInitialization(s, smp.type);
- s << '\n';
- }
- }
-
if (!extendedConverters.isEmpty()) {
s << '\n';
for (ExtendedConverterData::const_iterator it = extendedConverters.cbegin(), end = extendedConverters.cend(); it != end; ++it) {
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.h b/sources/shiboken6/generator/shiboken/cppgenerator.h
index a31c2ca14..5920c9a3a 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.h
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.h
@@ -60,10 +60,10 @@ private:
void generateIncludes(TextStream &s, const GeneratorContext &classContext,
const IncludeGroupList &includes = {},
const AbstractMetaClassCList &innerClasses = {}) const;
- static void writeInitFunc(TextStream &declStr, TextStream &callStr,
- const QString &initFunctionName,
- const TypeEntryCPtr &enclosingEntry,
- const QString &pythonName, bool lazy = true);
+ static void writeInitFuncCall(TextStream &callStr,
+ const QString &functionName,
+ const TypeEntryCPtr &enclosingEntry,
+ const QString &pythonName, bool lazy = true);
static void writeCacheResetNative(TextStream &s, const GeneratorContext &classContext);
void writeConstructorNative(TextStream &s, const GeneratorContext &classContext,
const AbstractMetaFunctionCPtr &func) const;
@@ -413,6 +413,7 @@ private:
void writeSignatureInfo(TextStream &s, const OverloadData &overloads) const;
QString signatureParameter(const AbstractMetaArgument &arg) const;
+ QString pythonSignature(const AbstractMetaType &type) const;
/// Writes the implementation of all methods part of python sequence protocol
void writeSequenceMethods(TextStream &s,
const AbstractMetaClassCPtr &metaClass,
@@ -550,9 +551,6 @@ private:
static bool hasBoolCast(const AbstractMetaClassCPtr &metaClass)
{ return boolCast(metaClass).has_value(); }
- std::optional<AbstractMetaType>
- findSmartPointerInstantiation(const SmartPointerTypeEntryCPtr &pointer,
- const TypeEntryCPtr &pointee) const;
void clearTpFuncs();
static QString chopType(QString s);
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator_smartpointer.cpp b/sources/shiboken6/generator/shiboken/cppgenerator_smartpointer.cpp
index 1b893640a..44b76f181 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator_smartpointer.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator_smartpointer.cpp
@@ -86,18 +86,6 @@ static ComparisonOperatorList smartPointeeComparisons(const GeneratorContext &co
return result;
}
-std::optional<AbstractMetaType>
- CppGenerator::findSmartPointerInstantiation(const SmartPointerTypeEntryCPtr &pointer,
- const TypeEntryCPtr &pointee) const
-{
- for (const auto &smp : api().instantiatedSmartPointers()) {
- const auto &i = smp.type;
- if (i.typeEntry() == pointer && i.instantiations().at(0).typeEntry() == pointee)
- return i;
- }
- return {};
-}
-
static bool hasParameterPredicate(const AbstractMetaFunctionCPtr &f)
{
return !f->arguments().isEmpty();
@@ -225,6 +213,8 @@ void CppGenerator::generateSmartPointerClass(TextStream &s, const GeneratorConte
s << '\n';
writeConverterFunctions(s, metaClass, classContext);
+ // Implicit smart pointers conversions
+ writeSmartPointerConverterFunctions(s, classContext.preciseType());
writeClassRegister(s, metaClass, classContext, signatureStream);
// class inject-code native/end
@@ -252,8 +242,8 @@ void CppGenerator::writeSmartPointerConverterFunctions(TextStream &s,
for (const auto &base : baseClasses) {
auto baseTe = base->typeEntry();
if (smartPointerTypeEntry->matchesInstantiation(baseTe)) {
- if (auto opt = findSmartPointerInstantiation(smartPointerTypeEntry, baseTe)) {
- const auto smartTargetType = opt.value();
+ if (auto opt = api().findSmartPointerInstantiation(smartPointerTypeEntry, baseTe)) {
+ const auto &smartTargetType = opt.value().type;
s << "// SmartPointer derived class: "
<< smartTargetType.cppSignature() << "\n";
writePythonToCppConversionFunctions(s, smartPointerType,
@@ -308,8 +298,8 @@ void CppGenerator::writeSmartPointerConverterInitialization(TextStream &s,
for (const auto &base : classes) {
auto baseTe = base->typeEntry();
- if (auto opt = findSmartPointerInstantiation(smartPointerTypeEntry, baseTe)) {
- const auto smartTargetType = opt.value();
+ if (auto opt = api().findSmartPointerInstantiation(smartPointerTypeEntry, baseTe)) {
+ const auto &smartTargetType = opt.value().type;
s << "// Convert to SmartPointer derived class: ["
<< smartTargetType.cppSignature() << "]\n";
const QString converter = u"Shiboken::Conversions::getConverter(\""_s
diff --git a/sources/shiboken6/generator/shiboken/headergenerator.cpp b/sources/shiboken6/generator/shiboken/headergenerator.cpp
index 1f574b47c..7cec9c38e 100644
--- a/sources/shiboken6/generator/shiboken/headergenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/headergenerator.cpp
@@ -198,9 +198,6 @@ void HeaderGenerator::writeWrapperClassDeclaration(TextStream &s,
const auto typeEntry = metaClass->typeEntry();
InheritedOverloadSet inheritedOverloads;
- // write license comment
- s << licenseComment();
-
// Class
s << "class " << wrapperName
<< " : public " << metaClass->qualifiedCppName()
@@ -706,8 +703,12 @@ bool HeaderGenerator::finishGeneration()
macrosStream << ti;
macrosStream << "};\n\n";
+ // FIXME: Remove backwards compatible variable in PySide 7.
macrosStream << "// This variable stores all Python types exported by this module.\n";
macrosStream << "extern Shiboken::Module::TypeInitStruct *" << cppApiVariableName() << ";\n\n";
+ macrosStream << "// This variable stores all Python types exported by this module ";
+ macrosStream << "in a backwards compatible way with identical indexing.\n";
+ macrosStream << "[[deprecated]] extern PyTypeObject **" << cppApiVariableNameOld() << ";\n\n";
macrosStream << "// This variable stores the Python module object exported by this module.\n";
macrosStream << "extern PyObject *" << pythonModuleObjectName() << ";\n\n";
macrosStream << "// This variable stores all type converters exported by this module.\n";
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
index a1417e5d9..67fd9c994 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
@@ -2555,7 +2555,8 @@ void ShibokenGenerator::collectFullTypeNamesArray(QStringList &typeNames)
int smartPointerCountIndex = getMaxTypeIndex();
for (const auto &smp : api().instantiatedSmartPointers()) {
auto entry = smp.type.typeEntry();
- typeNames[smartPointerCountIndex] = entry->qualifiedTargetLangName();
+ typeNames[smartPointerCountIndex] =
+ smp.specialized->typeEntry()->qualifiedTargetLangName();
++smartPointerCountIndex;
}
}
diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp
index c11fbbfb2..8443af33d 100644
--- a/sources/shiboken6/libshiboken/basewrapper.cpp
+++ b/sources/shiboken6/libshiboken/basewrapper.cpp
@@ -7,13 +7,12 @@
#include "helper.h"
#include "pep384ext.h"
#include "sbkconverter.h"
-#include "sbkenum.h"
#include "sbkerrors.h"
#include "sbkfeature_base.h"
-#include "sbkmodule.h"
#include "sbkstring.h"
#include "sbkstaticstrings.h"
#include "sbkstaticstrings_p.h"
+#include "sbktypefactory.h"
#include "autodecref.h"
#include "gilstate.h"
#include <string>
@@ -27,7 +26,9 @@
#include "signature_p.h"
#include "voidptr.h"
+#include <string>
#include <iostream>
+#include <sstream>
#if defined(__APPLE__)
#include <dlfcn.h>
@@ -48,7 +49,7 @@ bool walkThroughBases(PyTypeObject *currentType, Predicate predicate)
const Py_ssize_t numBases = PyTuple_Size(bases);
bool result = false;
for (Py_ssize_t i = 0; !result && i < numBases; ++i) {
- auto type = reinterpret_cast<PyTypeObject *>(PyTuple_GetItem(bases, i));
+ auto *type = reinterpret_cast<PyTypeObject *>(PyTuple_GetItem(bases, i));
if (PyType_IsSubtype(type, SbkObject_TypeF()) != 0) {
result = PepType_SOTP(type)->is_user_type
? walkThroughBases(type, predicate) : predicate(type);
@@ -247,7 +248,7 @@ PyTypeObject *SbkObjectType_TypeF(void)
static PyObject *SbkObjectGetDict(PyObject *pObj, void *)
{
- auto ret = SbkObject_GetDict_NoRef(pObj);
+ auto *ret = SbkObject_GetDict_NoRef(pObj);
Py_XINCREF(ret);
return ret;
}
@@ -262,17 +263,15 @@ static int SbkObject_tp_traverse(PyObject *self, visitproc visit, void *arg)
auto *sbkSelf = reinterpret_cast<SbkObject *>(self);
//Visit children
- Shiboken::ParentInfo *pInfo = sbkSelf->d->parentInfo;
- if (pInfo) {
+ if (auto *pInfo = sbkSelf->d->parentInfo) {
for (SbkObject *c : pInfo->children)
Py_VISIT(c);
}
//Visit refs
- Shiboken::RefCountMap *rInfo = sbkSelf->d->referredObjects;
- if (rInfo) {
- for (auto it = rInfo->begin(), end = rInfo->end(); it != end; ++it)
- Py_VISIT(it->second);
+ if (auto *rInfo = sbkSelf->d->referredObjects) {
+ for (const auto &p : *rInfo)
+ Py_VISIT(p.second);
}
if (sbkSelf->ob_dict)
@@ -420,7 +419,9 @@ static void SbkDeallocWrapperCommon(PyObject *pyObj, bool canDelete)
}
}
- PyObject *error_type, *error_value, *error_traceback;
+ PyObject *error_type{};
+ PyObject *error_value{};
+ PyObject *error_traceback{};
/* Save the current exception, if any. */
PyErr_Fetch(&error_type, &error_value, &error_traceback);
@@ -535,7 +536,7 @@ PyObject *MakeQAppWrapper(PyTypeObject *type)
static PyObject *qApp_last = nullptr;
// protecting from multiple application instances
- if (!(type == nullptr || qApp_last == Py_None)) {
+ if (type != nullptr && qApp_last != Py_None) {
const char *res_name = qApp_last != nullptr
? PepType_GetNameStr(Py_TYPE(qApp_last)) : "<Unknown>";
const char *type_name = PepType_GetNameStr(type);
@@ -573,9 +574,9 @@ static PyTypeObject *SbkObjectType_tp_new(PyTypeObject *metatype, PyObject *args
// Before we changed to heap types, it was sufficient to remove the
// Py_TPFLAGS_BASETYPE flag. That does not work, because PySide does
// not respect this flag itself!
- PyObject *name;
- PyObject *pyBases;
- PyObject *dict;
+ PyObject *name{};
+ PyObject *pyBases{};
+ PyObject *dict{};
static const char *kwlist[] = { "name", "bases", "dict", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO!O!:sbktype", const_cast<char **>(kwlist),
@@ -694,9 +695,8 @@ PyObject *SbkQApp_tp_new(PyTypeObject *subtype, PyObject *, PyObject *)
auto *self = reinterpret_cast<SbkObject *>(obSelf);
if (self == nullptr)
return nullptr;
- auto ret = _setupNew(obSelf, subtype);
- auto priv = self->d;
- priv->isQAppSingleton = 1;
+ auto *ret = _setupNew(obSelf, subtype);
+ self->d->isQAppSingleton = 1;
return ret;
}
@@ -714,7 +714,7 @@ PyObject *FallbackRichCompare(PyObject *self, PyObject *other, int op)
{
// This is a very simple implementation that supplies a simple identity.
static const char * const opstrings[] = {"<", "<=", "==", "!=", ">", ">="};
- PyObject *res;
+ PyObject *res{};
switch (op) {
@@ -771,6 +771,19 @@ namespace Shiboken
void _initMainThreadId(); // helper.cpp
+static std::string msgFailedToInitializeType(const char *description)
+{
+ std::ostringstream stream;
+ stream << "[libshiboken] Failed to initialize " << description;
+ if (auto *error = PepErr_GetRaisedException()) {
+ if (auto *str = PyObject_Str(error))
+ stream << ": " << Shiboken::String::toCString(str);
+ Py_DECREF(error);
+ }
+ stream << '.';
+ return stream.str();
+}
+
namespace Conversions { void init(); }
void init()
@@ -786,11 +799,13 @@ void init()
//Init private data
Pep384_Init();
- if (PyType_Ready(SbkObjectType_TypeF()) < 0)
- Py_FatalError("[libshiboken] Failed to initialize Shiboken.BaseWrapperType metatype.");
+ auto *type = SbkObjectType_TypeF();
+ if (type == nullptr || PyType_Ready(type) < 0)
+ Py_FatalError(msgFailedToInitializeType("Shiboken.BaseWrapperType metatype").c_str());
- if (PyType_Ready(SbkObject_TypeF()) < 0)
- Py_FatalError("[libshiboken] Failed to initialize Shiboken.BaseWrapper type.");
+ type = SbkObject_TypeF();
+ if (type == nullptr || PyType_Ready(type) < 0)
+ Py_FatalError(msgFailedToInitializeType("Shiboken.BaseWrapper type").c_str());
VoidPtr::init();
@@ -980,13 +995,12 @@ introduceWrapperType(PyObject *enclosingObject,
PyObject *bases,
unsigned wrapperFlags)
{
- const auto basesSize = PySequence_Fast_GET_SIZE(bases);
- assert(basesSize > 0);
+ assert(PySequence_Fast_GET_SIZE(bases) > 0);
typeSpec->slots[0].pfunc = PySequence_Fast_GET_ITEM(bases, 0);
auto *type = SbkType_FromSpecBasesMeta(typeSpec, bases, SbkObjectType_TypeF());
- auto sotp = PepType_SOTP(type);
+ auto *sotp = PepType_SOTP(type);
if (wrapperFlags & DeleteInMainThread)
sotp->delete_in_main_thread = 1;
sotp->type_behaviour = (wrapperFlags & Value) != 0
@@ -1154,7 +1168,7 @@ bool wasCreatedByPython(SbkObject *pyObj)
void callCppDestructors(SbkObject *pyObj)
{
- auto priv = pyObj->d;
+ auto *priv = pyObj->d;
if (priv->isQAppSingleton && DestroyQApplication) {
// PYSIDE-1470: Allow to destroy the application from Shiboken.
DestroyQApplication();
@@ -1288,10 +1302,9 @@ static void recursive_invalidate(SbkObject *self, std::set<SbkObject *> &seen)
}
// If has ref to other objects invalidate all
- if (self->d->referredObjects) {
- RefCountMap &refCountMap = *(self->d->referredObjects);
- for (auto it = refCountMap.begin(), end = refCountMap.end(); it != end; ++it)
- recursive_invalidate(it->second, seen);
+ if (auto *rInfo = self->d->referredObjects) {
+ for (const auto &p : *rInfo)
+ recursive_invalidate(p.second, seen);
}
}
@@ -1466,7 +1479,8 @@ static PyObject *newObjectWithHeuristicsHelper(PyTypeObject *instanceType,
// Try type discovery in these cases.
if (exactType == nullptr || exactType == instanceType) {
auto resolved = BindingManager::instance().findDerivedType(cptr, instanceType);
- if (resolved.first != nullptr) {
+ if (resolved.first != nullptr
+ && Shiboken::ObjectType::canDowncastTo(instanceType, resolved.first)) {
exactType = resolved.first;
cptr = resolved.second;
}
diff --git a/sources/shiboken6/libshiboken/basewrapper.h b/sources/shiboken6/libshiboken/basewrapper.h
index ec5545aea..5e77d0c4f 100644
--- a/sources/shiboken6/libshiboken/basewrapper.h
+++ b/sources/shiboken6/libshiboken/basewrapper.h
@@ -6,7 +6,6 @@
#include "sbkpython.h"
#include "shibokenmacros.h"
-#include "sbktypefactory.h"
#include <vector>
#include <string>
diff --git a/sources/shiboken6/libshiboken/bindingmanager.cpp b/sources/shiboken6/libshiboken/bindingmanager.cpp
index 83c927ae5..df1079af8 100644
--- a/sources/shiboken6/libshiboken/bindingmanager.cpp
+++ b/sources/shiboken6/libshiboken/bindingmanager.cpp
@@ -230,10 +230,9 @@ void BindingManager::BindingManagerPrivate::assignWrapper(SbkObject *wrapper, co
}
}
-BindingManager::BindingManager()
+BindingManager::BindingManager() :
+ m_d(new BindingManager::BindingManagerPrivate)
{
- m_d = new BindingManager::BindingManagerPrivate;
-
#ifdef SHIBOKEN_INSTALL_FREE_DEBUG_HOOK
debugInstallFreeHook();
#endif
@@ -504,10 +503,11 @@ bool callInheritedInit(PyObject *self, PyObject *args, PyObject *kwds,
auto *startType = Py_TYPE(self);
auto *mro = startType->tp_mro;
- Py_ssize_t idx, n = PyTuple_GET_SIZE(mro);
+ Py_ssize_t idx = 0;
+ const Py_ssize_t n = PyTuple_GET_SIZE(mro);
auto classNameLen = std::strrchr(fullName, '.') - fullName;
/* No need to check the last one: it's gonna be skipped anyway. */
- for (idx = 0; idx + 1 < n; ++idx) {
+ for ( ; idx + 1 < n; ++idx) {
auto *lookType = reinterpret_cast<PyTypeObject *>(PyTuple_GET_ITEM(mro, idx));
const char *lookName = lookType->tp_name;
auto lookLen = long(std::strlen(lookName));
diff --git a/sources/shiboken6/libshiboken/embed/embedding_generator.py b/sources/shiboken6/libshiboken/embed/embedding_generator.py
index a058fd372..51c46ce54 100644
--- a/sources/shiboken6/libshiboken/embed/embedding_generator.py
+++ b/sources/shiboken6/libshiboken/embed/embedding_generator.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
embedding_generator.py
diff --git a/sources/shiboken6/libshiboken/embed/module_collector.py b/sources/shiboken6/libshiboken/embed/module_collector.py
index a58ce6e4f..8f7be6437 100644
--- a/sources/shiboken6/libshiboken/embed/module_collector.py
+++ b/sources/shiboken6/libshiboken/embed/module_collector.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
module_collector.py
diff --git a/sources/shiboken6/libshiboken/embed/signature_bootstrap.py b/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
index 37f95cd35..b0ba77107 100644
--- a/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
+++ b/sources/shiboken6/libshiboken/embed/signature_bootstrap.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
signature_bootstrap.py
diff --git a/sources/shiboken6/libshiboken/pep384impl.cpp b/sources/shiboken6/libshiboken/pep384impl.cpp
index f926107e2..f51296851 100644
--- a/sources/shiboken6/libshiboken/pep384impl.cpp
+++ b/sources/shiboken6/libshiboken/pep384impl.cpp
@@ -105,13 +105,13 @@ static PyType_Spec typeprobe_spec = {
static void
check_PyTypeObject_valid()
{
- auto *obtype = reinterpret_cast<PyObject *>(&PyType_Type);
- auto *probe_tp_base = reinterpret_cast<PyTypeObject *>(
- PyObject_GetAttr(obtype, Shiboken::PyMagicName::base()));
+ auto *typetype = &PyType_Type;
+ auto *obtype = reinterpret_cast<PyObject *>(typetype);
+ auto *probe_tp_base_obj = PyObject_GetAttr(obtype, Shiboken::PyMagicName::base());
+ auto *probe_tp_base = reinterpret_cast<PyTypeObject *>(probe_tp_base_obj);
auto *probe_tp_bases = PyObject_GetAttr(obtype, Shiboken::PyMagicName::bases());
- auto *check = reinterpret_cast<PyTypeObject *>(
- PyType_FromSpecWithBases(&typeprobe_spec, probe_tp_bases));
- auto *typetype = reinterpret_cast<PyTypeObject *>(obtype);
+ auto *checkObj = PyType_FromSpecWithBases(&typeprobe_spec, probe_tp_bases);
+ auto *check = reinterpret_cast<PyTypeObject *>(checkObj);
PyObject *w = PyObject_GetAttr(obtype, Shiboken::PyMagicName::weakrefoffset());
long probe_tp_weakrefoffset = PyLong_AsLong(w);
PyObject *d = PyObject_GetAttr(obtype, Shiboken::PyMagicName::dictoffset());
@@ -149,8 +149,8 @@ check_PyTypeObject_valid()
|| probe_tp_mro != typetype->tp_mro
|| Py_TPFLAGS_DEFAULT != (check->tp_flags & Py_TPFLAGS_DEFAULT))
Py_FatalError("The structure of type objects has changed!");
- Py_DECREF(check);
- Py_DECREF(probe_tp_base);
+ Py_DECREF(checkObj);
+ Py_DECREF(probe_tp_base_obj);
Py_DECREF(w);
Py_DECREF(d);
Py_DECREF(probe_tp_bases);
@@ -482,6 +482,47 @@ Pep_GetVerboseFlag()
}
#endif // Py_LIMITED_API
+// Support for pyerrors.h
+
+#if defined(Py_LIMITED_API) || PY_VERSION_HEX < 0x030C0000
+// Emulate PyErr_GetRaisedException() using the deprecated PyErr_Fetch()/PyErr_Store()
+PyObject *PepErr_GetRaisedException()
+{
+ PyObject *type{};
+ PyObject *value{};
+ PyObject *traceback{};
+ PyErr_Fetch(&type, &value, &traceback);
+ Py_XINCREF(value);
+ PyErr_Restore(type, value, traceback);
+ return value;
+}
+
+struct PepException_HEAD
+{
+ PyObject_HEAD
+ PyObject *x1; // dict
+ PyObject *args;
+};
+
+// PyException_GetArgs/PyException_SetArgs were added to the stable API in 3.12
+PyObject *PepException_GetArgs(PyObject *ex)
+{
+ auto *h = reinterpret_cast<PepException_HEAD *>(ex);
+ Py_XINCREF(h->args);
+ return h->args;
+}
+
+LIBSHIBOKEN_API void PepException_SetArgs(PyObject *ex, PyObject *args)
+{
+ auto *h = reinterpret_cast<PepException_HEAD *>(ex);
+ Py_XINCREF(args);
+ auto *old = h->args; // Py_XSETREF()
+ h->args = args;
+ Py_XDECREF(old);
+
+}
+#endif // Limited or < 3.12
+
/*****************************************************************************
*
* Support for code.h
@@ -722,11 +763,8 @@ PyTypeObject *PepStaticMethod_TypePtr = nullptr;
static PyTypeObject *
getStaticMethodType(void)
{
- // this works for Python 3, only
- // "StaticMethodType = type(str.__dict__['maketrans'])\n";
static const char prog[] =
- "from xxsubtype import spamlist\n"
- "result = type(spamlist.__dict__['staticmeth'])\n";
+ "result = type(str.__dict__['maketrans'])\n";
return reinterpret_cast<PyTypeObject *>(PepRun_GetResult(prog));
}
@@ -858,15 +896,13 @@ PepRun_GetResult(const char *command)
/*
* Evaluate a string and return the variable `result`
*/
- PyObject *d, *v, *res;
-
- d = PyDict_New();
+ PyObject *d = PyDict_New();
if (d == nullptr
|| PyDict_SetItem(d, Shiboken::PyMagicName::builtins(), PyEval_GetBuiltins()) < 0) {
return nullptr;
}
- v = PyRun_String(command, Py_file_input, d, d);
- res = v ? PyDict_GetItem(d, Shiboken::PyName::result()) : nullptr;
+ PyObject *v = PyRun_String(command, Py_file_input, d, d);
+ PyObject *res = v ? PyDict_GetItem(d, Shiboken::PyName::result()) : nullptr;
Py_XDECREF(v);
Py_DECREF(d);
return res;
@@ -874,7 +910,7 @@ PepRun_GetResult(const char *command)
PyTypeObject *PepType_Type_tp_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
{
- auto ret = PyType_Type.tp_new(metatype, args, kwds);
+ auto *ret = PyType_Type.tp_new(metatype, args, kwds);
return reinterpret_cast<PyTypeObject *>(ret);
}
@@ -903,7 +939,7 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name)
Py_INCREF(name);
return name;
}
- size_t nlen = PyUnicode_GET_LENGTH(name);
+ const Py_ssize_t nlen = PyUnicode_GET_LENGTH(name);
/* Don't mangle __id__ or names with dots. */
if ((PyUnicode_READ_CHAR(name, nlen-1) == '_' &&
PyUnicode_READ_CHAR(name, nlen-2) == '_') ||
@@ -917,9 +953,9 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name)
// PYSIDE-1436: _Py_Mangle is no longer exposed; implement it always.
// The rest of this function is our own implementation of _Py_Mangle.
// Please compare the original function in compile.c .
- size_t plen = PyUnicode_GET_LENGTH(privateobj.object());
+ Py_ssize_t plen = PyUnicode_GET_LENGTH(privateobj.object());
/* Strip leading underscores from class name */
- size_t ipriv = 0;
+ Py_ssize_t ipriv = 0;
while (PyUnicode_READ_CHAR(privateobj.object(), ipriv) == '_')
ipriv++;
if (ipriv == plen) {
@@ -933,8 +969,8 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name)
"private identifier too large to be mangled");
return nullptr;
}
- size_t const amount = ipriv + 1 + plen + nlen;
- size_t const big_stack = 1000;
+ const Py_ssize_t amount = ipriv + 1 + plen + nlen;
+ const Py_ssize_t big_stack = 1000;
wchar_t bigbuf[big_stack];
wchar_t *resbuf = amount <= big_stack ? bigbuf : (wchar_t *)malloc(sizeof(wchar_t) * amount);
if (!resbuf)
diff --git a/sources/shiboken6/libshiboken/pep384impl.h b/sources/shiboken6/libshiboken/pep384impl.h
index ec58aac81..7188366e2 100644
--- a/sources/shiboken6/libshiboken/pep384impl.h
+++ b/sources/shiboken6/libshiboken/pep384impl.h
@@ -188,6 +188,17 @@ LIBSHIBOKEN_API int Pep_GetFlag(const char *name);
LIBSHIBOKEN_API int Pep_GetVerboseFlag(void);
#endif
+// pyerrors.h
+#if defined(Py_LIMITED_API) || PY_VERSION_HEX < 0x030C0000
+LIBSHIBOKEN_API PyObject *PepErr_GetRaisedException();
+LIBSHIBOKEN_API PyObject *PepException_GetArgs(PyObject *ex);
+LIBSHIBOKEN_API void PepException_SetArgs(PyObject *ex, PyObject *args);
+#else
+# define PepErr_GetRaisedException PyErr_GetRaisedException
+# define PepException_GetArgs PyException_GetArgs
+# define PepException_SetArgs PyException_SetArgs
+#endif
+
/*****************************************************************************
*
* RESOLVED: unicodeobject.h
diff --git a/sources/shiboken6/libshiboken/sbkarrayconverter.h b/sources/shiboken6/libshiboken/sbkarrayconverter.h
index f07cb1d70..dcb9bfb38 100644
--- a/sources/shiboken6/libshiboken/sbkarrayconverter.h
+++ b/sources/shiboken6/libshiboken/sbkarrayconverter.h
@@ -70,7 +70,7 @@ template <class T, int columns>
class Array2Handle
{
public:
- typedef T RowType[columns];
+ using RowType = T[columns];
Array2Handle() = default;
diff --git a/sources/shiboken6/libshiboken/sbkconverter.cpp b/sources/shiboken6/libshiboken/sbkconverter.cpp
index 358827aa8..dac3fb638 100644
--- a/sources/shiboken6/libshiboken/sbkconverter.cpp
+++ b/sources/shiboken6/libshiboken/sbkconverter.cpp
@@ -12,7 +12,12 @@
#include "voidptr.h"
#include <string>
+#include <cstring>
+#include <iostream>
#include <unordered_map>
+#include <unordered_set>
+#include <map>
+#include <set>
static SbkConverter **PrimitiveTypeConverters;
@@ -72,13 +77,110 @@ void init()
initArrayConverters();
}
+static void dumpPyTypeObject(std::ostream &str, PyTypeObject *t)
+{
+ str << "\nPython type ";
+ if (t == nullptr) {
+ str << "<None>";
+ return;
+ }
+ str << '"' << t->tp_name << '"';
+ if (t->tp_base != nullptr && t->tp_base != &PyBaseObject_Type)
+ str << '(' << t->tp_base->tp_name << ')';
+}
+
+static void dumpSbkConverter(std::ostream &str, const SbkConverter *c)
+{
+ str << "SbkConverter " << static_cast<const void *>(c) << ": ";
+ if (c->pointerToPython != nullptr)
+ str << ", C++ pointer->Python";
+ if (c->copyToPython != nullptr)
+ str << ", copy->Python";
+ if (c->toCppPointerConversion.second != nullptr)
+ str << ", Python->C++ pointer";
+ if (!c->toCppConversions.empty())
+ str << ", " << c->toCppConversions.size() << " Python->C++ conversions";
+}
+
+// Less than operator for a PyTypeObject for dumping the converter map
+static bool pyTypeObjectLessThan(const PyTypeObject *t1, const PyTypeObject *t2)
+{
+ const bool isNull1 = t1 == nullptr;
+ const bool isNull2 = t2 == nullptr;
+ if (isNull1 || isNull2)
+ return isNull1 && !isNull2;
+ // Internal types (lower case) first
+ const bool isInternal1 = std::islower(t1->tp_name[0]);
+ const bool isInternal2 = std::islower(t2->tp_name[0]);
+ if (isInternal1 != isInternal2)
+ return !isInternal2;
+ return std::strcmp(t1->tp_name, t2->tp_name) < 0;
+}
+
+void dumpConverters()
+{
+ struct PyTypeObjectLess {
+
+ bool operator()(const PyTypeObject *t1, const PyTypeObject *t2) const {
+ return pyTypeObjectLessThan(t1, t2);
+ }
+ };
+
+ using StringSet = std::set<std::string>;
+ using SbkConverterNamesMap = std::unordered_map<SbkConverter *, StringSet>;
+ using PyTypeObjectConverterMap = std::map<PyTypeObject *, SbkConverterNamesMap,
+ PyTypeObjectLess>;
+
+ auto &str = std::cerr;
+
+ // Sort the entries by the associated PyTypeObjects and converters
+ PyTypeObjectConverterMap pyTypeObjectConverterMap;
+ for (const auto &converter : converters) {
+ auto *sbkConverter = converter.second;
+ if (sbkConverter == nullptr) {
+ str << "Non-existent: \"" << converter.first << "\"\n";
+ continue;
+ }
+ auto *typeObject = sbkConverter->pythonType;
+ auto typeIt = pyTypeObjectConverterMap.find(typeObject);
+ if (typeIt == pyTypeObjectConverterMap.end())
+ typeIt = pyTypeObjectConverterMap.insert(std::make_pair(typeObject,
+ SbkConverterNamesMap{})).first;
+ SbkConverterNamesMap &sbkConverterMap = typeIt->second;
+ auto convIt = sbkConverterMap.find(sbkConverter);
+ if (convIt == sbkConverterMap.end())
+ convIt = sbkConverterMap.insert(std::make_pair(sbkConverter,
+ StringSet{})).first;
+ convIt->second.insert(converter.first);
+ }
+
+ for (const auto &tc : pyTypeObjectConverterMap) {
+ dumpPyTypeObject(str, tc.first);
+ str << ", " << tc.second.size() << " converter(s):\n";
+ for (const auto &cn : tc.second) {
+ str << " ";
+ dumpSbkConverter(str, cn.first);
+ str << ", " << cn.second.size() << " alias(es):";
+ int i = 0;
+ for (const auto &name : cn.second) {
+ if ((i++ % 5) == 0)
+ str << "\n ";
+ str << " \"" << name << '"';
+ }
+ str << '\n';
+ }
+ }
+
+ str << '\n';
+}
+
SbkConverter *createConverterObject(PyTypeObject *type,
PythonToCppFunc toCppPointerConvFunc,
IsConvertibleToCppFunc toCppPointerCheckFunc,
CppToPythonFunc pointerToPythonFunc,
CppToPythonFunc copyToPythonFunc)
{
- auto converter = new SbkConverter;
+ auto *converter = new SbkConverter;
converter->pythonType = type;
// PYSIDE-595: All types are heaptypes now, so provide reference.
Py_XINCREF(type);
@@ -422,18 +524,36 @@ void registerConverterName(SbkConverter *converter, const char *typeName)
converters.insert(std::make_pair(typeName, converter));
}
-static std::string getRealTypeName(const char *name)
+static std::string getRealTypeName(const std::string &typeName)
{
- std::string typeName(name);
auto size = typeName.size();
if (std::isalnum(typeName[size - 1]) == 0)
return typeName.substr(0, size - 1);
return typeName;
}
-SbkConverter *getConverter(const char *typeName)
+// PYSIDE-2404: Build a negative cache of already failed lookups.
+// The resulting list must be reset after each new import,
+// because that can change results. Also clear the cache after
+// reaching some threashold.
+static std::unordered_set<std::string> nonExistingTypeNames{};
+
+// Arbitrary size limit to prevent random name overflows.
+static constexpr std::size_t negativeCacheLimit = 50;
+
+static void rememberAsNonexistent(const std::string &typeName)
+{
+ if (nonExistingTypeNames.size() > negativeCacheLimit)
+ clearNegativeLazyCache();
+ converters.insert(std::make_pair(typeName, nullptr));
+ nonExistingTypeNames.insert(typeName);
+}
+
+SbkConverter *getConverter(const char *typeNameC)
{
+ std::string typeName = typeNameC;
auto it = converters.find(typeName);
+ // PYSIDE-2404: This can also contain explicit nullptr as a negative cache.
if (it != converters.end())
return it->second;
// PYSIDE-2404: Did not find the name. Load the lazy classes
@@ -442,6 +562,9 @@ SbkConverter *getConverter(const char *typeName)
it = converters.find(typeName);
if (it != converters.end())
return it->second;
+ // Cache the negative result. Don't forget to clear the cache for new modules.
+ rememberAsNonexistent(typeName);
+
if (Shiboken::pyVerbose() > 0) {
const std::string message =
std::string("Can't find type resolver for type '") + typeName + "'.";
@@ -450,6 +573,15 @@ SbkConverter *getConverter(const char *typeName)
return nullptr;
}
+void clearNegativeLazyCache()
+{
+ for (const auto &typeName : nonExistingTypeNames) {
+ auto it = converters.find(typeName);
+ converters.erase(it);
+ }
+ nonExistingTypeNames.clear();
+}
+
SbkConverter *primitiveTypeConverter(int index)
{
return PrimitiveTypeConverters[index];
@@ -704,14 +836,7 @@ PyTypeObject *getPythonTypeObject(const SbkConverter *converter)
PyTypeObject *getPythonTypeObject(const char *typeName)
{
- auto *type = getPythonTypeObject(getConverter(typeName));
- if (type == nullptr) {
- // PYSIDE-2404: Did not find the name. Load the lazy classes
- // which have this name and try again.
- Shiboken::Module::loadLazyClassesWithName(getRealTypeName(typeName).c_str());
- type = getPythonTypeObject(getConverter(typeName));
- }
- return type;
+ return getPythonTypeObject(getConverter(typeName));
}
bool pythonTypeIsValueType(const SbkConverter *converter)
diff --git a/sources/shiboken6/libshiboken/sbkconverter.h b/sources/shiboken6/libshiboken/sbkconverter.h
index 0d68f3faf..2b3d50069 100644
--- a/sources/shiboken6/libshiboken/sbkconverter.h
+++ b/sources/shiboken6/libshiboken/sbkconverter.h
@@ -339,27 +339,29 @@ LIBSHIBOKEN_API bool pythonTypeIsObjectType(const SbkConverter *converter);
/// Returns true if the Python type associated with the converter is a wrapper type.
LIBSHIBOKEN_API bool pythonTypeIsWrapperType(const SbkConverter *converter);
-#define SBK_PY_LONG_LONG_IDX 0
+enum : int {
+SBK_PY_LONG_LONG_IDX = 0,
// Qt5: name collision in QtCore after QBool is replaced by bool
-#define SBK_BOOL_IDX_1 1
-#define SBK_CHAR_IDX 2
-#define SBK_CONSTCHARPTR_IDX 3
-#define SBK_DOUBLE_IDX 4
-#define SBK_FLOAT_IDX 5
-#define SBK_INT_IDX 6
-#define SBK_SIGNEDINT_IDX 6
-#define SBK_LONG_IDX 7
-#define SBK_SHORT_IDX 8
-#define SBK_SIGNEDCHAR_IDX 9
-#define SBK_STD_STRING_IDX 10
-#define SBK_STD_WSTRING_IDX 11
-#define SBK_UNSIGNEDPY_LONG_LONG_IDX 12
-#define SBK_UNSIGNEDCHAR_IDX 13
-#define SBK_UNSIGNEDINT_IDX 14
-#define SBK_UNSIGNEDLONG_IDX 15
-#define SBK_UNSIGNEDSHORT_IDX 16
-#define SBK_VOIDPTR_IDX 17
-#define SBK_NULLPTR_T_IDX 18
+SBK_BOOL_IDX_1 = 1,
+SBK_CHAR_IDX = 2,
+SBK_CONSTCHARPTR_IDX = 3,
+SBK_DOUBLE_IDX = 4,
+SBK_FLOAT_IDX = 5,
+SBK_INT_IDX = 6,
+SBK_SIGNEDINT_IDX = 6,
+SBK_LONG_IDX = 7,
+SBK_SHORT_IDX = 8,
+SBK_SIGNEDCHAR_IDX = 9,
+SBK_STD_STRING_IDX = 10,
+SBK_STD_WSTRING_IDX = 11,
+SBK_UNSIGNEDPY_LONG_LONG_IDX = 12,
+SBK_UNSIGNEDCHAR_IDX = 13,
+SBK_UNSIGNEDINT_IDX = 14,
+SBK_UNSIGNEDLONG_IDX = 15,
+SBK_UNSIGNEDSHORT_IDX = 16,
+SBK_VOIDPTR_IDX = 17,
+SBK_NULLPTR_T_IDX = 18
+};
template<typename T> SbkConverter *PrimitiveTypeConverter() { return nullptr; }
template<> inline SbkConverter *PrimitiveTypeConverter<PY_LONG_LONG>() { return primitiveTypeConverter(SBK_PY_LONG_LONG_IDX); }
diff --git a/sources/shiboken6/libshiboken/sbkconverter_p.h b/sources/shiboken6/libshiboken/sbkconverter_p.h
index c886c9b9f..08fc4c8e1 100644
--- a/sources/shiboken6/libshiboken/sbkconverter_p.h
+++ b/sources/shiboken6/libshiboken/sbkconverter_p.h
@@ -531,6 +531,12 @@ SbkConverter *createConverterObject(PyTypeObject *type,
IsConvertibleToCppFunc toCppPointerCheckFunc,
CppToPythonFunc pointerToPythonFunc,
CppToPythonFunc copyToPythonFunc);
+
+LIBSHIBOKEN_API void dumpConverters();
+
+/// Interface for sbkmodule which must reset cache when new module is loaded.
+LIBSHIBOKEN_API void clearNegativeLazyCache();
+
} // namespace Shiboken::Conversions
#endif // SBK_CONVERTER_P_H
diff --git a/sources/shiboken6/libshiboken/sbkcpptonumpy.cpp b/sources/shiboken6/libshiboken/sbkcpptonumpy.cpp
index 44e900f01..7637efa70 100644
--- a/sources/shiboken6/libshiboken/sbkcpptonumpy.cpp
+++ b/sources/shiboken6/libshiboken/sbkcpptonumpy.cpp
@@ -49,17 +49,17 @@ PyObject *createByteArray1(Py_ssize_t, const uint8_t *)
PyObject *createDoubleArray1(Py_ssize_t, const double *)
{
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject *createFloatArray1(Py_ssize_t, const float *)
{
- return Py_None;
+ Py_RETURN_NONE;
}
PyObject *createIntArray1(Py_ssize_t, const int *)
{
- return Py_None;
+ Py_RETURN_NONE;
}
#endif // !HAVE_NUMPY
diff --git a/sources/shiboken6/libshiboken/sbkenum.cpp b/sources/shiboken6/libshiboken/sbkenum.cpp
index d39369979..d43756249 100644
--- a/sources/shiboken6/libshiboken/sbkenum.cpp
+++ b/sources/shiboken6/libshiboken/sbkenum.cpp
@@ -3,13 +3,13 @@
#include "sbkenum.h"
#include "sbkstring.h"
+#include "helper.h"
#include "sbkstaticstrings.h"
#include "sbkstaticstrings_p.h"
#include "sbkconverter.h"
#include "basewrapper.h"
#include "autodecref.h"
-#include "sbkpython.h"
-#include "signature.h"
+#include "sbktypefactory.h"
#include <cstring>
#include <vector>
@@ -142,7 +142,8 @@ static PyObject *missing_func(PyObject * /* self */ , PyObject *args)
static auto *const _mro = Shiboken::String::createStaticString("__mro__");
static auto *const _class = Shiboken::String::createStaticString("__class__");
- PyObject *klass{}, *value{};
+ PyObject *klass{};
+ PyObject *value{};
if (!PyArg_UnpackTuple(args, "missing", 2, 2, &klass, &value))
Py_RETURN_NONE;
if (!PyLong_Check(value))
@@ -306,6 +307,8 @@ static PyTypeObject *createEnumForPython(PyObject *scopeOrModule,
enumName = PyDict_GetItem(sotp->enumTypeDict, name);
}
+ SBK_UNUSED(getPyEnumMeta()); // enforce PyEnumModule creation
+ assert(PyEnumModule != nullptr);
AutoDecRef PyEnumType(PyObject_GetAttr(PyEnumModule, enumName));
assert(PyEnumType.object());
bool isFlag = PyObject_IsSubclass(PyEnumType, PyFlag);
diff --git a/sources/shiboken6/libshiboken/sbkerrors.cpp b/sources/shiboken6/libshiboken/sbkerrors.cpp
index 1832624d5..84c080f8d 100644
--- a/sources/shiboken6/libshiboken/sbkerrors.cpp
+++ b/sources/shiboken6/libshiboken/sbkerrors.cpp
@@ -6,6 +6,11 @@
#include "helper.h"
#include "gilstate.h"
+#include <cstdio>
+#include <string>
+
+using namespace std::literals::string_literals;
+
namespace Shiboken
{
@@ -93,6 +98,21 @@ void setWrongContainerType()
PyErr_SetString(PyExc_TypeError, "Wrong type passed to container conversion.");
}
+// Prepend something to an exception message provided it is a single string
+// argument.
+static bool prependToExceptionMessage(PyObject *exc, const char *context)
+{
+ Shiboken::AutoDecRef args(PepException_GetArgs(exc));
+ if (args.isNull() || PyTuple_Check(args.object()) == 0 || PyTuple_Size(args) != 1)
+ return false;
+ auto *oldMessage = PyTuple_GetItem(args, 0);
+ if (oldMessage == nullptr || PyUnicode_CheckExact(oldMessage) == 0)
+ return false;
+ auto *newMessage = PyUnicode_FromFormat("%s%U", context, oldMessage);
+ PepException_SetArgs(exc, PyTuple_Pack(1, newMessage));
+ return true;
+}
+
struct ErrorStore {
PyObject *type;
PyObject *exc;
@@ -101,17 +121,42 @@ struct ErrorStore {
static thread_local ErrorStore savedError{};
+static bool hasPythonContext()
+{
+ return _pythonContextStack & 1;
+}
+
void storeErrorOrPrint()
{
// This error happened in a function with no way to return an error state.
// Therefore, we handle the error when we are error checking, anyway.
// But we do that only when we know that an error handler can pick it up.
- if (_pythonContextStack & 1)
+ if (hasPythonContext())
PyErr_Fetch(&savedError.type, &savedError.exc, &savedError.traceback);
else
PyErr_Print();
}
+// Like storeErrorOrPrint() with additional context info that is prepended
+// to the exception message or printed.
+static void storeErrorOrPrintWithContext(const char *context)
+{
+ if (hasPythonContext()) {
+ PyErr_Fetch(&savedError.type, &savedError.exc, &savedError.traceback);
+ prependToExceptionMessage(savedError.exc, context);
+ } else {
+ std::fputs(context, stderr);
+ PyErr_Print();
+ }
+}
+
+void storePythonOverrideErrorOrPrint(const char *className, const char *funcName)
+{
+ const std::string context = "Error calling Python override of "s
+ + className + "::"s + funcName + "(): "s;
+ storeErrorOrPrintWithContext(context.c_str());
+}
+
PyObject *occurred()
{
if (savedError.type) {
diff --git a/sources/shiboken6/libshiboken/sbkerrors.h b/sources/shiboken6/libshiboken/sbkerrors.h
index 6ff85f8e1..18ce701e7 100644
--- a/sources/shiboken6/libshiboken/sbkerrors.h
+++ b/sources/shiboken6/libshiboken/sbkerrors.h
@@ -50,6 +50,11 @@ LIBSHIBOKEN_API void setWrongContainerType();
/// This replaces `PyErr_Print`, which cannot report errors as exception.
/// To be used in contexts where raising errors is impossible.
LIBSHIBOKEN_API void storeErrorOrPrint();
+
+/// Call storeErrorOrPrint() and print the context to report
+/// errors when calling Python overrides of virtual functions.
+LIBSHIBOKEN_API void storePythonOverrideErrorOrPrint(const char *className, const char *funcName);
+
/// Handle an error as in PyErr_Occurred(), but also check for errors which
/// were captured by `storeErrorOrPrint`.
/// To be used in normal error checks.
diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
index f31b8f4f7..971835c53 100644
--- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp
+++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
@@ -92,8 +92,12 @@ void disassembleFrame(const char *marker)
PyErr_Restore(error_type, error_value, error_traceback);
}
-// python 3.12
-static int const CALL = 171;
+// Python 3.13
+static int const LOAD_ATTR_313 = 82;
+static int const CALL_313 = 53;
+static int const PUSH_NULL_313 = 34;
+// Python 3.12
+static int const CALL_312 = 171;
// Python 3.11
static int const PRECALL = 166;
// we have "big instructions" with gaps after them
@@ -105,13 +109,16 @@ static int const LOAD_METHOD = 160;
static int const CALL_METHOD = 161;
// Python 3.6
static int const CALL_FUNCTION = 131;
-static int const LOAD_ATTR = 106;
+static int const LOAD_ATTR_312 = 106;
// NoGil (how long will this exist in this form?)
static int const LOAD_METHOD_NOGIL = 55;
static int const CALL_METHOD_NOGIL = 72;
static bool currentOpcode_Is_CallMethNoArgs()
{
+ static auto number = _PepRuntimeVersion();
+ static int LOAD_ATTR = number < 0x030D00 ? LOAD_ATTR_312 : LOAD_ATTR_313;
+ static int CALL = number < 0x030D00 ? CALL_312 : CALL_313;
// PYSIDE-2221: Special case for the NoGil version:
// Find out if we have such a version.
// We could also ask the variable `Py_NOGIL`.
@@ -148,7 +155,6 @@ static bool currentOpcode_Is_CallMethNoArgs()
}
uint8_t opcode2 = co_code[f_lasti + 2];
uint8_t oparg2 = co_code[f_lasti + 3];
- static auto number = _PepRuntimeVersion();
if (number < 0x030B00)
return opcode1 == LOAD_METHOD && opcode2 == CALL_METHOD && oparg2 == 0;
@@ -158,7 +164,7 @@ static bool currentOpcode_Is_CallMethNoArgs()
// don't need to take care of them.
if (opcode1 == LOAD_METHOD)
f_lasti += LOAD_METHOD_GAP_311;
- else if (opcode1 == LOAD_ATTR)
+ else if (opcode1 == LOAD_ATTR_312)
f_lasti += LOAD_ATTR_GAP_311;
else
return false;
@@ -176,6 +182,11 @@ static bool currentOpcode_Is_CallMethNoArgs()
else
return false;
+ if (number >= 0x030D00) {
+ int opcode3 = co_code[f_lasti + 2];
+ if (opcode3 == PUSH_NULL_313)
+ f_lasti += 2;
+ }
opcode2 = co_code[f_lasti + 2];
oparg2 = co_code[f_lasti + 3];
diff --git a/sources/shiboken6/libshiboken/sbkmodule.cpp b/sources/shiboken6/libshiboken/sbkmodule.cpp
index 4153df27f..acadc60fa 100644
--- a/sources/shiboken6/libshiboken/sbkmodule.cpp
+++ b/sources/shiboken6/libshiboken/sbkmodule.cpp
@@ -7,21 +7,27 @@
#include "bindingmanager.h"
#include "sbkstring.h"
#include "sbkcppstring.h"
+#include "sbkconverter_p.h"
#include <unordered_map>
#include <unordered_set>
+#include <vector>
#include <cstring>
+/// This hash maps module objects to arrays of converters.
+using ModuleConvertersMap = std::unordered_map<PyObject *, SbkConverter **> ;
+
/// This hash maps module objects to arrays of Python types.
using ModuleTypesMap = std::unordered_map<PyObject *, Shiboken::Module::TypeInitStruct *> ;
-/// This hash maps module objects to arrays of converters.
-using ModuleConvertersMap = std::unordered_map<PyObject *, SbkConverter **>;
+struct TypeCreationStruct
+{
+ Shiboken::Module::TypeCreationFunction func;
+ std::vector<std::string> subtypeNames;
+};
-/// This hash maps type names to type creation functions.
-using TypeCreationFunctionModulePair =
- std::pair<Shiboken::Module::TypeCreationFunction, PyObject *>;
-using NameToTypeFunctionMap = std::unordered_map<std::string, TypeCreationFunctionModulePair>;
+/// This hash maps type names to type creation structs.
+using NameToTypeFunctionMap = std::unordered_map<std::string, TypeCreationStruct> ;
/// This hash maps module objects to maps of names to functions.
using ModuleToFuncsMap = std::unordered_map<PyObject *, NameToTypeFunctionMap> ;
@@ -56,8 +62,8 @@ LIBSHIBOKEN_API PyTypeObject *get(TypeInitStruct &typeStruct)
AutoDecRef modName(String::fromCppStringView(names.substr(0, dotPos)));
auto *modOrType = PyDict_GetItem(sysModules, modName);
if (modOrType == nullptr) {
- PyErr_Format(PyExc_SystemError, "Module %s should already be in sys.modules",
- PyModule_GetName(modOrType));
+ PyErr_Format(PyExc_SystemError, "Module \"%U\" should already be in sys.modules",
+ modName.object());
return nullptr;
}
@@ -74,6 +80,39 @@ LIBSHIBOKEN_API PyTypeObject *get(TypeInitStruct &typeStruct)
return typeStruct.type;
}
+static void incarnateHelper(PyObject *module, const std::string_view names,
+ const NameToTypeFunctionMap &nameToFunc)
+{
+ auto dotPos = names.find('.');
+ std::string::size_type startPos = 0;
+ auto *modOrType{module};
+ while (dotPos != std::string::npos) {
+ auto typeName = names.substr(startPos, dotPos - startPos);
+ AutoDecRef obTypeName(String::fromCppStringView(typeName));
+ modOrType = PyObject_GetAttr(modOrType, obTypeName);
+ startPos = dotPos + 1;
+ dotPos = names.find('.', startPos);
+ }
+ // now we have the type to create.
+ auto funcIter = nameToFunc.find(std::string(names));
+ // - call this function that returns a PyTypeObject
+ auto tcStruct = funcIter->second;
+ auto initFunc = tcStruct.func;
+ PyTypeObject *type = initFunc(modOrType);
+ auto name = names.substr(startPos);
+ PyObject_SetAttrString(modOrType, name.data(), reinterpret_cast<PyObject *>(type));
+}
+
+static void incarnateSubtypes(PyObject *module,
+ const std::vector<std::string> &nameList,
+ NameToTypeFunctionMap &nameToFunc)
+{
+ for (auto const & tableIter : nameList) {
+ std::string_view names(tableIter);
+ incarnateHelper(module, names, nameToFunc);
+ }
+}
+
static PyTypeObject *incarnateType(PyObject *module, const char *name,
NameToTypeFunctionMap &nameToFunc)
{
@@ -85,13 +124,15 @@ static PyTypeObject *incarnateType(PyObject *module, const char *name,
return nullptr;
}
// - call this function that returns a PyTypeObject
- auto pair = funcIter->second;
- auto initFunc = pair.first;
- auto *modOrType = pair.second;
+ auto tcStruct = funcIter->second;
+ auto initFunc = tcStruct.func;
+ auto *modOrType{module};
// PYSIDE-2404: Make sure that no switching happens during type creation.
auto saveFeature = initSelectableFeature(nullptr);
PyTypeObject *type = initFunc(modOrType);
+ if (!tcStruct.subtypeNames.empty())
+ incarnateSubtypes(module, tcStruct.subtypeNames, nameToFunc);
initSelectableFeature(saveFeature);
// - assign this object to the name in the module
@@ -151,7 +192,7 @@ static PyObject *PyModule_lazyGetAttro(PyObject *module, PyObject *name)
// - check if the attribute is present and return it.
auto *attr = PyObject_GenericGetAttr(module, name);
// - we handle AttributeError, only.
- if (!(attr == nullptr && PyErr_ExceptionMatches(PyExc_AttributeError)))
+ if (attr != nullptr || PyErr_ExceptionMatches(PyExc_AttributeError) == 0)
return attr;
PyErr_Clear();
@@ -164,7 +205,7 @@ static PyObject *PyModule_lazyGetAttro(PyObject *module, PyObject *name)
// - locate the name and retrieve the generating function
const char *attrNameStr = Shiboken::String::toCString(name);
auto &nameToFunc = tableIter->second;
- // - create the real type (incarnateType checks this)
+ // - create the real type and handle subtypes
auto *type = incarnateType(module, attrNameStr, nameToFunc);
auto *ret = reinterpret_cast<PyObject *>(type);
// - if attribute does really not exist use the original
@@ -172,7 +213,6 @@ static PyObject *PyModule_lazyGetAttro(PyObject *module, PyObject *name)
PyErr_Clear();
return origModuleGetattro(module, name);
}
-
return ret;
}
@@ -208,6 +248,9 @@ static PyMethodDef module_methods[] = {
// Python 3.8 - 3.12
static int const LOAD_CONST_312 = 100;
static int const IMPORT_NAME_312 = 108;
+// Python 3.13
+static int const LOAD_CONST_313 = 83;
+static int const IMPORT_NAME_313 = 75;
static bool isImportStar(PyObject *module)
{
@@ -220,6 +263,9 @@ static bool isImportStar(PyObject *module)
static PyObject *const _co_consts = Shiboken::String::createStaticString("co_consts");
static PyObject *const _co_names = Shiboken::String::createStaticString("co_names");
+ static int LOAD_CONST = _PepRuntimeVersion() < 0x030D00 ? LOAD_CONST_312 : LOAD_CONST_313;
+ static int IMPORT_NAME = _PepRuntimeVersion() < 0x030D00 ? IMPORT_NAME_312 : IMPORT_NAME_313;
+
auto *obFrame = reinterpret_cast<PyObject *>(PyEval_GetFrame());
if (obFrame == nullptr)
return true; // better assume worst-case.
@@ -234,12 +280,12 @@ static bool isImportStar(PyObject *module)
AutoDecRef dec_co_code(PyObject_GetAttr(dec_f_code, _co_code));
AutoDecRef dec_f_lasti(PyObject_GetAttr(dec_frame, _f_lasti));
Py_ssize_t f_lasti = PyLong_AsSsize_t(dec_f_lasti);
- Py_ssize_t code_len;
+ Py_ssize_t code_len{};
char *co_code{};
PyBytes_AsStringAndSize(dec_co_code, &co_code, &code_len);
uint8_t opcode2 = co_code[f_lasti];
uint8_t opcode1 = co_code[f_lasti - 2];
- if (opcode1 == LOAD_CONST_312 && opcode2 == IMPORT_NAME_312) {
+ if (opcode1 == LOAD_CONST && opcode2 == IMPORT_NAME) {
uint8_t oparg1 = co_code[f_lasti - 1];
uint8_t oparg2 = co_code[f_lasti + 1];
AutoDecRef dec_co_consts(PyObject_GetAttr(dec_f_code, _co_consts));
@@ -260,8 +306,6 @@ static bool isImportStar(PyObject *module)
// PYSIDE-2404: These modules produce ambiguous names which we cannot handle, yet.
static std::unordered_set<std::string> dontLazyLoad{
- "sample",
- "smart",
"testbinding"
};
@@ -292,24 +336,22 @@ static bool shouldLazyLoad(PyObject *module)
return std::strncmp(modName, "PySide6.", 8) == 0;
}
-void AddTypeCreationFunction(PyObject *module,
- const char *name,
- TypeCreationFunction func)
+static int lazyLoadDefault()
{
- static const char *flag = getenv("PYSIDE6_OPTION_LAZY");
- static const int value = flag != nullptr ? std::atoi(flag) : 1;
+#ifndef PYPY_VERSION
+ int result = 1;
+#else
+ int result = 0;
+#endif
+ if (auto *flag = getenv("PYSIDE6_OPTION_LAZY"))
+ result = std::atoi(flag);
+ return result;
+}
- // - locate the module in the moduleTofuncs mapping
- auto tableIter = moduleToFuncs.find(module);
- assert(tableIter != moduleToFuncs.end());
- // - Assign the name/generating function pair.
- auto &nameToFunc = tableIter->second;
- TypeCreationFunctionModulePair pair{func, module};
- auto nit = nameToFunc.find(name);
- if (nit == nameToFunc.end())
- nameToFunc.insert(std::make_pair(name, pair));
- else
- nit->second = pair;
+void checkIfShouldLoadImmediately(PyObject *module, const std::string &name,
+ const NameToTypeFunctionMap &nameToFunc)
+{
+ static const int value = lazyLoadDefault();
// PYSIDE-2404: Lazy Loading
//
@@ -319,56 +361,56 @@ void AddTypeCreationFunction(PyObject *module,
// 3 - lazy loading for any module.
//
// By default we lazy load all known modules (option = 1).
-
if (value == 0 // completely disabled
|| canNotLazyLoad(module) // for some reason we cannot lazy load
|| (value == 1 && !shouldLazyLoad(module)) // not a known module
) {
- PyTypeObject *type = func(module);
- PyModule_AddObject(module, name, reinterpret_cast<PyObject *>(type)); // steals reference
+ incarnateHelper(module, name, nameToFunc);
}
}
void AddTypeCreationFunction(PyObject *module,
const char *name,
- TypeCreationFunction func,
- const char *containerName)
+ TypeCreationFunction func)
{
- // This version could be delayed as well, but for the few cases
- // we simply fetch the container type and insert directly.
- AutoDecRef obContainerType(PyObject_GetAttrString(module, containerName));
- PyTypeObject *type = func(obContainerType);
- PyObject_SetAttrString(obContainerType, name, reinterpret_cast<PyObject *>(type)); // steals reference
-}
+ // - locate the module in the moduleTofuncs mapping
+ auto tableIter = moduleToFuncs.find(module);
+ assert(tableIter != moduleToFuncs.end());
+ // - Assign the name/generating function tcStruct.
+ auto &nameToFunc = tableIter->second;
+ TypeCreationStruct tcStruct{func, {}};
+ auto nit = nameToFunc.find(name);
+ if (nit == nameToFunc.end())
+ nameToFunc.insert(std::make_pair(name, tcStruct));
+ else
+ nit->second = tcStruct;
-void AddTypeCreationFunction(PyObject *module,
- const char *name,
- TypeCreationFunction func,
- const char *outerContainerName,
- const char *innerContainerName)
-{
- // This version has even more indirection. It is very rare, and
- // we handle it directly.
- AutoDecRef obOuterType(PyObject_GetAttrString(module, outerContainerName));
- AutoDecRef obInnerType(PyObject_GetAttrString(obOuterType, innerContainerName));
- PyTypeObject *type = func(obInnerType);
- PyObject_SetAttrString(obInnerType, name, reinterpret_cast<PyObject *>(type)); // steals reference
+ checkIfShouldLoadImmediately(module, name, nameToFunc);
}
void AddTypeCreationFunction(PyObject *module,
- const char *name,
+ const char *containerName,
TypeCreationFunction func,
- const char *containerName3,
- const char *containerName2,
- const char *containerName)
+ const char *namePath)
{
- // This version has even mode indirection. It is very rare, and
- // we handle it directly.
- AutoDecRef obContainerType3(PyObject_GetAttrString(module, containerName3));
- AutoDecRef obContainerType2(PyObject_GetAttrString(obContainerType3, containerName2));
- AutoDecRef obContainerType(PyObject_GetAttrString(obContainerType2, containerName));
- PyTypeObject *type = func(obContainerType);
- PyObject_SetAttrString(obContainerType, name, reinterpret_cast<PyObject *>(type)); // steals reference
+ // - locate the module in the moduleTofuncs mapping
+ auto tableIter = moduleToFuncs.find(module);
+ assert(tableIter != moduleToFuncs.end());
+ // - Assign the name/generating function tcStruct.
+ auto &nameToFunc = tableIter->second;
+ auto nit = nameToFunc.find(containerName);
+
+ // - insert namePath into the subtype vector of the main type.
+ nit->second.subtypeNames.emplace_back(namePath);
+ // - insert it also as its own entry.
+ nit = nameToFunc.find(namePath);
+ TypeCreationStruct tcStruct{func, {}};
+ if (nit == nameToFunc.end())
+ nameToFunc.insert(std::make_pair(namePath, tcStruct));
+ else
+ nit->second = tcStruct;
+
+ checkIfShouldLoadImmediately(module, namePath, nameToFunc);
}
PyObject *import(const char *moduleName)
@@ -441,11 +483,11 @@ PyObject *create(const char * /* modName */, void *moduleData)
// Install the getattr patch.
origModuleGetattro = PyModule_Type.tp_getattro;
PyModule_Type.tp_getattro = PyModule_lazyGetAttro;
- // Add the lazy import redirection.
+ // Add the lazy import redirection, keeping a reference.
origImportFunc = PyDict_GetItemString(builtins, "__import__");
- auto *func = PyCFunction_NewEx(lazy_methods, nullptr, nullptr);
+ Py_INCREF(origImportFunc);
+ AutoDecRef func(PyCFunction_NewEx(lazy_methods, nullptr, nullptr));
PyDict_SetItemString(builtins, "__import__", func);
- // Everything is set.
lazy_init = true;
}
// PYSIDE-2404: Nuitka inserts some additional code in standalone mode
@@ -455,6 +497,8 @@ PyObject *create(const char * /* modName */, void *moduleData)
// into `sys.modules`. This can cause a race condition.
// Insert the module early into the module dict to prevend recursion.
PyDict_SetItemString(sysModules, PyModule_GetName(module), module);
+ // Clear the non-existing name cache because we have a new module.
+ Shiboken::Conversions::clearNegativeLazyCache();
return module;
}
diff --git a/sources/shiboken6/libshiboken/sbkmodule.h b/sources/shiboken6/libshiboken/sbkmodule.h
index 1b3de33b7..2c407e09d 100644
--- a/sources/shiboken6/libshiboken/sbkmodule.h
+++ b/sources/shiboken6/libshiboken/sbkmodule.h
@@ -56,18 +56,6 @@ LIBSHIBOKEN_API void AddTypeCreationFunction(PyObject *module,
TypeCreationFunction func,
const char *containerName);
-LIBSHIBOKEN_API void AddTypeCreationFunction(PyObject *module,
- const char *name,
- TypeCreationFunction func,
- const char *outerContainerName,
- const char *innerContainerName);
-
-LIBSHIBOKEN_API void AddTypeCreationFunction(PyObject *module,
- const char *name,
- TypeCreationFunction func,
- const char *containerName3,
- const char *containerName2,
- const char *containerName);
/**
* Registers the list of types created by \p module.
* \param module Module where the types were created.
diff --git a/sources/shiboken6/libshiboken/sbkstring.cpp b/sources/shiboken6/libshiboken/sbkstring.cpp
index 1471cd7fe..b5e87ca5a 100644
--- a/sources/shiboken6/libshiboken/sbkstring.cpp
+++ b/sources/shiboken6/libshiboken/sbkstring.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "sbkstring.h"
+#include "sbkenum.h"
#include "sbkstaticstrings_p.h"
#include "autodecref.h"
@@ -14,6 +15,11 @@ bool checkIterable(PyObject *obj)
return PyObject_HasAttr(obj, Shiboken::PyMagicName::iter());
}
+bool checkIterableArgument(PyObject *obj)
+{
+ return checkIterable(obj) && !Shiboken::Enum::check(obj);
+}
+
static PyObject *initPathLike()
{
PyObject *PathLike{};
diff --git a/sources/shiboken6/libshiboken/sbkstring.h b/sources/shiboken6/libshiboken/sbkstring.h
index f91847c11..3ff2805e2 100644
--- a/sources/shiboken6/libshiboken/sbkstring.h
+++ b/sources/shiboken6/libshiboken/sbkstring.h
@@ -7,12 +7,12 @@
#include "sbkpython.h"
#include "shibokenmacros.h"
-namespace Shiboken
-{
-namespace String
+namespace Shiboken::String
{
LIBSHIBOKEN_API bool check(PyObject *obj);
LIBSHIBOKEN_API bool checkIterable(PyObject *obj);
+ /// Check for iterable function arguments (excluding enumerations)
+ LIBSHIBOKEN_API bool checkIterableArgument(PyObject *obj);
LIBSHIBOKEN_API bool checkPath(PyObject *path);
LIBSHIBOKEN_API bool checkType(PyTypeObject *obj);
LIBSHIBOKEN_API bool checkChar(PyObject *obj);
@@ -31,10 +31,6 @@ namespace String
LIBSHIBOKEN_API PyObject *getSnakeCaseName(PyObject *name, bool lower);
LIBSHIBOKEN_API PyObject *repr(PyObject *o);
-} // namespace String
-} // namespace Shiboken
-
+} // namespace Shiboken::String
#endif
-
-
diff --git a/sources/shiboken6/libshiboken/shiboken.h b/sources/shiboken6/libshiboken/shiboken.h
index fcf777ae0..27ba05fa7 100644
--- a/sources/shiboken6/libshiboken/shiboken.h
+++ b/sources/shiboken6/libshiboken/shiboken.h
@@ -19,6 +19,7 @@
#include "sbkmodule.h"
#include "sbkstring.h"
#include "sbkstaticstrings.h"
+#include "sbktypefactory.h"
#include "shibokenmacros.h"
#include "shibokenbuffer.h"
#include "signature.h"
diff --git a/sources/shiboken6/libshiboken/shibokenbuffer.h b/sources/shiboken6/libshiboken/shibokenbuffer.h
index 6b17eb6eb..068a5e9fd 100644
--- a/sources/shiboken6/libshiboken/shibokenbuffer.h
+++ b/sources/shiboken6/libshiboken/shibokenbuffer.h
@@ -7,10 +7,7 @@
#include "sbkpython.h"
#include "shibokenmacros.h"
-namespace Shiboken
-{
-
-namespace Buffer
+namespace Shiboken::Buffer
{
enum Type {
ReadOnly,
@@ -51,7 +48,6 @@ namespace Buffer
*/
LIBSHIBOKEN_API void *copyData(PyObject *pyObj, Py_ssize_t *size = nullptr);
-} // namespace Buffer
-} // namespace Shiboken
+} // namespace Shiboken::Buffer
#endif
diff --git a/sources/shiboken6/libshiboken/signature/signature.cpp b/sources/shiboken6/libshiboken/signature/signature.cpp
index 3255cb56d..45269844e 100644
--- a/sources/shiboken6/libshiboken/signature/signature.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature.cpp
@@ -424,7 +424,9 @@ static int PySide_FinishSignatures(PyObject *module, const char *signatures[])
* to the PyCFunction attributes. Therefore I simplified things
* and always use our own mapping.
*/
- PyObject *key, *func, *obdict = PyModule_GetDict(module);
+ PyObject *key{};
+ PyObject *func{};
+ PyObject *obdict = PyModule_GetDict(module);
Py_ssize_t pos = 0;
while (PyDict_Next(obdict, &pos, &key, &func))
@@ -538,7 +540,7 @@ static PyObject *adjustFuncName(const char *func_name)
assert(PyType_Check(obtype)); // This was not true for __init__!
// Find the feature flags
- auto type = reinterpret_cast<PyTypeObject *>(obtype.object());
+ auto *type = reinterpret_cast<PyTypeObject *>(obtype.object());
AutoDecRef dict(PepType_GetDict(type));
int id = currentSelectId(type);
id = id < 0 ? 0 : id; // if undefined, set to zero
@@ -585,7 +587,9 @@ void SetError_Argument(PyObject *args, const char *func_name, PyObject *info)
// PYSIDE-1305: Handle errors set by fillQtProperties.
if (PyErr_Occurred()) {
- PyObject *e, *v, *t;
+ PyObject *e{};
+ PyObject *v{};
+ PyObject *t{};
// Note: These references are all borrowed.
PyErr_Fetch(&e, &v, &t);
Py_DECREF(e);
@@ -606,7 +610,8 @@ void SetError_Argument(PyObject *args, const char *func_name, PyObject *info)
PyErr_Print();
Py_FatalError("seterror_argument did not receive a result");
}
- PyObject *err, *msg;
+ PyObject *err{};
+ PyObject *msg{};
if (!PyArg_UnpackTuple(res, func_name, 2, 2, &err, &msg)) {
PyErr_Print();
Py_FatalError("unexpected failure in seterror_argument");
diff --git a/sources/shiboken6/libshiboken/signature/signature_extend.cpp b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
index 7292f8216..3ce9e21e3 100644
--- a/sources/shiboken6/libshiboken/signature/signature_extend.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
@@ -120,12 +120,10 @@ static int handle_doc_in_progress = 0;
static PyObject *handle_doc(PyObject *ob, PyObject *old_descr)
{
AutoDecRef ob_type_mod(GetClassOrModOf(ob));
- const char *name;
bool isModule = PyModule_Check(ob_type_mod.object());
- if (isModule)
- name = PyModule_GetName(ob_type_mod.object());
- else
- name = reinterpret_cast<PyTypeObject *>(ob_type_mod.object())->tp_name;
+ const char *name = isModule
+ ? PyModule_GetName(ob_type_mod.object())
+ : reinterpret_cast<PyTypeObject *>(ob_type_mod.object())->tp_name;
PyObject *res{};
if (handle_doc_in_progress || name == nullptr
@@ -205,14 +203,14 @@ int PySide_PatchTypes(void)
AutoDecRef wrap_descr(PyObject_GetAttrString(
reinterpret_cast<PyObject *>(Py_TYPE(Py_True)), "__add__"));
// abbreviations for readability
- auto md_gs = new_PyMethodDescr_getsets;
- auto md_doc = &old_md_doc_descr;
- auto cf_gs = new_PyCFunction_getsets;
- auto cf_doc = &old_cf_doc_descr;
- auto sm_gs = new_PyStaticMethod_getsets;
- auto sm_doc = &old_sm_doc_descr;
- auto wd_gs = new_PyWrapperDescr_getsets;
- auto wd_doc = &old_wd_doc_descr;
+ auto *md_gs = new_PyMethodDescr_getsets;
+ auto *md_doc = &old_md_doc_descr;
+ auto *cf_gs = new_PyCFunction_getsets;
+ auto *cf_doc = &old_cf_doc_descr;
+ auto *sm_gs = new_PyStaticMethod_getsets;
+ auto *sm_doc = &old_sm_doc_descr;
+ auto *wd_gs = new_PyWrapperDescr_getsets;
+ auto *wd_doc = &old_wd_doc_descr;
if (meth_descr.isNull() || wrap_descr.isNull()
|| PyType_Ready(Py_TYPE(meth_descr)) < 0
diff --git a/sources/shiboken6/libshiboken/signature/signature_globals.cpp b/sources/shiboken6/libshiboken/signature/signature_globals.cpp
index 3a79a12d5..0a08309cc 100644
--- a/sources/shiboken6/libshiboken/signature/signature_globals.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_globals.cpp
@@ -120,7 +120,7 @@ static safe_globals_struc *init_phase_1()
return p;
- } while (0);
+ } while (false);
PyErr_Print();
Py_FatalError("could not initialize part 1");
@@ -130,10 +130,8 @@ static safe_globals_struc *init_phase_1()
static int init_phase_2(safe_globals_struc *p, PyMethodDef *methods)
{
do {
- PyMethodDef *ml;
-
// The single function to be called, but maybe more to come.
- for (ml = methods; ml->ml_name != nullptr; ml++) {
+ for (PyMethodDef *ml = methods; ml->ml_name != nullptr; ++ml) {
PyObject *v = PyCFunction_NewEx(ml, nullptr, nullptr);
if (v == nullptr
|| PyObject_SetAttrString(p->helper_module, ml->ml_name, v) != 0)
@@ -220,10 +218,8 @@ static int init_phase_2(safe_globals_struc *p, PyMethodDef *methods)
static void handler(int sig) {
#if defined(__GLIBC__)
void *array[30];
- size_t size;
-
// get void *'s for all entries on the stack
- size = backtrace(array, 30);
+ const int size = backtrace(array, 30);
// print out all the frames to stderr
#endif
diff --git a/sources/shiboken6/libshiboken/signature/signature_helper.cpp b/sources/shiboken6/libshiboken/signature/signature_helper.cpp
index cf84cfa13..9aab7a6a9 100644
--- a/sources/shiboken6/libshiboken/signature/signature_helper.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_helper.cpp
@@ -17,6 +17,8 @@
#include "signature_p.h"
+#include <cstring>
+
using namespace Shiboken;
extern "C" {
@@ -115,11 +117,11 @@ static PyObject *_func_with_new_name(PyTypeObject *type,
* but does not create a descriptor.
* XXX Maybe we can get rid of this, completely?
*/
- auto obtype = reinterpret_cast<PyObject *>(type);
- int len = strlen(new_name);
- auto name = new char[len + 1];
- strcpy(name, new_name);
- auto new_meth = new PyMethodDef;
+ auto *obtype = reinterpret_cast<PyObject *>(type);
+ const size_t len = std::strlen(new_name);
+ auto *name = new char[len + 1];
+ std::strcpy(name, new_name);
+ auto *new_meth = new PyMethodDef;
new_meth->ml_name = name;
new_meth->ml_meth = meth->ml_meth;
new_meth->ml_flags = meth->ml_flags;
@@ -196,8 +198,8 @@ static PyObject *_build_new_entry(PyObject *new_name, PyObject *value)
if (list.isNull())
return nullptr;
for (int idx = 0; idx < len; ++idx) {
- auto multi_entry = PyList_GetItem(multi, idx);
- auto dup = PyDict_Copy(multi_entry);
+ auto *multi_entry = PyList_GetItem(multi, idx);
+ auto *dup = PyDict_Copy(multi_entry);
if (PyDict_SetItem(dup, PyName::name(), new_name) < 0)
return nullptr;
if (PyList_SetItem(list, idx, dup) < 0)
@@ -215,7 +217,8 @@ static PyObject *_build_new_entry(PyObject *new_name, PyObject *value)
int insert_snake_case_variants(PyObject *dict)
{
AutoDecRef snake_dict(PyDict_New());
- PyObject *key, *value;
+ PyObject *key{};
+ PyObject *value{};
Py_ssize_t pos = 0;
while (PyDict_Next(dict, &pos, &key, &value)) {
AutoDecRef name(String::getSnakeCaseName(key, true));
@@ -363,8 +366,8 @@ int _build_func_to_type(PyObject *obtype)
if (descr == nullptr)
return -1;
char mangled_name[200];
- strcpy(mangled_name, meth->ml_name);
- strcat(mangled_name, ".overload");
+ std::strcpy(mangled_name, meth->ml_name);
+ std::strcat(mangled_name, ".overload");
if (PyDict_SetItemString(dict, mangled_name, descr) < 0)
return -1;
if (meth->ml_flags & METH_STATIC) {
diff --git a/sources/shiboken6/libshiboken/voidptr.cpp b/sources/shiboken6/libshiboken/voidptr.cpp
index 8bb3f6ac8..ce85d4946 100644
--- a/sources/shiboken6/libshiboken/voidptr.cpp
+++ b/sources/shiboken6/libshiboken/voidptr.cpp
@@ -6,6 +6,7 @@
#include "sbkconverter.h"
#include "basewrapper.h"
#include "basewrapper_p.h"
+#include "sbktypefactory.h"
extern "C"
{
@@ -41,7 +42,7 @@ PyObject *SbkVoidPtrObject_new(PyTypeObject *type, PyObject * /* args */, PyObje
int SbkVoidPtrObject_init(PyObject *self, PyObject *args, PyObject *kwds)
{
- PyObject *addressObject;
+ PyObject *addressObject{};
Py_ssize_t size = -1;
int isWritable = 0;
auto *sbkSelf = reinterpret_cast<SbkVoidPtrObject *>(self);
diff --git a/sources/shiboken6/shiboken_tool.py b/sources/shiboken6/shiboken_tool.py
index 30d334f44..2b69a1c6a 100755
--- a/sources/shiboken6/shiboken_tool.py
+++ b/sources/shiboken6/shiboken_tool.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import sys
import os
import subprocess
diff --git a/sources/shiboken6/shiboken_version.py b/sources/shiboken6/shiboken_version.py
index 07b247316..033a2e439 100644
--- a/sources/shiboken6/shiboken_version.py
+++ b/sources/shiboken6/shiboken_version.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
major_version = "@shiboken_MAJOR_VERSION@"
minor_version = "@shiboken_MINOR_VERSION@"
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/__init__.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/__init__.py
index e54bec75a..db4f381f5 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/__init__.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/__init__.py
@@ -1,4 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# this file intentionally left blank
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py
index 7a0871ee7..4a8ccdbc6 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/feature.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# flake8: noqa F:821
# flake8: noqa F:401
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/fix-complaints.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/fix-complaints.py
index f7190b12f..524c1c483 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/fix-complaints.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/fix-complaints.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
fix-complaints.py
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/__init__.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/__init__.py
index bebf56c7e..2704ffab7 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/__init__.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/__init__.py
@@ -1,4 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
__all__ = "get_signature layout mapping lib".split()
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
index c2a19efef..5ec41aa9f 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# flake8: noqa E:721
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py
index bae264294..394e8cda3 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/importhandler.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
importhandler.py
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/layout.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/layout.py
index 0e781cbcb..6fc8ff1b3 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/layout.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/layout.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
layout.py
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/__init__.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/__init__.py
index e54bec75a..db4f381f5 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/__init__.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/__init__.py
@@ -1,4 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# this file intentionally left blank
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py
index 5650e2bc1..9d98d7b1b 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
enum_sig.py
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py
index ce12dd6c8..641b6693a 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py
@@ -1,6 +1,7 @@
LICENSE_TEXT = """
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
# flake8: noqa E:402
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py
index 979dcf4ce..48546d7cb 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
"""
tool.py
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py
index fb4c9eeca..ba9f78761 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/loader.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# flake8: noqa E:402
# flake8: noqa F:401
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py
index 944a928e6..3bdd4c1d2 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
# flake8: noqa E:203
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py
index 9b48ab442..6071dd92c 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/parser.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import ast
import enum
diff --git a/sources/shiboken6/shibokenmodule/shibokenmodule.cpp b/sources/shiboken6/shibokenmodule/shibokenmodule.cpp
index b3adfe78b..5c6219885 100644
--- a/sources/shiboken6/shibokenmodule/shibokenmodule.cpp
+++ b/sources/shiboken6/shibokenmodule/shibokenmodule.cpp
@@ -100,6 +100,10 @@ const bool ok = Shiboken::BindingManager::instance().dumpTypeGraph(%1);
Shiboken::BindingManager::instance().dumpWrapperMap();
// @snippet dumpwrappermap
+// @snippet dumpconverters
+Shiboken::Conversions::dumpConverters();
+// @snippet dumpconverters
+
// @snippet init
// Add __version__ and __version_info__ attributes to the module
PyObject* version = PyTuple_New(5);
diff --git a/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml b/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml
index aa08a8bbf..acb522ecc 100644
--- a/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml
+++ b/sources/shiboken6/shibokenmodule/typesystem_shiboken.xml
@@ -57,9 +57,14 @@
<inject-code file="shibokenmodule.cpp" snippet="dumpwrappermap"/>
</add-function>
+ <add-function signature="dumpConverters()">
+ <inject-code file="shibokenmodule.cpp" snippet="dumpconverters"/>
+ </add-function>
+
<extra-includes>
<include file-name="sbkversion.h" location="local"/>
<include file-name="voidptr.h" location="local"/>
+ <include file-name="sbkconverter_p.h" location="local"/>
</extra-includes>
<inject-code position="end" file="shibokenmodule.cpp" snippet="init"/>
</typesystem>
diff --git a/sources/shiboken6/tests/libother/othermultiplederived.h b/sources/shiboken6/tests/libother/othermultiplederived.h
index cd9910687..9f90c43a7 100644
--- a/sources/shiboken6/tests/libother/othermultiplederived.h
+++ b/sources/shiboken6/tests/libother/othermultiplederived.h
@@ -6,6 +6,7 @@
#include "libothermacros.h"
#include "multiple_derived.h"
+#include "objecttype.h"
#include "virtualmethods.h"
class ObjectType;
diff --git a/sources/shiboken6/tests/libsample/derived.h b/sources/shiboken6/tests/libsample/derived.h
index b7736c37a..cf95cb601 100644
--- a/sources/shiboken6/tests/libsample/derived.h
+++ b/sources/shiboken6/tests/libsample/derived.h
@@ -26,7 +26,7 @@ public:
public:
void uselessMethod() {}
SomeInnerClass operator+(const SomeInnerClass &other) { return other; }
- bool operator==(const SomeInnerClass &) { return true; }
+ bool operator==(const SomeInnerClass &) const { return true; }
};
explicit Derived(int id = -1) noexcept;
diff --git a/sources/shiboken6/tests/libsample/point.cpp b/sources/shiboken6/tests/libsample/point.cpp
index b8630eb1e..0a28e877f 100644
--- a/sources/shiboken6/tests/libsample/point.cpp
+++ b/sources/shiboken6/tests/libsample/point.cpp
@@ -34,7 +34,7 @@ void Point::show() const
std::cout << "(x: " << m_x << ", y: " << m_y << ")";
}
-bool Point::operator==(const Point &other)
+bool Point::operator==(const Point &other) const
{
return m_x == other.m_x && m_y == other.m_y;
}
diff --git a/sources/shiboken6/tests/libsample/point.h b/sources/shiboken6/tests/libsample/point.h
index 59e0236d5..7e5d128ab 100644
--- a/sources/shiboken6/tests/libsample/point.h
+++ b/sources/shiboken6/tests/libsample/point.h
@@ -38,7 +38,7 @@ public:
// The != operator is not implemented for the purpose of testing
// for the absense of the __ne__ method in the Python binding.
- bool operator==(const Point &other);
+ bool operator==(const Point &other) const;
Point operator+(const Point &other);
Point operator-(const Point &other);
diff --git a/sources/shiboken6/tests/libsample/pointf.cpp b/sources/shiboken6/tests/libsample/pointf.cpp
index 6b39f73a9..736a5c6b5 100644
--- a/sources/shiboken6/tests/libsample/pointf.cpp
+++ b/sources/shiboken6/tests/libsample/pointf.cpp
@@ -26,7 +26,7 @@ void PointF::show() const
std::cout << "(x: " << m_x << ", y: " << m_y << ")";
}
-bool PointF::operator==(const PointF &other)
+bool PointF::operator==(const PointF &other) const
{
return m_x == other.m_x && m_y == other.m_y;
}
diff --git a/sources/shiboken6/tests/libsample/pointf.h b/sources/shiboken6/tests/libsample/pointf.h
index bb50b5c6d..49e009467 100644
--- a/sources/shiboken6/tests/libsample/pointf.h
+++ b/sources/shiboken6/tests/libsample/pointf.h
@@ -31,7 +31,7 @@ public:
// The != operator is not implemented for the purpose of testing
// for the absence of the __ne__ method in the Python binding.
- bool operator==(const PointF &other);
+ bool operator==(const PointF &other) const;
PointF operator+(const PointF &other);
PointF operator-(const PointF &other);
diff --git a/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.cpp b/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.cpp
index a7b73cc81..472f807f2 100644
--- a/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.cpp
+++ b/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.cpp
@@ -51,6 +51,46 @@ void StdSharedPtrTestBench::printInt(const std::shared_ptr<int> &p)
std::cerr << '\n';
}
+std::shared_ptr<double> StdSharedPtrTestBench::createDouble(double v)
+{
+ return std::make_shared<double>(v);
+}
+
+std::shared_ptr<double> StdSharedPtrTestBench::createNullDouble()
+{
+ return {};
+}
+
+void StdSharedPtrTestBench::printDouble(const std::shared_ptr<double> &p)
+{
+ std::cerr << __FUNCTION__ << ' ';
+ if (p.get())
+ std::cerr << *p;
+ else
+ std::cerr << "nullptr";
+ std::cerr << '\n';
+}
+
+std::shared_ptr<std::string> StdSharedPtrTestBench::createString(const char *text)
+{
+ return std::make_shared<std::string>(text);
+}
+
+std::shared_ptr<std::string> StdSharedPtrTestBench::createNullString()
+{
+ return {};
+}
+
+void StdSharedPtrTestBench::printString(const std::shared_ptr<std::string> &p)
+{
+ std::cerr << __FUNCTION__ << ' ';
+ if (p.get())
+ std::cerr << '"' << *p << '"';
+ else
+ std::cerr << "nullptr";
+ std::cerr << '\n';
+}
+
StdSharedPtrVirtualMethodTester::StdSharedPtrVirtualMethodTester() = default;
StdSharedPtrVirtualMethodTester::~StdSharedPtrVirtualMethodTester() = default;
diff --git a/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.h b/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.h
index 8991cded6..9d4c207b5 100644
--- a/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.h
+++ b/sources/shiboken6/tests/libsmart/stdsharedptrtestbench.h
@@ -7,6 +7,7 @@
#include "libsmartmacros.h"
#include <memory>
+#include <string>
class Integer;
@@ -23,6 +24,14 @@ public:
static std::shared_ptr<int> createInt(int v = 42);
static std::shared_ptr<int> createNullInt();
static void printInt(const std::shared_ptr<int> &);
+
+ static std::shared_ptr<double> createDouble(double v = 42);
+ static std::shared_ptr<double> createNullDouble();
+ static void printDouble(const std::shared_ptr<double> &);
+
+ static std::shared_ptr<std::string> createString(const char *text);
+ static std::shared_ptr<std::string> createNullString();
+ static void printString(const std::shared_ptr<std::string> &);
};
class LIB_SMART_API StdSharedPtrVirtualMethodTester
diff --git a/sources/shiboken6/tests/minimalbinding/brace_pattern_test.py b/sources/shiboken6/tests/minimalbinding/brace_pattern_test.py
index 946a869db..a45c6edb2 100644
--- a/sources/shiboken6/tests/minimalbinding/brace_pattern_test.py
+++ b/sources/shiboken6/tests/minimalbinding/brace_pattern_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+from __future__ import annotations
import os
import re
diff --git a/sources/shiboken6/tests/minimalbinding/containeruser_test.py b/sources/shiboken6/tests/minimalbinding/containeruser_test.py
index 25d683957..cda4f32b2 100644
--- a/sources/shiboken6/tests/minimalbinding/containeruser_test.py
+++ b/sources/shiboken6/tests/minimalbinding/containeruser_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/minimalbinding/listuser_test.py b/sources/shiboken6/tests/minimalbinding/listuser_test.py
index b30bb653a..bf09eeffb 100644
--- a/sources/shiboken6/tests/minimalbinding/listuser_test.py
+++ b/sources/shiboken6/tests/minimalbinding/listuser_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from functools import reduce
import os
diff --git a/sources/shiboken6/tests/minimalbinding/minbool_test.py b/sources/shiboken6/tests/minimalbinding/minbool_test.py
index d9ce0eac0..0f033e4d1 100644
--- a/sources/shiboken6/tests/minimalbinding/minbool_test.py
+++ b/sources/shiboken6/tests/minimalbinding/minbool_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/minimalbinding/obj_test.py b/sources/shiboken6/tests/minimalbinding/obj_test.py
index e873845de..82dc89d38 100644
--- a/sources/shiboken6/tests/minimalbinding/obj_test.py
+++ b/sources/shiboken6/tests/minimalbinding/obj_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/minimalbinding/spanuser_test.py b/sources/shiboken6/tests/minimalbinding/spanuser_test.py
index 6db6aa616..4239fe9a2 100644
--- a/sources/shiboken6/tests/minimalbinding/spanuser_test.py
+++ b/sources/shiboken6/tests/minimalbinding/spanuser_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/minimalbinding/typedef_test.py b/sources/shiboken6/tests/minimalbinding/typedef_test.py
index c2fc8fc12..c69a1c3c5 100644
--- a/sources/shiboken6/tests/minimalbinding/typedef_test.py
+++ b/sources/shiboken6/tests/minimalbinding/typedef_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/minimalbinding/val_test.py b/sources/shiboken6/tests/minimalbinding/val_test.py
index b8225a247..25642dc3f 100644
--- a/sources/shiboken6/tests/minimalbinding/val_test.py
+++ b/sources/shiboken6/tests/minimalbinding/val_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/otherbinding/collector_external_operator_test.py b/sources/shiboken6/tests/otherbinding/collector_external_operator_test.py
index 2ba21653d..7819d1e0d 100644
--- a/sources/shiboken6/tests/otherbinding/collector_external_operator_test.py
+++ b/sources/shiboken6/tests/otherbinding/collector_external_operator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Collector shift operators defined in other modules.'''
diff --git a/sources/shiboken6/tests/otherbinding/conversion_operator_for_class_without_implicit_conversions_test.py b/sources/shiboken6/tests/otherbinding/conversion_operator_for_class_without_implicit_conversions_test.py
index bd00b5892..e837300a3 100644
--- a/sources/shiboken6/tests/otherbinding/conversion_operator_for_class_without_implicit_conversions_test.py
+++ b/sources/shiboken6/tests/otherbinding/conversion_operator_for_class_without_implicit_conversions_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests calling NoImplicitConversion using a ExtendsNoImplicitConversion parameter,
being that the latter defines a new conversion operator for the former, and this one
diff --git a/sources/shiboken6/tests/otherbinding/extended_multiply_operator_test.py b/sources/shiboken6/tests/otherbinding/extended_multiply_operator_test.py
index abbef6231..bb2511dae 100644
--- a/sources/shiboken6/tests/otherbinding/extended_multiply_operator_test.py
+++ b/sources/shiboken6/tests/otherbinding/extended_multiply_operator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for libsample's Point multiply operator defined in libother module.'''
diff --git a/sources/shiboken6/tests/otherbinding/module_reload_test.py b/sources/shiboken6/tests/otherbinding/module_reload_test.py
index bde2f5236..2fd66a51f 100644
--- a/sources/shiboken6/tests/otherbinding/module_reload_test.py
+++ b/sources/shiboken6/tests/otherbinding/module_reload_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
from importlib import reload
import os
diff --git a/sources/shiboken6/tests/otherbinding/new_ctor_operator_test.py b/sources/shiboken6/tests/otherbinding/new_ctor_operator_test.py
index d6c356436..3c63929f1 100644
--- a/sources/shiboken6/tests/otherbinding/new_ctor_operator_test.py
+++ b/sources/shiboken6/tests/otherbinding/new_ctor_operator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests calling Str constructor using a Number parameter, being that number defines
a cast operator to Str.'''
diff --git a/sources/shiboken6/tests/otherbinding/objtypehashes_test.py b/sources/shiboken6/tests/otherbinding/objtypehashes_test.py
index d2cd7de5b..6764cc0f7 100644
--- a/sources/shiboken6/tests/otherbinding/objtypehashes_test.py
+++ b/sources/shiboken6/tests/otherbinding/objtypehashes_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/otherbinding/otherderived_test.py b/sources/shiboken6/tests/otherbinding/otherderived_test.py
index 459f474f1..13c59f91f 100644
--- a/sources/shiboken6/tests/otherbinding/otherderived_test.py
+++ b/sources/shiboken6/tests/otherbinding/otherderived_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for OtherDerived class'''
diff --git a/sources/shiboken6/tests/otherbinding/othertypesystypedef_test.py b/sources/shiboken6/tests/otherbinding/othertypesystypedef_test.py
index 198c71693..236dda6b0 100644
--- a/sources/shiboken6/tests/otherbinding/othertypesystypedef_test.py
+++ b/sources/shiboken6/tests/otherbinding/othertypesystypedef_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for a class that holds a void pointer.'''
diff --git a/sources/shiboken6/tests/otherbinding/signature_test.py b/sources/shiboken6/tests/otherbinding/signature_test.py
index 8db3e566b..a22f65316 100644
--- a/sources/shiboken6/tests/otherbinding/signature_test.py
+++ b/sources/shiboken6/tests/otherbinding/signature_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for functions signature'''
diff --git a/sources/shiboken6/tests/otherbinding/smartptr_test.py b/sources/shiboken6/tests/otherbinding/smartptr_test.py
index fd5c7fa09..1c9466e24 100644
--- a/sources/shiboken6/tests/otherbinding/smartptr_test.py
+++ b/sources/shiboken6/tests/otherbinding/smartptr_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for the SmartPtrTester class'''
diff --git a/sources/shiboken6/tests/otherbinding/star_import_test.py b/sources/shiboken6/tests/otherbinding/star_import_test.py
index 4b5f1d270..9c4b42fa8 100644
--- a/sources/shiboken6/tests/otherbinding/star_import_test.py
+++ b/sources/shiboken6/tests/otherbinding/star_import_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""PYSIDE-2404: Test whether star imports work as they require special handling
by the lazy initialization."""
diff --git a/sources/shiboken6/tests/otherbinding/test_module_template.py b/sources/shiboken6/tests/otherbinding/test_module_template.py
index 36ab43ae3..b4e5515fa 100644
--- a/sources/shiboken6/tests/otherbinding/test_module_template.py
+++ b/sources/shiboken6/tests/otherbinding/test_module_template.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/otherbinding/typediscovery_test.py b/sources/shiboken6/tests/otherbinding/typediscovery_test.py
index 39dc5cf0f..67f45e7ba 100644
--- a/sources/shiboken6/tests/otherbinding/typediscovery_test.py
+++ b/sources/shiboken6/tests/otherbinding/typediscovery_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for type discovery'''
diff --git a/sources/shiboken6/tests/otherbinding/usersprimitivefromothermodule_test.py b/sources/shiboken6/tests/otherbinding/usersprimitivefromothermodule_test.py
index 15a988326..e99256f35 100644
--- a/sources/shiboken6/tests/otherbinding/usersprimitivefromothermodule_test.py
+++ b/sources/shiboken6/tests/otherbinding/usersprimitivefromothermodule_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests user defined primitive type from a required module.'''
diff --git a/sources/shiboken6/tests/otherbinding/wrongctor_test.py b/sources/shiboken6/tests/otherbinding/wrongctor_test.py
index b9251b428..a5fe04ecd 100644
--- a/sources/shiboken6/tests/otherbinding/wrongctor_test.py
+++ b/sources/shiboken6/tests/otherbinding/wrongctor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/qtxmltosphinx/main.cpp b/sources/shiboken6/tests/qtxmltosphinx/main.cpp
index 27aaee7d1..5b0624376 100644
--- a/sources/shiboken6/tests/qtxmltosphinx/main.cpp
+++ b/sources/shiboken6/tests/qtxmltosphinx/main.cpp
@@ -40,6 +40,7 @@ public:
const QString &) const override;
const QLoggingCategory &loggingCategory() const override;
QtXmlToSphinxLink resolveLink(const QtXmlToSphinxLink &link) const override;
+ Image resolveImage(const QString &href, const QString &) const;
};
// QtXmlToSphinxDocGeneratorInterface
@@ -63,11 +64,18 @@ const QLoggingCategory &QtXmlToSphinxDocGenerator::loggingCategory() const
return lcQtXmlToSphinx();
}
-QtXmlToSphinxLink QtXmlToSphinxDocGenerator::resolveLink(const QtXmlToSphinxLink &link) const
+QtXmlToSphinxLink
+ QtXmlToSphinxDocGenerator::resolveLink(const QtXmlToSphinxLink &link) const
{
return link;
}
+QtXmlToSphinxDocGeneratorInterface::Image
+ QtXmlToSphinxDocGenerator::resolveImage(const QString &href, const QString &) const
+{
+ return {href, href};
+}
+
static bool run(const QString &fileName)
{
QtXmlToSphinxDocGenerator generator;
diff --git a/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.cpp b/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.cpp
index 45cecd1a1..3ba77196f 100644
--- a/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.cpp
+++ b/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.cpp
@@ -39,6 +39,12 @@ QtXmlToSphinxLink QtXmlToSphinxTest::resolveLink(const QtXmlToSphinxLink &link)
return link;
}
+QtXmlToSphinxDocGeneratorInterface::Image
+ QtXmlToSphinxTest::resolveImage(const QString &href, const QString &) const
+{
+ return {href, href};
+}
+
QString QtXmlToSphinxTest::transformXml(const QString &xml) const
{
return QtXmlToSphinx(this, m_parameters, xml).result();
diff --git a/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.h b/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.h
index 0a210b7a0..5108ef452 100644
--- a/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.h
+++ b/sources/shiboken6/tests/qtxmltosphinxtest/qtxmltosphinxtest.h
@@ -19,6 +19,7 @@ public:
const QString &) const override;
const QLoggingCategory &loggingCategory() const override;
QtXmlToSphinxLink resolveLink(const QtXmlToSphinxLink &link) const override;
+ Image resolveImage(const QString &href, const QString &context) const override;
private slots:
void testTable_data();
diff --git a/sources/shiboken6/tests/samplebinding/__del___test.py b/sources/shiboken6/tests/samplebinding/__del___test.py
index 456886614..688e35445 100644
--- a/sources/shiboken6/tests/samplebinding/__del___test.py
+++ b/sources/shiboken6/tests/samplebinding/__del___test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/shiboken6/tests/samplebinding/abstract_test.py b/sources/shiboken6/tests/samplebinding/abstract_test.py
index 89e87be1d..bf7f36dfb 100644
--- a/sources/shiboken6/tests/samplebinding/abstract_test.py
+++ b/sources/shiboken6/tests/samplebinding/abstract_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Abstract class'''
diff --git a/sources/shiboken6/tests/samplebinding/addedfunction_test.py b/sources/shiboken6/tests/samplebinding/addedfunction_test.py
index 0b5680143..cd7132ad9 100644
--- a/sources/shiboken6/tests/samplebinding/addedfunction_test.py
+++ b/sources/shiboken6/tests/samplebinding/addedfunction_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for added functions.'''
diff --git a/sources/shiboken6/tests/samplebinding/addedfunction_with_container_args_test.py b/sources/shiboken6/tests/samplebinding/addedfunction_with_container_args_test.py
index 2a739033b..01b77531e 100644
--- a/sources/shiboken6/tests/samplebinding/addedfunction_with_container_args_test.py
+++ b/sources/shiboken6/tests/samplebinding/addedfunction_with_container_args_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for added functions with nested and multi-argument container types.'''
diff --git a/sources/shiboken6/tests/samplebinding/argumentmodifications_test.py b/sources/shiboken6/tests/samplebinding/argumentmodifications_test.py
index b0ca56a6d..576554404 100644
--- a/sources/shiboken6/tests/samplebinding/argumentmodifications_test.py
+++ b/sources/shiboken6/tests/samplebinding/argumentmodifications_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for method arguments modifications performed as described on typesystem.'''
diff --git a/sources/shiboken6/tests/samplebinding/array_numpy_test.py b/sources/shiboken6/tests/samplebinding/array_numpy_test.py
index 0d73bca1c..a8baeb098 100644
--- a/sources/shiboken6/tests/samplebinding/array_numpy_test.py
+++ b/sources/shiboken6/tests/samplebinding/array_numpy_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for NumPy Array types.'''
diff --git a/sources/shiboken6/tests/samplebinding/array_sequence_test.py b/sources/shiboken6/tests/samplebinding/array_sequence_test.py
index ad65d58db..379d0b69e 100644
--- a/sources/shiboken6/tests/samplebinding/array_sequence_test.py
+++ b/sources/shiboken6/tests/samplebinding/array_sequence_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for Array types (PySequence).'''
diff --git a/sources/shiboken6/tests/samplebinding/bug_554_test.py b/sources/shiboken6/tests/samplebinding/bug_554_test.py
index a7e7a7210..0292a3cdb 100644
--- a/sources/shiboken6/tests/samplebinding/bug_554_test.py
+++ b/sources/shiboken6/tests/samplebinding/bug_554_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Unit test for bug#554'''
diff --git a/sources/shiboken6/tests/samplebinding/bug_704_test.py b/sources/shiboken6/tests/samplebinding/bug_704_test.py
index c470fe723..d0cfe4038 100644
--- a/sources/shiboken6/tests/samplebinding/bug_704_test.py
+++ b/sources/shiboken6/tests/samplebinding/bug_704_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/bytearray_test.py b/sources/shiboken6/tests/samplebinding/bytearray_test.py
index e51a899fa..a3771ef94 100644
--- a/sources/shiboken6/tests/samplebinding/bytearray_test.py
+++ b/sources/shiboken6/tests/samplebinding/bytearray_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/child_return_test.py b/sources/shiboken6/tests/samplebinding/child_return_test.py
index f0ac70626..dc39aaaab 100644
--- a/sources/shiboken6/tests/samplebinding/child_return_test.py
+++ b/sources/shiboken6/tests/samplebinding/child_return_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''The BlackBox class has cases of ownership transference between C++ and Python.'''
diff --git a/sources/shiboken6/tests/samplebinding/class_fields_test.py b/sources/shiboken6/tests/samplebinding/class_fields_test.py
index 1eeb3d446..63b8b8fa3 100644
--- a/sources/shiboken6/tests/samplebinding/class_fields_test.py
+++ b/sources/shiboken6/tests/samplebinding/class_fields_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Simple test case for accessing the exposed C++ class fields.'''
diff --git a/sources/shiboken6/tests/samplebinding/collector_test.py b/sources/shiboken6/tests/samplebinding/collector_test.py
index 4caebc62a..dfde29ae7 100644
--- a/sources/shiboken6/tests/samplebinding/collector_test.py
+++ b/sources/shiboken6/tests/samplebinding/collector_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Collector class' shift operators.'''
diff --git a/sources/shiboken6/tests/samplebinding/complex_test.py b/sources/shiboken6/tests/samplebinding/complex_test.py
index 454aff100..83e5c26d0 100644
--- a/sources/shiboken6/tests/samplebinding/complex_test.py
+++ b/sources/shiboken6/tests/samplebinding/complex_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Complex class'''
diff --git a/sources/shiboken6/tests/samplebinding/conversion_operator_test.py b/sources/shiboken6/tests/samplebinding/conversion_operator_test.py
index 7e76245b1..aa30637e7 100644
--- a/sources/shiboken6/tests/samplebinding/conversion_operator_test.py
+++ b/sources/shiboken6/tests/samplebinding/conversion_operator_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for implicit conversion generated by conversion operator.'''
diff --git a/sources/shiboken6/tests/samplebinding/copy_test.py b/sources/shiboken6/tests/samplebinding/copy_test.py
index db539d1b9..95437676d 100644
--- a/sources/shiboken6/tests/samplebinding/copy_test.py
+++ b/sources/shiboken6/tests/samplebinding/copy_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for deep copy of objects'''
diff --git a/sources/shiboken6/tests/samplebinding/ctorconvrule_test.py b/sources/shiboken6/tests/samplebinding/ctorconvrule_test.py
index 5e2695d72..9381164cb 100644
--- a/sources/shiboken6/tests/samplebinding/ctorconvrule_test.py
+++ b/sources/shiboken6/tests/samplebinding/ctorconvrule_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for proper generation of constructor altered by conversion-rule tag.'''
diff --git a/sources/shiboken6/tests/samplebinding/cyclic_test.py b/sources/shiboken6/tests/samplebinding/cyclic_test.py
index 4e4ae2603..95cc33375 100644
--- a/sources/shiboken6/tests/samplebinding/cyclic_test.py
+++ b/sources/shiboken6/tests/samplebinding/cyclic_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/shiboken6/tests/samplebinding/date_test.py b/sources/shiboken6/tests/samplebinding/date_test.py
index 2b6efcf18..48a9414c5 100644
--- a/sources/shiboken6/tests/samplebinding/date_test.py
+++ b/sources/shiboken6/tests/samplebinding/date_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for python conversions types '''
diff --git a/sources/shiboken6/tests/samplebinding/decisor_test.py b/sources/shiboken6/tests/samplebinding/decisor_test.py
index 0d39c5f96..9db6342a1 100644
--- a/sources/shiboken6/tests/samplebinding/decisor_test.py
+++ b/sources/shiboken6/tests/samplebinding/decisor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for the method overload decisor.'''
diff --git a/sources/shiboken6/tests/samplebinding/delete_test.py b/sources/shiboken6/tests/samplebinding/delete_test.py
index 57a792ae2..09ad6f947 100644
--- a/sources/shiboken6/tests/samplebinding/delete_test.py
+++ b/sources/shiboken6/tests/samplebinding/delete_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/deprecated_test.py b/sources/shiboken6/tests/samplebinding/deprecated_test.py
index c371df94f..eafbd7c54 100644
--- a/sources/shiboken6/tests/samplebinding/deprecated_test.py
+++ b/sources/shiboken6/tests/samplebinding/deprecated_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/derived_test.py b/sources/shiboken6/tests/samplebinding/derived_test.py
index 346f29136..834d3416a 100644
--- a/sources/shiboken6/tests/samplebinding/derived_test.py
+++ b/sources/shiboken6/tests/samplebinding/derived_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Derived class'''
diff --git a/sources/shiboken6/tests/samplebinding/duck_punching_test.py b/sources/shiboken6/tests/samplebinding/duck_punching_test.py
index aa21a0f7e..04fb0a7e0 100644
--- a/sources/shiboken6/tests/samplebinding/duck_punching_test.py
+++ b/sources/shiboken6/tests/samplebinding/duck_punching_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for virtual methods.'''
diff --git a/sources/shiboken6/tests/samplebinding/echo_test.py b/sources/shiboken6/tests/samplebinding/echo_test.py
index f1859260e..b42abcf3f 100644
--- a/sources/shiboken6/tests/samplebinding/echo_test.py
+++ b/sources/shiboken6/tests/samplebinding/echo_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for <add-function> with const char* as argument'''
diff --git a/sources/shiboken6/tests/samplebinding/enum_test.py b/sources/shiboken6/tests/samplebinding/enum_test.py
index 276b8d894..50bf4a61d 100644
--- a/sources/shiboken6/tests/samplebinding/enum_test.py
+++ b/sources/shiboken6/tests/samplebinding/enum_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Python representation of C++ enums.'''
diff --git a/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py b/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
index 42ae23961..f88d6c3d8 100644
--- a/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
+++ b/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/event_loop_call_virtual_test.py b/sources/shiboken6/tests/samplebinding/event_loop_call_virtual_test.py
index 8e13d5d46..c2b6200d0 100644
--- a/sources/shiboken6/tests/samplebinding/event_loop_call_virtual_test.py
+++ b/sources/shiboken6/tests/samplebinding/event_loop_call_virtual_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Simple event loop dispatcher test.'''
diff --git a/sources/shiboken6/tests/samplebinding/event_loop_thread_test.py b/sources/shiboken6/tests/samplebinding/event_loop_thread_test.py
index 8b854fca6..5a8d32bce 100644
--- a/sources/shiboken6/tests/samplebinding/event_loop_thread_test.py
+++ b/sources/shiboken6/tests/samplebinding/event_loop_thread_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
from random import random
diff --git a/sources/shiboken6/tests/samplebinding/exception_test.py b/sources/shiboken6/tests/samplebinding/exception_test.py
index d9e6b377f..95555b330 100644
--- a/sources/shiboken6/tests/samplebinding/exception_test.py
+++ b/sources/shiboken6/tests/samplebinding/exception_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/filter_test.py b/sources/shiboken6/tests/samplebinding/filter_test.py
index df805093f..a0c631a37 100644
--- a/sources/shiboken6/tests/samplebinding/filter_test.py
+++ b/sources/shiboken6/tests/samplebinding/filter_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/handleholder_test.py b/sources/shiboken6/tests/samplebinding/handleholder_test.py
index af22328c5..cddea4035 100644
--- a/sources/shiboken6/tests/samplebinding/handleholder_test.py
+++ b/sources/shiboken6/tests/samplebinding/handleholder_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
''' Test case for a class that holds a unknown handle object.
Test case for BUG #1105.
diff --git a/sources/shiboken6/tests/samplebinding/hashabletype_test.py b/sources/shiboken6/tests/samplebinding/hashabletype_test.py
index c41f5cc06..4643f6103 100644
--- a/sources/shiboken6/tests/samplebinding/hashabletype_test.py
+++ b/sources/shiboken6/tests/samplebinding/hashabletype_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for __hash__'''
diff --git a/sources/shiboken6/tests/samplebinding/ignorederefop_test.py b/sources/shiboken6/tests/samplebinding/ignorederefop_test.py
index feb78d045..1ee44ac59 100644
--- a/sources/shiboken6/tests/samplebinding/ignorederefop_test.py
+++ b/sources/shiboken6/tests/samplebinding/ignorederefop_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/implicitconv_numerical_test.py b/sources/shiboken6/tests/samplebinding/implicitconv_numerical_test.py
index 081666281..b114ad0c1 100644
--- a/sources/shiboken6/tests/samplebinding/implicitconv_numerical_test.py
+++ b/sources/shiboken6/tests/samplebinding/implicitconv_numerical_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for inplicit converting C++ numeric types.'''
diff --git a/sources/shiboken6/tests/samplebinding/implicitconv_test.py b/sources/shiboken6/tests/samplebinding/implicitconv_test.py
index ebafe0c52..4dde6c786 100644
--- a/sources/shiboken6/tests/samplebinding/implicitconv_test.py
+++ b/sources/shiboken6/tests/samplebinding/implicitconv_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for implicit conversions'''
diff --git a/sources/shiboken6/tests/samplebinding/inheritanceandscope_test.py b/sources/shiboken6/tests/samplebinding/inheritanceandscope_test.py
index 28d62486a..8305cd40b 100644
--- a/sources/shiboken6/tests/samplebinding/inheritanceandscope_test.py
+++ b/sources/shiboken6/tests/samplebinding/inheritanceandscope_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for finding scope in cases involving inheritance.'''
diff --git a/sources/shiboken6/tests/samplebinding/injectcode_test.py b/sources/shiboken6/tests/samplebinding/injectcode_test.py
index f673a7807..933995100 100644
--- a/sources/shiboken6/tests/samplebinding/injectcode_test.py
+++ b/sources/shiboken6/tests/samplebinding/injectcode_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for std::list container conversions'''
diff --git a/sources/shiboken6/tests/samplebinding/innerclass_test.py b/sources/shiboken6/tests/samplebinding/innerclass_test.py
index 721f33483..39e827a64 100644
--- a/sources/shiboken6/tests/samplebinding/innerclass_test.py
+++ b/sources/shiboken6/tests/samplebinding/innerclass_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/intlist_test.py b/sources/shiboken6/tests/samplebinding/intlist_test.py
index defa9ca71..813ff4126 100644
--- a/sources/shiboken6/tests/samplebinding/intlist_test.py
+++ b/sources/shiboken6/tests/samplebinding/intlist_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/intwrapper_test.py b/sources/shiboken6/tests/samplebinding/intwrapper_test.py
index d883adf47..04b2ff351 100644
--- a/sources/shiboken6/tests/samplebinding/intwrapper_test.py
+++ b/sources/shiboken6/tests/samplebinding/intwrapper_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/invalid_virtual_return_test.py b/sources/shiboken6/tests/samplebinding/invalid_virtual_return_test.py
index bb35b2bb1..d0bcd415d 100644
--- a/sources/shiboken6/tests/samplebinding/invalid_virtual_return_test.py
+++ b/sources/shiboken6/tests/samplebinding/invalid_virtual_return_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for returning invalid types in a virtual function'''
diff --git a/sources/shiboken6/tests/samplebinding/keep_reference_test.py b/sources/shiboken6/tests/samplebinding/keep_reference_test.py
index 10591fec6..1c431763e 100644
--- a/sources/shiboken6/tests/samplebinding/keep_reference_test.py
+++ b/sources/shiboken6/tests/samplebinding/keep_reference_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/list_test.py b/sources/shiboken6/tests/samplebinding/list_test.py
index b668bfd90..4d113722f 100644
--- a/sources/shiboken6/tests/samplebinding/list_test.py
+++ b/sources/shiboken6/tests/samplebinding/list_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for std::list container conversions'''
diff --git a/sources/shiboken6/tests/samplebinding/lock_test.py b/sources/shiboken6/tests/samplebinding/lock_test.py
index acd47634a..5ea6bf8d8 100644
--- a/sources/shiboken6/tests/samplebinding/lock_test.py
+++ b/sources/shiboken6/tests/samplebinding/lock_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Simple test with a blocking C++ method that should allow python
threads to run.'''
diff --git a/sources/shiboken6/tests/samplebinding/map_test.py b/sources/shiboken6/tests/samplebinding/map_test.py
index fa99ad2e7..fd319617a 100644
--- a/sources/shiboken6/tests/samplebinding/map_test.py
+++ b/sources/shiboken6/tests/samplebinding/map_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for std::map container conversions'''
diff --git a/sources/shiboken6/tests/samplebinding/metaclass_test.py b/sources/shiboken6/tests/samplebinding/metaclass_test.py
index 4d7eeda96..c233e7e12 100644
--- a/sources/shiboken6/tests/samplebinding/metaclass_test.py
+++ b/sources/shiboken6/tests/samplebinding/metaclass_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/mi_virtual_methods_test.py b/sources/shiboken6/tests/samplebinding/mi_virtual_methods_test.py
index 8d324db59..c5043c8b3 100644
--- a/sources/shiboken6/tests/samplebinding/mi_virtual_methods_test.py
+++ b/sources/shiboken6/tests/samplebinding/mi_virtual_methods_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for virtual methods in multiple inheritance scenarios'''
diff --git a/sources/shiboken6/tests/samplebinding/mixed_mi_test.py b/sources/shiboken6/tests/samplebinding/mixed_mi_test.py
index fa8481600..b3ee886d4 100644
--- a/sources/shiboken6/tests/samplebinding/mixed_mi_test.py
+++ b/sources/shiboken6/tests/samplebinding/mixed_mi_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for multiple inheritance in mixed Python/C++ scenarios'''
diff --git a/sources/shiboken6/tests/samplebinding/modelindex_test.py b/sources/shiboken6/tests/samplebinding/modelindex_test.py
index e23503eff..786e4a727 100644
--- a/sources/shiboken6/tests/samplebinding/modelindex_test.py
+++ b/sources/shiboken6/tests/samplebinding/modelindex_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/modelview_test.py b/sources/shiboken6/tests/samplebinding/modelview_test.py
index b5663a04e..090c4f98b 100644
--- a/sources/shiboken6/tests/samplebinding/modelview_test.py
+++ b/sources/shiboken6/tests/samplebinding/modelview_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for objects that keep references to other object without owning them
(e.g. model/view relationships).'''
diff --git a/sources/shiboken6/tests/samplebinding/modifications_test.py b/sources/shiboken6/tests/samplebinding/modifications_test.py
index dced14396..ccd6747d7 100644
--- a/sources/shiboken6/tests/samplebinding/modifications_test.py
+++ b/sources/shiboken6/tests/samplebinding/modifications_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for method modifications performed as described on type system. '''
diff --git a/sources/shiboken6/tests/samplebinding/modified_constructor_test.py b/sources/shiboken6/tests/samplebinding/modified_constructor_test.py
index 9791a3491..8b99a557c 100644
--- a/sources/shiboken6/tests/samplebinding/modified_constructor_test.py
+++ b/sources/shiboken6/tests/samplebinding/modified_constructor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests cases for ConstructorWithModifiedArgument class.'''
diff --git a/sources/shiboken6/tests/samplebinding/modifiedvirtualmethods_test.py b/sources/shiboken6/tests/samplebinding/modifiedvirtualmethods_test.py
index dcb487f1a..244820b6f 100644
--- a/sources/shiboken6/tests/samplebinding/modifiedvirtualmethods_test.py
+++ b/sources/shiboken6/tests/samplebinding/modifiedvirtualmethods_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for modified virtual methods.'''
diff --git a/sources/shiboken6/tests/samplebinding/multi_cpp_inheritance_test.py b/sources/shiboken6/tests/samplebinding/multi_cpp_inheritance_test.py
index fc6b26c3f..53cda8a80 100644
--- a/sources/shiboken6/tests/samplebinding/multi_cpp_inheritance_test.py
+++ b/sources/shiboken6/tests/samplebinding/multi_cpp_inheritance_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for multiple inheritance'''
diff --git a/sources/shiboken6/tests/samplebinding/multiple_derived_test.py b/sources/shiboken6/tests/samplebinding/multiple_derived_test.py
index 7497714a8..4b33cc63e 100644
--- a/sources/shiboken6/tests/samplebinding/multiple_derived_test.py
+++ b/sources/shiboken6/tests/samplebinding/multiple_derived_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for multiple inheritance'''
diff --git a/sources/shiboken6/tests/samplebinding/namespace_test.py b/sources/shiboken6/tests/samplebinding/namespace_test.py
index 64a6792ac..0d0dc7f33 100644
--- a/sources/shiboken6/tests/samplebinding/namespace_test.py
+++ b/sources/shiboken6/tests/samplebinding/namespace_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for std::map container conversions'''
diff --git a/sources/shiboken6/tests/samplebinding/newdivision_test.py b/sources/shiboken6/tests/samplebinding/newdivision_test.py
index 0e7dfbee1..3a5510e3a 100644
--- a/sources/shiboken6/tests/samplebinding/newdivision_test.py
+++ b/sources/shiboken6/tests/samplebinding/newdivision_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/nondefaultctor_test.py b/sources/shiboken6/tests/samplebinding/nondefaultctor_test.py
index bc8d29e50..3a2340bc7 100644
--- a/sources/shiboken6/tests/samplebinding/nondefaultctor_test.py
+++ b/sources/shiboken6/tests/samplebinding/nondefaultctor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for ...'''
diff --git a/sources/shiboken6/tests/samplebinding/nontypetemplate_test.py b/sources/shiboken6/tests/samplebinding/nontypetemplate_test.py
index a10547728..257bd5ef7 100644
--- a/sources/shiboken6/tests/samplebinding/nontypetemplate_test.py
+++ b/sources/shiboken6/tests/samplebinding/nontypetemplate_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
hasNumPy = False
diff --git a/sources/shiboken6/tests/samplebinding/nonzero_test.py b/sources/shiboken6/tests/samplebinding/nonzero_test.py
index 7be239fc4..8dded99df 100644
--- a/sources/shiboken6/tests/samplebinding/nonzero_test.py
+++ b/sources/shiboken6/tests/samplebinding/nonzero_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/numericaltypedef_test.py b/sources/shiboken6/tests/samplebinding/numericaltypedef_test.py
index f714a4fc8..50569b88c 100644
--- a/sources/shiboken6/tests/samplebinding/numericaltypedef_test.py
+++ b/sources/shiboken6/tests/samplebinding/numericaltypedef_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/numpy_test.py b/sources/shiboken6/tests/samplebinding/numpy_test.py
index 42094a463..2f02859a9 100644
--- a/sources/shiboken6/tests/samplebinding/numpy_test.py
+++ b/sources/shiboken6/tests/samplebinding/numpy_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import sys
diff --git a/sources/shiboken6/tests/samplebinding/objecttype_test.py b/sources/shiboken6/tests/samplebinding/objecttype_test.py
index ead68ba13..73866e3a2 100644
--- a/sources/shiboken6/tests/samplebinding/objecttype_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttype_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests ObjectType class of object-type with privates copy constructor and = operator.'''
diff --git a/sources/shiboken6/tests/samplebinding/objecttype_with_named_args_test.py b/sources/shiboken6/tests/samplebinding/objecttype_with_named_args_test.py
index 285e2313b..add9f947f 100644
--- a/sources/shiboken6/tests/samplebinding/objecttype_with_named_args_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttype_with_named_args_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/objecttypebyvalue_test.py b/sources/shiboken6/tests/samplebinding/objecttypebyvalue_test.py
index 8f74af3ab..ab8f18ba6 100644
--- a/sources/shiboken6/tests/samplebinding/objecttypebyvalue_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttypebyvalue_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/objecttypelayout_test.py b/sources/shiboken6/tests/samplebinding/objecttypelayout_test.py
index 677b89281..9f6012164 100644
--- a/sources/shiboken6/tests/samplebinding/objecttypelayout_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttypelayout_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests cases for ObjectTypeLayout class.'''
diff --git a/sources/shiboken6/tests/samplebinding/objecttypeoperators_test.py b/sources/shiboken6/tests/samplebinding/objecttypeoperators_test.py
index ceeee6c8d..3123c7b61 100644
--- a/sources/shiboken6/tests/samplebinding/objecttypeoperators_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttypeoperators_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/objecttypereferenceasvirtualmethodargument_test.py b/sources/shiboken6/tests/samplebinding/objecttypereferenceasvirtualmethodargument_test.py
index 5fa6f824e..370c5c8f7 100644
--- a/sources/shiboken6/tests/samplebinding/objecttypereferenceasvirtualmethodargument_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttypereferenceasvirtualmethodargument_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/oddbool_test.py b/sources/shiboken6/tests/samplebinding/oddbool_test.py
index 87a8cdb1f..31db7bc6f 100644
--- a/sources/shiboken6/tests/samplebinding/oddbool_test.py
+++ b/sources/shiboken6/tests/samplebinding/oddbool_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for OddBool user's primitive type conversion.'''
diff --git a/sources/shiboken6/tests/samplebinding/onlycopyclass_test.py b/sources/shiboken6/tests/samplebinding/onlycopyclass_test.py
index bcb154c52..5a26b5096 100644
--- a/sources/shiboken6/tests/samplebinding/onlycopyclass_test.py
+++ b/sources/shiboken6/tests/samplebinding/onlycopyclass_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/overflow_test.py b/sources/shiboken6/tests/samplebinding/overflow_test.py
index 84442306a..6dbce0f94 100644
--- a/sources/shiboken6/tests/samplebinding/overflow_test.py
+++ b/sources/shiboken6/tests/samplebinding/overflow_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for overflowing C++ numeric types.'''
diff --git a/sources/shiboken6/tests/samplebinding/overload_sorting_test.py b/sources/shiboken6/tests/samplebinding/overload_sorting_test.py
index 060d91510..462a44eff 100644
--- a/sources/shiboken6/tests/samplebinding/overload_sorting_test.py
+++ b/sources/shiboken6/tests/samplebinding/overload_sorting_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for overload sorting'''
diff --git a/sources/shiboken6/tests/samplebinding/overload_test.py b/sources/shiboken6/tests/samplebinding/overload_test.py
index 62fa8d8d2..f87e4ef57 100644
--- a/sources/shiboken6/tests/samplebinding/overload_test.py
+++ b/sources/shiboken6/tests/samplebinding/overload_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Overload class'''
diff --git a/sources/shiboken6/tests/samplebinding/overloadwithdefault_test.py b/sources/shiboken6/tests/samplebinding/overloadwithdefault_test.py
index 269b97299..c55443529 100644
--- a/sources/shiboken6/tests/samplebinding/overloadwithdefault_test.py
+++ b/sources/shiboken6/tests/samplebinding/overloadwithdefault_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/ownership_argument_invalidation_test.py b/sources/shiboken6/tests/samplebinding/ownership_argument_invalidation_test.py
index 8a55d3ab8..5233571ed 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_argument_invalidation_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_argument_invalidation_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Wrapper validity tests for arguments.'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_cpp_test.py b/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_cpp_test.py
index 25c6fea26..5943c4437 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_cpp_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_cpp_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for destroy a child object in C++'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_python_test.py b/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_python_test.py
index 3ae186815..93df51773 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_python_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_delete_child_in_python_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for deleting a child object in python'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_delete_parent_test.py b/sources/shiboken6/tests/samplebinding/ownership_delete_parent_test.py
index 8f654639c..758ba8351 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_delete_parent_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_delete_parent_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for destroying the parent'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_invalidate_after_use_test.py b/sources/shiboken6/tests/samplebinding/ownership_invalidate_after_use_test.py
index 37b7591e4..b62cf5e31 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_invalidate_after_use_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_invalidate_after_use_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Ownership tests for cases of invalidation of Python wrapper after use.'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_invalidate_child_test.py b/sources/shiboken6/tests/samplebinding/ownership_invalidate_child_test.py
index 77b7c576c..40011a0cb 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_invalidate_child_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_invalidate_child_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for invalidating a C++ created child that was already on the care of a parent.'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py b/sources/shiboken6/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py
index 8cbefc30c..d69fc3f1c 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_invalidate_nonpolymorphic_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''The BlackBox class has cases of ownership transference between Python and C++.'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_invalidate_parent_test.py b/sources/shiboken6/tests/samplebinding/ownership_invalidate_parent_test.py
index c721a212c..8238876af 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_invalidate_parent_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_invalidate_parent_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for invalidating a parent of other objects.'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_reparenting_test.py b/sources/shiboken6/tests/samplebinding/ownership_reparenting_test.py
index 304223063..ecb291123 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_reparenting_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_reparenting_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests for object reparenting.'''
diff --git a/sources/shiboken6/tests/samplebinding/ownership_transference_test.py b/sources/shiboken6/tests/samplebinding/ownership_transference_test.py
index 0e9f08b72..c22d29a1c 100644
--- a/sources/shiboken6/tests/samplebinding/ownership_transference_test.py
+++ b/sources/shiboken6/tests/samplebinding/ownership_transference_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''The BlackBox class has cases of ownership transference between C++ and Python.'''
diff --git a/sources/shiboken6/tests/samplebinding/pair_test.py b/sources/shiboken6/tests/samplebinding/pair_test.py
index 4bd5c697c..2770dd3a4 100644
--- a/sources/shiboken6/tests/samplebinding/pair_test.py
+++ b/sources/shiboken6/tests/samplebinding/pair_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for std::pair container conversions'''
diff --git a/sources/shiboken6/tests/samplebinding/pen_test.py b/sources/shiboken6/tests/samplebinding/pen_test.py
index 106f3bd61..922676f84 100644
--- a/sources/shiboken6/tests/samplebinding/pen_test.py
+++ b/sources/shiboken6/tests/samplebinding/pen_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for <add-function> with const char* as argument'''
diff --git a/sources/shiboken6/tests/samplebinding/point_test.py b/sources/shiboken6/tests/samplebinding/point_test.py
index f86c0f423..301fe1ab8 100644
--- a/sources/shiboken6/tests/samplebinding/point_test.py
+++ b/sources/shiboken6/tests/samplebinding/point_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for Point class'''
diff --git a/sources/shiboken6/tests/samplebinding/pointerholder_test.py b/sources/shiboken6/tests/samplebinding/pointerholder_test.py
index 633525a9c..0c1316095 100644
--- a/sources/shiboken6/tests/samplebinding/pointerholder_test.py
+++ b/sources/shiboken6/tests/samplebinding/pointerholder_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for a class that holds an arbitraty pointer and is modified to hold an PyObject.'''
diff --git a/sources/shiboken6/tests/samplebinding/pointerprimitivetype_test.py b/sources/shiboken6/tests/samplebinding/pointerprimitivetype_test.py
index 4da1a89c6..4bfe125cd 100644
--- a/sources/shiboken6/tests/samplebinding/pointerprimitivetype_test.py
+++ b/sources/shiboken6/tests/samplebinding/pointerprimitivetype_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
"""
pointerprimitivetype_test.py
diff --git a/sources/shiboken6/tests/samplebinding/pointf_test.py b/sources/shiboken6/tests/samplebinding/pointf_test.py
index 91c58eb1d..6190dca1f 100644
--- a/sources/shiboken6/tests/samplebinding/pointf_test.py
+++ b/sources/shiboken6/tests/samplebinding/pointf_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for PointF class'''
diff --git a/sources/shiboken6/tests/samplebinding/primitivereferenceargument_test.py b/sources/shiboken6/tests/samplebinding/primitivereferenceargument_test.py
index 0b9fe2249..19042f614 100644
--- a/sources/shiboken6/tests/samplebinding/primitivereferenceargument_test.py
+++ b/sources/shiboken6/tests/samplebinding/primitivereferenceargument_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/privatector_test.py b/sources/shiboken6/tests/samplebinding/privatector_test.py
index 63040388d..df7ee402b 100644
--- a/sources/shiboken6/tests/samplebinding/privatector_test.py
+++ b/sources/shiboken6/tests/samplebinding/privatector_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for a class with only a private constructor.'''
diff --git a/sources/shiboken6/tests/samplebinding/privatedtor_test.py b/sources/shiboken6/tests/samplebinding/privatedtor_test.py
index 651f63b15..df1bd90f4 100644
--- a/sources/shiboken6/tests/samplebinding/privatedtor_test.py
+++ b/sources/shiboken6/tests/samplebinding/privatedtor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for a class with a private destructor.'''
diff --git a/sources/shiboken6/tests/samplebinding/protected_test.py b/sources/shiboken6/tests/samplebinding/protected_test.py
index e4ccf721d..05f72b673 100644
--- a/sources/shiboken6/tests/samplebinding/protected_test.py
+++ b/sources/shiboken6/tests/samplebinding/protected_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for protected methods.'''
diff --git a/sources/shiboken6/tests/samplebinding/pstrlist_test.py b/sources/shiboken6/tests/samplebinding/pstrlist_test.py
index d60f9cf35..d4e4c8316 100644
--- a/sources/shiboken6/tests/samplebinding/pstrlist_test.py
+++ b/sources/shiboken6/tests/samplebinding/pstrlist_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/pystr_test.py b/sources/shiboken6/tests/samplebinding/pystr_test.py
index ec64c1e31..f7b4656bb 100644
--- a/sources/shiboken6/tests/samplebinding/pystr_test.py
+++ b/sources/shiboken6/tests/samplebinding/pystr_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for definition of __str__ method.'''
diff --git a/sources/shiboken6/tests/samplebinding/python_thread_test.py b/sources/shiboken6/tests/samplebinding/python_thread_test.py
index 65398b5c6..2cee34947 100644
--- a/sources/shiboken6/tests/samplebinding/python_thread_test.py
+++ b/sources/shiboken6/tests/samplebinding/python_thread_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
#!/usr/bin/env python
diff --git a/sources/shiboken6/tests/samplebinding/receive_null_cstring_test.py b/sources/shiboken6/tests/samplebinding/receive_null_cstring_test.py
index 1d19de941..686a2435a 100644
--- a/sources/shiboken6/tests/samplebinding/receive_null_cstring_test.py
+++ b/sources/shiboken6/tests/samplebinding/receive_null_cstring_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for a function that could receive a NULL pointer in a '[const] char*' parameter.'''
diff --git a/sources/shiboken6/tests/samplebinding/reference_test.py b/sources/shiboken6/tests/samplebinding/reference_test.py
index 1b6dd3a7a..ab5387ccb 100644
--- a/sources/shiboken6/tests/samplebinding/reference_test.py
+++ b/sources/shiboken6/tests/samplebinding/reference_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for methods that receive references to objects.'''
diff --git a/sources/shiboken6/tests/samplebinding/referencetopointer_test.py b/sources/shiboken6/tests/samplebinding/referencetopointer_test.py
index 942c7ea29..3c614ba18 100644
--- a/sources/shiboken6/tests/samplebinding/referencetopointer_test.py
+++ b/sources/shiboken6/tests/samplebinding/referencetopointer_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for a reference to pointer argument type.'''
diff --git a/sources/shiboken6/tests/samplebinding/renaming_test.py b/sources/shiboken6/tests/samplebinding/renaming_test.py
index b08438ef3..597763643 100644
--- a/sources/shiboken6/tests/samplebinding/renaming_test.py
+++ b/sources/shiboken6/tests/samplebinding/renaming_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for renaming using target-lang-name attribute.'''
diff --git a/sources/shiboken6/tests/samplebinding/return_null_test.py b/sources/shiboken6/tests/samplebinding/return_null_test.py
index 2c4f07c65..92341e015 100644
--- a/sources/shiboken6/tests/samplebinding/return_null_test.py
+++ b/sources/shiboken6/tests/samplebinding/return_null_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for functions that could return a NULL pointer.'''
diff --git a/sources/shiboken6/tests/samplebinding/richcompare_test.py b/sources/shiboken6/tests/samplebinding/richcompare_test.py
index 3146d0faf..decd8f3b9 100644
--- a/sources/shiboken6/tests/samplebinding/richcompare_test.py
+++ b/sources/shiboken6/tests/samplebinding/richcompare_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/sample_test.py b/sources/shiboken6/tests/samplebinding/sample_test.py
index 19b2f708d..2e11bebe4 100644
--- a/sources/shiboken6/tests/samplebinding/sample_test.py
+++ b/sources/shiboken6/tests/samplebinding/sample_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for libsample bindings module'''
diff --git a/sources/shiboken6/tests/samplebinding/simplefile_test.py b/sources/shiboken6/tests/samplebinding/simplefile_test.py
index 55c894a35..6b6dccac7 100644
--- a/sources/shiboken6/tests/samplebinding/simplefile_test.py
+++ b/sources/shiboken6/tests/samplebinding/simplefile_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for SimpleFile class'''
diff --git a/sources/shiboken6/tests/samplebinding/size_test.py b/sources/shiboken6/tests/samplebinding/size_test.py
index 069ce59b3..d6561faf0 100644
--- a/sources/shiboken6/tests/samplebinding/size_test.py
+++ b/sources/shiboken6/tests/samplebinding/size_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for operator overloads on Size class'''
diff --git a/sources/shiboken6/tests/samplebinding/snakecase_test.py b/sources/shiboken6/tests/samplebinding/snakecase_test.py
index a1538796a..2c2812498 100644
--- a/sources/shiboken6/tests/samplebinding/snakecase_test.py
+++ b/sources/shiboken6/tests/samplebinding/snakecase_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for snake case generation'''
diff --git a/sources/shiboken6/tests/samplebinding/static_nonstatic_methods_test.py b/sources/shiboken6/tests/samplebinding/static_nonstatic_methods_test.py
index cf0889299..ac05375fd 100644
--- a/sources/shiboken6/tests/samplebinding/static_nonstatic_methods_test.py
+++ b/sources/shiboken6/tests/samplebinding/static_nonstatic_methods_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for overloads involving static and non-static versions of a method.'''
diff --git a/sources/shiboken6/tests/samplebinding/stdcomplex_test.py b/sources/shiboken6/tests/samplebinding/stdcomplex_test.py
index 0caa9764d..2de954ff2 100644
--- a/sources/shiboken6/tests/samplebinding/stdcomplex_test.py
+++ b/sources/shiboken6/tests/samplebinding/stdcomplex_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for StdComplex class'''
diff --git a/sources/shiboken6/tests/samplebinding/str_test.py b/sources/shiboken6/tests/samplebinding/str_test.py
index c06fd6428..a30a79e96 100644
--- a/sources/shiboken6/tests/samplebinding/str_test.py
+++ b/sources/shiboken6/tests/samplebinding/str_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for a method that receives a reference to class that is implicitly
convertible from a Python native type.'''
diff --git a/sources/shiboken6/tests/samplebinding/strlist_test.py b/sources/shiboken6/tests/samplebinding/strlist_test.py
index 2bfb80b67..d141714d3 100644
--- a/sources/shiboken6/tests/samplebinding/strlist_test.py
+++ b/sources/shiboken6/tests/samplebinding/strlist_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for StrList class that inherits from std::list<Str>.'''
diff --git a/sources/shiboken6/tests/samplebinding/templateinheritingclass_test.py b/sources/shiboken6/tests/samplebinding/templateinheritingclass_test.py
index 11279c7ec..f16d947aa 100644
--- a/sources/shiboken6/tests/samplebinding/templateinheritingclass_test.py
+++ b/sources/shiboken6/tests/samplebinding/templateinheritingclass_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/time_test.py b/sources/shiboken6/tests/samplebinding/time_test.py
index 6283a6744..2eb2ca498 100644
--- a/sources/shiboken6/tests/samplebinding/time_test.py
+++ b/sources/shiboken6/tests/samplebinding/time_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for constructor and method signature decisor on Time class.'''
diff --git a/sources/shiboken6/tests/samplebinding/transform_test.py b/sources/shiboken6/tests/samplebinding/transform_test.py
index 7dfd18a4a..e9897c8f8 100644
--- a/sources/shiboken6/tests/samplebinding/transform_test.py
+++ b/sources/shiboken6/tests/samplebinding/transform_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for argument modification with more than nine arguments.'''
diff --git a/sources/shiboken6/tests/samplebinding/typeconverters_test.py b/sources/shiboken6/tests/samplebinding/typeconverters_test.py
index 987ba6dfd..049b17f65 100644
--- a/sources/shiboken6/tests/samplebinding/typeconverters_test.py
+++ b/sources/shiboken6/tests/samplebinding/typeconverters_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Tests various usages of the type converters.'''
diff --git a/sources/shiboken6/tests/samplebinding/typedealloc_test.py b/sources/shiboken6/tests/samplebinding/typedealloc_test.py
index ce881e802..468095af7 100644
--- a/sources/shiboken6/tests/samplebinding/typedealloc_test.py
+++ b/sources/shiboken6/tests/samplebinding/typedealloc_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test deallocation of type extended in Python.'''
diff --git a/sources/shiboken6/tests/samplebinding/typedtordoublefree_test.py b/sources/shiboken6/tests/samplebinding/typedtordoublefree_test.py
index ab8e535b5..36ff7ddf4 100644
--- a/sources/shiboken6/tests/samplebinding/typedtordoublefree_test.py
+++ b/sources/shiboken6/tests/samplebinding/typedtordoublefree_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/typesystypedef_test.py b/sources/shiboken6/tests/samplebinding/typesystypedef_test.py
index f7f5342ee..76047e0dd 100644
--- a/sources/shiboken6/tests/samplebinding/typesystypedef_test.py
+++ b/sources/shiboken6/tests/samplebinding/typesystypedef_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for a class that holds a void pointer.'''
diff --git a/sources/shiboken6/tests/samplebinding/unsafe_parent_test.py b/sources/shiboken6/tests/samplebinding/unsafe_parent_test.py
index 2a7e5cac7..822ee0d3b 100644
--- a/sources/shiboken6/tests/samplebinding/unsafe_parent_test.py
+++ b/sources/shiboken6/tests/samplebinding/unsafe_parent_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for ...'''
diff --git a/sources/shiboken6/tests/samplebinding/useraddedctor_test.py b/sources/shiboken6/tests/samplebinding/useraddedctor_test.py
index 45d4095b6..4632e5e04 100644
--- a/sources/shiboken6/tests/samplebinding/useraddedctor_test.py
+++ b/sources/shiboken6/tests/samplebinding/useraddedctor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for user added constructors'''
diff --git a/sources/shiboken6/tests/samplebinding/virtualdtor_test.py b/sources/shiboken6/tests/samplebinding/virtualdtor_test.py
index 6be870269..14a970297 100644
--- a/sources/shiboken6/tests/samplebinding/virtualdtor_test.py
+++ b/sources/shiboken6/tests/samplebinding/virtualdtor_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for virtual destructor.'''
diff --git a/sources/shiboken6/tests/samplebinding/virtualmethods_test.py b/sources/shiboken6/tests/samplebinding/virtualmethods_test.py
index 52dc66c90..b5896f3a5 100644
--- a/sources/shiboken6/tests/samplebinding/virtualmethods_test.py
+++ b/sources/shiboken6/tests/samplebinding/virtualmethods_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test cases for virtual methods.'''
diff --git a/sources/shiboken6/tests/samplebinding/visibilitychange_test.py b/sources/shiboken6/tests/samplebinding/visibilitychange_test.py
index becdf7423..12c2f3abb 100644
--- a/sources/shiboken6/tests/samplebinding/visibilitychange_test.py
+++ b/sources/shiboken6/tests/samplebinding/visibilitychange_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/samplebinding/voidholder_test.py b/sources/shiboken6/tests/samplebinding/voidholder_test.py
index 186cb473e..f1f2a1182 100644
--- a/sources/shiboken6/tests/samplebinding/voidholder_test.py
+++ b/sources/shiboken6/tests/samplebinding/voidholder_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test case for a class that holds a void pointer.'''
diff --git a/sources/shiboken6/tests/samplebinding/weakref_test.py b/sources/shiboken6/tests/samplebinding/weakref_test.py
index 01c6d58d5..645174a8f 100644
--- a/sources/shiboken6/tests/samplebinding/weakref_test.py
+++ b/sources/shiboken6/tests/samplebinding/weakref_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
'''Test weakref support'''
diff --git a/sources/shiboken6/tests/samplebinding/writableclassdict_test.py b/sources/shiboken6/tests/samplebinding/writableclassdict_test.py
index dfc962db9..2d8b69bc4 100644
--- a/sources/shiboken6/tests/samplebinding/writableclassdict_test.py
+++ b/sources/shiboken6/tests/samplebinding/writableclassdict_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/shiboken_paths.py b/sources/shiboken6/tests/shiboken_paths.py
index 3ec940f2e..54b284ef6 100644
--- a/sources/shiboken6/tests/shiboken_paths.py
+++ b/sources/shiboken6/tests/shiboken_paths.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
diff --git a/sources/shiboken6/tests/shiboken_test_helper.py b/sources/shiboken6/tests/shiboken_test_helper.py
index 14fe6a2d1..2c7ad4d09 100644
--- a/sources/shiboken6/tests/shiboken_test_helper.py
+++ b/sources/shiboken6/tests/shiboken_test_helper.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
def objectFullname(t):
diff --git a/sources/shiboken6/tests/shibokenmodule/module_test.py b/sources/shiboken6/tests/shibokenmodule/module_test.py
index 9f9f8f5a4..fe12a5e65 100644
--- a/sources/shiboken6/tests/shibokenmodule/module_test.py
+++ b/sources/shiboken6/tests/shibokenmodule/module_test.py
@@ -1,5 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/smartbinding/CMakeLists.txt b/sources/shiboken6/tests/smartbinding/CMakeLists.txt
index 2e729321e..594744840 100644
--- a/sources/shiboken6/tests/smartbinding/CMakeLists.txt
+++ b/sources/shiboken6/tests/smartbinding/CMakeLists.txt
@@ -18,8 +18,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/smart/smart_integer2_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/sharedptr_integer2_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/stdsharedptrtestbench_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/stdsharedptrvirtualmethodtester_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/std_shared_ptr_double_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/std_shared_ptr_integer_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/std_shared_ptr_int_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/std_shared_ptr_std_string_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/std_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/std_optional_int_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/smart/std_optional_integer_wrapper.cpp
diff --git a/sources/shiboken6/tests/smartbinding/smart_pointer_test.py b/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
index 8d4272558..1c35a3e01 100644
--- a/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
+++ b/sources/shiboken6/tests/smartbinding/smart_pointer_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import gc
import os
diff --git a/sources/shiboken6/tests/smartbinding/std_optional_test.py b/sources/shiboken6/tests/smartbinding/std_optional_test.py
index bee573548..cd97facfa 100644
--- a/sources/shiboken6/tests/smartbinding/std_optional_test.py
+++ b/sources/shiboken6/tests/smartbinding/std_optional_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/smartbinding/std_shared_ptr_test.py b/sources/shiboken6/tests/smartbinding/std_shared_ptr_test.py
index 2e6aea3d9..a46dd2b24 100644
--- a/sources/shiboken6/tests/smartbinding/std_shared_ptr_test.py
+++ b/sources/shiboken6/tests/smartbinding/std_shared_ptr_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
@@ -10,7 +11,7 @@ from pathlib import Path
sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from shiboken_paths import init_paths
init_paths()
-from smart import Integer, StdSharedPtrTestBench, StdSharedPtrVirtualMethodTester, std
+from smart import Integer, StdDoublePtr, StdSharedPtrTestBench, StdSharedPtrVirtualMethodTester, std
def call_func_on_ptr(ptr):
@@ -49,6 +50,24 @@ class StdSharedPtrTests(unittest.TestCase):
self.assertFalse(np)
p = StdSharedPtrTestBench.createInt()
StdSharedPtrTestBench.printInt(p)
+ ip = std.StdIntPtr(42)
+ StdSharedPtrTestBench.printInt(ip)
+
+ def testDouble(self):
+ np = StdSharedPtrTestBench.createNullDouble()
+ StdSharedPtrTestBench.printDouble(np)
+ self.assertFalse(np)
+ p = StdSharedPtrTestBench.createDouble(67)
+ StdSharedPtrTestBench.printDouble(p)
+ dp = StdDoublePtr(42)
+ StdSharedPtrTestBench.printDouble(dp)
+
+ def testString(self):
+ np = StdSharedPtrTestBench.createNullString()
+ StdSharedPtrTestBench.printString(np)
+ self.assertFalse(np)
+ p = StdSharedPtrTestBench.createString("bla")
+ StdSharedPtrTestBench.printString(p)
def testVirtuals(self):
"""Test whether code generating virtual function overrides is generated
diff --git a/sources/shiboken6/tests/smartbinding/std_unique_ptr_test.py b/sources/shiboken6/tests/smartbinding/std_unique_ptr_test.py
index 9c7ef2f01..8e1ae80d9 100644
--- a/sources/shiboken6/tests/smartbinding/std_unique_ptr_test.py
+++ b/sources/shiboken6/tests/smartbinding/std_unique_ptr_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+from __future__ import annotations
import os
import sys
diff --git a/sources/shiboken6/tests/smartbinding/typesystem_smart.xml b/sources/shiboken6/tests/smartbinding/typesystem_smart.xml
index 261d5f15d..e479e4ddf 100644
--- a/sources/shiboken6/tests/smartbinding/typesystem_smart.xml
+++ b/sources/shiboken6/tests/smartbinding/typesystem_smart.xml
@@ -50,7 +50,7 @@
value-check-method="operator bool"
ref-count-method="use_count"
reset-method="reset"
- instantiations="Integer,int">
+ instantiations="Integer,int=StdIntPtr,double=::StdDoublePtr,std::string">
<include file-name="memory" location="global"/>
</smart-pointer-type>