aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/CMakeLists.txt42
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt2
-rw-r--r--sources/pyside2/PySide2/Qt3DCore/CMakeLists.txt41
-rw-r--r--sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml41
-rw-r--r--sources/pyside2/PySide2/Qt3DRender/CMakeLists.txt73
-rw-r--r--sources/pyside2/PySide2/Qt3DRender/typesystem_3drender.xml25
-rw-r--r--sources/pyside2/PySide2/QtAxContainer/CMakeLists.txt3
-rw-r--r--sources/pyside2/PySide2/QtAxContainer/QtAxContainer_global.post.h.in6
-rw-r--r--sources/pyside2/PySide2/QtAxContainer/typesystem_axcontainer.xml6
-rw-r--r--sources/pyside2/PySide2/QtCore/CMakeLists.txt62
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml489
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_win.xml12
-rw-r--r--sources/pyside2/PySide2/QtGui/CMakeLists.txt70
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml444
-rw-r--r--sources/pyside2/PySide2/QtNetwork/CMakeLists.txt24
-rw-r--r--sources/pyside2/PySide2/QtNetwork/typesystem_network.xml28
-rw-r--r--sources/pyside2/PySide2/QtOpenGL/CMakeLists.txt51
-rw-r--r--sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml783
-rw-r--r--sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt39
-rw-r--r--sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in54
-rw-r--r--sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml4
-rw-r--r--sources/pyside2/PySide2/QtOpenGLWidgets/CMakeLists.txt34
-rw-r--r--sources/pyside2/PySide2/QtOpenGLWidgets/typesystem_openglwidgets.xml (renamed from sources/pyside2/PySide2/QtWebKit/typesystem_webkit.xml)15
-rw-r--r--sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml1
-rw-r--r--sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp311
-rw-r--r--sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h19
-rw-r--r--sources/pyside2/PySide2/QtQml/typesystem_qml.xml58
-rw-r--r--sources/pyside2/PySide2/QtQuick/CMakeLists.txt11
-rw-r--r--sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp148
-rw-r--r--sources/pyside2/PySide2/QtQuick/typesystem_quick.xml7
-rw-r--r--sources/pyside2/PySide2/QtScript/CMakeLists.txt42
-rw-r--r--sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp3
-rw-r--r--sources/pyside2/PySide2/QtScript/typesystem_script.xml105
-rw-r--r--sources/pyside2/PySide2/QtScriptTools/CMakeLists.txt37
-rw-r--r--sources/pyside2/PySide2/QtSql/QtSql_global.pre.h.in2
-rw-r--r--sources/pyside2/PySide2/QtSvg/CMakeLists.txt7
-rw-r--r--sources/pyside2/PySide2/QtSvg/typesystem_svg.xml17
-rw-r--r--sources/pyside2/PySide2/QtSvgWidgets/CMakeLists.txt39
-rw-r--r--sources/pyside2/PySide2/QtSvgWidgets/typesystem_svgwidgets.xml (renamed from sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml)31
-rw-r--r--sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in2
-rw-r--r--sources/pyside2/PySide2/QtTest/typesystem_test.xml10
-rw-r--r--sources/pyside2/PySide2/QtWebKit/CMakeLists.txt34
-rw-r--r--sources/pyside2/PySide2/QtWebKitWidgets/CMakeLists.txt65
-rw-r--r--sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml211
-rw-r--r--sources/pyside2/PySide2/QtWidgets/CMakeLists.txt11
-rw-r--r--sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml178
-rw-r--r--sources/pyside2/PySide2/QtWinExtras/QtWinExtras_global.pre.h.in2
-rw-r--r--sources/pyside2/PySide2/QtXml/CMakeLists.txt14
-rw-r--r--sources/pyside2/PySide2/QtXml/typesystem_xml.xml186
-rw-r--r--sources/pyside2/PySide2/QtXmlPatterns/CMakeLists.txt41
-rw-r--r--sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml122
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp149
-rw-r--r--sources/pyside2/PySide2/glue/qtgui.cpp18
-rw-r--r--sources/pyside2/PySide2/glue/qtqml.cpp20
-rw-r--r--sources/pyside2/PySide2/glue/qtuitools.cpp16
-rw-r--r--sources/pyside2/PySide2/pysideqtesttouch.h122
-rw-r--r--sources/pyside2/PySide2/templates/core_common.xml21
-rw-r--r--sources/pyside2/PySide2/templates/gui_common.xml17
-rw-r--r--sources/pyside2/cmake/Macros/PySideModules.cmake2
-rw-r--r--sources/pyside2/doc/CMakeLists.txt4
-rw-r--r--sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h3
-rw-r--r--sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp60
-rw-r--r--sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebview_snippet.cpp80
-rw-r--r--sources/pyside2/doc/codesnippets/webkitsnippets/simple/main.cpp63
-rw-r--r--sources/pyside2/doc/codesnippets/webkitsnippets/webelement/main.cpp114
-rw-r--r--sources/pyside2/doc/codesnippets/webkitsnippets/webpage/main.cpp83
-rw-r--r--sources/pyside2/doc/extras/QtQml.qmlRegisterSingletonType.rst44
-rw-r--r--sources/pyside2/doc/extras/QtQml.qmlRegisterType.rst41
-rw-r--r--sources/pyside2/doc/extras/QtQml.qmlRegisterUncreatableType.rst36
-rw-r--r--sources/pyside2/doc/extras/QtWebKit.rst94
-rw-r--r--sources/pyside2/doc/modules.rst4
-rw-r--r--sources/pyside2/doc/qtmodules/pyside-qtxmlpatterns.qdocconf.in2
-rw-r--r--sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py4
-rw-r--r--sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py4
-rw-r--r--sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py4
-rw-r--r--sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py4
-rw-r--r--sources/pyside2/doc/tutorials/expenses/main.py4
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py3
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py4
-rw-r--r--sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py4
-rw-r--r--sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py3
-rw-r--r--sources/pyside2/libpyside/globalreceiverv2.cpp11
-rw-r--r--sources/pyside2/libpyside/pyside.cpp2
-rw-r--r--sources/pyside2/libpyside/pyside.h9
-rw-r--r--sources/pyside2/libpyside/pysidemetafunction.cpp4
-rw-r--r--sources/pyside2/libpyside/pysideproperty.cpp11
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp8
-rw-r--r--sources/pyside2/libpyside/pysidesignal.cpp4
-rw-r--r--sources/pyside2/libpyside/signalmanager.cpp54
-rw-r--r--sources/pyside2/plugins/CMakeLists.txt26
-rw-r--r--sources/pyside2/tests/CMakeLists.txt96
-rw-r--r--sources/pyside2/tests/QtCore/CMakeLists.txt7
-rw-r--r--sources/pyside2/tests/QtCore/bug_1031.py41
-rw-r--r--sources/pyside2/tests/QtCore/bug_1063.py4
-rw-r--r--sources/pyside2/tests/QtCore/bug_1313.py5
-rw-r--r--sources/pyside2/tests/QtCore/bug_938.py4
-rw-r--r--sources/pyside2/tests/QtCore/bug_994.py5
-rw-r--r--sources/pyside2/tests/QtCore/deepcopy_test.py3
-rw-r--r--sources/pyside2/tests/QtCore/qabstracttransition_test.py191
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py60
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py14
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py12
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_operator_test.py30
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_test.py164
-rw-r--r--sources/pyside2/tests/QtCore/qdatastream_test.py98
-rw-r--r--sources/pyside2/tests/QtCore/qfile_test.py8
-rw-r--r--sources/pyside2/tests/QtCore/qfileread_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qjsondocument_test.py12
-rw-r--r--sources/pyside2/tests/QtCore/qlinef_test.py2
-rw-r--r--sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py3
-rw-r--r--sources/pyside2/tests/QtCore/qobject_parent_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qobject_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qprocess_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qregexp_test.py55
-rw-r--r--sources/pyside2/tests/QtCore/qregularexpression_test.py1
-rw-r--r--sources/pyside2/tests/QtCore/qsettings_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qstate_test.py71
-rw-r--r--sources/pyside2/tests/QtCore/qstatemachine_test.py104
-rw-r--r--sources/pyside2/tests/QtCore/qstring_test.py9
-rw-r--r--sources/pyside2/tests/QtCore/qtext_codec_test.py54
-rw-r--r--sources/pyside2/tests/QtCore/qtextstream_test.py27
-rw-r--r--sources/pyside2/tests/QtCore/qtimezone_test.py3
-rw-r--r--sources/pyside2/tests/QtCore/qurlquery_test.py2
-rw-r--r--sources/pyside2/tests/QtCore/quuid_test.py3
-rw-r--r--sources/pyside2/tests/QtCore/repr_test.py3
-rw-r--r--sources/pyside2/tests/QtCore/setprop_on_ctor_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/translation_test.py9
-rw-r--r--sources/pyside2/tests/QtCore/unicode_test.py8
-rw-r--r--sources/pyside2/tests/QtGui/CMakeLists.txt3
-rw-r--r--sources/pyside2/tests/QtGui/bug_660.py5
-rw-r--r--sources/pyside2/tests/QtGui/bug_740.py3
-rw-r--r--sources/pyside2/tests/QtGui/deepcopy_test.py7
-rw-r--r--sources/pyside2/tests/QtGui/pyside_reload_test.py17
-rw-r--r--sources/pyside2/tests/QtGui/qmatrix_test.py106
-rw-r--r--sources/pyside2/tests/QtGui/qtextdocument_functions.py3
-rw-r--r--sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/repr_test.py11
-rw-r--r--sources/pyside2/tests/QtNetwork/bug_1084.py4
-rw-r--r--sources/pyside2/tests/QtNetwork/bug_446.py6
-rw-r--r--sources/pyside2/tests/QtNetwork/udpsocket_test.py4
-rw-r--r--sources/pyside2/tests/QtOpenGL/CMakeLists.txt4
-rw-r--r--sources/pyside2/tests/QtOpenGL/qglwidget_test.py54
-rw-r--r--sources/pyside2/tests/QtOpenGL/qopenglbuffer_test.py (renamed from sources/pyside2/tests/QtGui/qopenglbuffer_test.py)0
-rw-r--r--sources/pyside2/tests/QtOpenGL/qopenglwindow_test.py (renamed from sources/pyside2/tests/QtGui/qopenglwindow_test.py)4
-rw-r--r--sources/pyside2/tests/QtOpenGLWidgets/CMakeLists.txt (renamed from sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt)0
-rw-r--r--sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py6
-rw-r--r--sources/pyside2/tests/QtQml/CMakeLists.txt3
-rw-r--r--sources/pyside2/tests/QtQml/listproperty.py (renamed from sources/pyside2/tests/QtOpenGL/qglbuffer_test.py)89
-rw-r--r--sources/pyside2/tests/QtQml/qquickview_test.py7
-rw-r--r--sources/pyside2/tests/QtQml/registersingletontype.py (renamed from sources/pyside2/tests/QtScript/property_test.py)100
-rw-r--r--sources/pyside2/tests/QtQml/registersingletontype.qml36
-rw-r--r--sources/pyside2/tests/QtQml/registertype.py6
-rw-r--r--sources/pyside2/tests/QtQml/registeruncreatable.qml38
-rw-r--r--sources/pyside2/tests/QtQml/registeruncreatabletype.py (renamed from sources/pyside2/tests/QtWebKit/webframe_test.py)61
-rw-r--r--sources/pyside2/tests/QtScript/CMakeLists.txt5
-rw-r--r--sources/pyside2/tests/QtScript/base_test.py39
-rw-r--r--sources/pyside2/tests/QtScript/bug_1022.py47
-rw-r--r--sources/pyside2/tests/QtScript/engine_test.py47
-rw-r--r--sources/pyside2/tests/QtScript/qscriptvalue_test.py78
-rw-r--r--sources/pyside2/tests/QtScriptTools/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtScriptTools/debugger_test.py81
-rw-r--r--sources/pyside2/tests/QtSql/qvarianttype_test.py12
-rw-r--r--sources/pyside2/tests/QtSvg/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtSvg/qsvgrenderer_test.py10
-rw-r--r--sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py (renamed from sources/pyside2/tests/QtSvg/qsvgwidget_test.py)12
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_392.py17
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_426.py11
-rw-r--r--sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py7
-rw-r--r--sources/pyside2/tests/QtWebKit/CMakeLists.txt11
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_448.py52
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_694.py84
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_803.py53
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_899.py71
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_959.py133
-rw-r--r--sources/pyside2/tests/QtWebKit/fox.html7
-rw-r--r--sources/pyside2/tests/QtWebKit/qml_plugin_test.py92
-rw-r--r--sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys1
-rw-r--r--sources/pyside2/tests/QtWebKit/qmlplugin/index.html5
-rw-r--r--sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py78
-rw-r--r--sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py63
-rw-r--r--sources/pyside2/tests/QtWebKit/webpage_test.py95
-rw-r--r--sources/pyside2/tests/QtWebKit/webview_test.py101
-rw-r--r--sources/pyside2/tests/QtWidgets/CMakeLists.txt4
-rw-r--r--sources/pyside2/tests/QtWidgets/add_action_test.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_363.py59
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_416.py78
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_632.py54
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_711.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_714.py60
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_860.py2
-rw-r--r--sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qaction_test.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/qimage_test.py11
-rw-r--r--sources/pyside2/tests/QtWidgets/qshortcut_test.py22
-rw-r--r--sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/qtoolbar_test.py3
-rw-r--r--sources/pyside2/tests/QtWidgets/wrong_return_test.py6
-rw-r--r--sources/pyside2/tests/QtXml/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtXml/qdomdocument_test.py12
-rw-r--r--sources/pyside2/tests/QtXml/qxmlsimplereader_test.py70
-rw-r--r--sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtXmlPatterns/import_test.py66
-rw-r--r--sources/pyside2/tests/pysidetest/CMakeLists.txt19
-rw-r--r--sources/pyside2/tests/pysidetest/modelview_test.py3
-rw-r--r--sources/pyside2/tests/pysidetest/new_inherited_functions_test.py6
-rw-r--r--sources/pyside2/tests/pysidetest/qvariant_test.py2
-rw-r--r--sources/pyside2/tests/signals/signal_enum_test.py58
-rw-r--r--sources/pyside2/tests/support/voidptr_test.py2
-rwxr-xr-xsources/pyside2/tests/tools/list-class-hierarchy.py1
-rw-r--r--sources/pyside2/tests/util/httpd.py10
-rw-r--r--sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py2
-rw-r--r--sources/pyside2/tests/util/py3kcompat.py82
219 files changed, 1839 insertions, 6987 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt
index dc2beded0..df605b45a 100644
--- a/sources/pyside2/CMakeLists.txt
+++ b/sources/pyside2/CMakeLists.txt
@@ -1,12 +1,12 @@
include(cmake/Macros/icecc.cmake) # this must be the first line!
-cmake_minimum_required(VERSION 3.1)
-cmake_policy(VERSION 3.1)
+cmake_minimum_required(VERSION 3.16)
+cmake_policy(VERSION 3.16)
# Don't ignore targets that do not exist, inside add_dependencies calls.
cmake_policy(SET CMP0046 NEW)
-set (QT_MAJOR_VERSION 5)
+set (QT_MAJOR_VERSION 6)
project(pysidebindings)
@@ -82,20 +82,6 @@ endif()
find_package(Qt${QT_MAJOR_VERSION} 5.12 REQUIRED COMPONENTS Core)
add_definitions(${Qt${QT_MAJOR_VERSION}Core_DEFINITIONS})
-find_file(GL_H "gl.h" PATH_SUFFIXES "GL")
-message(STATUS "GL Headers path:" "${GL_H}")
-include(FindQt5Extra)
-
-set(XVFB_EXEC "")
-option(USE_XVFB "Uses xvfb-run with the unit tests to avoid QtGui tests popping windows on the screen." FALSE)
-if(USE_XVFB)
- find_program(XVFB_RUN NAMES xvfb-run)
- if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND")
- set(XVFB_EXEC ${XVFB_RUN} -a)
- message(STATUS "Using xvfb-run to perform QtGui tests.")
- endif()
-endif()
-
option(BUILD_TESTS "Build tests." TRUE)
option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE)
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
@@ -108,24 +94,13 @@ if(CMAKE_HOST_APPLE)
endif()
endif()
-# Force usage of the C++11 standard, without a silent fallback
-# to C++98 if the compiler does not support C++11.
-if(${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- set(CMAKE_CXX_STANDARD 17)
-else()
- set(CMAKE_CXX_STANDARD 11)
-endif()
+# Force usage of the C++17 standard
+set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# >= Qt5: QT_INCLUDE_DIR does no longer exist. Derive from QtCore
-if(${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- get_target_property(QT_INCLUDE_DIR Qt6::Core INTERFACE_INCLUDE_DIRECTORIES)
- get_filename_component(QT_INCLUDE_DIR "${QT_INCLUDE_DIR}" DIRECTORY)
-else()
- # On Windows, macOS, and Linux it can be computed from Qt5Core_INCLUDE_DIRS, which contains
- # a list of include directories. We take the first one.
- list(GET Qt5Core_INCLUDE_DIRS 0 QT_INCLUDE_DIR)
-endif()
+get_target_property(QT_INCLUDE_DIR Qt6::Core INTERFACE_INCLUDE_DIRECTORIES)
+get_filename_component(QT_INCLUDE_DIR "${QT_INCLUDE_DIR}" DIRECTORY)
message(STATUS "*** Qt ${QT_MAJOR_VERSION}, QT_INCLUDE_DIR= ${QT_INCLUDE_DIR}")
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
@@ -253,8 +228,7 @@ endif()
add_subdirectory(libpyside)
find_package(Qt${QT_MAJOR_VERSION}Designer)
-if(${QT_MAJOR_VERSION} LESS 6 AND Qt${QT_MAJOR_VERSION}UiTools_FOUND
- AND Qt${QT_MAJOR_VERSION}Designer_FOUND)
+if(Qt${QT_MAJOR_VERSION}UiTools_FOUND AND Qt${QT_MAJOR_VERSION}Designer_FOUND)
add_subdirectory(plugins)
endif()
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index 120bc8e52..0ded09f5d 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -100,8 +100,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/opengl_common.xml
DESTINATION share/PySide2${pyside_SUFFIX}/typesystems)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/openglfunctions_common.xml
DESTINATION share/PySide2${pyside_SUFFIX}/typesystems)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/webkitwidgets_common.xml
- DESTINATION share/PySide2${pyside_SUFFIX}/typesystems)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/xml_common.xml
DESTINATION share/PySide2${pyside_SUFFIX}/typesystems)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h
diff --git a/sources/pyside2/PySide2/Qt3DCore/CMakeLists.txt b/sources/pyside2/PySide2/Qt3DCore/CMakeLists.txt
index aa40c6ec8..2fa1ecee3 100644
--- a/sources/pyside2/PySide2/Qt3DCore/CMakeLists.txt
+++ b/sources/pyside2/PySide2/Qt3DCore/CMakeLists.txt
@@ -1,47 +1,32 @@
project(Qt3DCore)
set(Qt3DCore_SRC
-${Qt3DCore_GEN_DIR}/qt3dcore_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qabstractaspect_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qabstractfrontendnodemanager_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qabstractfunctor_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qabstractskeleton_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qarmature_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qaspectengine_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qaspectjob_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qattribute_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qbackendnode_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qboundingvolume_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qbuffer_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qcomponent_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qcomponentaddedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qcomponentremovedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qdynamicpropertyupdatedchange_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qentity_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qgeometry_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qgeometryview_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qjoint_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qnode_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qnodecreatedchangebase_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qnodedestroyedchange_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qnodeid_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qnodeidtypepair_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertynodeaddedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertynoderemovedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertyupdatedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertyupdatedchangebase_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertyvalueaddedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertyvalueaddedchangebase_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertyvalueremovedchange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qpropertyvalueremovedchangebase_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qscenechange_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qstaticpropertyupdatedchangebase_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qstaticpropertyvalueaddedchangebase_wrapper.cpp
-${Qt3DCore_GEN_DIR}/qt3dcore_qstaticpropertyvalueremovedchangebase_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qskeleton_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_qskeletonloader_wrapper.cpp
${Qt3DCore_GEN_DIR}/qt3dcore_qtransform_wrapper.cpp
+${Qt3DCore_GEN_DIR}/qt3dcore_wrapper.cpp
# module is always needed
${Qt3DCore_GEN_DIR}/qt3dcore_module_wrapper.cpp)
-if (Qt${QT_MAJOR_VERSION}3DCore_VERSION VERSION_EQUAL 5.10.0 OR Qt${QT_MAJOR_VERSION}3DCore_VERSION VERSION_GREATER 5.10.0)
- list(APPEND Qt3DCore_SRC
- ${Qt3DCore_GEN_DIR}/qt3dcore_qarmature_wrapper.cpp
- ${Qt3DCore_GEN_DIR}/qt3dcore_qjoint_wrapper.cpp
- ${Qt3DCore_GEN_DIR}/qt3dcore_qabstractskeleton_wrapper.cpp
- ${Qt3DCore_GEN_DIR}/qt3dcore_qnodecommand_wrapper.cpp
- ${Qt3DCore_GEN_DIR}/qt3dcore_qskeleton_wrapper.cpp
- ${Qt3DCore_GEN_DIR}/qt3dcore_qskeletonloader_wrapper.cpp)
-endif()
-
set(Qt3DCore_include_dirs
${Qt3DCore_SOURCE_DIR}
${Qt3DCore_BINARY_DIR}
diff --git a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml
index 8696a128c..61b128f73 100644
--- a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml
+++ b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml
@@ -45,6 +45,10 @@
<namespace-type name="Qt3DCore" generate-using="no">
<enum-type name="ChangeFlag" flags="ChangeFlags"/>
<object-type name="QAbstractAspect"/>
+ <object-type name="QAbstractFrontEndNodeManager" since="6.0">
+ <enum-type name="DirtyNodeFlag" flags="DirtyNodeSet"/>
+ </object-type>
+ <object-type name="QAbstractFunctor" since="6.0"/>
<object-type name="QAbstractSkeleton" since="5.10"/>
<object-type name="QArmature" since="5.10"/>
<object-type name="QAspectEngine">
@@ -59,13 +63,19 @@
<object-type name="QBackendNode">
<enum-type name="Mode"/>
</object-type>
+ <object-type name="QAttribute">
+ <enum-type name="AttributeType"/>
+ <enum-type name="VertexBaseType"/>
+ </object-type>
<!-- TODO: Solve issues related to windows and a unresolved
external symbol
<object-type name="QBackendNodeMapper"/>-->
+ <object-type name="QBoundingVolume" since="6.0"/>
+ <object-type name="QBuffer" since="6.0">
+ <enum-type name="AccessType"/>
+ <enum-type name="UsageType"/>
+ </object-type>
<object-type name="QComponent"/>
- <object-type name="QComponentAddedChange"/>
- <object-type name="QComponentRemovedChange"/>
- <object-type name="QDynamicPropertyUpdatedChange"/>
<object-type name="QEntity">
<modify-function signature="addComponent(Qt3DCore::QComponent*)">
<modify-argument index="this">
@@ -73,6 +83,10 @@
</modify-argument>
</modify-function>
</object-type>
+ <object-type name="QGeometry" since="6.0"/>
+ <object-type name="QGeometryView" since="6.0">
+ <enum-type name="PrimitiveType"/>
+ </object-type>
<object-type name="QJoint" since="5.10">
<modify-function signature="addChildJoint(Qt3DCore::QJoint*)">
<modify-argument index="this">
@@ -80,32 +94,13 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QNode">
- <enum-type name="PropertyTrackingMode"/>
- </object-type>
- <object-type name="QNodeCommand" since="5.10"/>
- <object-type name="QNodeCreatedChangeBase"/>
- <object-type name="QNodeDestroyedChange"/>
+ <object-type name="QNode"/>
<value-type name="QNodeId"/>
<value-type name="QNodeIdTypePair"/>
- <object-type name="QPropertyNodeAddedChange"/>
- <object-type name="QPropertyNodeRemovedChange"/>
- <object-type name="QPropertyUpdatedChange"/>
- <object-type name="QPropertyUpdatedChangeBase"/>
- <object-type name="QPropertyValueAddedChange"/>
- <object-type name="QPropertyValueAddedChangeBase"/>
- <object-type name="QPropertyValueRemovedChange"/>
- <object-type name="QPropertyValueRemovedChangeBase"/>
- <object-type name="QSceneChange">
- <enum-type name="DeliveryFlag" flags="DeliveryFlags"/>
- </object-type>
<object-type name="QSkeleton" since="5.10"/>
<object-type name="QSkeletonLoader" since="5.10">
<enum-type name="Status"/>
</object-type>
- <object-type name="QStaticPropertyUpdatedChangeBase"/>
- <object-type name="QStaticPropertyValueAddedChangeBase"/>
- <object-type name="QStaticPropertyValueRemovedChangeBase"/>
<object-type name="QTransform">
<!-- Disambiguate from QtGui/qtransform.h -->
<include file-name="Qt3DCore/qtransform.h" location="global"/>
diff --git a/sources/pyside2/PySide2/Qt3DRender/CMakeLists.txt b/sources/pyside2/PySide2/Qt3DRender/CMakeLists.txt
index 32f28e032..208f4df06 100644
--- a/sources/pyside2/PySide2/Qt3DRender/CMakeLists.txt
+++ b/sources/pyside2/PySide2/Qt3DRender/CMakeLists.txt
@@ -1,20 +1,17 @@
project(Qt3DRender)
set(Qt3DRender_SRC
-${Qt3DRender_GEN_DIR}/qt3drender_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_propertyreaderinterface_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qabstractfunctor_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qabstractlight_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qabstractraycaster_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qabstracttexture_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qabstracttextureimage_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qalphacoverage_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qalphatest_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qattribute_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qblendequation_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qblendequationarguments_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qbuffer_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qblitframebuffer_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qbuffercapture_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qbufferdatagenerator_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qcamera_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qcameralens_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qcameraselector_wrapper.cpp
@@ -31,11 +28,8 @@ ${Qt3DRender_GEN_DIR}/qt3drender_qeffect_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qenvironmentlight_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qfilterkey_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qframegraphnode_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qframegraphnodecreatedchangebase_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qfrontface_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qfrustumculling_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qgeometry_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qgeometryfactory_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qgeometryrenderer_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qgraphicsapifilter_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qlayer_wrapper.cpp
@@ -43,22 +37,30 @@ ${Qt3DRender_GEN_DIR}/qt3drender_qlayerfilter_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qlevelofdetail_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qlevelofdetailboundingsphere_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qlevelofdetailswitch_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qlinewidth_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qmaterial_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qmemorybarrier_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qmesh_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qmultisampleantialiasing_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qnodepthmask_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qnodraw_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qnopicking_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qobjectpicker_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qpaintedtextureimage_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qparameter_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qpickevent_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qpicktriangleevent_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qpickingsettings_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qpicklineevent_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qpickpointevent_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qpicktriangleevent_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qpointlight_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qpointsize_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qpolygonoffset_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qproximityfilter_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qraycaster_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qraycasterhit_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qrenderaspect_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qrendercapabilities_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qrendercapture_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qrendercapturereply_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qrenderpass_wrapper.cpp
@@ -72,9 +74,14 @@ ${Qt3DRender_GEN_DIR}/qt3drender_qrendertargetoutput_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qrendertargetselector_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qsceneloader_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qscissortest_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qscreenraycaster_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qseamlesscubemap_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qsetfence_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qshaderdata_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qshaderimage_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qshaderprogram_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qshaderprogrambuilder_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qsharedgltexture_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qsortpolicy_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qspotlight_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qstencilmask_wrapper.cpp
@@ -95,7 +102,6 @@ ${Qt3DRender_GEN_DIR}/qt3drender_qtexturebuffer_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtexturecubemap_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtexturecubemaparray_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtexturedata_wrapper.cpp
-${Qt3DRender_GEN_DIR}/qt3drender_qtexturegenerator_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtextureimage_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtextureimagedata_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtextureimagedatagenerator_wrapper.cpp
@@ -103,51 +109,11 @@ ${Qt3DRender_GEN_DIR}/qt3drender_qtextureloader_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtexturerectangle_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qtexturewrapmode_wrapper.cpp
${Qt3DRender_GEN_DIR}/qt3drender_qviewport_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_qwaitfence_wrapper.cpp
+${Qt3DRender_GEN_DIR}/qt3drender_wrapper.cpp
# module is always needed
${Qt3DRender_GEN_DIR}/qt3drender_module_wrapper.cpp)
-if (Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_EQUAL 5.10.0
- OR Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_GREATER 5.10.0)
- list(APPEND Qt3DRender_SRC
- ${Qt3DRender_GEN_DIR}/qt3drender_qblitframebuffer_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qlinewidth_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qpicklineevent_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qpickpointevent_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qproximityfilter_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qshaderprogrambuilder_wrapper.cpp
-)
-endif()
-
-if (Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_EQUAL 5.11.0
- OR Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_GREATER 5.11.0)
- list(APPEND Qt3DRender_SRC
- ${Qt3DRender_GEN_DIR}/qt3drender_qabstractraycaster_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qraycaster_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qraycasterhit_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qscreenraycaster_wrapper.cpp)
-endif()
-
-if (Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_EQUAL 5.13.0
- OR Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_GREATER 5.13.0)
- list(APPEND Qt3DRender_SRC
- ${Qt3DRender_GEN_DIR}/qt3drender_qsetfence_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qsharedgltexture_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qwaitfence_wrapper.cpp)
-endif()
-
-if (Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_EQUAL 5.14.0
- OR Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_GREATER 5.14.0)
- list(APPEND Qt3DRender_SRC
- ${Qt3DRender_GEN_DIR}/qt3drender_qnopicking_wrapper.cpp
- ${Qt3DRender_GEN_DIR}/qt3drender_qshaderimage_wrapper.cpp)
-endif()
-
-if (Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_EQUAL 5.15.0
- OR Qt${QT_MAJOR_VERSION}3DRender_VERSION VERSION_GREATER 5.15.0)
- list(APPEND Qt3DRender_SRC
- ${Qt3DRender_GEN_DIR}/qt3drender_qrendercapabilities_wrapper.cpp)
-endif()
-
set(Qt3DRender_include_dirs
${Qt3DRender_SOURCE_DIR}
${Qt3DRender_BINARY_DIR}
@@ -157,12 +123,13 @@ set(Qt3DRender_include_dirs
${libpyside_SOURCE_DIR}
${QtCore_GEN_DIR}
${QtGui_GEN_DIR}
+ ${QtOpenGL_GEN_DIR}
${Qt3DCore_GEN_DIR})
set(Qt3DRender_libraries pyside2
${Qt${QT_MAJOR_VERSION}3DRender_LIBRARIES})
-set(Qt3DRender_deps Qt3DCore)
+set(Qt3DRender_deps Qt3DCore QtOpenGL)
create_pyside_module(NAME Qt3DRender
INCLUDE_DIRS Qt3DRender_include_dirs
diff --git a/sources/pyside2/PySide2/Qt3DRender/typesystem_3drender.xml b/sources/pyside2/PySide2/Qt3DRender/typesystem_3drender.xml
index 1ab13d7d7..a221ef41a 100644
--- a/sources/pyside2/PySide2/Qt3DRender/typesystem_3drender.xml
+++ b/sources/pyside2/PySide2/Qt3DRender/typesystem_3drender.xml
@@ -43,8 +43,8 @@
<typesystem package="PySide2.Qt3DRender">
<load-typesystem name="Qt3DCore/typesystem_3dcore.xml" generate="no"/>
<namespace-type name="Qt3DRender">
+ <enum-type name="API"/>
<object-type name="PropertyReaderInterface"/>
- <object-type name="QAbstractFunctor"/>
<object-type name="QAbstractLight">
<enum-type name="Type"/>
</object-type>
@@ -69,10 +69,6 @@
<object-type name="QAlphaTest">
<enum-type name="AlphaFunction"/>
</object-type>
- <object-type name="QAttribute">
- <enum-type name="AttributeType"/>
- <enum-type name="VertexBaseType"/>
- </object-type>
<object-type name="QBlendEquation">
<enum-type name="BlendFunction"/>
</object-type>
@@ -82,15 +78,7 @@
<object-type name="QBlitFramebuffer" since="5.10">
<enum-type name="InterpolationMethod"/>
</object-type>
- <object-type name="QBuffer">
- <enum-type name="AccessType"/>
- <enum-type name="BufferType"/>
- <enum-type name="UsageType"/>
- </object-type>
<object-type name="QBufferCapture"/>
- <object-type name="QBufferDataGenerator">
- <modify-function signature="operator()()" remove="all"/>
- </object-type>
<object-type name="QCamera">
<enum-type name="CameraTranslationOption"/>
</object-type>
@@ -119,15 +107,10 @@
<object-type name="QEnvironmentLight"/>
<object-type name="QFilterKey"/>
<object-type name="QFrameGraphNode"/>
- <object-type name="QFrameGraphNodeCreatedChangeBase"/>
<object-type name="QFrontFace">
<enum-type name="WindingDirection"/>
</object-type>
<object-type name="QFrustumCulling"/>
- <object-type name="QGeometry"/>
- <object-type name="QGeometryFactory">
- <modify-function signature="operator()()" remove="all"/>
- </object-type>
<object-type name="QGeometryRenderer">
<enum-type name="PrimitiveType"/>
</object-type>
@@ -182,7 +165,7 @@
<enum-type name="HitType"/>
</value-type>
<object-type name="QRenderAspect">
- <enum-type name="RenderType"/>
+ <enum-type name="SubmissionType"/>
</object-type>
<object-type name="QRenderCapabilities" since="5.15">
<enum-type name="API"/>
@@ -215,6 +198,7 @@
</object-type>
<object-type name="QShaderData"/>
<object-type name="QShaderProgram">
+ <enum-type name="Format" since="6.0"/>
<enum-type name="ShaderType"/>
<enum-type name="Status"/>
</object-type>
@@ -252,9 +236,6 @@
<object-type name="QTextureCubeMap"/>
<object-type name="QTextureCubeMapArray"/>
<object-type name="QTextureData"/>
- <object-type name="QTextureGenerator">
- <modify-function signature="QTextureGenerator()" remove="all"/>
- </object-type>
<object-type name="QTextureImage">
<enum-type name="Status"/>
</object-type>
diff --git a/sources/pyside2/PySide2/QtAxContainer/CMakeLists.txt b/sources/pyside2/PySide2/QtAxContainer/CMakeLists.txt
index 38e764405..8f8f5d4d1 100644
--- a/sources/pyside2/PySide2/QtAxContainer/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtAxContainer/CMakeLists.txt
@@ -2,7 +2,10 @@ project(QtAxContainer)
set(QtAxContainer_SRC
${QtAxContainer_GEN_DIR}/qaxbase_wrapper.cpp
+${QtAxContainer_GEN_DIR}/qaxbaseobject_wrapper.cpp
+${QtAxContainer_GEN_DIR}/qaxbasewidget_wrapper.cpp
${QtAxContainer_GEN_DIR}/qaxobject_wrapper.cpp
+${QtAxContainer_GEN_DIR}/qaxobjectinterface_wrapper.cpp
${QtAxContainer_GEN_DIR}/qaxscript_wrapper.cpp
${QtAxContainer_GEN_DIR}/qaxscriptengine_wrapper.cpp
${QtAxContainer_GEN_DIR}/qaxscriptmanager_wrapper.cpp
diff --git a/sources/pyside2/PySide2/QtAxContainer/QtAxContainer_global.post.h.in b/sources/pyside2/PySide2/QtAxContainer/QtAxContainer_global.post.h.in
index 22e1b0119..f4033c4f5 100644
--- a/sources/pyside2/PySide2/QtAxContainer/QtAxContainer_global.post.h.in
+++ b/sources/pyside2/PySide2/QtAxContainer/QtAxContainer_global.post.h.in
@@ -1,5 +1 @@
-#include <ActiveQt/QAxSelect>
-#include <ActiveQt/QAxScript>
-#include <ActiveQt/QAxScriptEngine>
-#include <ActiveQt/QAxScriptManager>
-#include <ActiveQt/QAxWidget>
+#include <QtAxContainer/QtAxContainer>
diff --git a/sources/pyside2/PySide2/QtAxContainer/typesystem_axcontainer.xml b/sources/pyside2/PySide2/QtAxContainer/typesystem_axcontainer.xml
index 19856a754..03977fcbf 100644
--- a/sources/pyside2/PySide2/QtAxContainer/typesystem_axcontainer.xml
+++ b/sources/pyside2/PySide2/QtAxContainer/typesystem_axcontainer.xml
@@ -46,10 +46,11 @@
<rejection class="*" function-name="queryInterface"/>
<rejection class="*" function-name="qt_metacall"/>
<rejection class="*" function-name="qt_static_metacall"/>
- <rejection class="*" field-name="qt_meta_stringdata_QAxBase"/>
- <rejection class="*" field-name="qt_meta_data_QAxBase"/>
+
<object-type name="QAxBase"/>
+ <object-type name="QAxBaseObject"/>
<object-type name="QAxObject"/>
+ <object-type name="QAxObjectInterface"/>
<object-type name="QAxScript">
<enum-type name="FunctionFlags"/>
</object-type>
@@ -60,6 +61,7 @@
<!-- Ax Servers only -->
<modify-function signature="addObject(QObject*)" remove="all"/>
</object-type>
+ <object-type name="QAxBaseWidget"/>
<object-type name="QAxSelect">
<enum-type name="SandboxingLevel"/>
</object-type>
diff --git a/sources/pyside2/PySide2/QtCore/CMakeLists.txt b/sources/pyside2/PySide2/QtCore/CMakeLists.txt
index 20ed65a67..e8356b9d8 100644
--- a/sources/pyside2/PySide2/QtCore/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtCore/CMakeLists.txt
@@ -18,30 +18,32 @@ ${QtCore_GEN_DIR}/qabstractitemmodel_wrapper.cpp
${QtCore_GEN_DIR}/qabstractlistmodel_wrapper.cpp
${QtCore_GEN_DIR}/qabstractnativeeventfilter_wrapper.cpp
${QtCore_GEN_DIR}/qabstractproxymodel_wrapper.cpp
-${QtCore_GEN_DIR}/qabstractstate_wrapper.cpp
${QtCore_GEN_DIR}/qabstracttablemodel_wrapper.cpp
-${QtCore_GEN_DIR}/qabstracttransition_wrapper.cpp
${QtCore_GEN_DIR}/qanimationgroup_wrapper.cpp
${QtCore_GEN_DIR}/qbasicmutex_wrapper.cpp
${QtCore_GEN_DIR}/qbasictimer_wrapper.cpp
${QtCore_GEN_DIR}/qbitarray_wrapper.cpp
${QtCore_GEN_DIR}/qbuffer_wrapper.cpp
+${QtCore_GEN_DIR}/qbytearray_frombase64result_wrapper.cpp
${QtCore_GEN_DIR}/qbytearray_wrapper.cpp
${QtCore_GEN_DIR}/qbytearraymatcher_wrapper.cpp
-${QtCore_GEN_DIR}/qchildevent_wrapper.cpp
+${QtCore_GEN_DIR}/qcalendar_wrapper.cpp
+${QtCore_GEN_DIR}/qcalendar_yearmonthday_wrapper.cpp
${QtCore_GEN_DIR}/qcborarray_wrapper.cpp
${QtCore_GEN_DIR}/qcborerror_wrapper.cpp
${QtCore_GEN_DIR}/qcbormap_wrapper.cpp
${QtCore_GEN_DIR}/qcborparsererror_wrapper.cpp
${QtCore_GEN_DIR}/qcborstreamreader_wrapper.cpp
-${QtCore_GEN_DIR}/qcborstringresultstring_wrapper.cpp
-${QtCore_GEN_DIR}/qcborstringresultbytearray_wrapper.cpp
${QtCore_GEN_DIR}/qcborstreamwriter_wrapper.cpp
+${QtCore_GEN_DIR}/qcborstringresultbytearray_wrapper.cpp
+${QtCore_GEN_DIR}/qcborstringresultstring_wrapper.cpp
${QtCore_GEN_DIR}/qcborvalue_wrapper.cpp
+${QtCore_GEN_DIR}/qchildevent_wrapper.cpp
${QtCore_GEN_DIR}/qcollator_wrapper.cpp
${QtCore_GEN_DIR}/qcollatorsortkey_wrapper.cpp
${QtCore_GEN_DIR}/qcommandlineoption_wrapper.cpp
${QtCore_GEN_DIR}/qcommandlineparser_wrapper.cpp
+${QtCore_GEN_DIR}/qconcatenatetablesproxymodel_wrapper.cpp
${QtCore_GEN_DIR}/qcoreapplication_wrapper.cpp
${QtCore_GEN_DIR}/qcryptographichash_wrapper.cpp
${QtCore_GEN_DIR}/qdatastream_wrapper.cpp
@@ -55,26 +57,24 @@ ${QtCore_GEN_DIR}/qeasingcurve_wrapper.cpp
${QtCore_GEN_DIR}/qelapsedtimer_wrapper.cpp
${QtCore_GEN_DIR}/qevent_wrapper.cpp
${QtCore_GEN_DIR}/qeventloop_wrapper.cpp
-${QtCore_GEN_DIR}/qeventtransition_wrapper.cpp
${QtCore_GEN_DIR}/qfactoryinterface_wrapper.cpp
${QtCore_GEN_DIR}/qfile_wrapper.cpp
-${QtCore_GEN_DIR}/qfileselector_wrapper.cpp
${QtCore_GEN_DIR}/qfiledevice_wrapper.cpp
${QtCore_GEN_DIR}/qfileinfo_wrapper.cpp
+${QtCore_GEN_DIR}/qfileselector_wrapper.cpp
${QtCore_GEN_DIR}/qfilesystemwatcher_wrapper.cpp
-${QtCore_GEN_DIR}/qfinalstate_wrapper.cpp
${QtCore_GEN_DIR}/qgenericargument_wrapper.cpp
${QtCore_GEN_DIR}/qgenericreturnargument_wrapper.cpp
-${QtCore_GEN_DIR}/qhistorystate_wrapper.cpp
${QtCore_GEN_DIR}/qidentityproxymodel_wrapper.cpp
${QtCore_GEN_DIR}/qiodevice_wrapper.cpp
+${QtCore_GEN_DIR}/qiodevicebase_wrapper.cpp
+${QtCore_GEN_DIR}/qitemselection_wrapper.cpp
+${QtCore_GEN_DIR}/qitemselectionmodel_wrapper.cpp
+${QtCore_GEN_DIR}/qitemselectionrange_wrapper.cpp
${QtCore_GEN_DIR}/qjsonarray_wrapper.cpp
${QtCore_GEN_DIR}/qjsondocument_wrapper.cpp
${QtCore_GEN_DIR}/qjsonparseerror_wrapper.cpp
${QtCore_GEN_DIR}/qjsonvalue_wrapper.cpp
-${QtCore_GEN_DIR}/qitemselection_wrapper.cpp
-${QtCore_GEN_DIR}/qitemselectionmodel_wrapper.cpp
-${QtCore_GEN_DIR}/qitemselectionrange_wrapper.cpp
${QtCore_GEN_DIR}/qlibraryinfo_wrapper.cpp
${QtCore_GEN_DIR}/qline_wrapper.cpp
${QtCore_GEN_DIR}/qlinef_wrapper.cpp
@@ -107,13 +107,13 @@ ${QtCore_GEN_DIR}/qpointf_wrapper.cpp
${QtCore_GEN_DIR}/qprocess_wrapper.cpp
${QtCore_GEN_DIR}/qprocessenvironment_wrapper.cpp
${QtCore_GEN_DIR}/qpropertyanimation_wrapper.cpp
-${QtCore_GEN_DIR}/qrandomgenerator_wrapper.cpp
${QtCore_GEN_DIR}/qrandomgenerator64_wrapper.cpp
+${QtCore_GEN_DIR}/qrandomgenerator_wrapper.cpp
${QtCore_GEN_DIR}/qreadlocker_wrapper.cpp
${QtCore_GEN_DIR}/qreadwritelock_wrapper.cpp
${QtCore_GEN_DIR}/qrect_wrapper.cpp
${QtCore_GEN_DIR}/qrectf_wrapper.cpp
-${QtCore_GEN_DIR}/qregexp_wrapper.cpp
+${QtCore_GEN_DIR}/qrecursivemutex_wrapper.cpp
${QtCore_GEN_DIR}/qregularexpression_wrapper.cpp
${QtCore_GEN_DIR}/qregularexpressionmatch_wrapper.cpp
${QtCore_GEN_DIR}/qregularexpressionmatchiterator_wrapper.cpp
@@ -126,17 +126,12 @@ ${QtCore_GEN_DIR}/qsequentialanimationgroup_wrapper.cpp
${QtCore_GEN_DIR}/qsettings_wrapper.cpp
${QtCore_GEN_DIR}/qsignalblocker_wrapper.cpp
${QtCore_GEN_DIR}/qsignalmapper_wrapper.cpp
-${QtCore_GEN_DIR}/qsignaltransition_wrapper.cpp
${QtCore_GEN_DIR}/qsize_wrapper.cpp
${QtCore_GEN_DIR}/qsizef_wrapper.cpp
${QtCore_GEN_DIR}/qsocketdescriptor_wrapper.cpp
${QtCore_GEN_DIR}/qsocketnotifier_wrapper.cpp
${QtCore_GEN_DIR}/qsortfilterproxymodel_wrapper.cpp
-${QtCore_GEN_DIR}/qstate_wrapper.cpp
${QtCore_GEN_DIR}/qstandardpaths_wrapper.cpp
-${QtCore_GEN_DIR}/qstatemachine_signalevent_wrapper.cpp
-${QtCore_GEN_DIR}/qstatemachine_wrappedevent_wrapper.cpp
-${QtCore_GEN_DIR}/qstatemachine_wrapper.cpp
${QtCore_GEN_DIR}/qstorageinfo_wrapper.cpp
${QtCore_GEN_DIR}/qstringlistmodel_wrapper.cpp
${QtCore_GEN_DIR}/qsysinfo_wrapper.cpp
@@ -145,10 +140,6 @@ ${QtCore_GEN_DIR}/qt_wrapper.cpp
${QtCore_GEN_DIR}/qtemporarydir_wrapper.cpp
${QtCore_GEN_DIR}/qtemporaryfile_wrapper.cpp
${QtCore_GEN_DIR}/qtextboundaryfinder_wrapper.cpp
-${QtCore_GEN_DIR}/qtextcodec_converterstate_wrapper.cpp
-${QtCore_GEN_DIR}/qtextcodec_wrapper.cpp
-${QtCore_GEN_DIR}/qtextdecoder_wrapper.cpp
-${QtCore_GEN_DIR}/qtextencoder_wrapper.cpp
${QtCore_GEN_DIR}/qtextstream_wrapper.cpp
${QtCore_GEN_DIR}/qtextstreammanipulator_wrapper.cpp
${QtCore_GEN_DIR}/qthread_wrapper.cpp
@@ -157,9 +148,10 @@ ${QtCore_GEN_DIR}/qtime_wrapper.cpp
${QtCore_GEN_DIR}/qtimeline_wrapper.cpp
${QtCore_GEN_DIR}/qtimer_wrapper.cpp
${QtCore_GEN_DIR}/qtimerevent_wrapper.cpp
-${QtCore_GEN_DIR}/qtimezone_wrapper.cpp
${QtCore_GEN_DIR}/qtimezone_offsetdata_wrapper.cpp
+${QtCore_GEN_DIR}/qtimezone_wrapper.cpp
${QtCore_GEN_DIR}/qtranslator_wrapper.cpp
+${QtCore_GEN_DIR}/qtransposeproxymodel_wrapper.cpp
${QtCore_GEN_DIR}/qurl_wrapper.cpp
${QtCore_GEN_DIR}/qurlquery_wrapper.cpp
${QtCore_GEN_DIR}/quuid_wrapper.cpp
@@ -176,33 +168,11 @@ ${QtCore_GEN_DIR}/qxmlstreamnotationdeclaration_wrapper.cpp
${QtCore_GEN_DIR}/qxmlstreamreader_wrapper.cpp
${QtCore_GEN_DIR}/qxmlstreamwriter_wrapper.cpp
-
${SPECIFIC_OS_FILES}
# module is always needed
${QtCore_GEN_DIR}/qtcore_module_wrapper.cpp
)
-if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 5.13.0
- OR Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 5.13.0)
- list(APPEND QtCore_SRC
- ${QtCore_GEN_DIR}/qconcatenatetablesproxymodel_wrapper.cpp
- ${QtCore_GEN_DIR}/qtransposeproxymodel_wrapper.cpp)
-endif()
-
-if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 5.14.0
- OR Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 5.14.0)
- list(APPEND QtCore_SRC
- ${QtCore_GEN_DIR}/qcalendar_wrapper.cpp
- ${QtCore_GEN_DIR}/qcalendar_yearmonthday_wrapper.cpp
- ${QtCore_GEN_DIR}/qrecursivemutex_wrapper.cpp)
-endif()
-
-if (Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_EQUAL 5.15.0
- OR Qt${QT_MAJOR_VERSION}Core_VERSION VERSION_GREATER 5.15.0)
- list(APPEND QtCore_SRC
- ${QtCore_GEN_DIR}/qbytearray_frombase64result_wrapper.cpp)
-endif()
-
set(QtCore_glue_sources
"${QtCore_SOURCE_DIR}/glue/qeasingcurve_glue.cpp"
"${QtCore_SOURCE_DIR}/glue/qeasingcurve_glue.h"
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
index 62928f3cf..144e16ffc 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -51,15 +51,9 @@
<custom-type name="PyTypeObject"/>
<custom-type name="PyUnicode"/>
<custom-type name="list of QAbstractAnimation"/>
- <custom-type name="list of QAbstractState"/>
-
- <function signature="qAcos(qreal)"/>
- <function signature="qAsin(qreal)" since="4.6"/>
- <function signature="qAtan(qreal)" since="4.6"/>
- <function signature="qAtan2(qreal,qreal)" since="4.6"/>
- <function signature="qChecksum(const char*,uint)"/>
- <function signature="qExp(qreal)" since="4.6"/>
- <function signature="qFabs(qreal)" since="4.6"/>
+<!--
+ <function signature="qChecksum(QByteArrayView data, Qt::ChecksumType)"/>
+-->
<function signature="qFastCos(qreal)" since="4.6"/>
<function signature="qFastSin(qreal)" since="4.6"/>
<function signature="qFuzzyCompare(double,double)"/>
@@ -69,14 +63,11 @@
<function signature="qIsNaN(double)"/>
<function signature="qIsNull(double)"/>
<!-- Qt5: gone <function signature="qRound(qreal)"/> -->
- <function signature="qTan(qreal)" since="4.6"/>
<function signature="qtTrId(const char*,int)" since="4.6"/>
<function signature="qVersion()"/>
- <function signature="qrand()"/>
- <function signature="qsrand(uint)"/>
- <function signature="qCompress(const uchar*,int,int)"/>
+ <function signature="qCompress(const uchar*,qsizetype,int)"/>
<function signature="qCompress(const QByteArray&amp;,int)"/>
- <function signature="qUncompress(const uchar*,int)"/>
+ <function signature="qUncompress(const uchar*,qsizetype)"/>
<function signature="qUncompress(const QByteArray&amp;)"/>
<inject-code class="native" position="beginning" file="../glue/qtcore.cpp" snippet="include-pyside"/>
@@ -170,7 +161,6 @@
<enum-type name="QtMsgType"/>
-
<enum-type name="QCborSimpleType" since="5.12"/>
<enum-type name="QCborKnownTags" since="5.12"/>
@@ -189,6 +179,8 @@
<primitive-type name="long long"/>
<primitive-type name="qlonglong" target-lang-api-name="PyLong"/>
<primitive-type name="qulonglong" target-lang-api-name="PyLong"/>
+ <primitive-type name="qsizetype" target-lang-api-name="PyLong"/>
+ <primitive-type name="size_t" target-lang-api-name="PyLong"/>
<primitive-type name="short"/>
<primitive-type name="signed short"/>
<primitive-type name="signed short int"/>
@@ -256,17 +248,18 @@
<native-to-target file="../glue/qtcore.cpp" snippet="return-pyunicode"/>
<target-to-native>
<add-conversion type="PyUnicode" file="../glue/qtcore.cpp" snippet="conversion-pyunicode"/>
- <add-conversion type="PyString" check="py2kStrCheck(%in)" file="../glue/qtcore.cpp" snippet="conversion-pystring"/>
<add-conversion type="Py_None" file="../glue/qtcore.cpp" snippet="conversion-pynone"/>
</target-to-native>
</conversion-rule>
</primitive-type>
- <primitive-type name="QStringRef">
+ <primitive-type name="QStringView" target-lang-api-name="PyUnicode" view-on="QString">
+ <include file-name="QStringView" location="global"/>
<conversion-rule>
- <native-to-target file="../glue/qtcore.cpp" snippet="return-pyunicode-qstringref"/>
+ <native-to-target file="../glue/qtcore.cpp" snippet="return-pyunicode"/>
</conversion-rule>
</primitive-type>
+
<primitive-type name="QChar">
<conversion-rule>
<native-to-target file="../glue/qtcore.cpp" snippet="return-pyunicode-qchar"/>
@@ -354,7 +347,7 @@
<include file-name="qcborstream.h" location="global"/>
<value-type name="StringResult" generate="no"/>
<!-- 64bit (qsizetype = long long) -->
- <modify-function signature="readStringChunk(char*,long long)" remove="all"/>
+ <modify-function signature="readStringChunk(char*,qsizetype)" remove="all"/>
<!-- 32bit (qsizetype = int) -->
<modify-function signature="readStringChunk(char*,int)" remove="all"/>
</object-type>
@@ -405,6 +398,7 @@
</conversion-rule>
</container-type>
+ <!-- FIXME: Which one is it going to be? -->
<container-type name="QList" type="list">
<include file-name="QList" location="global"/>
<conversion-rule>
@@ -419,21 +413,6 @@
</conversion-rule>
</container-type>
- <container-type name="QVector" type="vector">
- <include file-name="QVector" location="global"/>
- <conversion-rule>
- <native-to-target>
- <insert-template name="cppvector_to_pylist_conversion"/>
- </native-to-target>
- <target-to-native>
- <add-conversion type="PySequence">
- <insert-template name="pyseq_to_cppvector_conversion"/>
- </add-conversion>
- </target-to-native>
- </conversion-rule>
-
- </container-type>
-
<container-type name="QStack" type="stack">
<include file-name="QStack" location="global"/>
<conversion-rule>
@@ -462,20 +441,6 @@
</conversion-rule>
</container-type>
- <container-type name="QLinkedList" type="linked-list">
- <include file-name="QLinkedList" location="global"/>
- <conversion-rule>
- <native-to-target>
- <insert-template name="cpplist_to_pylist_conversion"/>
- </native-to-target>
- <target-to-native>
- <add-conversion type="PySequence">
- <insert-template name="pyseq_to_cpplist_conversion"/>
- </add-conversion>
- </target-to-native>
- </conversion-rule>
- </container-type>
-
<container-type name="QHash" type="hash">
<include file-name="QHash" location="global"/>
<!-- Include to make enum flags work. -->
@@ -550,15 +515,11 @@
<rejection class="" enum-name="enum_1"/>
<rejection class="" enum-name="enum_2"/>
<rejection class="" enum-name="QtValidLicenseForXmlModule"/>
- <rejection class="" enum-name="QtValidLicenseForXmlPatternsModule"/>
<rejection class="" enum-name="QtValidLicenseForActiveQtModule"/>
<rejection class="" enum-name="QtValidLicenseForCoreModule"/>
- <rejection class="" enum-name="QtValidLicenseForQt3SupportLightModule"/>
- <rejection class="" enum-name="QtValidLicenseForQt3SupportModule"/>
<rejection class="" enum-name="QtValidLicenseForNetworkModule"/>
<rejection class="" enum-name="QtValidLicenseForSvgModule"/>
<rejection class="" enum-name="QtValidLicenseForGuiModule"/>
- <rejection class="" enum-name="QtValidLicenseForScriptModule"/>
<rejection class="" enum-name="QtValidLicenseForHelpModule"/>
<!-- Internal -->
<rejection class="QAbstractFileEngine"/> <!--
@@ -634,6 +595,7 @@
<enum-type name="PenCapStyle"/>
<enum-type name="PenJoinStyle"/>
<enum-type name="PenStyle"/>
+ <enum-type name="ReturnByValueConstant" since="6.0"/>
<enum-type name="ScreenOrientation" flags="ScreenOrientations" since="5.0"/>
<enum-type name="ScrollBarPolicy"/>
<enum-type name="ScrollPhase" since="5.2"/>
@@ -747,7 +709,7 @@
</add-function>
</value-type>
<value-type name="QLineF">
- <enum-type name="IntersectType"/>
+ <enum-type name="IntersectionType"/>
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
@@ -774,7 +736,7 @@
</insert-template>
</inject-code>
</add-function>
- <modify-function signature="intersect(QLineF,QPointF*)const">
+ <modify-function signature="intersects(const QLineF &amp;,QPointF*)const">
<modify-argument index="2">
<remove-argument />
</modify-argument>
@@ -831,7 +793,6 @@
<extra-includes>
<include file-name="datetime.h" location="global"/>
</extra-includes>
- <enum-type name="MonthNameType"/>
<add-function signature="__repr__" return-type="PyObject">
<inject-code class="target" position="beginning">
<insert-template name="repr_code">
@@ -852,7 +813,7 @@
<add-function signature="toPython()" return-type="PyObject">
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qdate-topython"/>
</add-function>
- <modify-function signature="getDate(int*,int*,int*)" >
+ <modify-function signature="getDate(int*,int*,int*)const" >
<modify-argument index="1">
<remove-argument/>
</modify-argument>
@@ -1314,8 +1275,6 @@
<rename to="format"/>
</modify-argument>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
- <modify-function signature="toUInt(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toUInt(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1328,8 +1287,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
- <modify-function signature="toULongLong(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toULongLong(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1342,8 +1299,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions -->
- <modify-function signature="toDouble(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toDouble(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1356,8 +1311,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions -->
- <modify-function signature="toFloat(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toFloat(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1370,8 +1323,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
- <modify-function signature="toInt(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toInt(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1383,8 +1334,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
- <modify-function signature="toLongLong(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toLongLong(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1396,8 +1345,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
- <modify-function signature="toShort(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toShort(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1409,8 +1356,6 @@
<insert-template name="fix_args,bool*"/>
</inject-code>
</modify-function>
- <!-- Qt5: ignore the new QStringRef versions, int arg is gone -->
- <modify-function signature="toUShort(QStringRef,bool*)const" remove="all"/>
<modify-function signature="toUShort(QString,bool*)const">
<modify-argument index="2">
<remove-argument />
@@ -1509,7 +1454,7 @@
<enum-type name="CheckIndexOption" flags="CheckIndexOptions" since="5.11"/>
<enum-type name="LayoutChangeHint"/>
<!-- This function was replaced by a added function -->
- <modify-function signature="createIndex(int,int,void*)const" remove="all"/>
+ <modify-function signature="createIndex(int,int,const void*)const" remove="all"/>
<!-- This function is the same as createIndex(int, int, int)const -->
<modify-function signature="createIndex(int,int,quintptr)const">
<modify-argument index="3">
@@ -1560,6 +1505,10 @@
</object-type>
<value-type name="QItemSelection">
<include file-name="QList" location="global"/>
+ <!-- Expose operator==, != inherited from QList, which the parser does
+ not see due to the TMP expression of the return type. -->
+ <add-function signature="operator==(const QItemSelection&amp;)" return-type="bool"/>
+ <add-function signature="operator!=(const QItemSelection&amp;)" return-type="bool"/>
</value-type>
<object-type name="QItemSelectionModel">
@@ -1590,10 +1539,6 @@
<reference-count action="set"/>
</modify-argument>
</modify-function>
- <!--### Obsolete in 4.3-->
- <modify-function signature="clear()" remove="all"/>
- <modify-function signature="filterChanged()" remove="all"/>
- <!--### End of obsolete section -->
</object-type>
<object-type name="QIdentityProxyModel"/>
<object-type name="QTransposeProxyModel" since="5.13"/>
@@ -1735,12 +1680,6 @@
<replace-default-expression with="QString()"/>
</modify-argument>
</add-function>
- <add-function signature="findChildren(PyTypeObject*,const QRegExp&amp;)" return-type="PySequence*" >
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren"/>
- <modify-argument index="return">
- <parent index="this" action="add"/>
- </modify-argument>
- </add-function>
<add-function signature="findChildren(PyTypeObject*,const QRegularExpression&amp;)" return-type="PySequence*" >
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren"/>
<modify-argument index="return">
@@ -1823,64 +1762,8 @@
</inject-code>
</add-function>
</value-type>
- <value-type name="QRegExp">
- <enum-type name="CaretMode"/>
- <enum-type name="PatternSyntax"/>
- <extra-includes>
- <include file-name="QStringList" location="global"/>
- </extra-includes>
- <add-function signature="__repr__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- <insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="'%s', %i, %i"/>
- <replace from="%REPR_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()"/>
- </insert-template>
- </inject-code>
- </add-function>
-
- <add-function signature="__reduce__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- <insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="sii"/>
- <replace from="%REDUCE_ARGS" to="qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()"/>
- </insert-template>
- </inject-code>
- </add-function>
- <add-function signature="replace(QString,QString)" return-type="QString">
- <modify-argument index="1">
- <rename to="sourceString"/>
- </modify-argument>
- <modify-argument index="2">
- <rename to="after"/>
- </modify-argument>
- <inject-documentation format="target" mode="append">
- Replaces every occurrence of the regular expression in *sourceString* with *after*.
- Returns a new Python string with the modified contents. For example:
-
- ::
-
- s = "Banana"
- re = QRegExp("a[mn]")
- s = re.replace(s, "ox")
- # s == "Boxoxa"
-
-
- For regular expressions containing capturing parentheses, occurrences of \1, \2, ..., in *after*
- are replaced with rx.cap(1), cap(2), ...
-
- ::
-
- t = "A &lt;i>bon mot&lt;/i>."
- re = QRegExp("&lt;i>([^&lt;]*)&lt;/i>")
- t = re.replace(t, "\\emph{\\1}")
- # t == "A \\emph{bon mot}."
-
- </inject-documentation>
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qregexp-replace"/>
- </add-function>
- </value-type>
-
<value-type name="QRegularExpression">
+ <enum-type name="WildcardConversionOption" flags="WildcardConversionOptions" since="6.0"/>
<enum-type name="MatchOption" flags="MatchOptions"/>
<enum-type name="MatchType"/>
<enum-type name="PatternOption" flags="PatternOptions"/>
@@ -1920,58 +1803,23 @@
</extra-includes>
<!-- ### These overloads must be removed accept strings with \x00 in their contents -->
- <modify-function signature="append(const char*,int)" remove="all"/>
<modify-function signature="append(const char*)" remove="all"/>
- <modify-function signature="append(QString)" remove="all"/>
- <modify-function signature="contains(const char*)const" remove="all"/>
- <modify-function signature="count(const char*)const" remove="all"/>
- <modify-function signature="endsWith(const char*)const" remove="all"/>
- <modify-function signature="indexOf(const char*,int)const" remove="all"/>
- <modify-function signature="indexOf(char,int)const" remove="all"/>
- <modify-function signature="indexOf(QString,int)const" remove="all"/>
- <modify-function signature="insert(int,const char*)" remove="all"/>
- <modify-function signature="insert(int,char)" remove="all"/>
- <modify-function signature="insert(int,const char*,int)" since="4.6" remove="all"/>
- <modify-function signature="insert(int,QString)" remove="all"/>
- <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
- <modify-function signature="lastIndexOf(QString,int)const" remove="all"/>
- <modify-function signature="lastIndexOf(char,int)const" remove="all"/>
<modify-function signature="prepend(const char*)" remove="all"/>
- <modify-function signature="prepend(const char*,int)" since="4.6" remove="all"/>
- <modify-function signature="replace(QByteArray,const char*)" remove="all"/>
- <modify-function signature="replace(const char*,int,const char*,int)" remove="all"/>
- <modify-function signature="replace(QString,const char*)" remove="all"/>
- <modify-function signature="replace(const char*,QByteArray)" remove="all"/>
- <modify-function signature="replace(const char*,const char*)" remove="all"/>
- <modify-function signature="replace(int,int,const char*)" remove="all"/>
- <modify-function signature="replace(int,int,const char*,int)" since="4.6" remove="all"/>
- <modify-function signature="replace(char,const char*)" remove="all"/>
- <modify-function signature="replace(char,QString)" remove="all"/>
- <modify-function signature="startsWith(const char*)const" remove="all"/>
- <modify-function signature="operator==(QString)const" remove="all"/>
<modify-function signature="operator==(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator==(QByteArray,const char*)" remove="all"/>
- <modify-function signature="operator>(QString)const" remove="all"/>
<modify-function signature="operator>(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator>(QByteArray,const char*)" remove="all"/>
- <modify-function signature="operator>=(QString)const" remove="all"/>
<modify-function signature="operator>=(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator>=(QByteArray,const char*)" remove="all"/>
- <modify-function signature="operator&lt;(QString)const" remove="all"/>
<modify-function signature="operator&lt;(const char*,QByteArray)" remove="all"/>
- <modify-function signature="operator&lt;=(QString)const" remove="all"/>
<modify-function signature="operator&lt;=(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator&lt;=(QByteArray,const char*)" remove="all"/>
- <modify-function signature="operator!=(QString)const" remove="all"/>
<modify-function signature="operator!=(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator!=(QByteArray,const char*)" remove="all"/>
- <modify-function signature="operator+=(QString)" remove="all"/>
<modify-function signature="operator+=(const char*)" remove="all"/>
<modify-function signature="operator+(QByteArray,const char*)" remove="all"/>
<modify-function signature="operator+(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator+(QByteArray,const char*)" remove="all"/>
- <modify-function signature="operator+(QString,QByteArray)" remove="all"/>
- <modify-function signature="operator+(QByteArray,QString)" remove="all"/>
<add-function signature="operator+(PyBytes,QByteArray)">
<inject-code file="../glue/qtcore.cpp" snippet="qbytearray-operatorplus-1"/>
</add-function>
@@ -2016,10 +1864,6 @@
</insert-template>
</inject-code>
</add-function>
- <modify-function signature="QByteArray(const char*,int)">
- <!-- Keep \x00 bytes passed in python strings -->
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-1"/>
- </modify-function>
<add-function signature="QByteArray(PyByteArray)">
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-2"/>
</add-function>
@@ -2056,16 +1900,18 @@
<modify-function signature="operator&lt;=(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator>(const char*,QByteArray)" remove="all"/>
<modify-function signature="operator>=(const char*,QByteArray)" remove="all"/>
- <modify-function signature="operator[](int)const" remove="all"/>
- <modify-function signature="operator[](uint)const" remove="all"/>
<!-- Those types have the same representation in Python, an overload
would be useless and cause overflow errors. -->
<modify-function signature="setNum(uint,int)" remove="all"/>
<modify-function signature="setNum(ushort,int)" remove="all"/>
<modify-function signature="setNum(float,char,int)" remove="all"/>
<modify-function signature="setNum(short,int)" remove="all"/>
+ <modify-function signature="setNum(long,int)" remove="all"/>
+ <modify-function signature="setNum(ulong,int)" remove="all"/>
<modify-function signature="setNum(qulonglong,int)" remove="all"/>
<modify-function signature="number(uint,int)" remove="all"/>
+ <modify-function signature="number(long,int)" remove="all"/>
+ <modify-function signature="number(ulong,int)" remove="all"/>
<modify-function signature="number(qulonglong,int)" remove="all"/>
<!--### -->
@@ -2147,16 +1993,6 @@
</inject-code>
</modify-function>
<!-- QByteArray(const char *) do the job of this constructor -->
- <modify-function signature="QByteArray(const char*,int)" remove="all"/>
- <modify-function signature="fromRawData(const char*,int)">
- <modify-argument index="1">
- <replace-type modified-type="PyBytes"/>
- </modify-argument>
- <modify-argument index="2">
- <remove-argument />
- </modify-argument>
- <inject-code class="target" file="../glue/qtcore.cpp" snippet="qbytearray-fromrawdata"/>
- </modify-function>
<modify-function signature="toDouble(bool*)const">
<modify-argument index="1">
<remove-argument/>
@@ -2192,18 +2028,24 @@
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qbytearray-msetitem"/>
</add-function>
</value-type>
+ <primitive-type name="QByteArrayView" view-on="QByteArray" since="6.0">
+ <conversion-rule>
+ <native-to-target file="../glue/qtcore.cpp" snippet="return-pybytes"/>
+ </conversion-rule>
+ </primitive-type>
+
<value-type name="QTextBoundaryFinder">
<enum-type name="BoundaryReason" flags="BoundaryReasons"/>
<enum-type name="BoundaryType"/>
<!-- There's no QChar in PySide -->
- <modify-function signature="QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType,const QChar*,int,unsigned char*,int)" remove="all"/>
+ <modify-function signature="QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType,const QChar*,qsizetype,unsigned char*,qsizetype)" remove="all"/>
</value-type>
<object-type name="QXmlStreamEntityResolver"/>
<!-- Qt5: had to move QAbstractEventDispatcher into os-specific files because of Windows -->
<object-type name="QAbstractNativeEventFilter">
<!-- see QWidget::nativeEvent(), QWindow::nativeEvent() -->
- <modify-function signature="nativeEventFilter(const QByteArray&amp;,void*,long*)">
+ <modify-function signature="nativeEventFilter(const QByteArray&amp;,void*,qintptr*)">
<modify-argument index="3">
<remove-argument/>
<conversion-rule class="native">
@@ -2231,7 +2073,7 @@
<object-type name="QFileDevice" since="5.0">
<enum-type name="FileError"/>
<enum-type name="FileTime" since="5.10"/>
- <enum-type name="MemoryMapFlags"/>
+ <enum-type name="MemoryMapFlag" flags="MemoryMapFlags"/>
<enum-type name="Permission" flags="Permissions"/>
<enum-type name="FileHandleFlag" flags="FileHandleFlags"/>
<extra-includes>
@@ -2243,7 +2085,7 @@
</modify-argument>
<inject-code file="../glue/qtcore.cpp" snippet="qfiledevice-unmap"/>
</modify-function>
- <modify-function signature="map(qint64,qint64,QFileDevice::MemoryMapFlags)">
+ <modify-function signature="map(qint64,qint64,QFlags&lt;QFileDevice::MemoryMapFlag&gt;)">
<modify-argument index="return">
<replace-type modified-type="PyObject"/>
</modify-argument>
@@ -2252,8 +2094,8 @@
<modify-function signature="flush()" allow-thread="yes"/>
</object-type>
<object-type name="QFile">
- <modify-function signature="open(QFlags&lt;QIODevice::OpenModeFlag&gt;)" allow-thread="yes"/>
- <modify-function signature="open(int,QFlags&lt;QIODevice::OpenModeFlag&gt;,QFlags&lt;QFileDevice::FileHandleFlag&gt;)" allow-thread="yes"/>
+ <modify-function signature="open(QFlags&lt;QIODeviceBase::OpenModeFlag&gt;)" allow-thread="yes"/>
+ <modify-function signature="open(int,QFlags&lt;QIODeviceBase::OpenModeFlag&gt;,QFlags&lt;QFileDevice::FileHandleFlag&gt;)" allow-thread="yes"/>
<modify-function signature="copy(const QString&amp;)" allow-thread="yes"/>
<modify-function signature="copy(const QString&amp;,const QString&amp;)" allow-thread="yes"/>
<modify-function signature="link(const QString&amp;)" allow-thread="yes"/>
@@ -2267,8 +2109,7 @@
<object-type name="QFileSelector"/>
<object-type name="QIODevice">
- <enum-type name="OpenModeFlag" flags="OpenMode"/>
- <modify-function signature="open(QFlags&lt;QIODevice::OpenModeFlag>)" allow-thread="yes"/>
+ <modify-function signature="open(QFlags&lt;QIODeviceBase::OpenModeFlag>)" allow-thread="yes"/>
<modify-function signature="close()" allow-thread="yes"/>
<modify-function signature="seek(qint64)" allow-thread="yes"/>
<modify-function signature="readAll()" allow-thread="yes"/>
@@ -2315,9 +2156,12 @@
<inject-code class="native" position="end" file="../glue/qtcore.cpp" snippet="return-readData"/>
</modify-function>
</object-type>
+ <value-type name="QIODeviceBase" since="6.0">
+ <enum-type name="OpenModeFlag" flags="OpenMode"/>
+ </value-type>
<object-type name="QCryptographicHash">
<enum-type name="Algorithm"/>
- <modify-function signature="addData(const char*,int)">
+ <modify-function signature="addData(const char*,qsizetype)">
<modify-argument index="2">
<remove-argument />
</modify-argument>
@@ -2328,7 +2172,7 @@
<enum-type name="OSType"/>
</value-type>
<object-type name="QLibraryInfo">
- <enum-type name="LibraryLocation"/>
+ <enum-type name="LibraryPath"/>
<modify-function signature="build()">
<inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qlibraryinfo_build"/>
</modify-function>
@@ -2413,40 +2257,7 @@
<include file-name="QUrl" location="global"/>
</extra-includes>
</object-type>
- <object-type name="QTextCodec">
- <enum-type name="ConversionFlag" flags="ConversionFlags"/>
-
- <object-type name="ConverterState">
- <include file-name="QTextCodec" location="global"/>
- <modify-function signature="ConverterState(QFlags&lt;QTextCodec::ConversionFlag&gt;)">
- <modify-argument index="1">
- <replace-default-expression with="QTextCodec::DefaultConversion"/>
- </modify-argument>
- </modify-function>
- </object-type>
-
- <modify-function signature="setCodecForLocale(QTextCodec*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <!-- fromUnicode(QString) does the job -->
- <modify-function signature="fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all"/>
- <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const" remove="all"/>
- <!-- this causes a warning that I cannot avoid. See suppressed warning at the end. -->
- </object-type>
- <object-type name="QTextDecoder">
- <!-- ### toUnicode(QByteArray) does the job -->
- <modify-function signature="toUnicode(const char*,int)" remove="all"/>
- <modify-function signature="toUnicode(QString*,const char*,int)" remove="all"/>
- <!-- ### -->
- </object-type>
- <object-type name="QTextEncoder">
- <!-- fromUnicode(QString) does the job -->
- <modify-function signature="fromUnicode(const QChar*,int)" remove="all"/>
- </object-type>
<object-type name="QTimeLine">
- <enum-type name="CurveShape"/>
<enum-type name="Direction"/>
<enum-type name="State"/>
</object-type>
@@ -2500,7 +2311,6 @@
<modify-function signature="readAllStandardOutput()" allow-thread="yes"/>
<modify-function signature="readAllStandardError()" allow-thread="yes"/>
<modify-function signature="execute(QString,QStringList)" allow-thread="yes"/>
- <modify-function signature="execute(QString)" allow-thread="yes"/>
<modify-function signature="startDetached(QString,QStringList,QString,qint64*)">
<modify-argument index="4">
<remove-argument />
@@ -2510,15 +2320,6 @@
</modify-argument>
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qprocess-startdetached"/>
</modify-function>
- <!-- Function removed because on windows it returns a win32 specific structure -->
- <modify-function signature="pid()const" remove="all"/>
- <add-function signature="pid()" return-type="long">
- <inject-code file="../glue/qtcore.cpp" snippet="qprocess-pid"/>
- </add-function>
- <!--### Obsolete in 4.3-->
- <modify-function signature="setReadChannelMode(QProcess::ProcessChannelMode)" remove="all"/>
- <modify-function signature="readChannelMode()const" remove="all"/>
- <!-- ### -->
</object-type>
<object-type name="QSignalMapper"/>
@@ -2568,7 +2369,6 @@
<!-- blocking functions -->
<modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;,int)" allow-thread="yes"/>
<modify-function signature="processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)" allow-thread="yes"/>
- <modify-function signature="flush()" allow-thread="yes"/>
<modify-function signature="sendEvent(QObject*,QEvent*)" allow-thread="yes"/>
<modify-function signature="sendPostedEvents(QObject*,int)" allow-thread="yes"/>
<modify-function signature="instance()">
@@ -2594,15 +2394,6 @@
<extra-includes>
<include file-name="QStringList" location="global"/>
</extra-includes>
- <!--### Obsolete in 4.3-->
- <modify-function signature="setSystemIniPath(const QString&amp;)" remove="all"/>
- <modify-function signature="setUserIniPath(const QString&amp;)" remove="all"/>
- <!--### Obsolete in 4.3-->
- <modify-function signature="iniCodec()const">
- <modify-argument index="return">
- <define-ownership class="target" owner="default"/>
- </modify-argument>
- </modify-function>
<!-- PYSIDE-1010:
We remove the original implementation of value() to include the optional parameter -->
<modify-function signature="value(const QString&amp;,const QVariant&amp;)const" remove="all"/>
@@ -2791,14 +2582,14 @@
<enum-type name="RealNumberNotation"/>
<enum-type name="Status"/>
<!-- Removed because it expect QString to be mutable -->
- <modify-function signature="QTextStream(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
+ <modify-function signature="QTextStream(QString*,QFlags&lt;QIODeviceBase::OpenModeFlag&gt;)" remove="all"/>
<!-- Qt5.5: Removed because it expect QString to be mutable -->
<modify-function signature="readLineInto(QString*,qint64)" since="5.5" remove="all"/>
<!-- Removed because we use the non-const version -->
- <modify-function signature="QTextStream(const QByteArray&amp;,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
+ <modify-function signature="QTextStream(const QByteArray&amp;,QFlags&lt;QIODeviceBase::OpenModeFlag&gt;)" remove="all"/>
<!-- Removed because it expect QString to be mutable -->
- <modify-function signature="setString(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
+ <modify-function signature="setString(QString*,QFlags&lt;QIODeviceBase::OpenModeFlag&gt;)" remove="all"/>
<modify-function signature="operator&lt;&lt;(const void*)" remove="all"/>
<modify-function signature="operator&lt;&lt;(float)" remove="all"/>
@@ -2875,8 +2666,14 @@
<modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
<modify-function signature="pop_front()" remove="all"/>
<modify-function signature="toList()const" remove="all"/>
+ <!-- Remove methods from QList -->
+ <modify-function signature="value(qsizetype,const QXmlStreamAttribute&amp;) const" remove="all"/>
<modify-function signature="fromList(const QList&lt;QXmlStreamAttribute&gt; &amp;)" remove="all"/>
<modify-function signature="operator+=(QVector&lt;QXmlStreamAttribute&gt;)" remove="all"/>
+ <!-- Expose operator==, != inherited from QList, which the parser does
+ not see due to the TMP expression of the return type. -->
+ <add-function signature="operator==(const QXmlStreamAttributes&amp;)" return-type="bool"/>
+ <add-function signature="operator!=(const QXmlStreamAttributes&amp;)" return-type="bool"/>
</value-type>
<value-type name="QXmlStreamNamespaceDeclaration"/>
<value-type name="QXmlStreamNotationDeclaration"/>
@@ -2889,11 +2686,6 @@
<object-type name="QXmlStreamWriter">
<!-- Removed because it expect QString to be mutable -->
<modify-function signature="QXmlStreamWriter(QString*)" remove="all"/>
- <modify-function signature="codec()const">
- <modify-argument index="return">
- <define-ownership class="target" owner="default"/>
- </modify-argument>
- </modify-function>
</object-type>
<value-type name="QModelIndex" hash-function="qHash">
<modify-function signature="internalPointer()const">
@@ -2982,61 +2774,6 @@
<enum-type name="State"/>
</object-type>
- <object-type name="QAbstractState" since="4.6">
- <modify-function signature="machine()const">
- <modify-argument index="this">
- <parent index="return" action="add"/>
- </modify-argument>
- </modify-function>
- </object-type>
-
- <object-type name="QAbstractTransition" since="4.6">
- <enum-type name="TransitionType" since="5.5"/>
-
- <modify-function signature="QAbstractTransition(QState*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="addAnimation(QAbstractAnimation*)">
- <modify-argument index="1">
- <reference-count action="add"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="removeAnimation(QAbstractAnimation*)">
- <modify-argument index="1">
- <reference-count action="remove"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="setTargetState(QAbstractState*)">
- <modify-argument index="1">
- <reference-count action="set"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="targetState()const">
- <modify-argument index="return">
- <reference-count action="set" variable-name="setTargetState(QAbstractState*)1"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="targetStates()const">
- <modify-argument index="return">
- <reference-count action="set" variable-name="setTargetState(QAbstractState*)1"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="setTargetStates(QList&lt;QAbstractState*&gt;)">
- <modify-argument index="1">
- <reference-count action="set" variable-name="setTargetState(QAbstractState*)1"/>
- </modify-argument>
- </modify-function>
-
- </object-type>
-
<object-type name="QAnimationGroup" since="4.6">
<modify-function signature="addAnimation(QAbstractAnimation*)">
<modify-argument index="1">
@@ -3111,48 +2848,6 @@
</extra-includes>
</value-type>
- <object-type name="QEventTransition" since="4.6">
- <modify-function signature="QEventTransition(QState*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="QEventTransition(QObject*,QEvent::Type,QState*)">
- <modify-argument index="3">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
-
- </object-type>
-
- <object-type name="QFinalState" since="4.6"/>
-
- <object-type name="QHistoryState" since="4.6">
- <enum-type name="HistoryType"/>
- <modify-documentation xpath='description/code'>
- &lt;code>machine = QStateMachine()
-
-s1 = QState()
-s11 = QState(s1)
-s12 = QState(s1)
-
-s1h = QHistoryState(s1)
-s1h.setDefaultState(s11)
-
-machine.addState(s1)
-
-s2 = QState()
-machine.addState(s2)
-
-button = QPushButton()
-# Clicking the button will cause the state machine to enter the child state
-# that s1 was in the last time s1 was exited, or the history state's default
-# state if s1 has never been entered.
-s1.addTransition(button.clicked, s1h)&lt;/code>
- </modify-documentation>
- </object-type>
-
<value-type name="QMargins" since="4.6"/>
<value-type name="QMarginsF" since="5.3"/>
@@ -3166,82 +2861,6 @@ s1.addTransition(button.clicked, s1h)&lt;/code>
<object-type name="QSequentialAnimationGroup" since="4.6"/>
- <object-type name="QSignalTransition" since="4.6">
- <add-function signature="QSignalTransition(PyObject*,QState*)" return-type="QSignalTransition*">
- <modify-argument index="2">
- <replace-default-expression with="0"/>
- </modify-argument>
- <inject-code file="../glue/qtcore.cpp" snippet="qsignaltransition"/>
- </add-function>
- </object-type>
-
- <object-type name="QState" since="4.6">
- <enum-type name="ChildMode"/>
- <enum-type name="RestorePolicy"/>
- <modify-function signature="addTransition(QAbstractTransition*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="addTransition(const QObject*,const char*,QAbstractState*)">
- <modify-argument index="return">
- <parent index="this" action="add"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstate-addtransition-1"/>
- </modify-function>
- <modify-function signature="addTransition(QAbstractState*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
-
- <!-- FIXME: the proper signature for this added function would be something like
- addTransition(PySide2.QtCore.Signal, QAbstractState*)
- but that depends on bug #362. -->
- <add-function signature="addTransition(PyObject*,QAbstractState*)" return-type="QSignalTransition*">
- <modify-argument index="return">
- <parent index="this" action="add"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstate-addtransition-2"/>
- </add-function>
-
- <modify-function signature="removeTransition(QAbstractTransition*)">
- <modify-argument index="1">
- <parent index="this" action="remove"/>
- </modify-argument>
- </modify-function>
- </object-type>
-
- <object-type name="QStateMachine" since="4.6">
- <enum-type name="Error"/>
- <enum-type name="EventPriority"/>
-
- <value-type name="SignalEvent" since="4.6"/>
- <value-type name="WrappedEvent" since="4.6"/>
-
- <modify-function signature="addState(QAbstractState*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="removeState(QAbstractState*)">
- <modify-argument index="1">
- <parent index="this" action="remove"/>
- </modify-argument>
- </modify-function>
-
- <add-function signature="configuration()" return-type="list of QAbstractState" >
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstatemachine-configuration"/>
- </add-function>
-
- <!-- Replaced by a added function -->
- <modify-function signature="defaultAnimations()const" remove="all"/>
- <add-function signature="defaultAnimations()" return-type="list of QAbstractAnimation" >
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstatemachine-defaultanimations"/>
- </add-function>
- </object-type>
-
<object-type name="QVariantAnimation" since="4.6"/>
<value-type name="QVersionNumber" since="5.6">
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml
index 8e3fa6f5e..6a0e1087e 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_win.xml
@@ -49,22 +49,14 @@
<include file-name="wtypes.h" location="global"/>
<conversion-rule>
<native-to-target>
- #ifdef IS_PY3K
- return PyCapsule_New(%in, 0, 0);
- #else
- return PyCObject_FromVoidPtr(%in, 0);
- #endif
+ return PyCapsule_New(%in, nullptr, nullptr);
</native-to-target>
<target-to-native>
<add-conversion type="PyNone">
%out = 0;
</add-conversion>
<add-conversion check="checkPyCapsuleOrPyCObject(%in)" type="PyObject">
- #ifdef IS_PY3K
- %out = (%OUTTYPE)PyCapsule_GetPointer(%in, 0);
- #else
- %out = (%OUTTYPE)PyCObject_AsVoidPtr(%in);
- #endif
+ %out = (%OUTTYPE)PyCapsule_GetPointer(%in, nullptr);
</add-conversion>
</target-to-native>
</conversion-rule>
diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
index c4a38a184..7885af343 100644
--- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
@@ -1,18 +1,11 @@
project(QtGui)
-if (${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- qt6_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside2_SOURCE_DIR}/qpytextobject.h")
-else()
- qt5_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside2_SOURCE_DIR}/qpytextobject.h")
-endif()
+qt_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside2_SOURCE_DIR}/qpytextobject.h")
set(QtGui_DROPPED_ENTRIES)
-get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui
- PROPERTY QT_ENABLED_PUBLIC_FEATURES)
-
set(QtGui_SRC
-${QtGui_GEN_DIR}/qabstractopenglfunctions_wrapper.cpp
+${QtGui_GEN_DIR}/qabstractfileiconprovider_wrapper.cpp
${QtGui_GEN_DIR}/qabstracttextdocumentlayout_paintcontext_wrapper.cpp
${QtGui_GEN_DIR}/qabstracttextdocumentlayout_selection_wrapper.cpp
${QtGui_GEN_DIR}/qabstracttextdocumentlayout_wrapper.cpp
@@ -31,13 +24,18 @@ ${QtGui_GEN_DIR}/qaccessibletextselectionevent_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibletextupdateevent_wrapper.cpp
${QtGui_GEN_DIR}/qaccessiblevaluechangeevent_wrapper.cpp
${QtGui_GEN_DIR}/qaccessiblevalueinterface_wrapper.cpp
+${QtGui_GEN_DIR}/qaction_wrapper.cpp
${QtGui_GEN_DIR}/qactionevent_wrapper.cpp
+${QtGui_GEN_DIR}/qactiongroup_wrapper.cpp
${QtGui_GEN_DIR}/qbackingstore_wrapper.cpp
${QtGui_GEN_DIR}/qbitmap_wrapper.cpp
${QtGui_GEN_DIR}/qbrush_wrapper.cpp
${QtGui_GEN_DIR}/qclipboard_wrapper.cpp
${QtGui_GEN_DIR}/qcloseevent_wrapper.cpp
${QtGui_GEN_DIR}/qcolor_wrapper.cpp
+${QtGui_GEN_DIR}/qcolorspace_wrapper.cpp
+${QtGui_GEN_DIR}/qcolorconstants_wrapper.cpp
+${QtGui_GEN_DIR}/qcolorconstants_svg_wrapper.cpp
${QtGui_GEN_DIR}/qconicalgradient_wrapper.cpp
${QtGui_GEN_DIR}/qcontextmenuevent_wrapper.cpp
${QtGui_GEN_DIR}/qcursor_wrapper.cpp
@@ -49,6 +47,7 @@ ${QtGui_GEN_DIR}/qdragleaveevent_wrapper.cpp
${QtGui_GEN_DIR}/qdragmoveevent_wrapper.cpp
${QtGui_GEN_DIR}/qdropevent_wrapper.cpp
${QtGui_GEN_DIR}/qenterevent_wrapper.cpp
+${QtGui_GEN_DIR}/qeventpoint_wrapper.cpp
${QtGui_GEN_DIR}/qexposeevent_wrapper.cpp
${QtGui_GEN_DIR}/qfileopenevent_wrapper.cpp
${QtGui_GEN_DIR}/qfocusevent_wrapper.cpp
@@ -64,22 +63,23 @@ ${QtGui_GEN_DIR}/qhideevent_wrapper.cpp
${QtGui_GEN_DIR}/qhoverevent_wrapper.cpp
${QtGui_GEN_DIR}/qicon_wrapper.cpp
${QtGui_GEN_DIR}/qicondragevent_wrapper.cpp
-${QtGui_GEN_DIR}/qiconengine_availablesizesargument_wrapper.cpp
+${QtGui_GEN_DIR}/qiconengine_scaledpixmapargument_wrapper.cpp
${QtGui_GEN_DIR}/qiconengine_wrapper.cpp
${QtGui_GEN_DIR}/qimage_wrapper.cpp
${QtGui_GEN_DIR}/qimageiohandler_wrapper.cpp
${QtGui_GEN_DIR}/qimagereader_wrapper.cpp
${QtGui_GEN_DIR}/qimagewriter_wrapper.cpp
+${QtGui_GEN_DIR}/qinputdevice_wrapper.cpp
${QtGui_GEN_DIR}/qinputevent_wrapper.cpp
${QtGui_GEN_DIR}/qinputmethod_wrapper.cpp
${QtGui_GEN_DIR}/qinputmethodevent_attribute_wrapper.cpp
${QtGui_GEN_DIR}/qinputmethodevent_wrapper.cpp
${QtGui_GEN_DIR}/qinputmethodqueryevent_wrapper.cpp
${QtGui_GEN_DIR}/qintvalidator_wrapper.cpp
+${QtGui_GEN_DIR}/qkeycombination_wrapper.cpp
${QtGui_GEN_DIR}/qkeyevent_wrapper.cpp
${QtGui_GEN_DIR}/qkeysequence_wrapper.cpp
${QtGui_GEN_DIR}/qlineargradient_wrapper.cpp
-${QtGui_GEN_DIR}/qmatrix_wrapper.cpp
${QtGui_GEN_DIR}/qmatrix2x2_wrapper.cpp
${QtGui_GEN_DIR}/qmatrix2x3_wrapper.cpp
${QtGui_GEN_DIR}/qmatrix2x4_wrapper.cpp
@@ -95,21 +95,8 @@ ${QtGui_GEN_DIR}/qmovie_wrapper.cpp
${QtGui_GEN_DIR}/qnativegestureevent_wrapper.cpp
${QtGui_GEN_DIR}/qoffscreensurface_wrapper.cpp
${QtGui_GEN_DIR}/qopenglcontextgroup_wrapper.cpp
-${QtGui_GEN_DIR}/qopengldebuglogger_wrapper.cpp
-${QtGui_GEN_DIR}/qopengldebugmessage_wrapper.cpp
${QtGui_GEN_DIR}/qopenglextrafunctions_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglframebufferobjectformat_wrapper.cpp
${QtGui_GEN_DIR}/qopenglfunctions_wrapper.cpp
-# Compile error on Windows: ${QtGui_GEN_DIR}/qopenglpaintdevice_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglpixeltransferoptions_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglshaderprogram_wrapper.cpp
-${QtGui_GEN_DIR}/qopengltexture_wrapper.cpp
-${QtGui_GEN_DIR}/qopengltextureblitter_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglversionprofile_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglvertexarrayobject_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglvertexarrayobject_binder_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglwindow_wrapper.cpp
-${QtGui_GEN_DIR}/qpagedpaintdevice_margins_wrapper.cpp
${QtGui_GEN_DIR}/qpagedpaintdevice_wrapper.cpp
${QtGui_GEN_DIR}/qpagelayout_wrapper.cpp
${QtGui_GEN_DIR}/qpagesize_wrapper.cpp
@@ -127,35 +114,33 @@ ${QtGui_GEN_DIR}/qpalette_wrapper.cpp
${QtGui_GEN_DIR}/qpdfwriter_wrapper.cpp
${QtGui_GEN_DIR}/qpen_wrapper.cpp
${QtGui_GEN_DIR}/qpicture_wrapper.cpp
-${QtGui_GEN_DIR}/qpictureio_wrapper.cpp
${QtGui_GEN_DIR}/qpixmap_wrapper.cpp
${QtGui_GEN_DIR}/qpixmapcache_key_wrapper.cpp
${QtGui_GEN_DIR}/qpixmapcache_wrapper.cpp
${QtGui_GEN_DIR}/qpixelformat_wrapper.cpp
+${QtGui_GEN_DIR}/qpointerevent_wrapper.cpp
+${QtGui_GEN_DIR}/qpointingdevice_wrapper.cpp
${QtGui_GEN_DIR}/qpointingdeviceuniqueid_wrapper.cpp
${QtGui_GEN_DIR}/qpolygon_wrapper.cpp
${QtGui_GEN_DIR}/qpolygonf_wrapper.cpp
${QtGui_GEN_DIR}/qpytextobject_wrapper.cpp
${QtGui_GEN_DIR}/qquaternion_wrapper.cpp
${QtGui_GEN_DIR}/qradialgradient_wrapper.cpp
-${QtGui_GEN_DIR}/qregexpvalidator_wrapper.cpp
${QtGui_GEN_DIR}/qregularexpressionvalidator_wrapper.cpp
${QtGui_GEN_DIR}/qregion_wrapper.cpp
${QtGui_GEN_DIR}/qresizeevent_wrapper.cpp
${QtGui_GEN_DIR}/qsessionmanager_wrapper.cpp
${QtGui_GEN_DIR}/qshortcutevent_wrapper.cpp
${QtGui_GEN_DIR}/qshowevent_wrapper.cpp
+${QtGui_GEN_DIR}/qsinglepointevent_wrapper.cpp
${QtGui_GEN_DIR}/qstandarditem_wrapper.cpp
${QtGui_GEN_DIR}/qstandarditemmodel_wrapper.cpp
${QtGui_GEN_DIR}/qstatustipevent_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglbuffer_wrapper.cpp
${QtGui_GEN_DIR}/qopenglcontext_wrapper.cpp
${QtGui_GEN_DIR}/qaccessible_state_wrapper.cpp
${QtGui_GEN_DIR}/qaccessibleinterface_wrapper.cpp
${QtGui_GEN_DIR}/qscreen_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglshader_wrapper.cpp
-#${QtGui_GEN_DIR}/qopenglshaderprogram_wrapper.cpp
-${QtGui_GEN_DIR}/qopenglframebufferobject_wrapper.cpp
+${QtGui_GEN_DIR}/qshortcut_wrapper.cpp
${QtGui_GEN_DIR}/qrasterwindow_wrapper.cpp
${QtGui_GEN_DIR}/qrawfont_wrapper.cpp
${QtGui_GEN_DIR}/qscrollevent_wrapper.cpp
@@ -199,11 +184,12 @@ ${QtGui_GEN_DIR}/qtexttablecell_wrapper.cpp
${QtGui_GEN_DIR}/qtexttablecellformat_wrapper.cpp
${QtGui_GEN_DIR}/qtexttableformat_wrapper.cpp
${QtGui_GEN_DIR}/qtoolbarchangeevent_wrapper.cpp
-${QtGui_GEN_DIR}/qtouchdevice_wrapper.cpp
-${QtGui_GEN_DIR}/qtouchevent_touchpoint_wrapper.cpp
${QtGui_GEN_DIR}/qtouchevent_wrapper.cpp
${QtGui_GEN_DIR}/qtransform_wrapper.cpp
${QtGui_GEN_DIR}/qt_wrapper.cpp
+${QtGui_GEN_DIR}/qundocommand_wrapper.cpp
+${QtGui_GEN_DIR}/qundogroup_wrapper.cpp
+${QtGui_GEN_DIR}/qundostack_wrapper.cpp
${QtGui_GEN_DIR}/qvalidator_wrapper.cpp
${QtGui_GEN_DIR}/qvector2d_wrapper.cpp
${QtGui_GEN_DIR}/qvector3d_wrapper.cpp
@@ -216,26 +202,6 @@ ${QtGui_GEN_DIR}/qwindowstatechangeevent_wrapper.cpp
${QtGui_GEN_DIR}/qtgui_module_wrapper.cpp
)
-if (Qt${QT_MAJOR_VERSION}Gui_VERSION VERSION_EQUAL 5.14.0
- OR Qt${QT_MAJOR_VERSION}Gui_VERSION VERSION_GREATER 5.14.0)
- list(APPEND QtGui_SRC ${QtGui_GEN_DIR}/qcolorspace_wrapper.cpp)
- list(APPEND QtGui_SRC ${QtGui_GEN_DIR}/qcolorconstants_wrapper.cpp)
- list(APPEND QtGui_SRC ${QtGui_GEN_DIR}/qcolorconstants_svg_wrapper.cpp)
-endif()
-
-# cf qtbase/src/gui/opengl/opengl.pri
-list(FIND QtGui_enabled_features "opengles2" _opengles2Index)
-# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtGui_enabled_features)
-if(_opengles2Index GREATER -1)
- list(APPEND QtGui_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery)
- message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Dropping Desktop OpenGL classes (GLES2)")
-else()
- list(APPEND QtGui_SRC
- ${QtGui_GEN_DIR}/qopengltimemonitor_wrapper.cpp
- ${QtGui_GEN_DIR}/qopengltimerquery_wrapper.cpp)
- message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Adding Desktop OpenGL classes")
-endif()
-
configure_file("${QtGui_SOURCE_DIR}/typesystem_gui.xml.in"
"${QtGui_BINARY_DIR}/typesystem_gui.xml" @ONLY)
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index 04abbae5d..88c19360a 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -113,83 +113,8 @@
besides the fact they are accessible by ordinary event methods.
-->
- <rejection class="^QAccessible.*Event$" field-name="^m_.*$"/>
-
- <rejection class="QEnterEvent" field-name="l"/>
- <rejection class="QEnterEvent" field-name="w"/>
- <rejection class="QEnterEvent" field-name="s"/>
-
- <rejection class="QInputEvent" field-name="modState"/>
- <rejection class="QInputEvent" field-name="modState"/>
-
- <rejection class="QMouseEvent" field-name="p"/>
- <rejection class="QMouseEvent" field-name="g"/>
- <rejection class="QMouseEvent" field-name="b"/>
- <rejection class="QMouseEvent" field-name="mouseState"/>
- <rejection class="QNativeGestureEvent" field-name="^m.*$"/>
-
- <rejection class="QHoverEvent" field-name="p"/>
- <rejection class="QHoverEvent" field-name="op"/>
-
- <rejection class="QWheelEvent" field-name="p"/>
- <rejection class="QWheelEvent" field-name="g"/>
- <rejection class="QWheelEvent" field-name="mouseState"/>
- <rejection class="QWheelEvent" field-name="o"/>
-
- <rejection class="QTabletEvent" field-name="mPos"/>
- <rejection class="QTabletEvent" field-name="mGPos"/>
- <rejection class="QTabletEvent" field-name="mHiResGlobalPos"/>
- <rejection class="QTabletEvent" field-name="mDev"/>
- <rejection class="QTabletEvent" field-name="mPointerType"/>
- <rejection class="QTabletEvent" field-name="mXT"/>
- <rejection class="QTabletEvent" field-name="mYT"/>
- <rejection class="QTabletEvent" field-name="mZ"/>
- <rejection class="QTabletEvent" field-name="mPress"/>
- <rejection class="QTabletEvent" field-name="mTangential"/>
- <rejection class="QTabletEvent" field-name="mRot"/>
- <rejection class="QTabletEvent" field-name="mUnique"/>
- <rejection class="QTabletEvent" field-name="mExtra"/>
-
- <rejection class="QKeyEvent" field-name="txt"/>
- <rejection class="QKeyEvent" field-name="k"/>
- <rejection class="QKeyEvent" field-name="c"/>
- <rejection class="QKeyEvent" field-name="auto"/>
-
- <rejection class="QPaintEvent" field-name="m_rect"/>
- <rejection class="QPaintEvent" field-name="m_region"/>
- <rejection class="QPaintEvent" field-name="m_erased"/>
-
- <rejection class="QMoveEvent" field-name="p"/>
- <rejection class="QMoveEvent" field-name="oldp"/>
-
- <rejection class="QResizeEvent" field-name="s"/>
- <rejection class="QResizeEvent" field-name="olds"/>
-
- <rejection class="QContextMenuEvent" field-name="p"/>
- <rejection class="QContextMenuEvent" field-name="gp"/>
- <rejection class="QContextMenuEvent" field-name="reas"/>
-
- <rejection class="QDropEvent" field-name="p"/>
- <rejection class="QDropEvent" field-name="mouseState"/>
- <rejection class="QDropEvent" field-name="modState"/>
- <rejection class="QDropEvent" field-name="act"/>
- <rejection class="QDropEvent" field-name="drop_action"/>
- <rejection class="QDropEvent" field-name="default_action"/>
- <rejection class="QDropEvent" field-name="mdata"/>
- <rejection class="QDropEvent" field-name="fmts"/>
-
- <rejection class="QDragMoveEvent" field-name="rect"/>
-
- <rejection class="QShortcutEvent" field-name="sequence"/>
- <rejection class="QShortcutEvent" field-name="ambig"/>
- <rejection class="QShortcutEvent" field-name="sid"/>
-
- <rejection class="QTouchEvent" field-name="_device"/>
- <rejection class="QTouchEvent" field-name="_widget"/>
- <rejection class="QTouchEvent" field-name="_window"/>
- <rejection class="QTouchEvent" field-name="_deviceType"/>
- <rejection class="QTouchEvent" field-name="_touchPointStates"/>
- <rejection class="QTouchEvent" field-name="_touchPoints"/>
+ <rejection class="^Q.*Event$" field-name="^m_.*$"/>
+ <rejection class="QEventPoint" field-name="^m_.*$"/>
<rejection class="QAbstractTextDocumentLayout::PaintContext" field-name="selections"/>
<rejection class="QBrush" function-name="cleanUp"/>
@@ -218,6 +143,11 @@
</conversion-rule>
</primitive-type>
+ <object-type name="QAbstractFileIconProvider" since="6.0">
+ <enum-type name="IconType"/>
+ <enum-type name="Option" flags="Options"/>
+ </object-type>
+
<value-type name="QAccessible">
<value-type name="State"/>
<enum-type name="Event"/>
@@ -247,6 +177,40 @@
<object-type name="QAccessibleTextUpdateEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QAccessible::TextUpdated"/>
<object-type name="QAccessibleValueChangeEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QAccessible::ValueChanged"/>
+ <object-type name="QAction">
+ <enum-type name="ActionEvent"/>
+ <enum-type name="MenuRole"/>
+ <enum-type name="Priority" since="4.6"/>
+ <modify-function signature="setMenu(QMenu*)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="triggered(bool)" allow-thread="yes"/>
+ </object-type>
+ <object-type name="QActionGroup">
+ <enum-type name="ExclusionPolicy" since="5.14"/>
+ <modify-function signature="addAction(QAction*)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="removeAction(QAction*)">
+ <modify-argument index="1">
+ <parent index="this" action="remove"/>
+ </modify-argument>
+ </modify-function>
+ </object-type>
+ <object-type name="QShortcut">
+ <add-function signature="QShortcut(QKeySequence&amp;,QObject*,PyCallable*,Qt::ShortcutContext)">
+ <modify-argument index="4">
+ <replace-default-expression with="Qt::WindowShortcut"/>
+ </modify-argument>
+ <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qshortcut-1"/>
+ <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qshortcut-2"/>
+ </add-function>
+ </object-type>
+
<value-type name="QTransform">
<enum-type name="TransformationType"/>
<add-function signature="__repr__" return-type="PyObject*">
@@ -372,6 +336,7 @@
<object-type name="QInputMethod">
<enum-type name="Action"/>
</object-type>
+ <value-type name="QKeyCombination"/>
<value-type name="QKeySequence">
<enum-type name="SequenceFormat"/>
<enum-type name="SequenceMatch"/>
@@ -379,11 +344,7 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
- <replace from="%REPR_ARGS"
- to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/>
- </insert-template>
+ <insert-template name="qkeysequence_repr"/>
</inject-code>
</add-function>
@@ -405,10 +366,10 @@
<modify-function signature="operator QVariant()const" remove="all"/>
</value-type>
<value-type name="QPicture" >
- <modify-function signature="load(QIODevice*,const char*)" allow-thread="yes"/>
- <modify-function signature="load(const QString&amp;,const char*)" allow-thread="yes"/>
- <modify-function signature="save(QIODevice*,const char*)" allow-thread="yes"/>
- <modify-function signature="save(const QString&amp;,const char*)" allow-thread="yes"/>
+ <modify-function signature="load(QIODevice*)" allow-thread="yes"/>
+ <modify-function signature="load(const QString&amp;)" allow-thread="yes"/>
+ <modify-function signature="save(QIODevice*)" allow-thread="yes"/>
+ <modify-function signature="save(const QString&amp;)" allow-thread="yes"/>
<!-- See bug 759 -->
<modify-function signature="data()const">
<modify-argument index="return">
@@ -501,9 +462,12 @@
</value-type>
<value-type name="QPolygon">
<extra-includes>
- <include file-name="QMatrix" location="global"/>
<include file-name="QTransform" location="global"/>
</extra-includes>
+ <!-- Expose operator==, != inherited from QList, which the parser does
+ not see due to the TMP expression of the return type. -->
+ <add-function signature="operator==(const QPolygon&amp;)" return-type="bool"/>
+ <add-function signature="operator!=(const QPolygon&amp;)" return-type="bool"/>
<add-function signature="__reduce__" return-type="PyObject*">
<inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qpolygon-reduce">
<insert-template name="reduce_code">
@@ -527,7 +491,6 @@
</value-type>
<value-type name="QPolygonF">
<extra-includes>
- <include file-name="QMatrix" location="global"/>
<include file-name="QTransform" location="global"/>
</extra-includes>
<!-- ### A QVector parameter, for no defined type, will generate wrong code. -->
@@ -655,70 +618,6 @@
</modify-function>
</value-type>
- <!-- Qt5: this _should_ be obsolete, but QImage is still using it... -->
- <value-type name="QMatrix">
- <extra-includes>
- <include file-name="QPainterPath" location="global"/>
- </extra-includes>
- <add-function signature="__repr__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- <insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%f, %f, %f, %f, %f, %f"/>
- <replace from="%REPR_ARGS"
- to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/>
- </insert-template>
- </inject-code>
- </add-function>
-
- <add-function signature="__reduce__" return-type="PyObject*">
- <inject-code class="target" position="beginning">
- <insert-template name="reduce_code">
- <replace from="%REDUCE_FORMAT" to="dddddd"/>
- <replace from="%REDUCE_ARGS" to="%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()"/>
- </insert-template>
- </inject-code>
- </add-function>
- <modify-function signature="map(int,int,int*,int*)const">
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <modify-argument index="4">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="qmatrix_map"/>
- </inject-code>
- </modify-function>
- <modify-function signature="map(qreal,qreal,qreal*,qreal*)const">
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <modify-argument index="4">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="qmatrix_map"/>
- </inject-code>
- </modify-function>
- <modify-function signature="map(const QPoint&amp;)const">
- <modify-argument index="return">
- <replace-type modified-type="QPoint"/>
- </modify-argument>
- <inject-code file="../glue/qtgui.cpp" snippet="qmatrix-map-point" />
- </modify-function>
- <modify-function signature="inverted(bool*)const">
- <modify-argument index="1">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PyTuple"/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_bool*"/>
- </inject-code>
- </modify-function>
- </value-type>
-
<value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient"/>
<value-type name="QFontInfo"/>
<value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient"/>
@@ -756,7 +655,6 @@
<enum-type name="InvertMode"/>
<extra-includes>
<include file-name="QStringList" location="global"/>
- <include file-name="QMatrix" location="global"/>
</extra-includes>
<modify-function signature="load(const QString&amp;, const char*)" allow-thread="yes"/>
@@ -764,7 +662,7 @@
<modify-function signature="save(const QString&amp;,const char*,int)const" allow-thread="yes"/>
<modify-function signature="save(QIODevice*,const char*,int)const" allow-thread="yes"/>
- <modify-function signature="QImage(uchar*,int,int,int,QImage::Format,QImageCleanupFunction,void*)">
+ <modify-function signature="QImage(uchar*,int,int,qsizetype,QImage::Format,QImageCleanupFunction,void*)">
<modify-argument index="1">
<replace-type modified-type="PyBuffer"/>
</modify-argument>
@@ -801,7 +699,7 @@
</add-function>
<!-- The non-const versions are already used -->
- <modify-function signature="QImage(const uchar*,int,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
+ <modify-function signature="QImage(const uchar*,int,int,qsizetype,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
<modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all"/>
<!-- ### -->
@@ -909,7 +807,7 @@
<inject-code class="target" position="beginning" file="../glue/qtgui.cpp" snippet="qcolor"/>
</add-function>
<!-- get* methods. Inject code -->
- <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
+ <modify-function signature="getCmyk(int*,int*,int*,int*,int*)const">
<modify-argument index="0">
<replace-type modified-type="PyObject*"/>
</modify-argument>
@@ -936,7 +834,7 @@
</insert-template>
</inject-code>
</modify-function>
- <modify-function signature="getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)">
+ <modify-function signature="getCmykF(float*,float*,float*,float*,float*)const">
<modify-argument index="0">
<replace-type modified-type="PyObject*"/>
</modify-argument>
@@ -959,7 +857,7 @@
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal"/>
+ <replace from="$TYPE" to="float"/>
</insert-template>
</inject-code>
</modify-function>
@@ -986,7 +884,7 @@
</insert-template>
</inject-code>
</modify-function>
- <modify-function signature="getHslF(qreal*,qreal*,qreal*,qreal*)const" since="4.6">
+ <modify-function signature="getHslF(float*,float*,float*,float*)const" since="4.6">
<modify-argument index="0">
<replace-type modified-type="PyObject*"/>
</modify-argument>
@@ -1005,7 +903,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal"/>
+ <replace from="$TYPE" to="float"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1032,7 +930,7 @@
</insert-template>
</inject-code>
</modify-function>
- <modify-function signature="getHsvF(qreal*,qreal*,qreal*,qreal*)const">
+ <modify-function signature="getHsvF(float*,float*,float*,float*)const">
<modify-argument index="0">
<replace-type modified-type="PyObject*"/>
</modify-argument>
@@ -1051,7 +949,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal"/>
+ <replace from="$TYPE" to="float"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1078,7 +976,7 @@
</insert-template>
</inject-code>
</modify-function>
- <modify-function signature="getRgbF(qreal*,qreal*,qreal*,qreal*)const">
+ <modify-function signature="getRgbF(float*,float*,float*,float*)const">
<modify-argument index="0">
<replace-type modified-type="PyObject*"/>
</modify-argument>
@@ -1097,7 +995,7 @@
</modify-argument>
<inject-code class="target" position="beginning">
<insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="qreal"/>
+ <replace from="$TYPE" to="float"/>
</insert-template>
</inject-code>
</modify-function>
@@ -1131,7 +1029,7 @@
</inject-code>
</modify-function>
- <modify-function signature="width(QChar)const" rename="widthChar">
+ <modify-function signature="horizontalAdvance(QChar)const" rename="horizontalAdvanceChar">
<modify-argument index="1">
<replace-type modified-type="char"/>
</modify-argument>
@@ -1167,7 +1065,7 @@
</inject-code>
</modify-function>
- <modify-function signature="width(QChar)const" rename="widthChar">
+ <modify-function signature="horizontalAdvance(QChar)const" rename="horizontalAdvanceChar">
<modify-argument index="1">
<replace-type modified-type="char"/>
</modify-argument>
@@ -1212,7 +1110,6 @@
<enum-type name="PaintDeviceMetric"/>
</object-type>
<object-type name="QPagedPaintDevice">
- <value-type name="Margins"/>
<enum-type name="PageSize"/>
<enum-type name="PdfVersion" since="5.10"/>
</object-type>
@@ -1243,7 +1140,7 @@
<enum-type name="Notation"/>
</object-type>
<object-type name="QIconEngine">
- <object-type name="AvailableSizesArgument"/>
+ <object-type name="ScaledPixmapArgument"/>
<enum-type name="IconEngineHook"/>
<modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
<modify-argument index="1" invalidate-after-use="yes"/>
@@ -1269,23 +1166,16 @@
<object-type name="QIntValidator"/>
<object-type name="QPainterPathStroker" copyable="false"/>
- <object-type name="QPictureIO">
- <modify-function signature="setIODevice(QIODevice*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="read()" allow-thread="yes"/>
- <modify-function signature="write()" allow-thread="yes"/>
- </object-type>
<object-type name="QPixmapCache">
<value-type name="Key"/>
<add-function signature="find(QPixmapCache::Key&amp;)">
<inject-code file="../glue/qtgui.cpp" snippet="qpixmapcache-find"/>
</add-function>
+ <add-function signature="find(const QString&amp;)">
+ <inject-code file="../glue/qtgui.cpp" snippet="qpixmapcache-find"/>
+ </add-function>
</object-type>
- <object-type name="QRegExpValidator"/>
<object-type name="QRegularExpressionValidator"/>
<object-type name="QStandardItem">
@@ -1388,10 +1278,7 @@
<object-type name="QTextItem">
<enum-type name="RenderFlag" flags="RenderFlags"/>
</object-type>
- <object-type name="QTextList" >
- <!--### Obsolete in 4.3-->
- <modify-function signature="isEmpty()const" remove="all"/>
- </object-type>
+ <object-type name="QTextList"/>
<object-type name="QTextObject"/>
<object-type name="QTextObjectInterface" >
<modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
@@ -1429,6 +1316,9 @@
<enum-type name="Reason"/>
</object-type>
+ <value-type name="QEventPoint" since="6.0">
+ <enum-type name="State"/>
+ </value-type>
<object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
<object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
<object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove"/>
@@ -1464,11 +1354,9 @@
<object-type name="QShortcutEvent" copyable = "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
</object-type>
<object-type name="QShowEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
+ <object-type name="QSinglePointEvent" copyable="false" since="6.0"/>
<object-type name="QStatusTipEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
- <object-type name="QTabletEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease">
- <enum-type name="PointerType"/>
- <enum-type name="TabletDevice"/>
- </object-type>
+ <object-type name="QTabletEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
<object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
<object-type name="QWhatsThisClickedEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
<object-type name="QWheelEvent" copyable= "false" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
@@ -1487,6 +1375,7 @@
<object-type name="QScrollEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::Scroll">
<enum-type name="ScrollState"/>
</object-type>
+ <object-type name="QPointerEvent" copyable= "false" since="6.0"/>
<object-type name="QScrollPrepareEvent" copyable="false" polymorphic-id-expression="%1-&gt;type() == QEvent::ScrollPrepare"/>
<object-type name="QTextFrame" >
@@ -1907,14 +1796,6 @@
<insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
- <modify-function signature="drawRoundRect(int,int,int,int,int,int)">
- <modify-argument index="5">
- <rename to="xRound"/>
- </modify-argument>
- <modify-argument index="6">
- <rename to="yRound"/>
- </modify-argument>
- </modify-function>
<modify-function signature="drawTiledPixmap(const QRect&amp;,const QPixmap&amp;,const QPoint&amp;)">
<modify-argument index="3">
<rename to="pos"/>
@@ -1930,16 +1811,6 @@
<no-null-pointer/>
</modify-argument>
</modify-function>
- <modify-function signature="setRedirected(const QPaintDevice*,QPaintDevice*,const QPoint&amp;)">
- <modify-argument index="1">
- <no-null-pointer/>
- </modify-argument>
- </modify-function>
- <modify-function signature="restoreRedirected(const QPaintDevice*)">
- <modify-argument index="1">
- <no-null-pointer/>
- </modify-argument>
- </modify-function>
<modify-function signature="drawText(QRectF,int,QString,QRectF*)">
<modify-argument index="4">
<remove-argument/>
@@ -2273,6 +2144,7 @@
</value-type>
<value-type name="QMatrix4x4" since="4.6">
+ <enum-type name="Flag" flags="Flags" since="6.0"/>
<!-- Qt5: HAIRY TRICK ALERT ahead!
Qt5 partially replaced 'qreal' by float.
@@ -2390,15 +2262,11 @@
<modify-function signature="getEulerAngles(float*,float*,float*)const" since="5.5" remove="all"/>
</value-type>
- <object-type name="QTouchEvent" since="4.6">
- <value-type name="TouchPoint" since="4.6">
- <enum-type name="InfoFlag" flags="InfoFlags"/>
- </value-type>
- </object-type>
+ <object-type name="QTouchEvent" since="4.6"/>
- <object-type name="QTouchDevice">
- <enum-type name="CapabilityFlag" flags="Capabilities"/>
- <enum-type name="DeviceType"/>
+ <object-type name="QInputDevice">
+ <enum-type name="Capability" flags="Capabilities"/>
+ <enum-type name="DeviceType" flags="DeviceTypes"/>
</object-type>
<value-type name="QVector2D" since="4.6">
@@ -2542,7 +2410,7 @@
<enum-type name="Visibility"/>
<modify-function signature="raise()" rename="raise_"/>
<!-- see QWidget::nativeEvent(), QAbstractNativeEventFilter::nativeEventFilter() -->
- <modify-function signature="nativeEvent(const QByteArray &amp;,void*,long*)">
+ <modify-function signature="nativeEvent(const QByteArray &amp;,void*,qintptr*)">
<modify-argument index="3">
<remove-argument/>
<conversion-rule class="native">
@@ -2593,29 +2461,10 @@
</object-type>
- <object-type name="QOpenGLBuffer" since="5.0">
- <enum-type name="Access"/>
- <enum-type name="RangeAccessFlag" flags="RangeAccessFlags"/>
- <enum-type name="Type"/>
- <enum-type name="UsagePattern"/>
- </object-type>
<object-type name="QOpenGLContext">
<enum-type name="OpenGLModuleType"/>
</object-type>
<object-type name="QOpenGLContextGroup" since="5.0"/>
- <object-type name="QOpenGLDebugLogger" since="5.1">
- <enum-type name="LoggingMode"/>
- </object-type>
- <value-type name="QOpenGLDebugMessage" since="5.1">
- <enum-type name="Source" flags="Sources"/>
- <enum-type name="Type" flags="Types"/>
- <enum-type name="Severity" flags="Severities"/>
- </value-type>
- <object-type name="QOpenGLFramebufferObject" since="5.0">
- <enum-type name="Attachment"/>
- <enum-type name="FramebufferRestorePolicy" since="5.7"/>
- </object-type>
- <value-type name="QOpenGLFramebufferObjectFormat"/>
<!-- Compile error on Windows: QOpenGLPaintDevice::QOpenGLPaintDevice(const QOpenGLPaintDevice &)': attempting to reference a deleted function
<object-type name="QOpenGLPaintDevice" since="5.0"/>
-->
@@ -2902,7 +2751,6 @@
<modify-argument index="2"><array/></modify-argument>
</modify-function>
</object-type>
- <object-type name="QAbstractOpenGLFunctions" since="5.1"/>
<!-- Classes are result of a macro expansion in src/gui/opengl/qopenglversionfunctions.h
<object-type name="QOpenGLFunctions_1_0" since="5.1"/>
<object-type name="QOpenGLFunctions_1_1" since="5.1"/>
@@ -2932,98 +2780,6 @@
<object-type name="QOpenGLFunctions_4_5_Core" since="5.5"/>
<object-type name="QOpenGLFunctions_ES2" since="5.1"/>
-->
- <value-type name="QOpenGLPixelTransferOptions"/>
- <object-type name="QOpenGLShader" since="5.0">
- <enum-type name="ShaderTypeBit" flags="ShaderType"/>
- </object-type>
- <object-type name="QOpenGLShaderProgram" since="5.0">
- <modify-function signature="setAttributeArray(int,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setAttributeArray(const char*,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setAttributeArray(int,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setAttributeValue(int,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setAttributeValue(const char*,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setUniformValueArray(int,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setUniformValueArray(int,const int*,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setUniformValueArray(int,const unsigned int*,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setUniformValueArray(const char*,const float*,int,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setUniformValueArray(const char*,const int*,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <modify-function signature="setUniformValueArray(const char*,const unsigned int*,int)">
- <modify-argument index="2"><array/></modify-argument>
- </modify-function>
- <!-- Add explicit signatures for the setUniformValue functions -->
- <modify-function signature="^setUniformValue\(const char\*,(float|int|uint)\)$" remove="all"/>
- <!-- No need for a signature for GLuint, since Qt (internally) calls the same function: glUniform1i -->
- <add-function signature="setUniformValue1f(const char*, float)" return-type="void">
- <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/>
- </add-function>
- <add-function signature="setUniformValue1i(const char*, int)" return-type="void">
- <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_int"/>
- </add-function>
- <add-function signature="setUniformValue1f(int, float)" return-type="void">
- <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/>
- </add-function>
- <add-function signature="setUniformValue1i(int, int)" return-type="void">
- <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_int"/>
- </add-function>
- </object-type>
- <object-type name="QOpenGLTexture" since="5.2">
- <enum-type name="BindingTarget"/>
- <enum-type name="CoordinateDirection"/>
- <enum-type name="ComparisonFunction"/>
- <enum-type name="ComparisonMode"/>
- <enum-type name="CubeMapFace"/>
- <enum-type name="DepthStencilMode"/>
- <enum-type name="Feature" flags="Features"/>
- <enum-type name="Filter"/>
- <enum-type name="MipMapGeneration"/>
- <enum-type name="PixelFormat"/>
- <enum-type name="PixelType"/>
- <enum-type name="SwizzleComponent"/>
- <enum-type name="SwizzleValue"/>
- <enum-type name="Target"/>
- <enum-type name="TextureFormat"/>
- <enum-type name="TextureFormatClass"/>
- <enum-type name="TextureUnitReset"/>
- <enum-type name="WrapMode"/>
- <modify-function signature="borderColor(unsigned int*)const" remove="all"/>
- <modify-function signature="borderColor(int*)const" remove="all"/>
- <modify-function signature="borderColor(float*)const" remove="all"/>
- <!-- Work around link error introduced by qtbase/d15b02ff291e3124d9bb8ac3b06b704c292f52ab, can be removed once
- qtbase/1bfabe35d8178c93e66acef21c01e08980f9ed0d has landed -->
- <modify-function signature="setData(int,int,int,int,int,int,int,QOpenGLTexture::PixelFormat,QOpenGLTexture::PixelType,const void*,QOpenGLPixelTransferOptions*const)" remove="all"/>
- </object-type>
- <object-type name="QOpenGLTextureBlitter">
- <enum-type name="Origin"/>
- </object-type>
- <object-type name="QOpenGLTimeMonitor" since="5.1"/>
- <object-type name="QOpenGLTimerQuery" since="5.1"/>
- <object-type name="QOpenGLWindow" since="5.4">
- <enum-type name="UpdateBehavior"/>
- </object-type>
- <value-type name="QOpenGLVersionProfile" since="5.1"/>
- <object-type name="QOpenGLVertexArrayObject">
- <object-type name="Binder"/>
- </object-type>
<value-type name="QPageLayout">
<enum-type name="Mode"/>
<enum-type name="Orientation"/>
@@ -3045,6 +2801,10 @@
<enum-type name="YUVLayout"/>
</value-type>
<object-type name="QPdfWriter"/>
+ <object-type name="QPointingDevice" since="6.0">
+ <enum-type name="PointerType" flags="PointerTypes"/>
+ <enum-type name="GrabTransition"/>
+ </object-type>
<value-type name="QPointingDeviceUniqueId"/>
<value-type name="QRawFont">
<enum-type name="AntialiasingType"/>
@@ -3066,4 +2826,38 @@
</object-type>
<object-type name="QStyleHints"/>
+ <object-type name="QUndoCommand">
+ <modify-function signature="mergeWith(const QUndoCommand*)">
+ <modify-argument index="1" invalidate-after-use="yes"/>
+ </modify-function>
+ </object-type>
+ <object-type name="QUndoGroup">
+ <modify-function signature="addStack(QUndoStack*)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="removeStack(QUndoStack*)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ </object-type>
+ <object-type name="QUndoStack">
+ <modify-function signature="createUndoAction(QObject*,const QString&amp;)const">
+ <modify-argument index="return">
+ <parent index="1" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="createRedoAction(QObject*,const QString&amp;)const">
+ <modify-argument index="return">
+ <parent index="1" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="push(QUndoCommand*)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ </object-type>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt
index 9557c4a26..0f56db57c 100644
--- a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt
@@ -23,8 +23,6 @@ ${QtNetwork_GEN_DIR}/qlocalsocket_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkaccessmanager_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkaddressentry_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkcachemetadata_wrapper.cpp
-${QtNetwork_GEN_DIR}/qnetworkconfiguration_wrapper.cpp
-${QtNetwork_GEN_DIR}/qnetworkconfigurationmanager_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkcookie_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkcookiejar_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkdatagram_wrapper.cpp
@@ -35,7 +33,6 @@ ${QtNetwork_GEN_DIR}/qnetworkproxyfactory_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkproxyquery_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkreply_wrapper.cpp
${QtNetwork_GEN_DIR}/qnetworkrequest_wrapper.cpp
-${QtNetwork_GEN_DIR}/qnetworksession_wrapper.cpp
${QtNetwork_GEN_DIR}/qpassworddigestor_wrapper.cpp
${QtNetwork_GEN_DIR}/qssl_wrapper.cpp
${QtNetwork_GEN_DIR}/qsslcertificate_wrapper.cpp
@@ -47,17 +44,10 @@ ${QtNetwork_GEN_DIR}/qudpsocket_wrapper.cpp
${QtNetwork_GEN_DIR}/qtnetwork_module_wrapper.cpp
)
-get_property(QtNetwork_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Network
- PROPERTY QT_ENABLED_PUBLIC_FEATURES)
get_property(QtNetwork_disabled_features TARGET Qt${QT_MAJOR_VERSION}::Network
PROPERTY QT_DISABLED_PUBLIC_FEATURES)
-# ### fixme: For cmake >= 3.3, use if( needle IN_LIST list)
-list(FIND QtNetwork_enabled_features "ssl" _sslEnabledIndex)
-list(FIND QtNetwork_disabled_features "dtls" _dtlsDisabledIndex)
-list(FIND QtNetwork_disabled_features "sctp" _sctpDisabledIndex)
-
-if(_sslEnabledIndex EQUAL -1)
+if("ssl" IN_LIST QtNetwork_disabled_features)
list(APPEND QtNetwork_DROPPED_ENTRIES QOcspResponse QSslCipher
QSslConfiguration QSslDiffieHellmanParameters QSslError
QSslKey QSslPreSharedKeyAuthenticator QSslSocket)
@@ -72,16 +62,12 @@ else()
${QtNetwork_GEN_DIR}/qsslerror_wrapper.cpp
${QtNetwork_GEN_DIR}/qsslkey_wrapper.cpp
${QtNetwork_GEN_DIR}/qsslpresharedkeyauthenticator_wrapper.cpp
- ${QtNetwork_GEN_DIR}/qsslsocket_wrapper.cpp)
- if (Qt${QT_MAJOR_VERSION}Network_VERSION VERSION_EQUAL 5.13.0
- OR Qt${QT_MAJOR_VERSION}Network_VERSION VERSION_GREATER 5.13.0)
- list(APPEND QtNetwork_SRC
- ${QtNetwork_GEN_DIR}/qocspresponse_wrapper.cpp)
- endif()
+ ${QtNetwork_GEN_DIR}/qsslsocket_wrapper.cpp
+ ${QtNetwork_GEN_DIR}/qocspresponse_wrapper.cpp)
message(STATUS "Qt${QT_MAJOR_VERSION}Network: Adding SSL classes")
endif()
-if(_dtlsDisabledIndex GREATER -1)
+if("dtls" IN_LIST QtNetwork_disabled_features)
list(APPEND QtNetwork_DROPPED_ENTRIES QDtls)
message(STATUS "Qt${QT_MAJOR_VERSION}Network: Dropping DTLS classes")
else()
@@ -90,7 +76,7 @@ else()
message(STATUS "Qt${QT_MAJOR_VERSION}Network: Adding DTLS classes")
endif()
-if(_sctpDisabledIndex GREATER -1)
+if("sctp" IN_LIST QtNetwork_disabled_features)
list(APPEND QtNetwork_DROPPED_ENTRIES QSctpServer QSctpSocket)
message(STATUS "Qt${QT_MAJOR_VERSION}Network: Dropping SCTP classes")
else()
diff --git a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml
index dc60a509d..fab2d01bb 100644
--- a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml
+++ b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml
@@ -42,6 +42,8 @@
<typesystem package="PySide2.QtNetwork">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
+ <rejection class="dtlsopenssl"/>
+
<enum-type name="QDtlsError" since="5.12"/>
<enum-type name="QOcspCertificateStatus" since="5.13"/>
<enum-type name="QOcspRevocationReason" since="5.13"/>
@@ -53,6 +55,8 @@
</namespace-type>
<namespace-type name="QSsl">
+ <enum-type name="AlertLevel" since="6.0"/>
+ <enum-type name="AlertType" since="6.0"/>
<enum-type name="AlternativeNameEntryType"/>
<enum-type name="EncodingFormat"/>
<enum-type name="KeyAlgorithm"/>
@@ -75,8 +79,8 @@
<enum-type name="SocketOption" since="4.6"/>
<enum-type name="SocketState"/>
<enum-type name="SocketType"/>
- <modify-function signature="connectToHost(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes"/>
- <modify-function signature="connectToHost(const QHostAddress&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>)" allow-thread="yes"/>
+ <modify-function signature="connectToHost(const QString&amp;,quint16,QFlags&lt;QIODeviceBase::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes"/>
+ <modify-function signature="connectToHost(const QHostAddress&amp;,quint16,QFlags&lt;QIODeviceBase::OpenModeFlag>)" allow-thread="yes"/>
<modify-function signature="disconnectFromHost()" allow-thread="yes"/>
<modify-function signature="waitForConnected(int)" allow-thread="yes"/>
<modify-function signature="waitForDisconnected(int)" allow-thread="yes"/>
@@ -172,7 +176,6 @@
<enum-type name="LocalSocketState"/>
</object-type>
<object-type name="QNetworkAccessManager">
- <enum-type name="NetworkAccessibility" since="4.7"/>
<enum-type name="Operation"/>
<modify-function signature="createRequest(QNetworkAccessManager::Operation,const QNetworkRequest&amp;,QIODevice*)">
<modify-argument index="3" invalidate-after-use="yes"/>
@@ -202,10 +205,8 @@
<enum-type name="ConversionModeFlag" flags="ConversionMode" since="5.8"/>
<enum-type name="SpecialAddress"/>
<!-- ### QHostAddress(QIPv6Address) does this -->
- <modify-function signature="QHostAddress(quint8*)" remove="all"/>
<modify-function signature="QHostAddress(const quint8*)" remove="all"/>
<!-- ### -->
- <modify-function signature="setAddress(quint8*)" remove="all"/>
<modify-function signature="setAddress(const quint8*)" remove="all"/>
</value-type>
@@ -262,21 +263,6 @@
<enum-type name="TransferTimeoutConstant" since="5.15"/>
</value-type>
- <value-type name="QNetworkConfiguration" since="4.7">
- <enum-type name="BearerType"/>
- <enum-type name="Purpose" since="4.7"/>
- <enum-type name="StateFlag" flags="StateFlags" since="4.7"/>
- <enum-type name="Type" since="4.7"/>
- </value-type>
- <object-type name="QNetworkConfigurationManager" since="4.7">
- <enum-type name="Capability" flags="Capabilities" since="4.7"/>
- </object-type>
- <object-type name="QNetworkSession" since="4.7">
- <enum-type name="SessionError" since="4.7"/>
- <enum-type name="State" since="4.7"/>
- <enum-type name="UsagePolicy" flags="UsagePolicies"/>
- </object-type>
-
<object-type name="QAbstractNetworkCache"/>
<object-type name="QNetworkDiskCache"/>
<value-type name="QNetworkCacheMetaData"/>
@@ -314,7 +300,7 @@
<object-type name="QSslSocket">
<enum-type name="SslMode"/>
<enum-type name="PeerVerifyMode"/>
- <modify-function signature="connectToHostEncrypted(const QString&amp;,quint16,QFlags&lt;QIODevice::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes"/>
+ <modify-function signature="connectToHostEncrypted(const QString&amp;,quint16,QFlags&lt;QIODeviceBase::OpenModeFlag>,QAbstractSocket::NetworkLayerProtocol)" allow-thread="yes"/>
<modify-function signature="waitForEncrypted(int)" allow-thread="yes"/>
</object-type>
diff --git a/sources/pyside2/PySide2/QtOpenGL/CMakeLists.txt b/sources/pyside2/PySide2/QtOpenGL/CMakeLists.txt
index 1d2c406fc..79df5af4a 100644
--- a/sources/pyside2/PySide2/QtOpenGL/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtOpenGL/CMakeLists.txt
@@ -1,42 +1,59 @@
project(QtOpenGL)
+set(QtOpenGL_DROPPED_ENTRIES)
+
set(QtOpenGL_SRC
-${QtOpenGL_GEN_DIR}/qgl_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglbuffer_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglcolormap_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglcontext_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglformat_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglframebufferobject_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglframebufferobjectformat_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglpixelbuffer_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglshader_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglshaderprogram_wrapper.cpp
-${QtOpenGL_GEN_DIR}/qglwidget_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qabstractopenglfunctions_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopengldebuglogger_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopengldebugmessage_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglframebufferobjectformat_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglpixeltransferoptions_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglshaderprogram_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopengltexture_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopengltextureblitter_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglversionprofile_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglvertexarrayobject_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglvertexarrayobject_binder_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglwindow_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglbuffer_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglshader_wrapper.cpp
+${QtOpenGL_GEN_DIR}/qopenglframebufferobject_wrapper.cpp
# module is always needed
${QtOpenGL_GEN_DIR}/qtopengl_module_wrapper.cpp
)
+get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui
+ PROPERTY QT_ENABLED_PUBLIC_FEATURES)
+
+if("opengles2" IN_LIST QtGui_enabled_features)
+ list(APPEND QtOpenGL_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery)
+ message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Dropping Desktop OpenGL classes (GLES2)")
+else()
+ list(APPEND QtOpenGL_SRC
+ ${QtOpenGL_GEN_DIR}/qopengltimemonitor_wrapper.cpp
+ ${QtOpenGL_GEN_DIR}/qopengltimerquery_wrapper.cpp)
+ message(STATUS "Qt${QT_MAJOR_VERSION}OpenGL: Adding Desktop OpenGL classes")
+endif()
+
set(QtOpenGL_include_dirs ${QtOpenGL_SOURCE_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}OpenGL_INCLUDE_DIRS}
${libpyside_SOURCE_DIR}
- ${QtWidgets_GEN_DIR}
- ${QtGui_GEN_DIR}
${QtCore_GEN_DIR}
+ ${QtGui_GEN_DIR}
${QtOpenGL_GEN_DIR}
)
set(QtOpenGL_libraries pyside2
${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
${Qt${QT_MAJOR_VERSION}OpenGL_LIBRARIES})
-set(QtOpenGL_deps QtWidgets)
+set(QtOpenGL_deps QtGui)
create_pyside_module(NAME QtOpenGL
INCLUDE_DIRS QtOpenGL_include_dirs
LIBRARIES QtOpenGL_libraries
DEPS QtOpenGL_deps
TYPESYSTEM_PATH QtOpenGL_SOURCE_DIR
- SOURCES QtOpenGL_SRC)
+ SOURCES QtOpenGL_SRC
+ DROPPED_ENTRIES QtOpenGL_DROPPED_ENTRIES)
diff --git a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml
index 5e864ca43..c04929cc4 100644
--- a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml
+++ b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml
@@ -2,7 +2,7 @@
<!--
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
@@ -40,677 +40,134 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtOpenGL">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no" />
<load-typesystem name="templates/opengl_common.xml" generate="no" />
- <primitive-type name="GLbitfield"/>
- <primitive-type name="GLboolean"/>
- <primitive-type name="GLbyte"/>
- <primitive-type name="GLclampd"/>
- <primitive-type name="GLclampf"/>
- <primitive-type name="GLdouble"/>
- <primitive-type name="GLenum"/>
- <primitive-type name="GLfloat"/>
- <primitive-type name="GLint"/>
- <primitive-type name="GLshort"/>
- <primitive-type name="GLsizei"/>
- <primitive-type name="GLubyte"/>
- <primitive-type name="GLuint"/>
- <primitive-type name="GLushort"/>
-
- <rejection class="QGLColormap::QGLColormapData"/>
- <rejection class="QGLContext" field-name="currentCtx"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLboolean ?\*$"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLchar ?\*$"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLchar ?\*const"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLenum ?\*$"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLfloat ?\*$"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLfloat ?\[.*$"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLdouble ?\*$"/>
- <rejection class="^QGL.*$" argument-type="GLintptr"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLint64 ?\*$"/>
- <rejection class="^QGL.*$" argument-type="^(const )?GLsizei ?\*$"/>
-
- <namespace-type name="QGL">
- <enum-type name="FormatOption" flags="FormatOptions"/>
- <extra-includes>
- <include file-name="qgl.h" location="global"/>
- </extra-includes>
- </namespace-type>
-
- <value-type name="QGLColormap">
- <modify-function signature="setEntries(int,const unsigned int*,int)">
- <access modifier="private"/>
- </modify-function>
- </value-type>
-
- <value-type name="QGLFormat">
- <enum-type name="OpenGLContextProfile" since="4.7"/>
- <enum-type name="OpenGLVersionFlag" flags="OpenGLVersionFlags"/>
- </value-type>
-
- <rejection class="QGLContext" field-name="currentCtx"/>
- <object-type name="QGLContext">
- <enum-type name="BindOption" flags="BindOptions" since="4.6"/>
- <modify-function signature="chooseContext(const QGLContext*)">
- <modify-argument index="1" invalidate-after-use="yes"/>
- </modify-function>
- <modify-function signature="create(const QGLContext*)">
- <modify-argument index="1" invalidate-after-use="yes"/>
- </modify-function>
-
- <!-- ### Obsolete functions and ctors -->
- <modify-function signature="QGLContext(const QGLFormat&amp;,QPaintDevice*)" remove="all"/>
- <!-- ### -->
+ <rejection class="^QOpenGL.*$" argument-type="^(const )?GLboolean ?\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="^GLchar\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="^(const )?GLchar ?\*(const)?\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="^char\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="^(const )?char ?\*\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="GLintptr"/>
+ <rejection class="^QOpenGL.*$" argument-type="GLsizeiptr"/>
+ <rejection class="^QOpenGL.*$" argument-type="GLsync"/>
+ <rejection class="^QOpenGL.*$" argument-type="^GLubyte( const)?\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="^(const )?QMatrix.x. ?\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="qopengl_GLintptr"/>
+ <rejection class="^QOpenGL.*$" argument-type="qopengl_GLsizeiptr"/>
+ <rejection class="^QOpenGL.*$" argument-type="QOpenGLTextureHelper*"/>
+ <rejection class="^QOpenGL.*$" argument-type="^(const )?QVector.D ?\*$"/>
+ <rejection class="^QOpenGL.*$" argument-type="^(const )?void ?\*\*$"/>
+
+ <object-type name="QOpenGLBuffer" since="5.0">
+ <enum-type name="Access"/>
+ <enum-type name="RangeAccessFlag" flags="RangeAccessFlags"/>
+ <enum-type name="Type"/>
+ <enum-type name="UsagePattern"/>
+ </object-type>
+ <object-type name="QOpenGLDebugLogger" since="5.1">
+ <enum-type name="LoggingMode"/>
</object-type>
- <object-type name="QGLFramebufferObject">
+ <value-type name="QOpenGLDebugMessage" since="5.1">
+ <enum-type name="Source" flags="Sources"/>
+ <enum-type name="Type" flags="Types"/>
+ <enum-type name="Severity" flags="Severities"/>
+ </value-type>
+ <object-type name="QOpenGLFramebufferObject" since="5.0">
<enum-type name="Attachment"/>
+ <enum-type name="FramebufferRestorePolicy" since="5.7"/>
</object-type>
- <object-type name="QGLPixelBuffer">
- <extra-includes>
- <include file-name="QImage" location="global"/>
- </extra-includes>
+ <value-type name="QOpenGLFramebufferObjectFormat"/>
+ <object-type name="QAbstractOpenGLFunctions" since="5.1"/>
+ <value-type name="QOpenGLPixelTransferOptions"/>
+ <object-type name="QOpenGLShader" since="5.0">
+ <enum-type name="ShaderTypeBit" flags="ShaderType"/>
</object-type>
- <object-type name="QGLWidget">
- <extra-includes>
- <include file-name="QImage" location="global"/>
- <include file-name="QPixmap" location="global"/>
- </extra-includes>
- <modify-function signature="QGLWidget(QGLContext*,QWidget*,const QGLWidget*,QFlags&lt;Qt::WindowType&gt;)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- <modify-argument index="this">
- <parent index="2" action="add"/>
- </modify-argument>
- </modify-function>
- <!-- ### Not part of Qt public API -->
- <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)" remove="all"/>
- <!-- ### -->
- <!--- ### Obsolete functions -->
- <modify-function signature="setFormat(QGLFormat)" remove="all"/>
- <!-- ### -->
+ <object-type name="QOpenGLShaderProgram" since="5.0">
+ <modify-function signature="setAttributeArray(int,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setAttributeArray(const char*,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setAttributeArray(int,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setAttributeValue(int,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setAttributeValue(const char*,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setUniformValueArray(int,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setUniformValueArray(int,const int*,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setUniformValueArray(int,const unsigned int*,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setUniformValueArray(const char*,const float*,int,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setUniformValueArray(const char*,const int*,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <modify-function signature="setUniformValueArray(const char*,const unsigned int*,int)">
+ <modify-argument index="2"><array/></modify-argument>
+ </modify-function>
+ <!-- Add explicit signatures for the setUniformValue functions -->
+ <modify-function signature="^setUniformValue\(const char\*,(float|int|uint)\)$" remove="all"/>
+ <!-- No need for a signature for GLuint, since Qt (internally) calls the same function: glUniform1i -->
+ <add-function signature="setUniformValue1f(const char*, float)" return-type="void">
+ <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/>
+ </add-function>
+ <add-function signature="setUniformValue1i(const char*, int)" return-type="void">
+ <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_int"/>
+ </add-function>
+ <add-function signature="setUniformValue1f(int, float)" return-type="void">
+ <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/>
+ </add-function>
+ <add-function signature="setUniformValue1i(int, int)" return-type="void">
+ <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_int"/>
+ </add-function>
</object-type>
-
- <value-type name="QGLFramebufferObjectFormat" since="4.6"/>
- <object-type name="QGLShader" since="4.6">
- <enum-type name="ShaderTypeBit" flags="ShaderType"/>
+ <object-type name="QOpenGLTexture" since="5.2">
+ <enum-type name="BindingTarget"/>
+ <enum-type name="CoordinateDirection"/>
+ <enum-type name="ComparisonFunction"/>
+ <enum-type name="ComparisonMode"/>
+ <enum-type name="CubeMapFace"/>
+ <enum-type name="DepthStencilMode"/>
+ <enum-type name="Feature" flags="Features"/>
+ <enum-type name="Filter"/>
+ <enum-type name="MipMapGeneration"/>
+ <enum-type name="PixelFormat"/>
+ <enum-type name="PixelType"/>
+ <enum-type name="SwizzleComponent"/>
+ <enum-type name="SwizzleValue"/>
+ <enum-type name="Target"/>
+ <enum-type name="TextureFormat"/>
+ <enum-type name="TextureFormatClass"/>
+ <enum-type name="TextureUnitReset"/>
+ <enum-type name="WrapMode"/>
+ <modify-function signature="borderColor(unsigned int*)const" remove="all"/>
+ <modify-function signature="borderColor(int*)const" remove="all"/>
+ <modify-function signature="borderColor(float*)const" remove="all"/>
</object-type>
-
- <object-type name="QGLShaderProgram" since="4.6">
- <!-- setAttributeArray -->
- <modify-function signature="setAttributeArray(int,const QVector2D*,int)" rename="setAttributeArray2D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3"/>
- <replace from="$ARG1" to="%3"/>
- <replace from="$ATTR_TYPE" to="QVector2D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setAttributeArray(int,const QVector3D*,int)" rename="setAttributeArray3D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3"/>
- <replace from="$ARG1" to="%3"/>
- <replace from="$ATTR_TYPE" to="QVector3D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setAttributeArray(int,const QVector4D*,int)" rename="setAttributeArray4D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3"/>
- <replace from="$ARG1" to="%3"/>
- <replace from="$ATTR_TYPE" to="QVector4D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setAttributeArray(const char*,const QVector2D*,int)" rename="setAttributeArray2D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3"/>
- <replace from="$ARG1" to="%3"/>
- <replace from="$ATTR_TYPE" to="QVector2D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setAttributeArray(const char*,const QVector3D*,int)" rename="setAttributeArray3D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3"/>
- <replace from="$ARG1" to="%3"/>
- <replace from="$ATTR_TYPE" to="QVector3D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setAttributeArray(const char*,const QVector4D*,int)" rename="setAttributeArray4D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="%3"/>
- <replace from="$ARG1" to="%3"/>
- <replace from="$ATTR_TYPE" to="QVector4D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <!-- setUniformValueArray -->
- <modify-function signature="setUniformValueArray(int,const GLint*,int)" rename="setUniformValueArrayInt">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- <array/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="GLint"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const GLuint*,int)" rename="setUniformValueArrayUint">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- <array/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="GLuint"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QVector2D*,int)" rename="setUniformValueArray2D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QVector2D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QVector3D*,int)" rename="setUniformValueArray3D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QVector3D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QVector4D*,int)" rename="setUniformValueArray4D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QVector4D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix2x2*,int)" rename="setUniformValueArray2x2">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix2x2"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix2x3*,int)" rename="setUniformValueArray2x3">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix2x3"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix2x4*,int)" rename="setUniformValueArray2x4">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix2x4"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix3x2*,int)" rename="setUniformValueArray3x2">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix3x2"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix3x3*,int)" rename="setUniformValueArray3x3">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix3x3"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix3x4*,int)" rename="setUniformValueArray3x4">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix3x4"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix4x2*,int)" rename="setUniformValueArray4x2">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix4x2"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix4x3*,int)" rename="setUniformValueArray4x3">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix4x3"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(int,const QMatrix4x4*,int)" rename="setUniformValueArray4x4">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix4x4"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const GLint*,int)" rename="setUniformValueArrayInt">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- <array/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="GLint"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const GLuint*,int)" rename="setUniformValueArrayUint">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- <array/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="GLuint"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QVector2D*,int)" rename="setUniformValueArray2D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QVector2D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QVector3D*,int)" rename="setUniformValueArray3D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QVector3D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QVector4D*,int)" rename="setUniformValueArray4D">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QVector4D"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix2x2*,int)" rename="setUniformValueArray2x2">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix2x2"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix2x3*,int)" rename="setUniformValueArray2x3">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix2x3"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix2x4*,int)" rename="setUniformValueArray2x4">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix2x4"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix3x2*,int)" rename="setUniformValueArray3x2">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix3x2"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix3x3*,int)" rename="setUniformValueArray3x3">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix3x3"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix3x4*,int)" rename="setUniformValueArray3x4">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix3x4"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix4x2*,int)" rename="setUniformValueArray4x2">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix4x2"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix4x3*,int)" rename="setUniformValueArray4x3">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix4x3"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <modify-function signature="setUniformValueArray(const char*,const QMatrix4x4*,int)" rename="setUniformValueArray4x4">
- <modify-argument index="2" >
- <replace-type modified-type="PySequence"/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument />
- </modify-argument>
- <inject-code>
- <insert-template name="callArrayFunction">
- <replace from="$ARG0" to="_size"/>
- <replace from="$ARG1" to="0"/>
- <replace from="$ATTR_TYPE" to="QMatrix4x4"/>
- </insert-template>
- </inject-code>
- </modify-function>
-
- <!-- ### Use QMatrixZxY overloads -->
- <modify-function signature="setAttributeArray(int,GLenum,const void*,int,int)" remove="all" since="4.7"/>
- <modify-function signature="setAttributeArray(const char*,GLenum,const void*,int,int)" remove="all" since="4.7"/>
- <!-- ### -->
+ <object-type name="QOpenGLTextureBlitter">
+ <enum-type name="Origin"/>
</object-type>
-
- <!-- Qt 4.7 -->
- <object-type name="QGLBuffer" since="4.7">
- <enum-type name="Access" since="4.7"/>
- <enum-type name="Type" since="4.7"/>
- <enum-type name="UsagePattern" since="4.7"/>
- <modify-function signature="allocate(const void*,int)">
- <modify-argument index="1">
- <replace-type modified-type="QByteArray&amp;"/>
- </modify-argument>
- <modify-argument index="2">
- <replace-default-expression with="-1"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtopengl.cpp" snippet="qglbuffer-allocate"/>
- </modify-function>
- <modify-function signature="map(QGLBuffer::Access)">
- <inject-code file="../glue/qtopengl.cpp" snippet="qglbuffer-map"/>
- </modify-function>
- <modify-function signature="read(int,void*,int)">
- <modify-argument index="2">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="(retval, data)"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtopengl.cpp" snippet="qglbuffer-read"/>
- </modify-function>
- <modify-function signature="write(int,const void*,int)">
- <modify-argument index="2">
- <replace-type modified-type="QByteArray&amp;"/>
- </modify-argument>
- <modify-argument index="3">
- <replace-default-expression with="-1"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtopengl.cpp" snippet="qglbuffer-write"/>
- </modify-function>
+ <object-type name="QOpenGLTimeMonitor" since="5.1"/>
+ <object-type name="QOpenGLTimerQuery" since="5.1"/>
+ <object-type name="QOpenGLWindow" since="5.4">
+ <enum-type name="UpdateBehavior"/>
+ </object-type>
+ <value-type name="QOpenGLVersionProfile" since="5.1"/>
+ <object-type name="QOpenGLVertexArrayObject">
+ <object-type name="Binder"/>
</object-type>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt
index 383afb68f..7e795989f 100644
--- a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt
@@ -1,17 +1,14 @@
project(QtOpenGLFunctions)
-set(QtOpenGLFunctions_DROPPED_ENTRIES)
-
get_property(QtOpenGLFunctions_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui
PROPERTY QT_ENABLED_PUBLIC_FEATURES)
set(QtOpenGLFunctions_SRC ${QtOpenGLFunctions_GEN_DIR}/qtopenglfunctions_module_wrapper.cpp)
-# cf qtbase/src/gui/opengl/opengl.pri
-list(FIND QtOpenGLFunctions_enabled_features "opengles2" _opengles2Index)
-# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtOpenGLFunctions_enabled_features)
-if(_opengles2Index GREATER -1)
- list(APPEND QtOpenGLFunctions_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery)
+get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui
+ PROPERTY QT_ENABLED_PUBLIC_FEATURES)
+
+if("opengles2" IN_LIST QtGui_enabled_features)
list(APPEND QtOpenGLFunctions_SRC
${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_es2_wrapper.cpp)
message(STATUS "Qt${QT_MAJOR_VERSION}OpenGLFunctions: Dropping Desktop OpenGL classes (GLES2)")
@@ -49,19 +46,23 @@ endif()
configure_file("${QtOpenGLFunctions_SOURCE_DIR}/QtOpenGLFunctions_global.post.h.in"
"${QtOpenGLFunctions_BINARY_DIR}/QtOpenGLFunctions_global.post.h" @ONLY)
-set(QtOpenGLFunctions_include_dirs ${QtGOpenGLFunctions_SOURCE_DIR}
- ${QtOpenGLFunctions_BINARY_DIR}
- ${pyside2_SOURCE_DIR}
- ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtCore_GEN_DIR}
- ${QtGui_GEN_DIR}
- )
-set(QtOpenGLFunctions_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES})
+set(QtOpenGLFunctions_include_dirs ${QtOpenGLFunctions_SOURCE_DIR}
+ ${QtOpenGLFunctions_BINARY_DIR}
+ ${pyside2_SOURCE_DIR}
+ ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtGui_GEN_DIR}
+ ${QtOpenGL_GEN_DIR}
+ )
+
+set(QtOpenGLFunctions_libraries pyside2
+ ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}OpenGL_LIBRARIES})
-set(QtOpenGLFunctions_deps QtGui)
+set(QtOpenGLFunctions_deps QtGui QtOpenGL)
create_pyside_module(NAME QtOpenGLFunctions
INCLUDE_DIRS QtOpenGLFunctions_include_dirs
diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in b/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in
index 6c8c77087..c25343e05 100644
--- a/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in
+++ b/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in
@@ -29,33 +29,33 @@
#include <QtGui/qtgui-config.h>
// OpenGL functions are not in the QtGui module header
#if QT_CONFIG(opengl)
-# include <QtGui/qopenglfunctions_1_0.h>
-# include <QtGui/qopenglfunctions_1_1.h>
-# include <QtGui/qopenglfunctions_1_2.h>
-# include <QtGui/qopenglfunctions_1_3.h>
-# include <QtGui/qopenglfunctions_1_4.h>
-# include <QtGui/qopenglfunctions_1_5.h>
-# include <QtGui/qopenglfunctions_2_0.h>
-# include <QtGui/qopenglfunctions_2_1.h>
-# include <QtGui/qopenglfunctions_3_0.h>
-# include <QtGui/qopenglfunctions_3_1.h>
-# include <QtGui/qopenglfunctions_3_2_compatibility.h>
-# include <QtGui/qopenglfunctions_3_2_core.h>
-# include <QtGui/qopenglfunctions_3_3_compatibility.h>
-# include <QtGui/qopenglfunctions_3_3_core.h>
-# include <QtGui/qopenglfunctions_4_0_compatibility.h>
-# include <QtGui/qopenglfunctions_4_0_core.h>
-# include <QtGui/qopenglfunctions_4_1_compatibility.h>
-# include <QtGui/qopenglfunctions_4_1_core.h>
-# include <QtGui/qopenglfunctions_4_2_compatibility.h>
-# include <QtGui/qopenglfunctions_4_2_core.h>
-# include <QtGui/qopenglfunctions_4_3_compatibility.h>
-# include <QtGui/qopenglfunctions_4_3_core.h>
-# include <QtGui/qopenglfunctions_4_4_compatibility.h>
-# include <QtGui/qopenglfunctions_4_4_core.h>
-# include <QtGui/qopenglfunctions_4_5_compatibility.h>
-# include <QtGui/qopenglfunctions_4_5_core.h>
+# include <QtOpenGL/qopenglfunctions_1_0.h>
+# include <QtOpenGL/qopenglfunctions_1_1.h>
+# include <QtOpenGL/qopenglfunctions_1_2.h>
+# include <QtOpenGL/qopenglfunctions_1_3.h>
+# include <QtOpenGL/qopenglfunctions_1_4.h>
+# include <QtOpenGL/qopenglfunctions_1_5.h>
+# include <QtOpenGL/qopenglfunctions_2_0.h>
+# include <QtOpenGL/qopenglfunctions_2_1.h>
+# include <QtOpenGL/qopenglfunctions_3_0.h>
+# include <QtOpenGL/qopenglfunctions_3_1.h>
+# include <QtOpenGL/qopenglfunctions_3_2_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_3_2_core.h>
+# include <QtOpenGL/qopenglfunctions_3_3_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_3_3_core.h>
+# include <QtOpenGL/qopenglfunctions_4_0_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_4_0_core.h>
+# include <QtOpenGL/qopenglfunctions_4_1_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_4_1_core.h>
+# include <QtOpenGL/qopenglfunctions_4_2_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_4_2_core.h>
+# include <QtOpenGL/qopenglfunctions_4_3_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_4_3_core.h>
+# include <QtOpenGL/qopenglfunctions_4_4_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_4_4_core.h>
+# include <QtOpenGL/qopenglfunctions_4_5_compatibility.h>
+# include <QtOpenGL/qopenglfunctions_4_5_core.h>
#endif
#if QT_CONFIG(opengles2)
-# include <QtGui/qopenglfunctions_es2.h>
+# include <QtOpenGL/qopenglfunctions_es2.h>
#endif
diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml
index 1d5b08edb..6e4bf8009 100644
--- a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml
+++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml
@@ -2,7 +2,7 @@
<!--
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
@@ -40,7 +40,7 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtOpenGLFunctions">
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
+ <load-typesystem name="QtOpenGL/typesystem_opengl.xml" generate="no"/>
<load-typesystem name="templates/openglfunctions_common.xml" generate="no"/>
<rejection class="^QOpenGL.*$" argument-type="^(const )?GLboolean ?\*$"/>
diff --git a/sources/pyside2/PySide2/QtOpenGLWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtOpenGLWidgets/CMakeLists.txt
new file mode 100644
index 000000000..694bd7f3a
--- /dev/null
+++ b/sources/pyside2/PySide2/QtOpenGLWidgets/CMakeLists.txt
@@ -0,0 +1,34 @@
+project(QtOpenGLWidgets)
+
+set(QtOpenGLWidgets_SRC
+${QtOpenGLWidgets_GEN_DIR}/qopenglwidget_wrapper.cpp
+# module is always needed
+${QtOpenGLWidgets_GEN_DIR}/qtopenglwidgets_module_wrapper.cpp
+)
+
+set(QtOpenGLWidgets_include_dirs ${QtOpenGLWidgets_SOURCE_DIR}
+ ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Widgets_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtGui_GEN_DIR}
+ ${QtWidgets_GEN_DIR}
+ ${QtOpenGLWidgets_GEN_DIR})
+
+set(QtOpenGLWidgets_libraries pyside2
+ ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}OpenGL_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}OpenGLWidgets_LIBRARIES})
+
+set(QtOpenGLWidgets_deps QtOpenGL QtWidgets)
+
+create_pyside_module(NAME QtOpenGLWidgets
+ INCLUDE_DIRS QtOpenGLWidgets_include_dirs
+ LIBRARIES QtOpenGLWidgets_libraries
+ DEPS QtOpenGLWidgets_deps
+ TYPESYSTEM_PATH QtOpenGLWidgets_SOURCE_DIR
+ SOURCES QtOpenGLWidgets_SRC)
diff --git a/sources/pyside2/PySide2/QtWebKit/typesystem_webkit.xml b/sources/pyside2/PySide2/QtOpenGLWidgets/typesystem_openglwidgets.xml
index e92417f26..983fc37fc 100644
--- a/sources/pyside2/PySide2/QtWebKit/typesystem_webkit.xml
+++ b/sources/pyside2/PySide2/QtOpenGLWidgets/typesystem_openglwidgets.xml
@@ -2,7 +2,7 @@
<!--
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
@@ -39,11 +39,12 @@
**
****************************************************************************/
-->
-<typesystem package="PySide2.QtWebKit">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
- <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
-
- <namespace-type name="WebCore"/>
+<typesystem package="PySide2.QtOpenGLWidgets">
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no" />
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no" />
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no" />
+ <object-type name="QOpenGLWidget">
+ <enum-type name="UpdateBehavior"/>
+ </object-type>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml
index 487103875..f51edf67a 100644
--- a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml
+++ b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml
@@ -64,7 +64,6 @@
<object-type name="QPrinter" >
<enum-type name="ColorMode"/>
<enum-type name="DuplexMode"/>
- <enum-type name="Orientation"/>
<enum-type name="OutputFormat"/>
<enum-type name="PageOrder"/>
<enum-type name="PaperSource"/>
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
index 2b60c5c7f..fd470cd71 100644
--- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
+++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
@@ -52,74 +52,34 @@
#include "pyside2_qtcore_python.h"
#include "pyside2_qtqml_python.h"
-#ifndef PYSIDE_MAX_QML_TYPES
-// Maximum number of different Qt QML types the user can export to QML using
-// qmlRegisterType. This limit exists because the QML engine instantiates objects
-// by calling a function with one argument (a void *pointer where the object should
-// be created), and thus does not allow us to choose which object to create. Thus
-// we create a C++ factory function for each new registered type at compile time.
-#define PYSIDE_MAX_QML_TYPES 50
-#endif
+#include <QtQml/QJSValue>
// Forward declarations.
static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call,
void **args);
-// All registered python types and their creation functions.
-static PyObject *pyTypes[PYSIDE_MAX_QML_TYPES];
-static void (*createFuncs[PYSIDE_MAX_QML_TYPES])(void *);
-
// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr.
static QMutex nextQmlElementMutex;
-template<int N>
-struct ElementFactoryBase
+static void createInto(void *memory, void *type)
{
- static void createInto(void *memory)
- {
- QMutexLocker locker(&nextQmlElementMutex);
- PySide::setNextQObjectMemoryAddr(memory);
- Shiboken::GilState state;
- PyObject *obj = PyObject_CallObject(pyTypes[N], 0);
- if (!obj || PyErr_Occurred())
- PyErr_Print();
- PySide::setNextQObjectMemoryAddr(0);
- }
-};
-
-template<int N>
-struct ElementFactory : ElementFactoryBase<N>
-{
- static void init()
- {
- createFuncs[N] = &ElementFactoryBase<N>::createInto;
- ElementFactory<N-1>::init();
- }
-};
-
-template<>
-struct ElementFactory<0> : ElementFactoryBase<0>
-{
- static void init()
- {
- createFuncs[0] = &ElementFactoryBase<0>::createInto;
- }
-};
+ QMutexLocker locker(&nextQmlElementMutex);
+ PySide::setNextQObjectMemoryAddr(memory);
+ Shiboken::GilState state;
+ PyObject *obj = PyObject_CallObject(reinterpret_cast<PyObject *>(type), 0);
+ if (!obj || PyErr_Occurred())
+ PyErr_Print();
+ PySide::setNextQObjectMemoryAddr(0);
+}
int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
- int versionMinor, const char *qmlName)
+ int versionMinor, const char *qmlName, const char *noCreationReason,
+ bool creatable)
{
using namespace Shiboken;
static PyTypeObject *qobjectType = Shiboken::Conversions::getPythonTypeObject("QObject*");
assert(qobjectType);
- static int nextType = 0;
-
- if (nextType >= PYSIDE_MAX_QML_TYPES) {
- PyErr_Format(PyExc_TypeError, "You can only export %d custom QML types to QML.",
- PYSIDE_MAX_QML_TYPES);
- return -1;
- }
PyTypeObject *pyObjType = reinterpret_cast<PyTypeObject *>(pyObj);
if (!PySequence_Contains(pyObjType->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) {
@@ -132,15 +92,15 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
Q_ASSERT(metaObject);
QQmlPrivate::RegisterType type;
- type.version = 0;
// Allow registering Qt Quick items.
bool registered = false;
#ifdef PYSIDE_QML_SUPPORT
QuickRegisterItemFunction quickRegisterItemFunction = getQuickRegisterItemFunction();
if (quickRegisterItemFunction) {
- registered = quickRegisterItemFunction(pyObj, uri, versionMajor, versionMinor,
- qmlName, &type);
+ registered =
+ quickRegisterItemFunction(pyObj, uri, versionMajor, versionMinor,
+ qmlName, creatable, noCreationReason, &type);
}
#endif
@@ -150,11 +110,11 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
// there's no way to unregister a QML type.
Py_INCREF(pyObj);
- pyTypes[nextType] = pyObj;
+ type.structVersion = 0;
// FIXME: Fix this to assign new type ids each time.
- type.typeId = qMetaTypeId<QObject *>();
- type.listId = qMetaTypeId<QQmlListProperty<QObject> >();
+ type.typeId = QMetaType(QMetaType::QObjectStar);
+ type.listId = QMetaType::fromType<QQmlListProperty<QObject> >();
type.attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<QObject>();
type.attachedPropertiesMetaObject = QQmlPrivate::attachedPropertiesMetaObject<QObject>();
@@ -168,16 +128,16 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
int objectSize = static_cast<int>(PySide::getSizeOfQObject(
reinterpret_cast<SbkObjectType *>(pyObj)));
type.objectSize = objectSize;
- type.create = createFuncs[nextType];
+ type.create = creatable ? createInto : nullptr;
+ type.noCreationReason = noCreationReason;
+ type.userdata = pyObj;
type.uri = uri;
- type.versionMajor = versionMajor;
- type.versionMinor = versionMinor;
+ type.version = QTypeRevision::fromVersion(versionMajor, versionMinor);
type.elementName = qmlName;
type.extensionObjectCreate = 0;
type.extensionMetaObject = 0;
type.customParser = 0;
- ++nextType;
}
type.metaObject = metaObject; // Snapshot may have changed.
@@ -189,6 +149,126 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
return qmlTypeId;
}
+int PySide::qmlRegisterSingletonType(PyObject *pyObj, const char *uri, int versionMajor,
+ int versionMinor, const char *qmlName, PyObject *callback,
+ bool isQObject, bool hasCallback)
+{
+ using namespace Shiboken;
+
+ if (hasCallback) {
+ if (!PyCallable_Check(callback)) {
+ PyErr_Format(PyExc_TypeError, "Invalid callback specified.");
+ return -1;
+ }
+
+ AutoDecRef funcCode(PyObject_GetAttrString(callback, "__code__"));
+ AutoDecRef argCount(PyObject_GetAttrString(funcCode, "co_argcount"));
+
+ int count = PyInt_AsLong(argCount);
+
+ if (count != 1) {
+ PyErr_Format(PyExc_TypeError, "Callback has a bad parameter count.");
+ return -1;
+ }
+
+ // Make sure the callback never gets deallocated
+ Py_INCREF(callback);
+ }
+
+ const QMetaObject *metaObject = nullptr;
+
+ if (isQObject) {
+ static PyTypeObject *qobjectType = Conversions::getPythonTypeObject("QObject*");
+ assert(qobjectType);
+
+ PyTypeObject *pyObjType = reinterpret_cast<PyTypeObject *>(pyObj);
+ if (!PySequence_Contains(pyObjType->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) {
+ PyErr_Format(PyExc_TypeError, "A type inherited from %s expected, got %s.",
+ qobjectType->tp_name, pyObjType->tp_name);
+ return -1;
+ }
+
+ // If we don't have a callback we'll need the pyObj to stay allocated indefinitely
+ if (!hasCallback)
+ Py_INCREF(pyObj);
+
+ metaObject = PySide::retrieveMetaObject(pyObjType);
+ Q_ASSERT(metaObject);
+ }
+
+ QQmlPrivate::RegisterSingletonType type;
+ type.structVersion = 0;
+
+ type.uri = uri;
+ type.version = QTypeRevision::fromVersion(versionMajor, versionMinor);
+ type.typeName = qmlName;
+ type.instanceMetaObject = metaObject;
+
+ if (isQObject) {
+ // FIXME: Fix this to assign new type ids each time.
+ type.typeId = QMetaType(QMetaType::QObjectStar);
+
+ type.qObjectApi =
+ [callback, pyObj, hasCallback](QQmlEngine *engine, QJSEngine *) -> QObject * {
+ AutoDecRef args(PyTuple_New(hasCallback ? 1 : 0));
+
+ if (hasCallback) {
+ PyTuple_SET_ITEM(args, 0, Conversions::pointerToPython(
+ (SbkObjectType *)SbkPySide2_QtQmlTypes[SBK_QQMLENGINE_IDX],
+ engine));
+ }
+
+ AutoDecRef retVal(PyObject_CallObject(hasCallback ? callback : pyObj, args));
+
+ SbkObjectType *qobjectType = (SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX];
+
+ // Make sure the callback returns something we can convert, else the entire application will crash.
+ if (retVal.isNull() ||
+ Conversions::isPythonToCppPointerConvertible(qobjectType, retVal) == nullptr) {
+ PyErr_Format(PyExc_TypeError, "Callback returns invalid value.");
+ return nullptr;
+ }
+
+ QObject *obj = nullptr;
+ Conversions::pythonToCppPointer(qobjectType, retVal, &obj);
+
+ if (obj != nullptr)
+ Py_INCREF(retVal);
+
+ return obj;
+ };
+ } else {
+ type.scriptApi =
+ [callback](QQmlEngine *engine, QJSEngine *) -> QJSValue {
+ AutoDecRef args(PyTuple_New(1));
+
+ PyTuple_SET_ITEM(args, 0, Conversions::pointerToPython(
+ (SbkObjectType *)SbkPySide2_QtQmlTypes[SBK_QQMLENGINE_IDX],
+ engine));
+
+ AutoDecRef retVal(PyObject_CallObject(callback, args));
+
+ SbkObjectType *qjsvalueType = (SbkObjectType *)SbkPySide2_QtQmlTypes[SBK_QJSVALUE_IDX];
+
+ // Make sure the callback returns something we can convert, else the entire application will crash.
+ if (retVal.isNull() ||
+ Conversions::isPythonToCppPointerConvertible(qjsvalueType, retVal) == nullptr) {
+ PyErr_Format(PyExc_TypeError, "Callback returns invalid value.");
+ return QJSValue(QJSValue::UndefinedValue);
+ }
+
+ QJSValue *val = nullptr;
+ Conversions::pythonToCppPointer(qjsvalueType, retVal, &val);
+
+ Py_INCREF(retVal);
+
+ return *val;
+ };
+ }
+
+ return QQmlPrivate::qmlregister(QQmlPrivate::SingletonRegistration, &type);
+}
+
extern "C"
{
@@ -197,27 +277,51 @@ struct QmlListProperty
{
PyTypeObject *type;
PyObject *append;
+ PyObject *count;
PyObject *at;
PyObject *clear;
- PyObject *count;
+ PyObject *replace;
+ PyObject *removeLast;
};
static int propListTpInit(PyObject *self, PyObject *args, PyObject *kwds)
{
- static const char *kwlist[] = {"type", "append", "at", "clear", "count", 0};
+ static const char *kwlist[] = {"type", "append", "count", "at", "clear", "replace", "removeLast", 0};
PySideProperty *pySelf = reinterpret_cast<PySideProperty *>(self);
QmlListProperty *data = new QmlListProperty;
memset(data, 0, sizeof(QmlListProperty));
if (!PyArg_ParseTupleAndKeywords(args, kwds,
- "OO|OOO:QtQml.ListProperty", (char **) kwlist,
+ "O|OOOOOO:QtQml.ListProperty", (char **) kwlist,
&data->type,
&data->append,
+ &data->count,
&data->at,
&data->clear,
- &data->count)) {
+ &data->replace,
+ &data->removeLast)) {
return -1;
}
+
+ static PyTypeObject *qobjectType = Shiboken::Conversions::getPythonTypeObject("QObject*");
+ assert(qobjectType);
+
+ if (!PySequence_Contains(data->type->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) {
+ PyErr_Format(PyExc_TypeError, "A type inherited from %s expected, got %s.",
+ qobjectType->tp_name, data->type->tp_name);
+ return -1;
+ }
+
+ if ((data->append && data->append != Py_None && !PyCallable_Check(data->append)) ||
+ (data->count && data->count != Py_None && !PyCallable_Check(data->count)) ||
+ (data->at && data->at != Py_None && !PyCallable_Check(data->at)) ||
+ (data->clear && data->clear != Py_None && !PyCallable_Check(data->clear)) ||
+ (data->replace && data->replace != Py_None && !PyCallable_Check(data->replace)) ||
+ (data->removeLast && data->removeLast != Py_None && !PyCallable_Check(data->removeLast))) {
+ PyErr_Format(PyExc_TypeError, "Non-callable parameter given");
+ return -1;
+ }
+
PySide::Property::setMetaCallHandler(pySelf, &propListMetaCall);
PySide::Property::setTypeName(pySelf, "QQmlListProperty<QObject>");
PySide::Property::setUserData(pySelf, data);
@@ -333,6 +437,38 @@ void propListClear(QQmlListProperty<QObject> * propList)
PyErr_Print();
}
+// Implementation of QQmlListProperty<T>::ReplaceFunction callback
+void propListReplace(QQmlListProperty<QObject> *propList, int index, QObject *value)
+{
+ Shiboken::GilState state;
+
+ Shiboken::AutoDecRef args(PyTuple_New(3));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index));
+ PyTuple_SET_ITEM(args, 2, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], value));
+
+ auto data = reinterpret_cast<QmlListProperty *>(propList->data);
+ Shiboken::AutoDecRef retVal(PyObject_CallObject(data->replace, args));
+
+ if (PyErr_Occurred())
+ PyErr_Print();
+}
+
+// Implementation of QQmlListProperty<T>::RemoveLastFunction callback
+void propListRemoveLast(QQmlListProperty<QObject> *propList)
+{
+ Shiboken::GilState state;
+
+ Shiboken::AutoDecRef args(PyTuple_New(1));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+
+ auto data = reinterpret_cast<QmlListProperty *>(propList->data);
+ Shiboken::AutoDecRef retVal(PyObject_CallObject(data->removeLast, args));
+
+ if (PyErr_Occurred())
+ PyErr_Print();
+}
+
// qt_metacall specialization for ListProperties
static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call, void **args)
{
@@ -342,7 +478,13 @@ static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Ca
auto data = reinterpret_cast<QmlListProperty *>(PySide::Property::userData(pp));
QObject *qobj;
Shiboken::Conversions::pythonToCppPointer((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], self, &qobj);
- QQmlListProperty<QObject> declProp(qobj, data, &propListAppender, &propListCount, &propListAt, &propListClear);
+ QQmlListProperty<QObject> declProp(qobj, data,
+ data->append && data->append != Py_None ? &propListAppender : nullptr,
+ data->count && data->count != Py_None ? &propListCount : nullptr,
+ data->at && data->at != Py_None ? &propListAt : nullptr,
+ data->clear && data->clear != Py_None ? &propListClear : nullptr,
+ data->replace && data->replace != Py_None ? &propListReplace : nullptr,
+ data->removeLast && data->removeLast != Py_None ? &propListRemoveLast : nullptr);
// Copy the data to the memory location requested by the meta call
void *v = args[0];
@@ -367,18 +509,23 @@ QtQml_VolatileBoolObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
QtQml_VolatileBoolObject *self
= reinterpret_cast<QtQml_VolatileBoolObject *>(type->tp_alloc(type, 0));
- if (self != Q_NULLPTR)
- self->flag = ok;
+ if (self != nullptr)
+ self->flag = new AtomicBool(ok);
return reinterpret_cast<PyObject *>(self);
}
+static void QtQml_VolatileBoolObject_dealloc(PyObject *self)
+{
+ auto volatileBool = reinterpret_cast<QtQml_VolatileBoolObject *>(self);
+ delete volatileBool->flag;
+ Sbk_object_dealloc(self);
+}
+
static PyObject *
QtQml_VolatileBoolObject_get(QtQml_VolatileBoolObject *self)
{
- if (self->flag)
- return Py_True;
- return Py_False;
+ return *self->flag ? Py_True : Py_False;
}
static PyObject *
@@ -397,10 +544,7 @@ QtQml_VolatileBoolObject_set(QtQml_VolatileBoolObject *self, PyObject *args)
return Q_NULLPTR;
}
- if (ok > 0)
- self->flag = true;
- else
- self->flag = false;
+ *self->flag = ok > 0;
Py_RETURN_NONE;
}
@@ -420,7 +564,7 @@ QtQml_VolatileBoolObject_repr(QtQml_VolatileBoolObject *self)
{
PyObject *s;
- if (self->flag)
+ if (*self->flag)
s = PyBytes_FromFormat("%s(True)",
Py_TYPE(self)->tp_name);
else
@@ -435,12 +579,12 @@ QtQml_VolatileBoolObject_str(QtQml_VolatileBoolObject *self)
{
PyObject *s;
- if (self->flag)
+ if (*self->flag)
s = PyBytes_FromFormat("%s(True) -> %p",
- Py_TYPE(self)->tp_name, &(self->flag));
+ Py_TYPE(self)->tp_name, self->flag);
else
s = PyBytes_FromFormat("%s(False) -> %p",
- Py_TYPE(self)->tp_name, &(self->flag));
+ Py_TYPE(self)->tp_name, self->flag);
Py_XINCREF(s);
return s;
}
@@ -450,7 +594,7 @@ static PyType_Slot QtQml_VolatileBoolType_slots[] = {
{Py_tp_str, (void *)reinterpret_cast<reprfunc>(QtQml_VolatileBoolObject_str)},
{Py_tp_methods, (void *)QtQml_VolatileBoolObject_methods},
{Py_tp_new, (void *)QtQml_VolatileBoolObject_new},
- {Py_tp_dealloc, (void *)Sbk_object_dealloc},
+ {Py_tp_dealloc, (void *)QtQml_VolatileBoolObject_dealloc},
{0, 0}
};
static PyType_Spec QtQml_VolatileBoolType_spec = {
@@ -481,8 +625,6 @@ static const char *VolatileBool_SignatureStrings[] = {
void PySide::initQmlSupport(PyObject *module)
{
- ElementFactory<PYSIDE_MAX_QML_TYPES - 1>::init();
-
// Export QmlListProperty type
if (InitSignatureStrings(PropertyListTypeF(), PropertyList_SignatureStrings) < 0) {
PyErr_Print();
@@ -490,6 +632,9 @@ void PySide::initQmlSupport(PyObject *module)
return;
}
+ // Register QQmlListProperty metatype for use in QML
+ qRegisterMetaType<QQmlListProperty<QObject>>();
+
Py_INCREF(reinterpret_cast<PyObject *>(PropertyListTypeF()));
PyModule_AddObject(module, PepType_GetNameStr(PropertyListTypeF()),
reinterpret_cast<PyObject *>(PropertyListTypeF()));
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
index 536348aa3..b147d9888 100644
--- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
+++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
@@ -68,10 +68,23 @@ void initQmlSupport(PyObject *module);
* \return the metatype id of the registered type.
*/
int qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int versionMinor,
- const char *qmlName);
-}
+ const char *qmlName, const char *noCreationReason = nullptr, bool creatable = true);
-// Volatile Bool Ptr type definition.
+/**
+ * PySide implementation of qmlRegisterType<T> function.
+ *
+ * \param pyObj Python type to be registered.
+ * \param uri QML element uri.
+ * \param versionMajor QML component major version.
+ * \param versionMinor QML component minor version.
+ * \param qmlName QML element name
+ * \param callback Registration callback
+ * \return the metatype id of the registered type.
+ */
+int qmlRegisterSingletonType(PyObject *pyObj,const char *uri, int versionMajor, int versionMinor, const char *qmlName,
+ PyObject *callback, bool isQObject, bool hasCallback);
+
+}
PyAPI_FUNC(PyTypeObject *) QtQml_VolatileBoolTypeF(void);
diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
index 0a12d44cf..b2def633f 100644
--- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
+++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml
@@ -45,11 +45,14 @@
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<inject-code class="target" position="declaration">
- // Volatile Bool Ptr type definition.
+ // Volatile Bool Ptr type definition for QQmlIncubationController::incubateWhile(std::atomic&lt;bool&gt; *, int)
+ #include &lt;atomic&gt;
+
+ using AtomicBool = std::atomic&lt;bool&gt;;
typedef struct {
PyObject_HEAD
- volatile bool flag;
+ AtomicBool *flag;
} QtQml_VolatileBoolObject;
</inject-code>
@@ -66,32 +69,35 @@
in generator tests folder. -->
</primitive-type>
+ <enum-type name="QQmlModuleImportSpecialVersions" since="6.0"/>
+
<!-- For qmlEngine(const QObject*), qmlContext(const QObject*) in qqml.h -->
<namespace-type name="QtQml"/>
- <add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
- <inject-documentation format="target" mode="append">
- This function registers the Python type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor.
- Returns the QML type id.
-
- For example, this registers a Python class MySliderItem as a QML type named Slider for version 1.0 of a module called "com.mycompany.qmlcomponents":
-
- ::
-
- qmlRegisterType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider")
-
- Once this is registered, the type can be used in QML by importing the specified module name and version number:
+ <!-- expose QQmlIncubationController::incubateWhile() (see
+ QtQml_VolatileBoolTypeF/pysideqmlregistertype.h) -->
+ <namespace-type name="std" generate="no">
+ <value-type name="atomic" generate="no"/>
+ </namespace-type>
- ::
+ <add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
+ </add-function>
- import com.mycompany.qmlcomponents 1.0
+ <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*,PyObject*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_callback"/>
+ </add-function>
- Slider { ... }
+ <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_nocallback"/>
+ </add-function>
- Note that it's perfectly reasonable for a library to register types to older versions than the actual version of the library. Indeed, it is normal for the new library to allow QML written to previous versions to continue to work, even if more advanced versions of some of its types are available.
- </inject-documentation>
+ <add-function signature="qmlRegisterSingletonType(const char*,int,int,const char*,PyObject*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qjsvalue"/>
+ </add-function>
- <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
+ <add-function signature="qmlRegisterUncreatableType(PyTypeObject,const char*,int,int,const char*,const char*)" return-type="int">
+ <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregisteruncreatabletype"/>
</add-function>
<enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES">
@@ -104,6 +110,7 @@
<object-type name="QJSEngine">
<enum-type name="Extension" flags="Extensions" since="5.6"/>
+ <enum-type name="ObjectOwnership" since="6.0"/>
<add-function signature="toScriptValue(const QVariant&amp;)" return-type="QJSValue">
<inject-code class="target" position="end" file="../glue/qtqml.cpp" snippet="qjsengine-toscriptvalue"/>
</add-function>
@@ -133,7 +140,6 @@
<enum-type name="StartMode"/>
</object-type>
<object-type name="QQmlEngine">
- <enum-type name="ObjectOwnership"/>
<modify-function signature="addImageProvider(const QString&amp;,QQmlImageProviderBase*)">
<modify-argument index="2">
<define-ownership owner="c++"/>
@@ -173,14 +179,14 @@
<extra-includes>
<include file-name="pysideqmlregistertype.h" location="local"/>
</extra-includes>
- <modify-function signature="incubateWhile(volatile bool*,int)" allow-thread="yes">
+ <modify-function signature="incubateWhile(std::atomic&lt;bool&gt;*,int)" allow-thread="yes">
<modify-argument index="1">
- <!-- The replace type is needed to use the VolatileBool_Check macro instead of
- a template conversion function with "volatile bool" as argument. -->
+ The replace type is needed to use the VolatileBool_Check macro instead of
+ a template conversion function with "volatile bool" as argument.
<replace-type modified-type="VolatileBool"/>
<conversion-rule class="native">
- volatile bool * %out =
- &amp;((reinterpret_cast&lt;QtQml_VolatileBoolObject *&gt;(%PYARG_1))->flag);
+ auto volatileBool = reinterpret_cast&lt;QtQml_VolatileBoolObject *&gt;(%PYARG_1);
+ std::atomic&lt;bool&gt; *%out = volatileBool->flag;
</conversion-rule>
</modify-argument>
</modify-function>
diff --git a/sources/pyside2/PySide2/QtQuick/CMakeLists.txt b/sources/pyside2/PySide2/QtQuick/CMakeLists.txt
index 0f453c90e..25f54679f 100644
--- a/sources/pyside2/PySide2/QtQuick/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtQuick/CMakeLists.txt
@@ -3,10 +3,12 @@ project(QtQuick)
set(QtQuick_registerType "${QtQuick_SOURCE_DIR}/pysidequickregistertype.cpp")
set(QtQuick_SRC
+${QtQuick_GEN_DIR}/qquickasyncimageprovider_wrapper.cpp
${QtQuick_GEN_DIR}/qquickframebufferobject_wrapper.cpp
${QtQuick_GEN_DIR}/qquickframebufferobject_renderer_wrapper.cpp
${QtQuick_GEN_DIR}/qquicktexturefactory_wrapper.cpp
${QtQuick_GEN_DIR}/qquickimageprovider_wrapper.cpp
+${QtQuick_GEN_DIR}/qquickimageresponse_wrapper.cpp
${QtQuick_GEN_DIR}/qquicktransform_wrapper.cpp
${QtQuick_GEN_DIR}/qquickitem_wrapper.cpp
${QtQuick_GEN_DIR}/qquickitem_updatepaintnodedata_wrapper.cpp
@@ -17,11 +19,9 @@ ${QtQuick_GEN_DIR}/qquickrendercontrol_wrapper.cpp
${QtQuick_GEN_DIR}/qquicktextdocument_wrapper.cpp
${QtQuick_GEN_DIR}/qquickview_wrapper.cpp
${QtQuick_GEN_DIR}/qquickwindow_wrapper.cpp
-${QtQuick_GEN_DIR}/qsgabstractrenderer_wrapper.cpp
${QtQuick_GEN_DIR}/qsgbasicgeometrynode_wrapper.cpp
${QtQuick_GEN_DIR}/qsgclipnode_wrapper.cpp
${QtQuick_GEN_DIR}/qsgdynamictexture_wrapper.cpp
-${QtQuick_GEN_DIR}/qsgengine_wrapper.cpp
#${QtQuick_GEN_DIR}/qsgflatcolormaterial_wrapper.cpp
${QtQuick_GEN_DIR}/qsggeometry_attribute_wrapper.cpp
${QtQuick_GEN_DIR}/qsggeometry_attributeset_wrapper.cpp
@@ -51,13 +51,6 @@ ${QtQuick_GEN_DIR}/qsgtransformnode_wrapper.cpp
${QtQuick_GEN_DIR}/qtquick_module_wrapper.cpp
)
-if (Qt${QT_MAJOR_VERSION}Quick_VERSION VERSION_GREATER 5.5.1)
- set(QtQuick_SRC ${QtQuick_SRC}
- ${QtQuick_GEN_DIR}/qquickasyncimageprovider_wrapper.cpp
- ${QtQuick_GEN_DIR}/qquickimageresponse_wrapper.cpp
- )
-endif()
-
set(QtQuick_include_dirs ${QtQuick_SOURCE_DIR}
${QtQml_SOURCE_DIR}
${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
diff --git a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp
index a042ac2cc..acb733f73 100644
--- a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp
+++ b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp
@@ -51,56 +51,19 @@
#include "pyside2_qtquick_python.h"
#include "pyside2_qtqml_python.h"
-#ifndef PYSIDE_MAX_QUICK_TYPES
-// Maximum number of different Qt Quick types the user can export to QML using
-// qmlRegisterType. This limit exists because the QML engine instantiates objects
-// by calling a function with one argument (a void* pointer where the object should
-// be created), and thus does not allow us to choose which object to create. Thus
-// we create a C++ factory function for each new registered type at compile time.
-# define PYSIDE_MAX_QUICK_TYPES 50
-#endif // !PYSIDE_MAX_QUICK_TYPES
-
-// All registered python types and their creation functions.
-static PyObject *pyTypes[PYSIDE_MAX_QUICK_TYPES];
-static void (*createFuncs[PYSIDE_MAX_QUICK_TYPES])(void *);
-
// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr.
static QMutex nextQmlElementMutex;
-// Python object factory functions.
-template<int N>
-struct ElementFactoryBase
-{
- static void createQuickItem(void *memory)
- {
- QMutexLocker locker(&nextQmlElementMutex);
- PySide::setNextQObjectMemoryAddr(memory);
- Shiboken::GilState state;
- PyObject *obj = PyObject_CallObject(pyTypes[N], 0);
- if (!obj || PyErr_Occurred())
- PyErr_Print();
- PySide::setNextQObjectMemoryAddr(0);
- }
-};
-
-template<int N>
-struct ElementFactory : ElementFactoryBase<N>
-{
- static void init()
- {
- createFuncs[N] = &ElementFactoryBase<N>::createQuickItem;
- ElementFactory<N-1>::init();
- }
-};
-
-template<>
-struct ElementFactory<0> : ElementFactoryBase<0>
+static void createQuickItem(void *memory, void *type)
{
- static void init()
- {
- createFuncs[0] = &ElementFactoryBase<0>::createQuickItem;
- }
-};
+ QMutexLocker locker(&nextQmlElementMutex);
+ PySide::setNextQObjectMemoryAddr(memory);
+ Shiboken::GilState state;
+ PyObject *obj = PyObject_CallObject(reinterpret_cast<PyObject *>(type), 0);
+ if (!obj || PyErr_Occurred())
+ PyErr_Print();
+ PySide::setNextQObjectMemoryAddr(0);
+}
#define PY_REGISTER_IF_INHERITS_FROM(className, typeToRegister,typePointerName, \
typeListName, typeMetaObject, type, registered) \
@@ -117,6 +80,40 @@ bool pyTypeObjectInheritsFromClass(PyTypeObject *pyObjType, QByteArray className
return isDerived;
}
+template <typename T>
+struct QPysideQmlMetaTypeInterface : QtPrivate::QMetaTypeInterface
+{
+ const QByteArray name;
+
+ QPysideQmlMetaTypeInterface(const QByteArray &name, const QMetaObject *metaObject = nullptr)
+ : QMetaTypeInterface {
+ /*.revision=*/ 0,
+ /*.alignment=*/ alignof(T),
+ /*.size=*/ sizeof(T),
+ /*.flags=*/ QtPrivate::QMetaTypeTypeFlags<T>::Flags,
+ /*.typeId=*/ 0,
+ /*.metaObject=*/ metaObject,
+ /*.name=*/ name.constData(),
+ /*.defaultCtr=*/ [](const QMetaTypeInterface *, void *addr) { new (addr) T(); },
+ /*.copyCtr=*/ [](const QMetaTypeInterface *, void *addr, const void *other) {
+ new (addr) T(*reinterpret_cast<const T *>(other));
+ },
+ /*.moveCtr=*/ [](const QMetaTypeInterface *, void *addr, void *other) {
+ new (addr) T(std::move(*reinterpret_cast<T *>(other)));
+ },
+ /*.dtor=*/ [](const QMetaTypeInterface *, void *addr) {
+ reinterpret_cast<T *>(addr)->~T();
+ },
+ /*.equals=*/ nullptr,
+ /*.lessThan=*/ nullptr,
+ /*.debugStream=*/ nullptr,
+ /*.dataStreamOut=*/ nullptr,
+ /*.dataStreamIn=*/ nullptr,
+ /*.legacyRegisterOp=*/ nullptr
+ }
+ , name(name) {}
+};
+
template <class WrapperClass>
void registerTypeIfInheritsFromClass(
QByteArray className,
@@ -129,40 +126,11 @@ void registerTypeIfInheritsFromClass(
{
bool shouldRegister = !registered && pyTypeObjectInheritsFromClass(typeToRegister, className);
if (shouldRegister) {
- int ptrType =
- QMetaType::registerNormalizedType(
- typePointerName.constData(),
- QtMetaTypePrivate::QMetaTypeFunctionHelper<WrapperClass *>::Destruct,
- QtMetaTypePrivate::QMetaTypeFunctionHelper<WrapperClass *>::Construct,
- sizeof(WrapperClass *),
- static_cast< ::QFlags<QMetaType::TypeFlag> >(QtPrivate::QMetaTypeTypeFlags<
- WrapperClass *>::Flags),
- typeMetaObject);
- if (ptrType == -1) {
- PyErr_Format(PyExc_TypeError, "Meta type registration of \"%s\" for QML usage failed.",
- typePointerName.constData());
- return;
- }
+ QMetaType ptrType(new QPysideQmlMetaTypeInterface<WrapperClass *>(typePointerName, typeMetaObject));
+ QMetaType lstType(new QPysideQmlMetaTypeInterface<QQmlListProperty<WrapperClass>>(typeListName));
- int lstType =
- QMetaType::registerNormalizedType(
- typeListName.constData(),
- QtMetaTypePrivate::QMetaTypeFunctionHelper<QQmlListProperty<WrapperClass> >
- ::Destruct,
- QtMetaTypePrivate::QMetaTypeFunctionHelper<QQmlListProperty<WrapperClass> >
- ::Construct,
- sizeof(QQmlListProperty<WrapperClass>),
- static_cast< ::QFlags<QMetaType::TypeFlag> >(
- QtPrivate::QMetaTypeTypeFlags<QQmlListProperty<WrapperClass> >::Flags),
- nullptr);
- if (lstType == -1) {
- PyErr_Format(PyExc_TypeError, "Meta type registration of \"%s\" for QML usage failed.",
- typeListName.constData());
- return;
- }
-
- type->typeId = ptrType;
- type->listId = lstType;
+ type->typeId = std::move(ptrType);
+ type->listId = std::move(lstType);
type->attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<WrapperClass>();
type->attachedPropertiesMetaObject =
QQmlPrivate::attachedPropertiesMetaObject<WrapperClass>();
@@ -178,16 +146,9 @@ void registerTypeIfInheritsFromClass(
}
bool quickRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int versionMinor,
- const char *qmlName, QQmlPrivate::RegisterType *type)
+ const char *qmlName, bool creatable, const char *noCreationReason, QQmlPrivate::RegisterType *type)
{
using namespace Shiboken;
- static int nextType = 0;
-
- if (nextType >= PYSIDE_MAX_QUICK_TYPES) {
- PyErr_Format(PyExc_TypeError,
- "You can only export %d Qt Quick types to QML.", PYSIDE_MAX_QUICK_TYPES);
- return false;
- }
PyTypeObject *pyObjType = reinterpret_cast<PyTypeObject *>(pyObj);
PyTypeObject *qQuickItemPyType =
@@ -208,8 +169,6 @@ bool quickRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int v
// there's no way to unregister a QML type.
Py_INCREF(pyObj);
- pyTypes[nextType] = pyObj;
-
// Used in macro registration.
QByteArray pointerName(qmlName);
pointerName.append('*');
@@ -227,11 +186,12 @@ bool quickRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int v
if (!registered)
return false;
- type->create = createFuncs[nextType];
- type->version = 0;
+ type->structVersion = 0;
+ type->create = creatable ? createQuickItem : nullptr;
+ type->noCreationReason = noCreationReason;
+ type->userdata = pyObj;
type->uri = uri;
- type->versionMajor = versionMajor;
- type->versionMinor = versionMinor;
+ type->version = QTypeRevision::fromVersion(versionMajor, versionMinor);
type->elementName = qmlName;
type->metaObject = metaObject;
@@ -239,14 +199,12 @@ bool quickRegisterType(PyObject *pyObj, const char *uri, int versionMajor, int v
type->extensionMetaObject = 0;
type->customParser = 0;
- ++nextType;
return true;
}
void PySide::initQuickSupport(PyObject *module)
{
Q_UNUSED(module);
- ElementFactory<PYSIDE_MAX_QUICK_TYPES - 1>::init();
#ifdef PYSIDE_QML_SUPPORT
setQuickRegisterItemFunction(quickRegisterType);
#endif
diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml
index 223eff773..31e05979b 100644
--- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml
+++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml
@@ -107,16 +107,9 @@
<enum-type name="TextRenderType" since="5.10"/>
</object-type>
- <object-type name="QSGAbstractRenderer">
- <enum-type name="ClearModeBit" flags="ClearMode"/>
- <enum-type name="MatrixTransformFlag" flags="MatrixTransformFlags" since="5.14"/>
- </object-type>
<object-type name="QSGBasicGeometryNode"/>
<object-type name="QSGClipNode"/>
<object-type name="QSGDynamicTexture"/>
- <object-type name="QSGEngine">
- <enum-type name="CreateTextureOption" flags="CreateTextureOptions"/>
- </object-type>
<!-- <object-type name="QSGFlatColorMaterial"/> -->
<object-type name="QSGGeometry">
<enum-type name="DataPattern"/>
diff --git a/sources/pyside2/PySide2/QtScript/CMakeLists.txt b/sources/pyside2/PySide2/QtScript/CMakeLists.txt
deleted file mode 100644
index 81d6c03d3..000000000
--- a/sources/pyside2/PySide2/QtScript/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-project(QtScript)
-
-set(QtScript_SRC
-${QtScript_GEN_DIR}/qscriptable_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptclass_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptclasspropertyiterator_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptcontext_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptcontextinfo_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptengineagent_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptprogram_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptengine_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptextensioninterface_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptextensionplugin_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptstring_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptvalue_wrapper.cpp
-${QtScript_GEN_DIR}/qscriptvalueiterator_wrapper.cpp
-# module is always needed
-${QtScript_GEN_DIR}/qtscript_module_wrapper.cpp
-)
-
-set(QtScript_glue_sources
- "${QtScript_SOURCE_DIR}/qscript_value_iterator_glue.cpp"
-)
-
-set(QtScript_include_dirs ${QtScript_SOURCE_DIR}
- ${QtScript_BINARY_DIR}
- ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Script_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtCore_GEN_DIR}
- )
-set(QtScript_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Script_LIBRARIES})
-set(QtScript_deps QtCore)
-create_pyside_module(NAME QtScript
- INCLUDE_DIRS QtScript_include_dirs
- LIBRARIES QtScript_libraries
- DEPS QtScript_deps
- TYPESYSTEM_PATH QtScript_SOURCE_DIR
- SOURCES QtScript_SRC
- GLUE_SOURCES QtScript_glue_sources)
diff --git a/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp b/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp
deleted file mode 100644
index 11dfd19b0..000000000
--- a/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-%PYARG_0 = Shiboken::Object::newObject(
- reinterpret_cast<SbkObjectType *>(Shiboken::SbkType< ::QScriptValueIterator >()),
- new QScriptValueIterator(*%CPPSELF), true, true);
diff --git a/sources/pyside2/PySide2/QtScript/typesystem_script.xml b/sources/pyside2/PySide2/QtScript/typesystem_script.xml
deleted file mode 100644
index 1fdad5d47..000000000
--- a/sources/pyside2/PySide2/QtScript/typesystem_script.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
--->
-<typesystem package="PySide2.QtScript">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
-
- <object-type name="QScriptable"/>
- <object-type name="QScriptClass">
- <enum-type name="Extension"/>
- <enum-type name="QueryFlag"/>
- </object-type>
- <object-type name="QScriptClassPropertyIterator"/>
- <object-type name="QScriptContext">
- <enum-type name="Error"/>
- <enum-type name="ExecutionState"/>
- </object-type>
- <value-type name="QScriptContextInfo">
- <enum-type name="FunctionType"/>
- </value-type>
- <object-type name="QScriptEngineAgent">
- <enum-type name="Extension"/>
- </object-type>
- <object-type name="QScriptEngine">
- <enum-type name="QObjectWrapOption" flags="QObjectWrapOptions"/>
- <enum-type name="ValueOwnership"/>
- <!-- Not supported BUG #957-->
- <modify-function signature="scriptValueFromQMetaObject()" remove="all"/>
- </object-type>
- <object-type name="QScriptExtensionInterface"/>
- <object-type name="QScriptExtensionPlugin"/>
- <value-type name="QScriptProgram" since="4.7"/>
- <value-type name="QScriptString">
- <modify-function signature="toArrayIndex(bool*)const">
- <modify-argument index="1">
- <remove-argument/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_bool*"/>
- </inject-code>
- </modify-function>
- </value-type>
- <value-type name="QScriptValue">
- <enum-type name="PropertyFlag" flags="PropertyFlags"/>
- <enum-type name="ResolveFlag" flags="ResolveFlags"/>
- <enum-type name="SpecialValue"/>
- <add-function signature="__repr__" return-type="PyObject*">
- <inject-code class="target" position="beginning" file="../glue/qtscript.cpp" snippet="qscriptvalue-repr"/>
- </add-function>
- <add-function signature="__mgetitem__">
- <inject-code file="../glue/qtscript.cpp" snippet="qscriptvalue-mgetitem"/>
- </add-function>
- <add-function signature="__iter__()" return-type="PyObject*">
- <inject-code file="qscript_value_iterator_glue.cpp"/>
- </add-function>
- </value-type>
- <object-type name="QScriptValueIterator">
- <add-function signature="__iter__()" return-type="PyObject*">
- <inject-code>
- <insert-template name="__iter__"/>
- </inject-code>
- </add-function>
- <add-function signature="__next__()" return-type="PyObject*">
- <inject-code file="../glue/qtscript.cpp" snippet="qscriptvalueiterator-next"/>
- </add-function>
- </object-type>
-</typesystem>
-
diff --git a/sources/pyside2/PySide2/QtScriptTools/CMakeLists.txt b/sources/pyside2/PySide2/QtScriptTools/CMakeLists.txt
deleted file mode 100644
index 7c19856cb..000000000
--- a/sources/pyside2/PySide2/QtScriptTools/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-project(QtScriptTools)
-
-set(QtScriptTools_SRC
-${QtScriptTools_GEN_DIR}/qscriptenginedebugger_wrapper.cpp
-# module is always needed
-${QtScriptTools_GEN_DIR}/qtscripttools_module_wrapper.cpp
-)
-
-set(QtScriptTools_include_dirs ${QtScriptTools_SOURCE_DIR}
- ${QtScriptTools_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}Script_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}ScriptTools_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtCore_GEN_DIR}
- ${QtGui_GEN_DIR}
- ${QtWidgets_GEN_DIR}
- ${QtScript_GEN_DIR}
- )
-
-set(QtScriptTools_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Script_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}ScriptTools_LIBRARIES})
-
-set(QtScriptTools_deps QtCore QtScript QtGui QtWidgets)
-
-create_pyside_module(NAME QtScriptTools
- INCLUDE_DIRS QtScriptTools_include_dirs
- LIBRARIES QtScriptTools_libraries
- DEPS QtScriptTools_deps
- TYPESYSTEM_PATH QtScriptTools_SOURCE_DIR
- SOURCES QtScriptTools_SRC)
diff --git a/sources/pyside2/PySide2/QtSql/QtSql_global.pre.h.in b/sources/pyside2/PySide2/QtSql/QtSql_global.pre.h.in
index 0c20c1888..c56bc78c1 100644
--- a/sources/pyside2/PySide2/QtSql/QtSql_global.pre.h.in
+++ b/sources/pyside2/PySide2/QtSql/QtSql_global.pre.h.in
@@ -1,5 +1,5 @@
// QT_WIDGETS_LIB must be defined for QSqlRelationalDelegate to become visible.
-#if @Qt5Widgets_FOUND@
+#if @Qt6Widgets_FOUND@
# define QT_WIDGETS_LIB
#endif
diff --git a/sources/pyside2/PySide2/QtSvg/CMakeLists.txt b/sources/pyside2/PySide2/QtSvg/CMakeLists.txt
index 19768274d..34f72219e 100644
--- a/sources/pyside2/PySide2/QtSvg/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtSvg/CMakeLists.txt
@@ -1,10 +1,8 @@
project(QtSvg)
set(QtSvg_SRC
-${QtSvg_GEN_DIR}/qgraphicssvgitem_wrapper.cpp
${QtSvg_GEN_DIR}/qsvggenerator_wrapper.cpp
${QtSvg_GEN_DIR}/qsvgrenderer_wrapper.cpp
-${QtSvg_GEN_DIR}/qsvgwidget_wrapper.cpp
# module is always needed
${QtSvg_GEN_DIR}/qtsvg_module_wrapper.cpp
)
@@ -13,20 +11,17 @@ set(QtSvg_include_dirs ${QtSvg_SOURCE_DIR}
${QtSvg_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}Svg_INCLUDE_DIRS}
${libpyside_SOURCE_DIR}
${QtCore_GEN_DIR}
${QtGui_GEN_DIR}
- ${QtWidgets_GEN_DIR}
)
set(QtSvg_libraries pyside2
${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
${Qt${QT_MAJOR_VERSION}Svg_LIBRARIES}
)
-set(QtSvg_deps QtWidgets)
+set(QtSvg_deps QtGui)
create_pyside_module(NAME QtSvg
INCLUDE_DIRS QtSvg_include_dirs
diff --git a/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml b/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml
index 079a79e96..c921c631e 100644
--- a/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml
+++ b/sources/pyside2/PySide2/QtSvg/typesystem_svg.xml
@@ -2,7 +2,7 @@
<!--
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
@@ -40,10 +40,9 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtSvg">
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
+ <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<object-type name="QSvgRenderer"/>
- <object-type name="QSvgWidget"/>
<object-type name="QSvgGenerator">
<modify-function signature="setOutputDevice(QIODevice*)">
@@ -59,16 +58,4 @@
</modify-function>
</object-type>
- <object-type name="QGraphicsSvgItem">
- <modify-function signature="QGraphicsSvgItem(QGraphicsItem*)">
- <modify-argument index="this">
- <parent index="1" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="QGraphicsSvgItem(const QString&amp;,QGraphicsItem*)">
- <modify-argument index="this">
- <parent index="2" action="add"/>
- </modify-argument>
- </modify-function>
- </object-type>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtSvgWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtSvgWidgets/CMakeLists.txt
new file mode 100644
index 000000000..e04d5194b
--- /dev/null
+++ b/sources/pyside2/PySide2/QtSvgWidgets/CMakeLists.txt
@@ -0,0 +1,39 @@
+project(QtSvgWidgets)
+
+set(QtSvgWidgets_SRC
+${QtSvgWidgets_GEN_DIR}/qgraphicssvgitem_wrapper.cpp
+${QtSvgWidgets_GEN_DIR}/qsvgwidget_wrapper.cpp
+# module is always needed
+${QtSvgWidgets_GEN_DIR}/qtsvgwidgets_module_wrapper.cpp
+)
+
+set(QtSvgWidgets_include_dirs ${QtSvgWidgets_SOURCE_DIR}
+ ${QtSvgWidgets_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}Svg_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}SvgWidgets_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtGui_GEN_DIR}
+ ${QtWidgets_GEN_DIR}
+ ${QtSvg_GEN_DIR}
+ )
+
+set(QtSvgWidgets_libraries pyside2
+ ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}Svg_LIBRARIES}
+ ${Qt${QT_MAJOR_VERSION}SvgWidgets_LIBRARIES}
+ )
+
+set(QtSvgWidgets_deps QtSvg QtWidgets)
+
+create_pyside_module(NAME QtSvgWidgets
+ INCLUDE_DIRS QtSvgWidgets_include_dirs
+ LIBRARIES QtSvgWidgets_libraries
+ DEPS QtSvgWidgets_deps
+ TYPESYSTEM_PATH QtSvgWidgets_SOURCE_DIR
+ SOURCES QtSvgWidgets_SRC)
diff --git a/sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml b/sources/pyside2/PySide2/QtSvgWidgets/typesystem_svgwidgets.xml
index eefa09a54..a6aa5b922 100644
--- a/sources/pyside2/PySide2/QtScriptTools/typesystem_scripttools.xml
+++ b/sources/pyside2/PySide2/QtSvgWidgets/typesystem_svgwidgets.xml
@@ -2,7 +2,7 @@
<!--
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
@@ -39,17 +39,22 @@
**
****************************************************************************/
-->
-<typesystem package="PySide2.QtScriptTools">
- <load-typesystem name="QtScript/typesystem_script.xml" generate="no"/>
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
+<typesystem package="PySide2.QtSvgWidgets">
+ <load-typesystem name="QtSvg/typesystem_svg.xml" generate="no"/>
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
- <object-type name="QScriptEngineDebugger">
- <enum-type name="DebuggerAction"/>
- <enum-type name="DebuggerState" since="4.6"/>
- <enum-type name="DebuggerWidget"/>
- <extra-includes>
- <include file-name="QScriptEngine" location="global"/>
- </extra-includes>
- </object-type>
+ <object-type name="QSvgWidget"/>
+
+ <object-type name="QGraphicsSvgItem">
+ <modify-function signature="QGraphicsSvgItem(QGraphicsItem*)">
+ <modify-argument index="this">
+ <parent index="1" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="QGraphicsSvgItem(const QString&amp;,QGraphicsItem*)">
+ <modify-argument index="this">
+ <parent index="2" action="add"/>
+ </modify-argument>
+ </modify-function>
+ </object-type>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in b/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in
index 65daf1b84..da5534b82 100644
--- a/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in
+++ b/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in
@@ -1,5 +1,5 @@
// QT_WIDGETS_LIB changes code generation in pysideqtesttouch.h
-#if @Qt5Widgets_FOUND@
+#if @Qt6Widgets_FOUND@
# define QT_WIDGETS_LIB
#endif
diff --git a/sources/pyside2/PySide2/QtTest/typesystem_test.xml b/sources/pyside2/PySide2/QtTest/typesystem_test.xml
index f7facaf7d..eb638befb 100644
--- a/sources/pyside2/PySide2/QtTest/typesystem_test.xml
+++ b/sources/pyside2/PySide2/QtTest/typesystem_test.xml
@@ -89,14 +89,14 @@
The problem that costed my days of bug hunting is the fact that shiboken gives
misleading error messages. The messages that I could not get rid of were
- signature 'generateTouchEvent(QWidget*,QTouchDevice*,bool)' for function modification in 'QTest' not found. Possible candidates:
- signature 'generateTouchEvent(QWindow*,QTouchDevice*,bool)' for function modification in 'QTest' not found. Possible candidates:
+ signature 'generateTouchEvent(QWidget*,QInputDevice*,bool)' for function modification in 'QTest' not found. Possible candidates:
+ signature 'generateTouchEvent(QWindow*,QInputDevice*,bool)' for function modification in 'QTest' not found. Possible candidates:
I always thought that for some reason the functions were not recognized, or the arguments somehow
do not match their declaration. Only late in the project, I learnt that also
a simply missing type name in the argument list leads to this message.
- <object-type name="QTouchDevice">
+ <object-type name="QInputDevice">
<enum-type name="CapabilityFlag" flags="Capabilities"/>
<enum-type name="DeviceType"/>
</object-type>
@@ -151,12 +151,12 @@
</modify-argument>
</modify-function>
</object-type>
- <modify-function signature="generateTouchEvent(QWidget*,QTouchDevice*,bool)" rename="touchEvent" since="4.6">
+ <modify-function signature="generateTouchEvent(QWidget*,QPointingDevice*,bool)" rename="touchEvent" since="4.6">
<modify-argument index="return">
<define-ownership class="target" owner="target"/>
</modify-argument>
</modify-function>
- <modify-function signature="generateTouchEvent(QWindow*,QTouchDevice*,bool)" rename="touchEvent" since="4.6">
+ <modify-function signature="generateTouchEvent(QWindow*,QPointingDevice*,bool)" rename="touchEvent" since="4.6">
<modify-argument index="return">
<define-ownership class="target" owner="target"/>
</modify-argument>
diff --git a/sources/pyside2/PySide2/QtWebKit/CMakeLists.txt b/sources/pyside2/PySide2/QtWebKit/CMakeLists.txt
deleted file mode 100644
index 4220e46bf..000000000
--- a/sources/pyside2/PySide2/QtWebKit/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-project(QtWebKit)
-
-set(QtWebKit_SRC
-${QtWebKit_GEN_DIR}/webcore_wrapper.cpp
-# module is always needed
-${QtWebKit_GEN_DIR}/qtwebkit_module_wrapper.cpp
-)
-
-set(QtWebKit_include_dirs ${QtWebKit_SOURCE_DIR}
- ${QtWebKit_BINARY_DIR}
- ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}WebKit_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtCore_GEN_DIR}
- ${QtGui_GEN_DIR}
- ${QtWidgets_GEN_DIR}
- ${QtNetwork_GEN_DIR}
- )
-set(QtWebKit_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}WebKit_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Network_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
- )
-set(QtWebKit_deps QtGui QtNetwork)
-create_pyside_module(NAME QtWebKit
- INCLUDE_DIRS QtWebKit_include_dirs
- LIBRARIES QtWebKit_libraries
- DEPS QtWebKit_deps
- TYPESYSTEM_PATH QtWebKit_SOURCE_DIR
- SOURCES QtWebKit_SRC)
-
diff --git a/sources/pyside2/PySide2/QtWebKitWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtWebKitWidgets/CMakeLists.txt
deleted file mode 100644
index 0bf660a62..000000000
--- a/sources/pyside2/PySide2/QtWebKitWidgets/CMakeLists.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-project(QtWebKitWidgets)
-
-set(QtWebKitWidgets_SRC
-${QtWebKitWidgets_GEN_DIR}/qgraphicswebview_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebdatabase_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebelement_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebelementcollection_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebframe_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebhistory_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebhistoryinterface_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebhistoryitem_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebhittestresult_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebinspector_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_choosemultiplefilesextensionoption_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_choosemultiplefilesextensionreturn_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_errorpageextensionoption_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_errorpageextensionreturn_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_extensionoption_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_extensionreturn_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_viewportattributes_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpage_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpluginfactory_mimetype_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpluginfactory_plugin_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebpluginfactory_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebsecurityorigin_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebsettings_wrapper.cpp
-${QtWebKitWidgets_GEN_DIR}/qwebview_wrapper.cpp
-# module is always needed
-${QtWebKitWidgets_GEN_DIR}/qtwebkitwidgets_module_wrapper.cpp
-)
-
-set(QtWebKitWidgets_include_dirs
- ${QtWebKitWidgets_SOURCE_DIR}
- ${QtWebKitWidgets_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}WebKit_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}PrintSupport_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}WebKitWidgets_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtCore_GEN_DIR}
- ${QtGui_GEN_DIR}
- ${QtWidgets_GEN_DIR}
- ${QtPrintSupport_GEN_DIR}
- ${QtWebKit_GEN_DIR}
- ${QtNetwork_GEN_DIR}
- )
-set(QtWebKitWidgets_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}WebKit_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}WebKitWidgets_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Network_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Widgets_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Gui_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
- )
-set(QtWebKitWidgets_deps QtWidgets QtPrintSupport QtNetwork)
-create_pyside_module(NAME QtWebKitWidgets
- INCLUDE_DIRS QtWebKitWidgets_include_dirs
- LIBRARIES QtWebKitWidgets_libraries
- DEPS QtWebKitWidgets_deps
- TYPESYSTEM_PATH QtWebKitWidgets_SOURCE_DIR
- SOURCES QtWebKitWidgets_SRC)
-
diff --git a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml
deleted file mode 100644
index 7760c1c3d..000000000
--- a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml
+++ /dev/null
@@ -1,211 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
--->
-<typesystem package="PySide2.QtWebKitWidgets">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
- <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
- <load-typesystem name="QtWebKit/typesystem_webkit.xml" generate="no"/>
- <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
- <load-typesystem name="QtPrintSupport/typesystem_printsupport.xml" generate="no"/>
- <load-typesystem name="templates/webkitwidgets_common.xml" generate="no"/>
-
- <value-type name="QWebDatabase"/>
-
- <object-type name="QWebPluginFactory">
- <enum-type name="Extension"/>
- <value-type name="Plugin"/>
- <value-type name="MimeType"/>
- <modify-function signature="create(const QString &amp;,const QUrl &amp;,const QStringList &amp;,const QStringList &amp;)const">
- <modify-argument index="return">
- <define-ownership class="native" owner="c++"/>
- <define-ownership class="target" owner="target"/>
- </modify-argument>
- </modify-function>
- </object-type>
-
- <object-type name="QWebHistory"/>
- <object-type name="QWebHistoryInterface"/>
- <value-type name="QWebHistoryItem"/>
-
- <value-type name="QWebSecurityOrigin">
- <enum-type name="SubdomainSetting"/>
- </value-type>
-
- <object-type name="QWebSettings">
- <enum-type name="FontFamily"/>
- <enum-type name="FontSize"/>
- <enum-type name="ThirdPartyCookiePolicy"/>
- <enum-type name="WebAttribute"/>
- <enum-type name="WebGraphic"/>
- </object-type>
-
- <object-type name="QWebView">
- <modify-function signature="setPage(QWebPage*)">
- <modify-argument index="1">
- <reference-count action="set"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="page()const">
- <modify-argument index="return">
- <define-ownership class="target" owner="default"/>
- </modify-argument>
- <inject-code position="end" file="../glue/qtwebkitwidgets.cpp" snippet="qwebview-page"/>
- </modify-function>
- <modify-function signature="print(QPrinter*)const" rename="print_"/>
- </object-type>
-
- <value-type name="QWebElement" since="4.6">
- <enum-type name="StyleResolveStrategy"/>
- </value-type>
-
- <value-type name="QWebElementCollection" since="4.6">
- <add-function signature="__len__">
- <inject-code file="../glue/qtwebkitwidgets.cpp" snippet="qwebelementcollection-len"/>
- </add-function>
- <add-function signature="__getitem__">
- <inject-code file="../glue/qtwebkitwidgets.cpp" snippet="qwebelementcollection-getitem"/>
- </add-function>
- </value-type>
-
- <object-type name="QWebFrame">
- <enum-type name="RenderLayer" flags="RenderLayers" since="4.6"/>
- <enum-type name="ValueOwnership"/>
- <modify-function signature="addToJavaScriptWindowObject(QString,QObject*,QWebFrame::ValueOwnership)">
- <modify-argument index="2">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="print(QPrinter*)const" rename="print_"/>
- <modify-function signature="metaData()const">
- <modify-argument index="return">
- <replace-type modified-type="PyObject"/>
- </modify-argument>
- <inject-code position="end" file="../glue/qtwebkitwidgets.cpp" snippet="qwebframe-metadata" />
- </modify-function>
- </object-type>
-
- <object-type name="QWebPage">
- <enum-type name="ErrorDomain"/>
- <enum-type name="Extension"/>
- <enum-type name="Feature"/>
- <enum-type name="FindFlag" flags="FindFlags"/>
- <enum-type name="LinkDelegationPolicy"/>
- <enum-type name="NavigationType"/>
- <enum-type name="PermissionPolicy" since="4.8" revision="4800"/>
- <enum-type name="VisibilityState"/>
- <enum-type name="WebAction"/>
- <enum-type name="WebWindowType"/>
-
- <value-type name="ChooseMultipleFilesExtensionOption"/>
- <value-type name="ChooseMultipleFilesExtensionReturn"/>
- <value-type name="ErrorPageExtensionOption" since="4.6"/>
- <value-type name="ErrorPageExtensionReturn" since="4.6"/>
- <value-type name="ExtensionOption"/>
- <value-type name="ExtensionReturn"/>
- <value-type name="ViewportAttributes"/>
-
- <modify-function signature="extension(QWebPage::Extension,const QWebPage::ExtensionOption*,QWebPage::ExtensionReturn*)">
- <modify-argument index="2" invalidate-after-use="yes">
- <conversion-rule class="target">
- <insert-template name="qwebpage_extension_argument_conversion">
- <replace from="$TYPE_SUFFIX" to="Option"/>
- </insert-template>
- </conversion-rule>
- </modify-argument>
- <modify-argument index="3" invalidate-after-use="yes">
- <conversion-rule class="target">
- <insert-template name="qwebpage_extension_argument_conversion">
- <replace from="$TYPE_SUFFIX" to="Return"/>
- </insert-template>
- </conversion-rule>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
- <modify-argument index="1">
- <reference-count action="set"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="networkAccessManager()const">
- <modify-argument index="return">
- <reference-count action="set" variable-name="setNetworkAccessManager(QNetworkAccessManager*)1"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="view()const">
- <modify-argument index="return">
- <define-ownership owner="default"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="pluginFactory()const">
- <modify-argument index="return">
- <define-ownership owner="default"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="javaScriptPrompt(QWebFrame*,const QString &amp;,const QString &amp;,QString*)">
- <modify-argument index="4">
- <remove-argument />
- <conversion-rule class="native">
- <insert-template name="qstring_remove"/>
- </conversion-rule>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="pysequence_qstring"/>
- </conversion-rule>
- <conversion-rule class="target">
- <insert-template name="qstring_pytuple"/>
- </conversion-rule>
- </modify-argument>
- </modify-function>
-
- <add-function signature="qt_metacall()">
- <inject-code class="native" file="../glue/qtwebkitwidgets.cpp" snippet="qwebpage-qt-metacall"/>
- </add-function>
- </object-type>
-
- <value-type name="QWebHitTestResult"/>
-
- <object-type name="QGraphicsWebView" since="4.6"/>
- <object-type name="QWebInspector" since="4.6"/>
-</typesystem>
diff --git a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt
index 506a6fc78..3df3b8d19 100644
--- a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt
@@ -9,8 +9,6 @@ ${QtWidgets_GEN_DIR}/qabstractitemview_wrapper.cpp
${QtWidgets_GEN_DIR}/qabstractscrollarea_wrapper.cpp
${QtWidgets_GEN_DIR}/qabstractslider_wrapper.cpp
${QtWidgets_GEN_DIR}/qabstractspinbox_wrapper.cpp
-${QtWidgets_GEN_DIR}/qaction_wrapper.cpp
-${QtWidgets_GEN_DIR}/qactiongroup_wrapper.cpp
${QtWidgets_GEN_DIR}/qapplication_wrapper.cpp
${QtWidgets_GEN_DIR}/qboxlayout_wrapper.cpp
${QtWidgets_GEN_DIR}/qbuttongroup_wrapper.cpp
@@ -26,11 +24,9 @@ ${QtWidgets_GEN_DIR}/qcompleter_wrapper.cpp
${QtWidgets_GEN_DIR}/qdatawidgetmapper_wrapper.cpp
${QtWidgets_GEN_DIR}/qdateedit_wrapper.cpp
${QtWidgets_GEN_DIR}/qdatetimeedit_wrapper.cpp
-${QtWidgets_GEN_DIR}/qdesktopwidget_wrapper.cpp
${QtWidgets_GEN_DIR}/qdial_wrapper.cpp
${QtWidgets_GEN_DIR}/qdialog_wrapper.cpp
${QtWidgets_GEN_DIR}/qdialogbuttonbox_wrapper.cpp
-${QtWidgets_GEN_DIR}/qdirmodel_wrapper.cpp
${QtWidgets_GEN_DIR}/qdockwidget_wrapper.cpp
${QtWidgets_GEN_DIR}/qdoublespinbox_wrapper.cpp
${QtWidgets_GEN_DIR}/qerrormessage_wrapper.cpp
@@ -92,7 +88,6 @@ ${QtWidgets_GEN_DIR}/qinputdialog_wrapper.cpp
${QtWidgets_GEN_DIR}/qitemdelegate_wrapper.cpp
${QtWidgets_GEN_DIR}/qitemeditorcreatorbase_wrapper.cpp
${QtWidgets_GEN_DIR}/qitemeditorfactory_wrapper.cpp
-${QtWidgets_GEN_DIR}/qkeyeventtransition_wrapper.cpp
${QtWidgets_GEN_DIR}/qkeysequenceedit_wrapper.cpp
${QtWidgets_GEN_DIR}/qlabel_wrapper.cpp
${QtWidgets_GEN_DIR}/qlayout_wrapper.cpp
@@ -108,8 +103,6 @@ ${QtWidgets_GEN_DIR}/qmdisubwindow_wrapper.cpp
${QtWidgets_GEN_DIR}/qmenu_wrapper.cpp
${QtWidgets_GEN_DIR}/qmenubar_wrapper.cpp
${QtWidgets_GEN_DIR}/qmessagebox_wrapper.cpp
-${QtWidgets_GEN_DIR}/qmouseeventtransition_wrapper.cpp
-${QtWidgets_GEN_DIR}/qopenglwidget_wrapper.cpp
${QtWidgets_GEN_DIR}/qpangesture_wrapper.cpp
${QtWidgets_GEN_DIR}/qpinchgesture_wrapper.cpp
${QtWidgets_GEN_DIR}/qplaintextdocumentlayout_wrapper.cpp
@@ -124,7 +117,6 @@ ${QtWidgets_GEN_DIR}/qscrollarea_wrapper.cpp
${QtWidgets_GEN_DIR}/qscrollbar_wrapper.cpp
${QtWidgets_GEN_DIR}/qscroller_wrapper.cpp
${QtWidgets_GEN_DIR}/qscrollerproperties_wrapper.cpp
-${QtWidgets_GEN_DIR}/qshortcut_wrapper.cpp
${QtWidgets_GEN_DIR}/qsizegrip_wrapper.cpp
${QtWidgets_GEN_DIR}/qsizepolicy_wrapper.cpp
${QtWidgets_GEN_DIR}/qslider_wrapper.cpp
@@ -190,9 +182,6 @@ ${QtWidgets_GEN_DIR}/qtreeview_wrapper.cpp
${QtWidgets_GEN_DIR}/qtreewidget_wrapper.cpp
${QtWidgets_GEN_DIR}/qtreewidgetitem_wrapper.cpp
${QtWidgets_GEN_DIR}/qtreewidgetitemiterator_wrapper.cpp
-${QtWidgets_GEN_DIR}/qundocommand_wrapper.cpp
-${QtWidgets_GEN_DIR}/qundogroup_wrapper.cpp
-${QtWidgets_GEN_DIR}/qundostack_wrapper.cpp
${QtWidgets_GEN_DIR}/qundoview_wrapper.cpp
${QtWidgets_GEN_DIR}/qvboxlayout_wrapper.cpp
${QtWidgets_GEN_DIR}/qwhatsthis_wrapper.cpp
diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
index 155591b0c..d067e1aba 100644
--- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
+++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
@@ -235,7 +235,7 @@
<object-type name="QLayoutItem">
- <modify-function signature="widget()">
+ <modify-function signature="widget()const">
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
</modify-argument>
@@ -426,11 +426,6 @@
<reference-count action="set"/>
</modify-argument>
</modify-function>
- <modify-function signature="viewOptions()const">
- <modify-argument index="return">
- <replace-default-expression with="QStyleOptionViewItem()"/>
- </modify-argument>
- </modify-function>
<modify-function signature="model()const">
<modify-argument index="return">
<!-- Defining ownership as "default" avoids the object to be automatically
@@ -461,19 +456,6 @@
<enum-type name="SliderAction"/>
<enum-type name="SliderChange"/>
</object-type>
- <object-type name="QActionGroup">
- <enum-type name="ExclusionPolicy" since="5.14"/>
- <modify-function signature="addAction(QAction*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="removeAction(QAction*)">
- <modify-argument index="1">
- <parent index="this" action="remove"/>
- </modify-argument>
- </modify-function>
- </object-type>
<object-type name="QCheckBox"/>
<object-type name="QCommonStyle">
</object-type>
@@ -525,18 +507,7 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QDirModel" polymorphic-id-expression="qobject_cast&lt;QDirModel*&gt;(%1)">
- <enum-type name="Roles"/>
- <modify-function signature="setIconProvider(QFileIconProvider*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- </object-type>
- <object-type name="QFileIconProvider">
- <enum-type name="IconType"/>
- <enum-type name="Option" flags="Options"/>
- </object-type>
+ <object-type name="QFileIconProvider"/>
<object-type name="QWizard">
<enum-type name="WizardButton"/>
<enum-type name="WizardOption" flags="WizardOptions"/>
@@ -638,8 +609,6 @@
<object-type name="QItemDelegate">
<!-- ### "doLayout(...)" is an internal method. -->
<modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const" remove="all"/>
- <!-- ### "selected(QPixmap,QPalette,bool)" is an internal method. -->
- <modify-function signature="selected(QPixmap,QPalette,bool)const" remove="all"/>
<!-- ### -->
<modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
<modify-argument index="1" invalidate-after-use="yes"/>
@@ -963,15 +932,6 @@
</modify-function>
</object-type>
- <object-type name="QShortcut">
- <add-function signature="QShortcut(QKeySequence&amp;,QWidget*,PyCallable*,Qt::ShortcutContext)">
- <modify-argument index="4">
- <replace-default-expression with="Qt::WindowShortcut"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qshortcut-1"/>
- <inject-code class="target" position="end" file="../glue/qtwidgets.cpp" snippet="qshortcut-2"/>
- </add-function>
- </object-type>
<object-type name="QSpacerItem"/>
<object-type name="QStatusBar">
<modify-function signature="addWidget(QWidget*,int)">
@@ -1078,40 +1038,6 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QUndoCommand">
- <modify-function signature="mergeWith(const QUndoCommand*)">
- <modify-argument index="1" invalidate-after-use="yes"/>
- </modify-function>
- </object-type>
- <object-type name="QUndoGroup">
- <modify-function signature="addStack(QUndoStack*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="removeStack(QUndoStack*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- </object-type>
- <object-type name="QUndoStack">
- <modify-function signature="createUndoAction(QObject*,const QString&amp;)const">
- <modify-argument index="return">
- <parent index="1" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="createRedoAction(QObject*,const QString&amp;)const">
- <modify-argument index="return">
- <parent index="1" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="push(QUndoCommand*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- </object-type>
<object-type name="QUndoView">
<modify-function signature="setGroup(QUndoGroup*)">
<modify-argument index="1">
@@ -1252,14 +1178,10 @@
<object-type name="QColorDialog">
<enum-type name="ColorDialogOption" flags="ColorDialogOptions"/>
<modify-function signature="getColor(const QColor&amp;,QWidget*,const QString&amp;,QFlags&lt;QColorDialog::ColorDialogOption>)" allow-thread="yes"/>
- <!-- Qt5: obsolete -->
- <modify-function signature="getRgba(unsigned int,bool*,QWidget*)" remove="all"/>
</object-type>
<object-type name="QLayout">
<inject-code class="native" position="beginning" file="../glue/qtwidgets.cpp" snippet="qlayout-help-functions"/>
- <!-- Becomes a real Q_OPROPERTY in Qt 6 -->
- <property name="contentsMargins" type="QMargins" get="contentsMargins" set="setContentsMargins"/>
<enum-type name="SizeConstraint"/>
<modify-function signature="itemAt(int)const">
@@ -1564,16 +1486,6 @@
</inject-code>
</modify-function>
- <modify-function signature="getDouble(QWidget*,const QString&amp;,const QString&amp;,double,double,double,int,bool*,QFlags&lt;Qt::WindowType&gt;)" allow-thread="yes">
- <modify-argument index="8">
- <remove-default-expression/>
- <remove-argument/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg"/>
- </inject-code>
- </modify-function>
-
<modify-function signature="getDouble(QWidget*,const QString&amp;,const QString&amp;,double,double,double,int,bool*,QFlags&lt;Qt::WindowType&gt;,double)" allow-thread="yes">
<modify-argument index="8">
<remove-default-expression/>
@@ -2026,7 +1938,7 @@
<object-type name="QWidget" delete-in-main-thread="true">
<!-- see QWindow::nativeEvent(), QAbstractNativeEventFilter::nativeEventFilter() -->
- <modify-function signature="nativeEvent(const QByteArray &amp;,void*,long*)">
+ <modify-function signature="nativeEvent(const QByteArray &amp;,void*,qintptr*)">
<modify-argument index="3">
<remove-argument/>
<conversion-rule class="native">
@@ -2114,7 +2026,7 @@
<rename to="event"/>
</modify-argument>
</modify-function>
- <modify-function signature="enterEvent(QEvent*)">
+ <modify-function signature="enterEvent(QEnterEvent*)">
<modify-argument index="1" invalidate-after-use="yes">
<rename to="event"/>
</modify-argument>
@@ -2227,33 +2139,6 @@
</modify-argument>
</modify-function>
- <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
- <modify-argument index="0">
- <replace-type modified-type="PyObject"/>
- </modify-argument>
- <modify-argument index="1">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="2">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="4">
- <remove-argument/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int"/>
- </insert-template>
- </inject-code>
- <inject-code class="native" position="end">
- <insert-template name="fix_native_return_number*,number*,number*,number*">
- <replace from="$TYPE" to="int"/>
- </insert-template>
- </inject-code>
- </modify-function>
<modify-function signature="insertAction(QAction*,QAction*)">
<modify-argument index="2">
<parent index="this" action="add"/>
@@ -2412,13 +2297,8 @@
</modify-argument>
</modify-function>
- <modify-function signature="pixmap()const">
- <modify-argument index="return">
- <!-- Defining ownership as "default" avoids the object to be automatically
- set as parent of the returned pointer. -->
- <define-ownership class="target" owner="default"/>
- </modify-argument>
- </modify-function>
+ <modify-function signature="pixmap(Qt::ReturnByValueConstant)const" remove="all"/>
+ <modify-function signature="picture(Qt::ReturnByValueConstant)const" remove="all"/>
<modify-function signature="setMovie(QMovie *)">
<modify-argument index="1">
<parent index="this" action="add"/>
@@ -2436,7 +2316,7 @@
<include file-name="QUrl" location="global"/>
<include file-name="QAbstractProxyModel" location="global"/>
</extra-includes>
- <modify-function signature="setIconProvider(QFileIconProvider*)">
+ <modify-function signature="setIconProvider(QAbstractFileIconProvider*)">
<modify-argument index="1">
<parent index="this" action="add"/>
</modify-argument>
@@ -2708,28 +2588,6 @@
</modify-argument>
</modify-function>
<modify-function signature="del()" rename="del_"/>
- <modify-function signature="getTextMargins(int*,int*,int*,int*)const">
- <modify-argument index="0">
- <replace-type modified-type="PyObject*"/>
- </modify-argument>
- <modify-argument index="1">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="2">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="3">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="4">
- <remove-argument/>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_number*,number*,number*,number*">
- <replace from="$TYPE" to="int"/>
- </insert-template>
- </inject-code>
- </modify-function>
<add-function signature="addAction(QAction*)">
<inject-code class="target" position="beginning" file="../glue/qtwidgets.cpp" snippet="qlineedit-addaction"/>
@@ -2740,9 +2598,6 @@
<enum-type name="Mode"/>
<enum-type name="SegmentStyle"/>
</object-type>
- <object-type name="QOpenGLWidget">
- <enum-type name="UpdateBehavior"/>
- </object-type>
<object-type name="QSplashScreen">
<!-- Override QWidget.painter -->
<modify-function signature="repaint()" remove="all"/>
@@ -2763,7 +2618,6 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QDesktopWidget"/>
<object-type name="QFrame">
<enum-type name="Shadow"/>
<enum-type name="Shape"/>
@@ -2784,7 +2638,7 @@
sys.exit(app.exec_())
</inject-documentation>
</modify-function>
- <modify-function signature="valueChanged(QString)">
+ <modify-function signature="textChanged(QString)">
<inject-documentation mode="append" format="target">
::
@@ -2951,20 +2805,8 @@
</modify-function>
<modify-function signature="print(QPagedPaintDevice*)const" rename="print_"/>
</object-type>
- <object-type name="QAction">
- <enum-type name="ActionEvent"/>
- <enum-type name="MenuRole"/>
- <enum-type name="Priority" since="4.6"/>
- <modify-function signature="setMenu(QMenu*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="triggered(bool)" allow-thread="yes"/>
- </object-type>
<object-type name="QApplication">
- <enum-type name="ColorSpec"/>
<extra-includes>
<include file-name="QBasicTimer" location="global"/>
<include file-name="QFont" location="global"/>
@@ -2994,7 +2836,7 @@
<object-type name="QFileSystemModel" polymorphic-id-expression="qobject_cast&lt;QFileSystemModel*&gt;(%1)">
<enum-type name="Roles"/>
<enum-type name="Option" flags="Options" since="5.14"/>
- <modify-function signature="setIconProvider(QFileIconProvider*)">
+ <modify-function signature="setIconProvider(QAbstractFileIconProvider*)">
<modify-argument index="1">
<parent index="this" action="add"/>
</modify-argument>
@@ -3431,8 +3273,6 @@
<object-type name="QGraphicsRotation" since="4.6"/>
<object-type name="QGraphicsScale" since="4.6"/>
<object-type name="QGraphicsTransform" since="4.6"/>
- <object-type name="QKeyEventTransition" since="4.6"/>
- <object-type name="QMouseEventTransition" since="4.6"/>
<object-type name="QPanGesture" since="4.6"/>
<object-type name="QPinchGesture" since="4.6">
<enum-type name="ChangeFlag" flags="ChangeFlags"/>
diff --git a/sources/pyside2/PySide2/QtWinExtras/QtWinExtras_global.pre.h.in b/sources/pyside2/PySide2/QtWinExtras/QtWinExtras_global.pre.h.in
index 3a2b87c3b..21285e301 100644
--- a/sources/pyside2/PySide2/QtWinExtras/QtWinExtras_global.pre.h.in
+++ b/sources/pyside2/PySide2/QtWinExtras/QtWinExtras_global.pre.h.in
@@ -1,5 +1,5 @@
// QT_WIDGETS_LIB must be defined for the widget functions to become visible.
-#if @Qt5Widgets_FOUND@
+#if @Qt6Widgets_FOUND@
# define QT_WIDGETS_LIB
#endif
diff --git a/sources/pyside2/PySide2/QtXml/CMakeLists.txt b/sources/pyside2/PySide2/QtXml/CMakeLists.txt
index eb64b4795..e7b22ca2b 100644
--- a/sources/pyside2/PySide2/QtXml/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtXml/CMakeLists.txt
@@ -18,20 +18,6 @@ ${QtXml_GEN_DIR}/qdomnodelist_wrapper.cpp
${QtXml_GEN_DIR}/qdomnotation_wrapper.cpp
${QtXml_GEN_DIR}/qdomprocessinginstruction_wrapper.cpp
${QtXml_GEN_DIR}/qdomtext_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlattributes_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlcontenthandler_wrapper.cpp
-${QtXml_GEN_DIR}/qxmldeclhandler_wrapper.cpp
-${QtXml_GEN_DIR}/qxmldefaulthandler_wrapper.cpp
-${QtXml_GEN_DIR}/qxmldtdhandler_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlentityresolver_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlerrorhandler_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlinputsource_wrapper.cpp
-${QtXml_GEN_DIR}/qxmllexicalhandler_wrapper.cpp
-${QtXml_GEN_DIR}/qxmllocator_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlnamespacesupport_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlparseexception_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlreader_wrapper.cpp
-${QtXml_GEN_DIR}/qxmlsimplereader_wrapper.cpp
# module is always needed
${QtXml_GEN_DIR}/qtxml_module_wrapper.cpp
)
diff --git a/sources/pyside2/PySide2/QtXml/typesystem_xml.xml b/sources/pyside2/PySide2/QtXml/typesystem_xml.xml
index 96d12ea4e..8da1664d5 100644
--- a/sources/pyside2/PySide2/QtXml/typesystem_xml.xml
+++ b/sources/pyside2/PySide2/QtXml/typesystem_xml.xml
@@ -147,42 +147,6 @@
</modify-argument>
<inject-code class="target" position="beginning" file="../glue/qtxml.cpp" snippet="qdomdocument-setcontent" />
</modify-function>
- <modify-function signature="setContent(QXmlInputSource*,bool,QString*,int*,int*)">
- <modify-argument index="3">
- <remove-argument/>
- <remove-default-expression/>
- </modify-argument>
- <modify-argument index="4">
- <remove-argument/>
- <remove-default-expression/>
- </modify-argument>
- <modify-argument index="5">
- <remove-argument/>
- <remove-default-expression/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtxml.cpp" snippet="qdomdocument-setcontent" />
- </modify-function>
- <modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)">
- <modify-argument index="3">
- <remove-argument/>
- <remove-default-expression/>
- </modify-argument>
- <modify-argument index="4">
- <remove-argument/>
- <remove-default-expression/>
- </modify-argument>
- <modify-argument index="5">
- <remove-argument/>
- <remove-default-expression/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/>
- </modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtxml.cpp" snippet="qdomdocument-setcontent" />
- </modify-function>
<modify-function signature="setContent(const QString&amp;,QString*,int*,int*)">
<modify-argument index="2">
<remove-argument/>
@@ -225,12 +189,6 @@
<value-type name="QDomText"/>
- <object-type name="QXmlParseException"/>
-
- <value-type name="QXmlAttributes"/>
-
- <object-type name="QXmlNamespaceSupport"/>
-
<value-type name="QDomElement">
<!-- PYSIDE-1372
We will leave only one for int, and one for float since Python
@@ -253,149 +211,5 @@
</modify-argument>
</modify-function>
</object-type>
- <object-type name="QXmlDTDHandler"/>
- <object-type name="QXmlDeclHandler"/>
- <object-type name="QXmlErrorHandler"/>
- <object-type name="QXmlLexicalHandler"/>
-
-
- <object-type name="QXmlEntityResolver">
- <modify-function signature="resolveEntity(const QString&amp;,const QString&amp;,QXmlInputSource*&amp;)">
- <modify-argument index="3">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="QXmlEntityResolver_resolveEntity_return_conversion_native"/>
- </conversion-rule>
- </modify-argument>
- <inject-code class="target" position="end" file="../glue/qtxml.cpp" snippet="qxmlentityresolver-resolveentity"/>
- </modify-function>
- </object-type>
- <object-type name="QXmlDefaultHandler">
- <modify-function signature="setDocumentLocator(QXmlLocator*)">
- <modify-argument index="1">
- <define-ownership owner="c++"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="resolveEntity(const QString&amp;,const QString&amp;,QXmlInputSource*&amp;)">
- <modify-argument index="3">
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="QXmlEntityResolver_resolveEntity_return_conversion_native"/>
- </conversion-rule>
- </modify-argument>
- <inject-code class="target" position="end" file="../glue/qtxml.cpp" snippet="qxmlentityresolver-resolveentity"/>
- </modify-function>
- </object-type>
- <object-type name="QXmlInputSource"/>
- <object-type name="QXmlLocator"/>
-
- <object-type name="QXmlReader">
- <modify-function signature="parse(const QXmlInputSource*)">
- <modify-argument index="1" invalidate-after-use="yes"/>
- </modify-function>
- <modify-function signature="feature(QString,bool*)const">
- <modify-argument index="2">
- <remove-default-expression/>
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="fix_virtual_method_return_value_and_bool*"/>
- </conversion-rule>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*"/>
- </inject-code>
- </modify-function>
- <modify-function signature="property(QString,bool*)const">
- <modify-argument index="2">
- <remove-default-expression/>
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="fix_virtual_method_return_value_and_bool*"/>
- </conversion-rule>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*"/>
- </inject-code>
- </modify-function>
- </object-type>
- <object-type name="QXmlSimpleReader">
- <modify-function signature="parse(const QXmlInputSource*,bool)">
- <modify-argument index="1" invalidate-after-use="yes"/>
- </modify-function>
-
- <modify-function signature="setContentHandler(QXmlContentHandler*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="setDTDHandler(QXmlDTDHandler*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="setDeclHandler(QXmlDeclHandler*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="setEntityResolver(QXmlEntityResolver*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="setErrorHandler(QXmlErrorHandler*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
- <modify-function signature="setLexicalHandler(QXmlLexicalHandler*)">
- <modify-argument index="1">
- <parent index="this" action="add"/>
- </modify-argument>
- </modify-function>
-
- <modify-function signature="feature(QString,bool*)const">
- <modify-argument index="2">
- <remove-default-expression/>
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="fix_virtual_method_return_value_and_bool*"/>
- </conversion-rule>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*"/>
- </inject-code>
- </modify-function>
- <modify-function signature="property(QString,bool*)const">
- <modify-argument index="2">
- <remove-default-expression/>
- <remove-argument/>
- </modify-argument>
- <modify-argument index="return">
- <replace-type modified-type="PySequence"/>
- <conversion-rule class="native">
- <insert-template name="fix_virtual_method_return_value_and_bool*"/>
- </conversion-rule>
- </modify-argument>
- <inject-code class="target" position="beginning">
- <insert-template name="fix_args,bool*"/>
- </inject-code>
- </modify-function>
- </object-type>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtXmlPatterns/CMakeLists.txt b/sources/pyside2/PySide2/QtXmlPatterns/CMakeLists.txt
deleted file mode 100644
index adc1be516..000000000
--- a/sources/pyside2/PySide2/QtXmlPatterns/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-project(QtXmlPatterns)
-
-set(QtXmlPatterns_SRC
-${QtXmlPatterns_GEN_DIR}/qabstractmessagehandler_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qabstracturiresolver_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qabstractxmlnodemodel_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qabstractxmlreceiver_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qsourcelocation_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlformatter_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlitem_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlnamepool_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlname_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlnodemodelindex_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlquery_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlresultitems_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlschemavalidator_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlschema_wrapper.cpp
-${QtXmlPatterns_GEN_DIR}/qxmlserializer_wrapper.cpp
-## always needed
-${QtXmlPatterns_GEN_DIR}/qtxmlpatterns_module_wrapper.cpp
-)
-
-set(QtXmlPatterns_include_dirs ${QtXmlPatterns_SOURCE_DIR}
- ${QtXmlPatterns_BINARY_DIR}
- ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
- ${Qt${QT_MAJOR_VERSION}XmlPatterns_INCLUDE_DIRS}
- ${libpyside_SOURCE_DIR}
- ${QtCore_GEN_DIR}
- )
-set(QtXmlPatterns_libraries pyside2
- ${Qt${QT_MAJOR_VERSION}Core_LIBRARIES}
- ${Qt${QT_MAJOR_VERSION}XmlPatterns_LIBRARIES})
-set(QtXmlPatterns_deps QtCore)
-
-create_pyside_module(NAME QtXmlPatterns
- INCLUDE_DIRS QtXmlPatterns_include_dirs
- LIBRARIES QtXmlPatterns_libraries
- DEPS QtXmlPatterns_deps
- TYPESYSTEM_PATH QtXmlPatterns_SOURCE_DIR
- SOURCES QtXmlPatterns_SRC)
-
diff --git a/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml b/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml
deleted file mode 100644
index 1e8eec083..000000000
--- a/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
--->
-<typesystem package="PySide2.QtXmlPatterns">
- <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
-
- <object-type name="QXmlSchema" since="4.6"/> <!-- Qt scoped pointer does not allow declare this as value type -->
- <object-type name="QXmlSchemaValidator" since="4.6">
- <modify-function signature="schema()const">
- <modify-argument index="return">
- <replace-type modified-type="QXmlSchema*"/>
- <define-ownership owner="target"/>
- </modify-argument>
- <inject-code file="../glue/qtxmlpatterns.cpp" snippet="qxmlschemavalidator-schema"/>
- </modify-function>
- </object-type>
- <object-type name="QAbstractMessageHandler"/>
- <object-type name="QAbstractUriResolver"/>
- <object-type name="QAbstractXmlNodeModel">
- <enum-type name="NodeCopySetting"/>
- <enum-type name="SimpleAxis"/>
- </object-type>
- <object-type name="QAbstractXmlReceiver"/>
- <value-type name="QSourceLocation"/>
- <object-type name="QXmlFormatter"/>
- <value-type name="QXmlItem"/>
- <value-type name="QXmlName">
- <primitive-type name="NamespaceCode"/>
- <primitive-type name="PrefixCode"/>
- <primitive-type name="LocalNameCode"/>
- <!-- ### These methods aren't part of Qt public API -->
- <modify-function signature="QXmlName(QXmlName::NamespaceCode,QXmlName::LocalNameCode,QXmlName::PrefixCode)" remove="all"/>
- <modify-function signature="setNamespaceURI(QXmlName::NamespaceCode)" remove="all"/>
- <modify-function signature="localName()const" remove="all"/>
- <modify-function signature="prefix()const" remove="all"/>
- <modify-function signature="hasPrefix()const" remove="all"/>
- <modify-function signature="hasNamespace()const" remove="all"/>
- <modify-function signature="namespaceURI()const" remove="all"/>
- <modify-function signature="isLexicallyEqual(const QXmlName&amp;)const" remove="all"/>
- <modify-function signature="setPrefix(QXmlName::PrefixCode)" remove="all"/>
- <modify-function signature="setLocalName(QXmlName::LocalNameCode)" remove="all"/>
- <modify-function signature="code()const" remove="all"/>
- <!-- ### -->
- </value-type>
- <value-type name="QXmlNamePool"/>
-
- <rejection class="QXmlNodeModelIndex" function-name="type"/>
- <rejection class="QXmlNodeModelIndex" function-name="sequencedTypedValue"/>
- <rejection class="QXmlNodeModelIndex" function-name="iterate"/>
- <!-- ### This enum isn't part of Qt public API -->
- <suppress-warning text="Enum 'QXmlNodeModelIndex::Axis' (class: QXmlNodeModelIndex) does not have a type entry"/>
- <value-type name="QXmlNodeModelIndex">
- <enum-type name="DocumentOrder"/>
- <enum-type name="NodeKind"/>
- <!-- ### Qt internal methods -->
- <modify-function signature="name()const" remove="all"/>
- <modify-function signature="root()const" remove="all"/>
- <modify-function signature="documentUri()const" remove="all"/>
- <modify-function signature="baseUri()const" remove="all"/>
- <modify-function signature="kind()const" remove="all"/>
- <modify-function signature="isDeepEqual(const QXmlNodeModelIndex&amp;)const" remove="all"/>
- <modify-function signature="compareOrder(const QXmlNodeModelIndex &amp;)const" remove="all"/>
- <modify-function signature="sendNamespaces(QAbstractXmlReceiver*const)const" remove="all"/>
- <modify-function signature="namespaceBindings()const" remove="all"/>
- <modify-function signature="namespaceForPrefix(QXmlName::PrefixCode)const" remove="all"/>
- <modify-function signature="stringValue()const" remove="all"/>
- <modify-function signature="is(const QXmlNodeModelIndex &amp;)const" remove="all"/>
- <modify-function signature="reset()" remove="all"/>
- <!-- ### -->
- </value-type>
-
- <value-type name="QXmlQuery">
- <!-- ### TODO: must evaluate if anything other than removal is needed. -->
- <enum-type name="QueryLanguage"/>
- <modify-function signature="evaluateTo(QStringList*)const" remove="all"/>
- <modify-function signature="evaluateTo(QString*)const" remove="all"/>
- <!-- ### -->
- </value-type>
- <object-type name="QXmlResultItems"/>
- <object-type name="QXmlSerializer"/>
-
- <suppress-warning text="class 'QAbstractXmlNodeModel' inherits from unknown base class 'QSharedData'"/>
- <suppress-warning text="class not found for setup inheritance 'QSharedData'"/>
-</typesystem>
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
index 306a2239c..e9c60aeac 100644
--- a/sources/pyside2/PySide2/glue/qtcore.cpp
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -46,17 +46,6 @@
#include <limits>
// @snippet include-pyside
-// @snippet pystring-check
-bool py2kStrCheck(PyObject *obj)
-{
-#ifdef IS_PY3K
- return false;
-#else
- return PyString_Check(obj);
-#endif
-}
-// @snippet pystring-check
-
// @snippet qsettings-value
// If we enter the kwds, means that we have a defaultValue or
// at least a type.
@@ -102,15 +91,9 @@ if (typeObj) {
} else if (typeObj == &PyUnicode_Type) {
QByteArray asByteArray = out.toByteArray();
%PYARG_0 = PyUnicode_FromString(asByteArray.data());
-#ifdef IS_PY3K
} else if (typeObj == &PyLong_Type) {
float asFloat = out.toFloat();
pyResult = PyLong_FromDouble(asFloat);
-#else
- } else if (typeObj == &PyInt_Type) {
- float asFloat = out.toFloat();
- pyResult = PyInt_FromLong(long(asFloat));
-#endif
} else if (typeObj == &PyFloat_Type) {
float asFloat = out.toFloat();
%PYARG_0 = PyFloat_FromDouble(asFloat);
@@ -148,7 +131,7 @@ static const char *QVariant_resolveMetaType(PyTypeObject *type, int *typeId)
// Do not convert user type of value
if (valueType && Shiboken::ObjectType::isUserType(type))
return nullptr;
- int obTypeId = QMetaType::type(typeName);
+ int obTypeId = QMetaType::fromName(typeName).id();
if (obTypeId) {
*typeId = obTypeId;
return typeName;
@@ -190,11 +173,11 @@ static QVariant QVariant_convertToValueList(PyObject *list)
QByteArray listTypeName("QList<");
listTypeName += typeName;
listTypeName += '>';
- typeId = QMetaType::type(listTypeName);
+ typeId = QMetaType::fromName(listTypeName).id();
if (typeId > 0) {
Shiboken::Conversions::SpecificConverter converter(listTypeName);
if (converter) {
- QVariant var(typeId, nullptr);
+ QVariant var(static_cast<QVariant::Type>(typeId));
converter.toCpp(list, &var);
return var;
}
@@ -657,8 +640,10 @@ if (%PYARG_0 == Py_None)
// @snippet qline-hash
namespace PySide {
- template<> inline Py_ssize_t hash(const QLine &v) {
- return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2())));
+ template<> inline Py_ssize_t hash(const QLine &l)
+ {
+ const int v[4] = {l.x1(), l.y1(), l.x2(), l.y2()};
+ return qHashRange(v, v + 4);
}
};
// @snippet qline-hash
@@ -683,7 +668,7 @@ if (d) {
// @snippet qdate-topython
if (!PyDateTimeAPI)
- PySideDateTime_IMPORT;
+ PyDateTime_IMPORT;
%PYARG_0 = PyDate_FromDate(%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day());
// @snippet qdate-topython
@@ -719,7 +704,8 @@ QTime time(%4, %5, %6);
// @snippet qdatetime-topython
QDate date = %CPPSELF.date();
QTime time = %CPPSELF.time();
-if (!PyDateTimeAPI) PySideDateTime_IMPORT;
+if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
%PYARG_0 = PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), time.msec()*1000);
// @snippet qdatetime-topython
@@ -733,8 +719,9 @@ namespace PySide {
// @snippet qrect
namespace PySide {
- template<> inline Py_ssize_t hash(const QRect &v) {
- return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height())));
+ template<> inline Py_ssize_t hash(const QRect &r) {
+ const int v[4] = {r.x(), r.y(), r.width(), r.height()};
+ return qHashRange(v, v + 4);
}
};
// @snippet qrect
@@ -749,7 +736,7 @@ namespace PySide {
// @snippet qtime-topython
if (!PyDateTimeAPI)
- PySideDateTime_IMPORT;
+ PyDateTime_IMPORT;
%PYARG_0 = PyTime_FromTime(%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()*1000);
// @snippet qtime-topython
@@ -811,11 +798,6 @@ static QObject *_findChildHelper(const QObject *parent, const QString &name, PyT
return nullptr;
}
-static inline bool _findChildrenComparator(const QObject *&child, const QRegExp &name)
-{
- return name.indexIn(child->objectName()) != -1;
-}
-
static inline bool _findChildrenComparator(const QObject *&child, const QRegularExpression &name)
{
return name.match(child->objectName()).hasMatch();
@@ -894,13 +876,7 @@ if (PyIndex_Check(_key)) {
}
} else if (PySlice_Check(_key)) {
Py_ssize_t start, stop, step, slicelength, cur;
-
-#ifdef IS_PY3K
- PyObject *key = _key;
-#else
- PySliceObject *key = reinterpret_cast<PySliceObject *>(_key);
-#endif
- if (PySlice_GetIndicesEx(key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) {
+ if (PySlice_GetIndicesEx(_key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) {
return nullptr;
}
@@ -945,15 +921,9 @@ if (PyIndex_Check(_key)) {
}
// Provide more specific error message for bytes/str, bytearray, QByteArray respectively
-#ifdef IS_PY3K
if (PyBytes_Check(_value)) {
if (Py_SIZE(_value) != 1) {
PyErr_SetString(PyExc_ValueError, "bytes must be of size 1");
-#else
- if (PyString_CheckExact(_value)) {
- if (Py_SIZE(_value) != 1) {
- PyErr_SetString(PyExc_ValueError, "str must be of size 1");
-#endif
return -1;
}
} else if (PyByteArray_Check(_value)) {
@@ -967,11 +937,7 @@ if (PyIndex_Check(_key)) {
return -1;
}
} else {
-#ifdef IS_PY3K
PyErr_SetString(PyExc_ValueError, "a bytes, bytearray, QByteArray of size 1 is required");
-#else
- PyErr_SetString(PyExc_ValueError, "a str, bytearray, QByteArray of size 1 is required");
-#endif
return -1;
}
@@ -984,13 +950,7 @@ if (PyIndex_Check(_key)) {
return !result ? -1 : 0;
} else if (PySlice_Check(_key)) {
Py_ssize_t start, stop, step, slicelength, value_length;
-
-#ifdef IS_PY3K
- PyObject *key = _key;
-#else
- PySliceObject *key = reinterpret_cast<PySliceObject *>(_key);
-#endif
- if (PySlice_GetIndicesEx(key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) {
+ if (PySlice_GetIndicesEx(_key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) {
return -1;
}
// The parameter candidates are: bytes/str, bytearray, QByteArray itself.
@@ -1021,11 +981,7 @@ if (PyIndex_Check(_key)) {
for (int j = 0; j < slicelength; j++) {
PyObject *item = PyObject_GetItem(_value, PyLong_FromLong(j));
QByteArray temp;
-#ifdef IS_PY3K
if (PyLong_Check(item)) {
-#else
- if (PyLong_Check(item) || PyInt_Check(item)) {
-#endif
int overflow;
long ival = PyLong_AsLongAndOverflow(item, &overflow);
// Not suppose to bigger than 255 because only bytes, bytearray, QByteArray were accept
@@ -1202,15 +1158,7 @@ if (aux == nullptr) {
return nullptr;
}
QByteArray b(Py_TYPE(%PYSELF)->tp_name);
-#ifdef IS_PY3K
- %PYARG_0 = PyUnicode_FromFormat("%s(%R)", b.constData(), aux);
-#else
- aux = PyObject_Repr(aux);
- b += '(';
- b += QByteArray(PyBytes_AS_STRING(aux), PyBytes_GET_SIZE(aux));
- b += ')';
- %PYARG_0 = Shiboken::String::fromStringAndSize(b.constData(), b.size());
-#endif
+%PYARG_0 = PyUnicode_FromFormat("%s(%R)", b.constData(), aux);
Py_DECREF(aux);
// @snippet qbytearray-repr
@@ -1253,12 +1201,8 @@ PyObject *aux = PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size())
if (aux == nullptr) {
return nullptr;
}
-#ifdef IS_PY3K
- %PYARG_0 = PyObject_Repr(aux);
- Py_DECREF(aux);
-#else
- %PYARG_0 = aux;
-#endif
+%PYARG_0 = PyObject_Repr(aux);
+Py_DECREF(aux);
// @snippet qbytearray-str
// @snippet qbytearray-len
@@ -1408,17 +1352,6 @@ PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[qint64](pid));
// @snippet qprocess-startdetached
-// @snippet qprocess-pid
-long result;
-#ifdef WIN32
- _PROCESS_INFORMATION *procInfo = %CPPSELF.%FUNCTION_NAME();
- result = procInfo ? procInfo->dwProcessId : 0;
-#else
- result = %CPPSELF.%FUNCTION_NAME();
-#endif
-%PYARG_0 = %CONVERTTOPYTHON[long](result);
-// @snippet qprocess-pid
-
// @snippet qcoreapplication-init
static void QCoreApplicationConstructor(PyObject *self, PyObject *pyargv, QCoreApplicationWrapper **cptr)
{
@@ -1705,7 +1638,7 @@ Py_END_ALLOW_THREADS
// @snippet conversion-pylong-unsigned
// @snippet conversion-pylong-quintptr
-#if defined(IS_PY3K) && QT_POINTER_SIZE == 8
+#if QT_POINTER_SIZE == 8
%out = %OUTTYPE(PyLong_AsUnsignedLongLong(%in));
#else
%out = %OUTTYPE(PyLong_AsUnsignedLong(%in));
@@ -1736,14 +1669,6 @@ PyMem_Free(temp);
#endif
// @snippet conversion-pyunicode
-// @snippet conversion-pystring
-#ifndef IS_PY3K
-const char * str = %CONVERTTOCPP[const char *](%in);
-//XXX /|\ omitting this space crashes shiboken!
-%out = %OUTTYPE(str);
-#endif
-// @snippet conversion-pystring
-
// @snippet conversion-pynone
%out = %OUTTYPE();
// @snippet conversion-pynone
@@ -1790,7 +1715,7 @@ if (!typeCode || !typeName) {
%out = QVariant::fromValue(PySide::PyObjectWrapper(%in));
}
else {
- QVariant var(typeCode, nullptr);
+ QVariant var(static_cast<QVariant::Type>(typeCode));
Shiboken::Conversions::SpecificConverter converter(typeName);
converter.toCpp(pyIn, var.data());
%out = var;
@@ -1828,15 +1753,18 @@ else if (Py_TYPE(%in) == SbkObjectType_TypeF())
typeName = Shiboken::ObjectType::getOriginalName((SbkObjectType *)%in);
else
typeName = reinterpret_cast<PyTypeObject *>(%in)->tp_name;
-%out = QVariant::nameToType(typeName);
+const int id = QMetaType::fromName(typeName).id();
+%out = QVariant::Type(id);
// @snippet conversion-qvariant-pytypeobject
// @snippet conversion-qvariant-pystring
-%out = QVariant::nameToType(Shiboken::String::toCString(%in));
+const int id = QMetaType::fromName(Shiboken::String::toCString(%in)).id();
+%out = QVariant::Type(id);
// @snippet conversion-qvariant-pystring
// @snippet conversion-qvariant-pydict
-%out = QVariant::nameToType("QVariantMap");
+const int id = QMetaType::fromName("QVariantMap").id();
+%out = QVariant::Type(id);
// @snippet conversion-qvariant-pydict
// @snippet conversion-qvariant-pysequence
@@ -1881,11 +1809,7 @@ int usec = PyDateTime_TIME_GET_MICROSECOND(%in);
// @snippet conversion-qtime-pytime
// @snippet conversion-qbytearray-pybytes
-#ifdef IS_PY3K
%out = %OUTTYPE(PyBytes_AS_STRING(%in), PyBytes_GET_SIZE(%in));
-#else
-%out = %OUTTYPE(Shiboken::String::toCString(%in), Shiboken::String::len(%in));
-#endif
// @snippet conversion-qbytearray-pybytes
// @snippet conversion-qbytearray-pybytearray
@@ -1904,6 +1828,10 @@ int usec = PyDateTime_TIME_GET_MICROSECOND(%in);
return PyBool_FromLong((bool)%in);
// @snippet return-pybool
+// @snippet return-pybytes
+return PyBytes_FromStringAndSize(%in.constData(), %in.size());
+// @snippet return-pybytes
+
// @snippet return-pylong
return PyLong_FromLong(%in);
// @snippet return-pylong
@@ -1913,7 +1841,7 @@ return PyLong_FromUnsignedLong(%in);
// @snippet return-pylong-unsigned
// @snippet return-pylong-quintptr
-#if defined(IS_PY3K) && QT_POINTER_SIZE == 8
+#if QT_POINTER_SIZE == 8
return PyLong_FromUnsignedLongLong(%in);
#else
return PyLong_FromUnsignedLong(%in);
@@ -1925,15 +1853,6 @@ QByteArray ba = %in.toUtf8();
return PyUnicode_FromStringAndSize(ba.constData(), ba.size());
// @snippet return-pyunicode
-// @snippet return-pyunicode-qstringref
- const int N = %in.length();
- wchar_t *str = new wchar_t[N];
- %in.toString().toWCharArray(str);
- PyObject *%out = PyUnicode_FromWideChar(str, N);
- delete[] str;
- return %out;
-// @snippet return-pyunicode-qstringref
-
// @snippet return-pyunicode-qchar
wchar_t c = (wchar_t)%in.unicode();
return PyUnicode_FromWideChar(&c, 1);
@@ -1968,7 +1887,7 @@ return 0;
// @snippet return-qvariant
// @snippet return-qvariant-type
-const char *typeName = QVariant::typeToName(%in);
+const char *typeName = QMetaType(%in).name();
PyObject *%out;
PyTypeObject *pyType = nullptr;
if (typeName)
@@ -2024,7 +1943,7 @@ pthread_cleanup_pop(0);
// @snippet qthread_pthread_cleanup_uninstall
// @snippet qlibraryinfo_build
-#if defined(IS_PY3K) && defined(Py_LIMITED_API)
+#if defined(Py_LIMITED_API)
auto suffix = PyUnicode_FromString(" [limited API]");
auto oldResult = pyResult;
pyResult = PyUnicode_Concat(pyResult, suffix);
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp
index a6b45b7c0..869fb9dc4 100644
--- a/sources/pyside2/PySide2/glue/qtgui.cpp
+++ b/sources/pyside2/PySide2/glue/qtgui.cpp
@@ -144,7 +144,7 @@ for (int i = 0, i_max = %CPPSELF.count(); i < i_max; ++i){
// @snippet qpixmap
// @snippet qimage-constbits
-%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
+%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.sizeInBytes());
// @snippet qimage-constbits
// @snippet qimage-bits
@@ -170,34 +170,34 @@ PyObject *args = PyTuple_GET_ITEM(%1, 1);
switch (%CPPSELF.spec()) {
case QColor::Rgb:
{
- qreal r, g, b, a;
+ float r, g, b, a;
%CPPSELF.getRgbF(&r, &g, &b, &a);
%PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
- "setRgbF", float(r), float(g), float(b), float(a));
+ "setRgbF", r, g, b, a);
break;
}
case QColor::Hsv:
{
- qreal h, s, v, a;
+ float h, s, v, a;
%CPPSELF.getHsvF(&h, &s, &v, &a);
%PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
- "setHsvF", float(h), float(s), float(v), float(a));
+ "setHsvF", h, s, v, a);
break;
}
case QColor::Cmyk:
{
- qreal c, m, y, k, a;
+ float c, m, y, k, a;
%CPPSELF.getCmykF(&c, &m, &y, &k, &a);
%PYARG_0 = Py_BuildValue("(ON(s(fffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
- "setCmykF", float(c), float(m), float(y), float(k), float(a));
+ "setCmykF", c, m, y, k, a);
break;
}
case QColor::Hsl:
{
- qreal h, s, l, a;
+ float h, s, l, a;
%CPPSELF.getHslF(&h, &s, &l, &a);
%PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0),
- "setHslF", float(h), float(s), float(l), float(a));
+ "setHslF", h, s, l, a);
break;
}
default:
diff --git a/sources/pyside2/PySide2/glue/qtqml.cpp b/sources/pyside2/PySide2/glue/qtqml.cpp
index 1913204c3..5ff072e09 100644
--- a/sources/pyside2/PySide2/glue/qtqml.cpp
+++ b/sources/pyside2/PySide2/glue/qtqml.cpp
@@ -42,6 +42,26 @@ int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES);
%PYARG_0 = %CONVERTTOPYTHON[int](%0);
// @snippet qmlregistertype
+// @snippet qmlregistersingletontype_qobject_callback
+int %0 = PySide::qmlRegisterSingletonType(%ARGUMENT_NAMES, true, true);
+%PYARG_0 = %CONVERTTOPYTHON[int](%0);
+// @snippet qmlregistersingletontype_qobject_callback
+
+// @snippet qmlregistersingletontype_qobject_nocallback
+int %0 = PySide::qmlRegisterSingletonType(%ARGUMENT_NAMES, nullptr, true, false);
+%PYARG_0 = %CONVERTTOPYTHON[int](%0);
+// @snippet qmlregistersingletontype_qobject_nocallback
+
+// @snippet qmlregistersingletontype_qjsvalue
+int %0 = PySide::qmlRegisterSingletonType(nullptr, %ARGUMENT_NAMES, false, true);
+%PYARG_0 = %CONVERTTOPYTHON[int](%0);
+// @snippet qmlregistersingletontype_qjsvalue
+
+// @snippet qmlregisteruncreatabletype
+int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES, false);
+%PYARG_0 = %CONVERTTOPYTHON[int](%0);
+// @snippet qmlregisteruncreatabletype
+
// @snippet init
PySide::initQmlSupport(module);
// @snippet init
diff --git a/sources/pyside2/PySide2/glue/qtuitools.cpp b/sources/pyside2/PySide2/glue/qtuitools.cpp
index d81f6205a..08dc0eb0a 100644
--- a/sources/pyside2/PySide2/glue/qtuitools.cpp
+++ b/sources/pyside2/PySide2/glue/qtuitools.cpp
@@ -116,14 +116,10 @@ Arguments:
%PYARG_1 (uifile)
*/
// 1. Generate the Python code from the UI file
-#ifdef IS_PY3K
PyObject *strObj = PyUnicode_AsUTF8String(%PYARG_1);
char *arg1 = PyBytes_AsString(strObj);
QByteArray uiFileName(arg1);
Py_DECREF(strObj);
-#else
-QByteArray uiFileName(PyBytes_AsString(%PYARG_1));
-#endif
QFile uiFile(uiFileName);
@@ -207,12 +203,7 @@ if (codeUi.isNull()) {
qCritical() << "Error while compiling the generated Python file";
Py_RETURN_NONE;
}
-PyObject *uiObj = nullptr;
-#ifdef IS_PY3K
-uiObj = PyEval_EvalCode(codeUi, loc, loc);
-#else
-uiObj = PyEval_EvalCode(reinterpret_cast<PyCodeObject *>(codeUi.object()), loc, loc);
-#endif
+PyObject *uiObj = PyEval_EvalCode(codeUi, loc, loc);
if (uiObj == nullptr) {
qCritical() << "Error while running exec() on the generated code";
@@ -234,13 +225,8 @@ if (codeBaseClass.isNull()) {
Py_RETURN_NONE;
}
-#ifdef IS_PY3K
PyObject *classObj = PyEval_EvalCode(codeClass, loc, loc);
PyObject *baseClassObj = PyEval_EvalCode(codeBaseClass, loc, loc);
-#else
-PyObject *classObj = PyEval_EvalCode(reinterpret_cast<PyCodeObject *>(codeClass.object()), loc, loc);
-PyObject *baseClassObj = PyEval_EvalCode(reinterpret_cast<PyCodeObject *>(codeBaseClass.object()), loc, loc);
-#endif
%PYARG_0 = PyTuple_New(2);
if (%PYARG_0 == nullptr) {
diff --git a/sources/pyside2/PySide2/pysideqtesttouch.h b/sources/pyside2/PySide2/pysideqtesttouch.h
index 115c7835e..935ab59d6 100644
--- a/sources/pyside2/PySide2/pysideqtesttouch.h
+++ b/sources/pyside2/PySide2/pysideqtesttouch.h
@@ -68,145 +68,133 @@ namespace QTest
}
PySideQTouchEventSequence *press(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
- QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(window, pt));
- p.setState(Qt::TouchPointPressed);
+ auto it = m_points.find(touchId);
+ if (it == m_points.end()) {
+ QEventPoint point(touchId, QEventPoint::Pressed, pt, mapToScreen(window, pt));
+ m_points.insert(touchId, point);
+ }
return this;
}
PySideQTouchEventSequence *move(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
- QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(window, pt));
- p.setState(Qt::TouchPointMoved);
+ QEventPoint point(touchId, QEventPoint::Updated, pt, mapToScreen(window, pt));
+ m_points[touchId] = point;
return this;
}
PySideQTouchEventSequence *release(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
- QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(window, pt));
- p.setState(Qt::TouchPointReleased);
+ auto it = m_points.find(touchId);
+ if (it == m_points.end()) {
+ QEventPoint point(touchId, QEventPoint::Released, pt, mapToScreen(window, pt));
+ m_points.insert(touchId, point);
+ }
return this;
}
PySideQTouchEventSequence *stationary(int touchId)
{
- QTouchEvent::TouchPoint &p = pointOrPreviousPoint(touchId);
- p.setState(Qt::TouchPointStationary);
+ auto it = m_points.find(touchId);
+ if (it == m_points.end()) {
+ auto previous_it = m_previousPoints.find(touchId);
+ const QEventPoint point = previous_it != m_previousPoints.end()
+ ? previous_it.value()
+ : QEventPoint(touchId, QEventPoint::Stationary, QPointF(), QPointF());
+ m_points.insert(touchId, point);
+ }
return this;
}
#ifdef QT_WIDGETS_LIB
PySideQTouchEventSequence *press(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
- QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(widget, pt));
- p.setState(Qt::TouchPointPressed);
+ auto it = m_points.find(touchId);
+ if (it == m_points.end()) {
+ QEventPoint point(touchId, QEventPoint::Pressed, pt, mapToScreen(widget, pt));
+ m_points.insert(touchId, point);
+ }
return this;
}
PySideQTouchEventSequence *move(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
- QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(widget, pt));
- p.setState(Qt::TouchPointMoved);
+ QEventPoint point(touchId, QEventPoint::Updated, pt, mapToScreen(widget, pt));
+ m_points[touchId] = point;
return this;
}
PySideQTouchEventSequence *release(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
- QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(widget, pt));
- p.setState(Qt::TouchPointReleased);
+ auto it = m_points.find(touchId);
+ if (it == m_points.end()) {
+ QEventPoint point(touchId, QEventPoint::Released, pt, mapToScreen(widget, pt));
+ m_points.insert(touchId, point);
+ }
return this;
}
#endif
void commit(bool processEvents = true)
{
- if (!points.isEmpty()) {
- if (targetWindow)
- {
- qt_handleTouchEvent(targetWindow, device, points.values());
+ if (!m_points.isEmpty()) {
+ if (targetWindow) {
+ qt_handleTouchEvent(targetWindow, device, m_points.values());
}
#ifdef QT_WIDGETS_LIB
- else if (targetWidget)
- {
- qt_handleTouchEvent(targetWidget->windowHandle(), device, points.values());
+ else if (targetWidget) {
+ qt_handleTouchEvent(targetWidget->windowHandle(), device, m_points.values());
}
#endif
}
if (processEvents)
QCoreApplication::processEvents();
- previousPoints = points;
- points.clear();
+ m_previousPoints = m_points;
+ m_points.clear();
}
private:
#ifdef QT_WIDGETS_LIB
- PySideQTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit)
- : targetWidget(widget), targetWindow(0), device(aDevice), commitWhenDestroyed(autoCommit)
+ PySideQTouchEventSequence(QWidget *widget, QPointingDevice *aDevice, bool autoCommit)
+ : targetWidget(widget), device(aDevice), commitWhenDestroyed(autoCommit)
{
}
#endif
- PySideQTouchEventSequence(QWindow *window, QTouchDevice *aDevice, bool autoCommit)
- :
-#ifdef QT_WIDGETS_LIB
- targetWidget(0),
-#endif
- targetWindow(window), device(aDevice), commitWhenDestroyed(autoCommit)
+ PySideQTouchEventSequence(QWindow *window, QPointingDevice *aDevice, bool autoCommit)
+ : targetWindow(window), device(aDevice), commitWhenDestroyed(autoCommit)
{
}
- QTouchEvent::TouchPoint &point(int touchId)
- {
- if (!points.contains(touchId))
- points[touchId] = QTouchEvent::TouchPoint(touchId);
- return points[touchId];
- }
-
- QTouchEvent::TouchPoint &pointOrPreviousPoint(int touchId)
- {
- if (!points.contains(touchId)) {
- if (previousPoints.contains(touchId))
- points[touchId] = previousPoints.value(touchId);
- else
- points[touchId] = QTouchEvent::TouchPoint(touchId);
- }
- return points[touchId];
- }
-
#ifdef QT_WIDGETS_LIB
- QPoint mapToScreen(QWidget *widget, const QPoint &pt)
+ QPointF mapToScreen(const QWidget *widget, const QPointF &pt)
{
if (widget)
return widget->mapToGlobal(pt);
return targetWidget ? targetWidget->mapToGlobal(pt) : pt;
}
#endif
- QPoint mapToScreen(QWindow *window, const QPoint &pt)
+ QPointF mapToScreen(const QWindow *window, const QPointF &pt)
{
if(window)
return window->mapToGlobal(pt);
return targetWindow ? targetWindow->mapToGlobal(pt) : pt;
}
- QMap<int, QTouchEvent::TouchPoint> previousPoints;
- QMap<int, QTouchEvent::TouchPoint> points;
+ QMap<int, QEventPoint> m_previousPoints;
+ QMap<int, QEventPoint> m_points;
#ifdef QT_WIDGETS_LIB
- QWidget *targetWidget;
+ QWidget *targetWidget = nullptr;
#endif
- QWindow *targetWindow;
- QTouchDevice *device;
- bool commitWhenDestroyed;
+ QWindow *targetWindow = nullptr;
+ QPointingDevice *device = nullptr;
+ bool commitWhenDestroyed = false;
#ifdef QT_WIDGETS_LIB
- friend PySideQTouchEventSequence *generateTouchEvent(QWidget *, QTouchDevice *, bool);
+ friend PySideQTouchEventSequence *generateTouchEvent(QWidget *, QPointingDevice *, bool);
#endif
- friend PySideQTouchEventSequence *generateTouchEvent(QWindow *, QTouchDevice *, bool);
+ friend PySideQTouchEventSequence *generateTouchEvent(QWindow *, QPointingDevice *, bool);
};
#ifdef QT_WIDGETS_LIB
inline
PySideQTouchEventSequence *generateTouchEvent(QWidget *widget,
- QTouchDevice *device,
+ QPointingDevice *device,
bool autoCommit = true)
{
return new PySideQTouchEventSequence(widget, device, autoCommit);
@@ -214,7 +202,7 @@ private:
#endif
inline
PySideQTouchEventSequence *generateTouchEvent(QWindow *window,
- QTouchDevice *device,
+ QPointingDevice *device,
bool autoCommit = true)
{
return new PySideQTouchEventSequence(window, device, autoCommit);
diff --git a/sources/pyside2/PySide2/templates/core_common.xml b/sources/pyside2/PySide2/templates/core_common.xml
index 6d02428ad..a7c9eca3d 100644
--- a/sources/pyside2/PySide2/templates/core_common.xml
+++ b/sources/pyside2/PySide2/templates/core_common.xml
@@ -242,8 +242,8 @@
<!-- Helpers for modifying "bool nativeEventFilter(QByteArray, void*, long *result)"
to return a tuple of bool,long -->
<template name="return_native_eventfilter_conversion_variables">
- long resultVar{0};
- long *%out = &amp;resultVar;
+ qintptr resultVar{0};
+ qintptr *%out = &amp;resultVar;
</template>
<template name="return_native_eventfilter_conversion">
%RETURN_TYPE %out = false;
@@ -343,11 +343,7 @@
<template name="checkPyCapsuleOrPyCObject_func">
static bool checkPyCapsuleOrPyCObject(PyObject* pyObj)
{
- #ifdef IS_PY3K
return PyCapsule_CheckExact(pyObj);
- #else
- return PyCObject_Check(pyObj);
- #endif
}
</template>
@@ -377,15 +373,10 @@
</template>
<template name="pydatetime_importandcheck_function">
- #ifdef IS_PY3K
- #define PySideDateTime_IMPORT PyDateTime_IMPORT
- #else
- #define PySideDateTime_IMPORT \
- (PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_Import((char*)"datetime", \
- (char*)"datetime_CAPI"))
- #endif
- static bool PyDateTime_ImportAndCheck(PyObject *pyIn) {
- if (!PyDateTimeAPI) PySideDateTime_IMPORT;
+ static bool PyDateTime_ImportAndCheck(PyObject *pyIn)
+ {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
return $DATETIMETYPE_Check(pyIn);
}
</template>
diff --git a/sources/pyside2/PySide2/templates/gui_common.xml b/sources/pyside2/PySide2/templates/gui_common.xml
index a139a5fe9..fb8e66881 100644
--- a/sources/pyside2/PySide2/templates/gui_common.xml
+++ b/sources/pyside2/PySide2/templates/gui_common.xml
@@ -88,7 +88,7 @@
switch(%CPPSELF.spec()) {
case QColor::Rgb:
{
- qreal r, g, b, a;
+ float r, g, b, a;
%CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);
QString repr = QString::asprintf("PySide2.QtGui.QColor.fromRgbF(%.6f, %.6f, %.6f, %.6f)", r, g, b, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
@@ -96,7 +96,7 @@
}
case QColor::Hsv:
{
- qreal h, s, v, a;
+ float h, s, v, a;
%CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);
QString repr = QString::asprintf("PySide2.QtGui.QColor.fromHsvF(%.6f, %.6f, %.6f, %.6f)", h, s, v, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
@@ -104,7 +104,7 @@
}
case QColor::Cmyk:
{
- qreal c, m, y, k, a;
+ float c, m, y, k, a;
%CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);
QString repr = QString::asprintf("PySide2.QtGui.QColor.fromCmykF(%.6f, %.6f, %.6f, %.6f, %.6f)", c, m, y, k, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
@@ -112,7 +112,7 @@
}
case QColor::Hsl:
{
- qreal h, s, l, a;
+ float h, s, l, a;
%CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);
QString repr = QString::asprintf("PySide2.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)", h, s, l, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
@@ -125,6 +125,15 @@
}
</template>
+ <template name="qkeysequence_repr">
+ QString result;
+ QDebug debug(&amp;result);
+ debug.noquote();
+ debug.nospace();
+ debug &lt;&lt; (*%CPPSELF);
+ %PYARG_0 = Shiboken::String::fromCString(result.toUtf8().constData());
+ </template>
+
<template name="validator_conversionrule">
QValidator::State %out;
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index 14707f964..5022002c9 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -93,7 +93,7 @@ macro(create_pyside_module)
# Contains include directories to pass to shiboken's preprocessor.
# Workaround: Added ${QT_INCLUDE_DIR}/QtCore until
# qtdeclarative/8d560d1bf0a747bf62f73fad6b6774095442d9d2 has reached qt5.git
- string(REPLACE ";" ${PATH_SEP} core_includes "${Qt5Core_INCLUDE_DIRS}")
+ string(REPLACE ";" ${PATH_SEP} core_includes "${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}")
set(shiboken_include_dirs ${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${core_includes})
set(shiboken_framework_include_dirs_option "")
if(CMAKE_HOST_APPLE)
diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt
index ab5d694e7..73b90c059 100644
--- a/sources/pyside2/doc/CMakeLists.txt
+++ b/sources/pyside2/doc/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 3.1)
-cmake_policy(VERSION 3.1)
+cmake_minimum_required(VERSION 3.16)
+cmake_policy(VERSION 3.16)
project(doc)
diff --git a/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h b/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h
index bdb7bcf22..d2cda4aa2 100644
--- a/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h
+++ b/sources/pyside2/doc/codesnippets/examples/mainwindows/application/mainwindow.h
@@ -48,7 +48,8 @@
**
****************************************************************************/
-from PySide2.QtWidgets import (QAction, QApplication, QMainWindow, QMenu,
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import (QApplication, QMainWindow, QMenu,
QPlainTextEdit, QSessionManager)
diff --git a/sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp b/sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
deleted file mode 100644
index 79dc15177..000000000
--- a/sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-def wrapInFunction():
-//! [0]
- # ...
- page = QWebPage()
- # ...
-
- inspector = QWebInspector()
- inspector.setPage(page)
-//! [0]
-
diff --git a/sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebview_snippet.cpp b/sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebview_snippet.cpp
deleted file mode 100644
index 268f4344e..000000000
--- a/sources/pyside2/doc/codesnippets/webkitsnippets/qtwebkit_qwebview_snippet.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-def wrapInFunction():
-//! [0]
- view.page().history()
-//! [0]
-
-
-//! [1]
- view.page().settings()
-//! [1]
-
-
-//! [2]
- view.triggerAction(QWebPage.Copy)
-//! [2]
-
-
-//! [3]
- view.page().triggerPageAction(QWebPage.Stop)
-//! [3]
-
-
-//! [4]
- view.page().triggerPageAction(QWebPage.GoBack)
-//! [4]
-
-
-//! [5]
- view.page().triggerPageAction(QWebPage.GoForward)
-//! [5]
-
diff --git a/sources/pyside2/doc/codesnippets/webkitsnippets/simple/main.cpp b/sources/pyside2/doc/codesnippets/webkitsnippets/simple/main.cpp
deleted file mode 100644
index 1382cd446..000000000
--- a/sources/pyside2/doc/codesnippets/webkitsnippets/simple/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-from PySide2.QtCore import *
-from PySide2.QtGui import *
-from PySide2.QtWebKit import *
-import sys
-
-app = QApplication(sys.argv)
-parent = None
-//! [Using QWebView]
-view = QWebView(parent)
-view.load(QUrl("http://qt-project.org/"))
-view.show()
-//! [Using QWebView]
-sys.exit(app.exec_())
diff --git a/sources/pyside2/doc/codesnippets/webkitsnippets/webelement/main.cpp b/sources/pyside2/doc/codesnippets/webkitsnippets/webelement/main.cpp
deleted file mode 100644
index 67e101ae0..000000000
--- a/sources/pyside2/doc/codesnippets/webkitsnippets/webelement/main.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-def traverse():
-//! [Traversing with QWebElement]
- frame.setHtml("<html><body><p>First Paragraph</p><p>Second Paragraph</p></body></html>")
- doc = frame.documentElement()
- body = doc.firstChild()
- firstParagraph = body.firstChild()
- secondParagraph = firstParagraph.nextSibling()
-//! [Traversing with QWebElement]
-
-def findButtonAndClick():
- frame.setHtml("<form name=\"myform\" action=\"submit_form.asp\" method=\"get\">" \
- "<input type=\"text\" name=\"myfield\">" \
- "<input type=\"submit\" value=\"Submit\">" \
- "</form>")
-
-//! [Calling a DOM element method]
-
- document = frame.documentElement()
- # Assume that the document has the following structure:
- #
- # <form name="myform" action="submit_form.asp" method="get">
- # <input type="text" name="myfield">
- # <input type="submit" value="Submit">
- # </form>
-
- button = document.findFirst("input[type=submit]")
- button.evaluateJavaScript("click()")
-
-//! [Calling a DOM element method]
-
-def autocomplete1():
- document = frame.documentElement()
-//! [autocomplete1]
- firstTextInput = document.findFirst("input[type=text]")
- storedText = firstTextInput.attribute("value")
-//! [autocomplete1]
-
-def autocomplete2():
- document = frame.documentElement()
- storedText = "text"
-
-//! [autocomplete2]
- firstTextInput = document.findFirst("input[type=text]")
- textInput.setAttribute("value", storedText)
-//! [autocomplete2]
-
-def findAll():
-//! [FindAll]
- document = frame.documentElement()
- # Assume the document has the following structure:
- #
- # <p class=intro>
- # <span>Intro</span>
- # <span>Snippets</span>
- # </p>
- # <p>
- # <span>Content</span>
- # <span>Here</span>
- # </p>
-
-//! [FindAll intro]
- allSpans = document.findAll("span")
- introSpans = document.findAll("p.intro span")
-//! [FindAll intro] //! [FindAll]
diff --git a/sources/pyside2/doc/codesnippets/webkitsnippets/webpage/main.cpp b/sources/pyside2/doc/codesnippets/webkitsnippets/webpage/main.cpp
deleted file mode 100644
index b64a4f35b..000000000
--- a/sources/pyside2/doc/codesnippets/webkitsnippets/webpage/main.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of Qt for Python.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//! [0]
-class Thumbnailer (QObject):
- def __init__(self, url):
-//! [1]
- QObject.__init__(self)
- self.page = QWebPage()
- self.page.mainFrame().load(url)
- page.loadFinished[bool].connect(self.render)
-//! [1]
-
- finished = Signal()
-
-//! [2]
- def render(self):
- self.page.setViewportSize(self.page.mainFrame().contentsSize())
- image = QImage(self.page.viewportSize(), QImage.Format_ARGB32)
- painter = QPainter(image)
-
- self.page.mainFrame().render(painter)
- painter.end()
-
- thumbnail = image.scaled(400, 400)
- thumbnail.save("thumbnail.png")
-
- self.finished.emit()
-//! [2]
-//! [0]
-
-app = QApplication(sys.argv)
-
-thumbnail = Thumbnailer(QUrl("http://qt-project.org"))
-thumbnail.finished.connect(app.quit)
-sys.exit(app.exec_())
diff --git a/sources/pyside2/doc/extras/QtQml.qmlRegisterSingletonType.rst b/sources/pyside2/doc/extras/QtQml.qmlRegisterSingletonType.rst
new file mode 100644
index 000000000..2e0f80762
--- /dev/null
+++ b/sources/pyside2/doc/extras/QtQml.qmlRegisterSingletonType.rst
@@ -0,0 +1,44 @@
+.. currentmodule:: PySide2.QtQml
+.. _qmlRegisterSingletonType:
+
+qmlRegisterSingletonType
+************************
+
+.. py:function:: qmlRegisterSingletonType(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str) -> int
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str typeName: name exposed to QML
+ :return: int (the QML type id)
+
+ This function registers a Python type as a singleton in the QML system.
+
+.. py:function:: qmlRegisterSingletonType(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str, callback: object) -> int
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str typeName: name exposed to QML
+ :param object callback: Python callable (to handle Python type)
+ :return: int (the QML type id)
+
+ This function registers a Python type as a singleton in the QML system using
+ the provided callback (which gets a QQmlEngine as a parameter) to generate
+ the singleton.
+
+
+.. py:function:: qmlRegisterSingletonType(uri: str, versionMajor: int, versionMinor: int, typeName: str, callback: object) -> int
+
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str typeName: name exposed to QML
+ :param object callback: Python callable (to handle QJSValue)
+ :return: int (the QML type id)
+
+ This function registers a QJSValue as a singleton in the QML system using
+ the provided callback (which gets a QQmlEngine as a parameter) to
+ generate the singleton.
diff --git a/sources/pyside2/doc/extras/QtQml.qmlRegisterType.rst b/sources/pyside2/doc/extras/QtQml.qmlRegisterType.rst
new file mode 100644
index 000000000..d8bd3acb1
--- /dev/null
+++ b/sources/pyside2/doc/extras/QtQml.qmlRegisterType.rst
@@ -0,0 +1,41 @@
+.. currentmodule:: PySide2.QtQml
+.. _qmlRegisterType:
+
+qmlRegisterType
+***************
+
+.. py:function:: qmlRegisterType(pytype: type, uri: str, versionMajor: int, versionMinor: int, qmlName: str) -> int
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str qmlName: name exposed to QML
+ :return: int (the QML type id)
+
+ This function registers the Python *type* in the QML system with the
+ name *qmlName*, in the library imported from *uri* having the
+ version number composed from *versionMajor* and *versionMinor*.
+
+ For example, this registers a Python class 'MySliderItem' as a QML
+ type named 'Slider' for version '1.0' of a module called
+ 'com.mycompany.qmlcomponents':
+
+ ::
+
+ qmlRegisterType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider")
+
+ Once this is registered, the type can be used in QML by importing
+ the specified module name and version number:
+
+ ::
+
+ import com.mycompany.qmlcomponents 1.0
+
+ Slider { ... }
+
+ Note that it's perfectly reasonable for a library to register types
+ to older versions than the actual version of the library.
+ Indeed, it is normal for the new library to allow QML written to
+ previous versions to continue to work, even if more advanced
+ versions of some of its types are available.
diff --git a/sources/pyside2/doc/extras/QtQml.qmlRegisterUncreatableType.rst b/sources/pyside2/doc/extras/QtQml.qmlRegisterUncreatableType.rst
new file mode 100644
index 000000000..0e73f3d97
--- /dev/null
+++ b/sources/pyside2/doc/extras/QtQml.qmlRegisterUncreatableType.rst
@@ -0,0 +1,36 @@
+.. currentmodule:: PySide2.QtQml
+.. _qmlRegisterUncreatableType:
+
+
+qmlRegisterUncreatableType
+**************************
+
+
+.. py:function:: qmlRegisterUncreatableType(pytype: type, uri: str, versionMajor: int, versionMinor: int, qmlName: str, noCreationReason: str) -> int
+
+
+ :param type pytype: Python class
+ :param str uri: uri to use while importing the component in QML
+ :param int versionMajor: major version
+ :param int versionMinor: minor version
+ :param str qmlName: name exposed to QML
+ :param str noCreationReason: Error message shown when trying to create the QML type
+ :return: int (the QML type id)
+
+ This function registers the Python *type* in the QML system as an uncreatable type with the
+ name *qmlName*, in the library imported from *uri* having the
+ version number composed from *versionMajor* and *versionMinor*,
+ showing *noCreationReason* as an error message when creating the type is attempted.
+
+ For example, this registers a Python class 'MySliderItem' as a QML
+ type named 'Slider' for version '1.0' of a module called
+ 'com.mycompany.qmlcomponents':
+
+ ::
+ qmlRegisterUncreatableType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider", "Slider cannot be created.")
+
+ Note that it's perfectly reasonable for a library to register types
+ to older versions than the actual version of the library.
+ Indeed, it is normal for the new library to allow QML written to
+ previous versions to continue to work, even if more advanced
+ versions of some of its types are available.
diff --git a/sources/pyside2/doc/extras/QtWebKit.rst b/sources/pyside2/doc/extras/QtWebKit.rst
deleted file mode 100644
index 58f9230a7..000000000
--- a/sources/pyside2/doc/extras/QtWebKit.rst
+++ /dev/null
@@ -1,94 +0,0 @@
-QtWebKit provides a Web browser engine that makes it easy to embed content from the World Wide Web into your Qt application. At the same time Web content can be enhanced with native controls.
-
-QtWebKit provides facilities for rendering of HyperText Markup Language (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and scripted with JavaScript.
-
-A bridge between the JavaScript execution environment and the Qt object model makes it possible for custom QObjects to be scripted. Integration with the Qt networking module enables Web pages to be transparently loaded from Web servers, the local file system or even the Qt resource system.
-
-In addition to providing pure rendering features, HTML documents can be made fully editable to the user through the use of the contenteditable attribute on HTML elements.
-
-QtWebKit is based on the Open Source WebKit engine. More information about WebKit itself can be found on the _`WebKit Open Source Project <http://webkit.org/>` Web site.
-
-Including In Your Project
--------------------------
-
-To include the definitions of the module's classes, use the following directive:
-
-::
-
- import PySide2.QtWebKit
-
-
-.. note:: Web site icons, also known as "FavIcons", are currently not supported on Windows. We plan to address this in a future release.
-
-Architecture
-------------
-
-The easiest way to render content is through the QWebView class. As a widget it can be embedded into your forms or a graphics view, and it provides convenience functions for downloading and rendering web sites.
-
-::
-
- view = QWebView(parent)
- view.load(QUrl("http://qt.nokia.com/"))
- view.show()
-
-QWebView is used to view Web pages. An instance of QWebView has one QWebPage. QWebPage provides access to the document structure in a page, describing features such as frames, the navigation history, and the undo/redo stack for editable content.
-
-HTML documents can be nested using frames in a frameset. An individual frame in HTML is represented using the QWebFrame class. This class includes the bridge to the JavaScript window object and can be painted using QPainter. Each QWebPage has one QWebFrame object as its main frame, and the main frame may contain many child frames.
-
-Individual elements of an HTML document can be accessed via DOM JavaScript interfaces from within a web page. The equivalent of this API in QtWebKit is represented by QWebElement. QWebElement objects are obtained using QWebFrame's findAllElements() and findFirstElement() functions with CSS selector queries.
-
-Common web browser features, defaults and other settings can be configured through the QWebSettings class. It is possible to provide defaults for all QWebPage instances through the default settings. Individual attributes can be overidden by the page specific settings object.
-
-Netscape Plugin Support
------------------------
-
-.. note:: Netscape plugin support is only available on desktop platforms.
-
-Since WebKit supports the Netscape Plugin API, Qt applications can display Web pages that embed common plugins on platforms for which those plugins are available. To enable plugin support, the user must have the appropriate binary files for those plugins installed and the ``QWebSettings.PluginsEnabled`` attribute must be enabled for the application.
-
-The following locations are searched for plugins:
-
-* Linux/Unix (X11)
- * .mozilla/plugins in the user's home directory
- * .netscape/plugins in the user's home directory
- * System locations, such as
- * /usr/lib/browser/plugins
- * /usr/local/lib/mozilla/plugins
- * /usr/lib/firefox/plugins
- * /usr/lib64/browser-plugins
- * /usr/lib/browser-plugins
- * /usr/lib/mozilla/plugins
- * /usr/local/netscape/plugins
- * /opt/mozilla/plugins
- * /opt/mozilla/lib/plugins
- * /opt/netscape/plugins
- * /opt/netscape/communicator/plugins
- * /usr/lib/netscape/plugins
- * /usr/lib/netscape/plugins-libc5
- * /usr/lib/netscape/plugins-libc6
- * /usr/lib64/netscape/plugins
- * /usr/lib64/mozilla/plugins
- * Locations specified by environment variables:
- * $MOZILLA_HOME/plugins
- * $MOZ_PLUGIN_PATH
- * $QTWEBKIT_PLUGIN_PATH
-* Windows
- * The user's Application Data\Mozilla\plugins directory
- * Standard system locations of plugins for Quicktime, Flash, etc.
-* Mac OS X
- * Library/Internet Plug-Ins in the user's home directory
- * The system /Library/Internet Plug-Ins directory
-
-License Information
--------------------
-
-Qt Commercial Edition licensees that wish to distribute applications that use the QtWebKit module need to be aware of their obligations under the GNU Library General Public License (LGPL).
-
-Developers using the Open Source Edition can choose to redistribute the module under the appropriate version of the GNU LGPL.
-WebKit is licensed under the GNU Library General Public License. Individual contributor names and copyright dates can be found inline in the code.
-
-This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. \ No newline at end of file
diff --git a/sources/pyside2/doc/modules.rst b/sources/pyside2/doc/modules.rst
index bb4b112a1..f42fac636 100644
--- a/sources/pyside2/doc/modules.rst
+++ b/sources/pyside2/doc/modules.rst
@@ -78,10 +78,6 @@ Qt Modules
Provides information about the X display configuration.
- :mod:`Qt Xml <PySide2.QtXml>`
Provides C++ implementations of SAX and DOM.
- * - :mod:`Qt XmlPatterns <PySide2.QtXmlPatterns>`
- Provides support for XPath, XQuery, XSLTi, and XML Schema validation.
- - :mod:`Qt 3D Core <PySide2.Qt3DCore>`
- Contains functionality to support near-realtime simulation systems.
* - :mod:`Qt 3D Extras <PySide2.Qt3DExtras>`
Provides a set of prebuilt elements to help you get started with Qt 3D.
- :mod:`Qt 3D Input <PySide2.Qt3DInput>`
diff --git a/sources/pyside2/doc/qtmodules/pyside-qtxmlpatterns.qdocconf.in b/sources/pyside2/doc/qtmodules/pyside-qtxmlpatterns.qdocconf.in
deleted file mode 100644
index 9e132ff24..000000000
--- a/sources/pyside2/doc/qtmodules/pyside-qtxmlpatterns.qdocconf.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include(@QT_SRC_DIR@/../qtxmlpatterns/src/xmlpatterns/doc/qtxmlpatterns.qdocconf)
-include(../pyside-config.qdocconf)
diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py
index 188e4930e..d97db65aa 100644
--- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py
+++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize3/main_window.py
@@ -39,8 +39,8 @@
#############################################################################
from PySide2.QtCore import Slot
-from PySide2.QtGui import QKeySequence
-from PySide2.QtWidgets import QMainWindow, QAction
+from PySide2.QtGui import QAction, QKeySequence
+from PySide2.QtWidgets import QMainWindow
class MainWindow(QMainWindow):
diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py
index 6a0374af0..db9517f42 100644
--- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py
+++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize4/main_window.py
@@ -39,8 +39,8 @@
#############################################################################
from PySide2.QtCore import Slot
-from PySide2.QtGui import QKeySequence
-from PySide2.QtWidgets import QMainWindow, QAction
+from PySide2.QtGui import QAction, QKeySequence
+from PySide2.QtWidgets import QMainWindow
class MainWindow(QMainWindow):
diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py
index 5f9003a92..e8979ab25 100644
--- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py
+++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize5/main_window.py
@@ -39,8 +39,8 @@
#############################################################################
from PySide2.QtCore import Slot
-from PySide2.QtGui import QKeySequence
-from PySide2.QtWidgets import QMainWindow, QAction
+from PySide2.QtGui import QAction, QKeySequence
+from PySide2.QtWidgets import QMainWindow
class MainWindow(QMainWindow):
diff --git a/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py b/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py
index 5c2c009d2..ef4e06f41 100644
--- a/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py
+++ b/sources/pyside2/doc/tutorials/datavisualize/datavisualize6/main_window.py
@@ -39,8 +39,8 @@
#############################################################################
from PySide2.QtCore import Slot
-from PySide2.QtGui import QKeySequence
-from PySide2.QtWidgets import QMainWindow, QAction
+from PySide2.QtGui import QAction, QKeySequence
+from PySide2.QtWidgets import QMainWindow
class MainWindow(QMainWindow):
diff --git a/sources/pyside2/doc/tutorials/expenses/main.py b/sources/pyside2/doc/tutorials/expenses/main.py
index c27576029..5dd632301 100644
--- a/sources/pyside2/doc/tutorials/expenses/main.py
+++ b/sources/pyside2/doc/tutorials/expenses/main.py
@@ -40,8 +40,8 @@
import sys
from PySide2.QtCore import Qt, Slot
-from PySide2.QtGui import QPainter
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+from PySide2.QtGui import QAction, QPainter
+from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QVBoxLayout, QWidget)
from PySide2.QtCharts import QtCharts
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py
index 0546bc9f3..9ffb2f9d0 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/02-expenses.py
@@ -39,7 +39,8 @@
#############################################################################
import sys
-from PySide2.QtWidgets import QAction, QApplication, QMainWindow
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QApplication, QMainWindow
class MainWindow(QMainWindow):
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py
index bc753309f..1cb2f0035 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/03-expenses.py
@@ -40,7 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtWidgets import QAction, QApplication, QMainWindow
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QApplication, QMainWindow
from PySide2.QtCharts import QtCharts
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py
index 78e9b1d1d..80a5cb16f 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/04-expenses.py
@@ -40,7 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtWidgets import QAction, QApplication, QMainWindow, QWidget
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QApplication, QMainWindow, QWidget
class Widget(QWidget):
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py
index 6fd515f40..a72f8d990 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/05-expenses.py
@@ -40,7 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QMainWindow,
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QMainWindow,
QTableWidget, QTableWidgetItem, QWidget)
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py
index 38fa881bf..e2c32e5c6 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/06-expenses.py
@@ -40,7 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QVBoxLayout, QWidget)
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py
index 6b915806d..acc7edc7c 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/07-expenses.py
@@ -40,7 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QVBoxLayout, QWidget)
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py
index 2f18dff9f..a6003cb35 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/08-expenses.py
@@ -40,7 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QVBoxLayout, QWidget)
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py
index 6b5d87e2e..3f1aed2c9 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/09-expenses.py
@@ -40,8 +40,8 @@
import sys
from PySide2.QtCore import Slot
-from PySide2.QtGui import QPainter
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+from PySide2.QtGui import QAction, QPainter
+from PySide2.QtWidgets import (QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QVBoxLayout, QWidget)
from PySide2.QtCharts import QtCharts
diff --git a/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py b/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py
index 6cc911671..2a7bddab0 100644
--- a/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py
+++ b/sources/pyside2/doc/tutorials/expenses/steps/10-expenses.py
@@ -40,8 +40,8 @@
import sys
from PySide2.QtCore import Qt, Slot
-from PySide2.QtGui import QPainter
-from PySide2.QtWidgets import (QAction, QApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
+from PySide2.QtGui import QAction, QPainter
+from PySide2.QtWidgets import (QQApplication, QHeaderView, QHBoxLayout, QLabel, QLineEdit,
QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QVBoxLayout, QWidget)
from PySide2.QtCharts import QtCharts
diff --git a/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py b/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py
index 33b92879b..792bcab51 100644
--- a/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py
+++ b/sources/pyside2/doc/tutorials/portingguide/chapter3/bookwindow.py
@@ -40,7 +40,8 @@
from __future__ import print_function, absolute_import
-from PySide2.QtWidgets import (QAction, QAbstractItemView, QDataWidgetMapper,
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import (QAbstractItemView, QDataWidgetMapper,
QHeaderView, QMainWindow, QMessageBox)
from PySide2.QtGui import QKeySequence
from PySide2.QtSql import (QSqlRelation, QSqlRelationalTableModel, QSqlTableModel,
diff --git a/sources/pyside2/libpyside/globalreceiverv2.cpp b/sources/pyside2/libpyside/globalreceiverv2.cpp
index 0377f7697..bfaa9ff44 100644
--- a/sources/pyside2/libpyside/globalreceiverv2.cpp
+++ b/sources/pyside2/libpyside/globalreceiverv2.cpp
@@ -100,9 +100,6 @@ DynamicSlotDataV2::DynamicSlotDataV2(PyObject *callback, GlobalReceiverV2 *paren
//Can not store calback pointe because this will be destroyed at the end of the scope
//To avoid increment intance reference keep the callback information
m_callback = PyMethod_GET_FUNCTION(callback);
-#ifndef IS_PY3K
- m_pyClass = PyMethod_GET_CLASS(callback);
-#endif
m_pythonSelf = PyMethod_GET_SELF(callback);
//monitor class from method lifetime
@@ -140,11 +137,7 @@ PyObject *DynamicSlotDataV2::callback()
//create a callback based on method data
if (m_isMethod)
-#ifdef IS_PY3K
callback = PyMethod_New(m_callback, m_pythonSelf);
-#else
- callback = PyMethod_New(m_callback, m_pythonSelf, m_pyClass);
-#endif
else
Py_INCREF(callback);
@@ -283,11 +276,7 @@ int GlobalReceiverV2::refCount(const QObject *link) const
void GlobalReceiverV2::notify()
{
-#if QT_VERSION >= 0x050E00
const QSet<const QObject *> objSet(m_refs.cbegin(), m_refs.cend());
-#else
- const auto objSet = QSet<const QObject *>::fromList(m_refs);
-#endif
Py_BEGIN_ALLOW_THREADS
for (const QObject *o : objSet) {
QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID);
diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp
index 219b99d48..2404788d3 100644
--- a/sources/pyside2/libpyside/pyside.cpp
+++ b/sources/pyside2/libpyside/pyside.cpp
@@ -473,13 +473,11 @@ QString pyStringToQString(PyObject *str) {
if (str == Py_None)
return QString();
-#ifdef IS_PY3K
if (PyUnicode_Check(str)) {
const char *unicodeBuffer = _PepUnicode_AsString(str);
if (unicodeBuffer)
return QString::fromUtf8(unicodeBuffer);
}
-#endif
if (PyBytes_Check(str)) {
const char *asciiBuffer = PyBytes_AS_STRING(str);
if (asciiBuffer)
diff --git a/sources/pyside2/libpyside/pyside.h b/sources/pyside2/libpyside/pyside.h
index c1a298cc8..e241ac74d 100644
--- a/sources/pyside2/libpyside/pyside.h
+++ b/sources/pyside2/libpyside/pyside.h
@@ -144,9 +144,11 @@ PYSIDE_API PyObject *getWrapperForQObject(QObject *cppSelf, SbkObjectType *sbk_t
#ifdef PYSIDE_QML_SUPPORT
// Used by QtQuick module to notify QtQml that custom QtQuick items can be registered.
-typedef bool (*QuickRegisterItemFunction)(PyObject *pyObj, const char *uri, int versionMajor,
- int versionMinor, const char *qmlName,
- QQmlPrivate::RegisterType *);
+using QuickRegisterItemFunction =
+ bool (*)(PyObject *pyObj, const char *uri, int versionMajor,
+ int versionMinor, const char *qmlName,
+ bool creatable, const char *noCreationReason,
+ QQmlPrivate::RegisterType *);
PYSIDE_API QuickRegisterItemFunction getQuickRegisterItemFunction();
PYSIDE_API void setQuickRegisterItemFunction(QuickRegisterItemFunction function);
#endif // PYSIDE_QML_SUPPORT
@@ -169,4 +171,3 @@ PYSIDE_API bool registerInternalQtConf();
#endif // PYSIDE_H
-
diff --git a/sources/pyside2/libpyside/pysidemetafunction.cpp b/sources/pyside2/libpyside/pysidemetafunction.cpp
index afb3dbb1a..0b7799af1 100644
--- a/sources/pyside2/libpyside/pysidemetafunction.cpp
+++ b/sources/pyside2/libpyside/pysidemetafunction.cpp
@@ -176,14 +176,14 @@ bool call(QObject *self, int methodIndex, PyObject *args, PyObject **retVal)
Shiboken::Conversions::SpecificConverter converter(typeName);
if (converter) {
- int typeId = QMetaType::type(typeName);
+ int typeId = QMetaType::fromName(typeName).id();
if (!Shiboken::Conversions::pythonTypeIsObjectType(converter)) {
if (!typeId) {
PyErr_Format(PyExc_TypeError, "Value types used on meta functions (including signals) need to be "
"registered on meta type: %s", typeName.data());
break;
}
- methValues[i] = QVariant(typeId, static_cast<const void *>(0));
+ methValues[i] = QVariant(static_cast<QVariant::Type>(typeId));
}
methArgs[i] = methValues[i].data();
if (i == 0) // Don't do this for return type
diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp
index 8aaa81205..79464541d 100644
--- a/sources/pyside2/libpyside/pysideproperty.cpp
+++ b/sources/pyside2/libpyside/pysideproperty.cpp
@@ -139,17 +139,8 @@ static void qpropertyMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::C
break;
}
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- case QMetaObject::RegisterQPropertyObserver:
- case QMetaObject::SetQPropertyBinding:
-#else
- case QMetaObject::QueryPropertyDesignable:
- case QMetaObject::QueryPropertyScriptable:
- case QMetaObject::QueryPropertyStored:
- case QMetaObject::QueryPropertyEditable:
- case QMetaObject::QueryPropertyUser:
// just to avoid gcc warnings
-#endif
+ case QMetaObject::BindableProperty:
case QMetaObject::InvokeMetaMethod:
case QMetaObject::CreateInstance:
case QMetaObject::IndexOfMethod:
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index b141ce157..b07a73332 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -141,21 +141,13 @@ namespace PySide
namespace QFlags
{
static PyType_Slot SbkNewQFlagsType_slots[] = {
-#ifdef IS_PY3K
{Py_nb_bool, 0},
-#else
- {Py_nb_nonzero, 0},
- {Py_nb_long, 0},
-#endif
{Py_nb_invert, 0},
{Py_nb_and, 0},
{Py_nb_xor, 0},
{Py_nb_or, 0},
{Py_nb_int, reinterpret_cast<void*>(qflag_int)},
{Py_nb_index, reinterpret_cast<void*>(qflag_int)},
-#ifndef IS_PY3K
- {Py_nb_long, 0},
-#endif
{Py_tp_new, (void *)PySideQFlagsNew},
{Py_tp_richcompare, (void *)PySideQFlagsRichCompare},
{Py_tp_dealloc, (void *)Sbk_object_dealloc},
diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp
index 5c030316e..f3fb4e06d 100644
--- a/sources/pyside2/libpyside/pysidesignal.cpp
+++ b/sources/pyside2/libpyside/pysidesignal.cpp
@@ -227,13 +227,9 @@ static int signalTpInit(PyObject *self, PyObject *args, PyObject *kwds)
Py_ssize_t argument_size = PySequence_Size(argArguments);
for (Py_ssize_t i = 0; i < argument_size; ++i) {
PyObject *item = PySequence_GetItem(argArguments, i);
-#ifdef IS_PY3K
PyObject *strObj = PyUnicode_AsUTF8String(item);
char *s = PyBytes_AsString(strObj);
Py_DECREF(strObj);
-#else
- char *s = PyBytes_AsString(item);
-#endif
Py_DECREF(item);
if (s != nullptr)
data->data->signalArguments->append(QByteArray(s));
diff --git a/sources/pyside2/libpyside/signalmanager.cpp b/sources/pyside2/libpyside/signalmanager.cpp
index 93847e066..0992cfcfd 100644
--- a/sources/pyside2/libpyside/signalmanager.cpp
+++ b/sources/pyside2/libpyside/signalmanager.cpp
@@ -66,9 +66,6 @@
#include <private/qv4engine_p.h>
#include <private/qv4context_p.h>
#include <private/qqmldata_p.h>
-#if QT_VERSION < 0x050700
- #include <private/qqmlcontextwrapper_p.h>
-#endif
#endif
#if QSLOT_CODE != 1 || QSIGNAL_CODE != 2
@@ -85,7 +82,6 @@ namespace {
static PyObject *parseArguments(const QList< QByteArray >& paramTypes, void **args);
static bool emitShortCircuitSignal(QObject *source, int signalIndex, PyObject *args);
-#ifdef IS_PY3K
static void destroyMetaObject(PyObject *obj)
{
void *ptr = PyCapsule_GetPointer(obj, 0);
@@ -95,17 +91,6 @@ namespace {
Shiboken::BindingManager::instance().releaseWrapper(wrapper);
delete meta;
}
-
-#else
- static void destroyMetaObject(void *obj)
- {
- auto meta = reinterpret_cast<PySide::MetaObjectBuilder *>(obj);
- SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);
- if (wrapper)
- Shiboken::BindingManager::instance().releaseWrapper(wrapper);
- delete meta;
- }
-#endif
}
namespace PySide {
@@ -275,9 +260,6 @@ SignalManager::SignalManager() : m_d(new SignalManagerPrivate)
// Register PyObject type to use in queued signal and slot connections
qRegisterMetaType<PyObjectWrapper>("PyObject");
- qRegisterMetaTypeStreamOperators<PyObjectWrapper>("PyObject");
- qRegisterMetaTypeStreamOperators<PyObjectWrapper>("PyObjectWrapper");
- qRegisterMetaTypeStreamOperators<PyObjectWrapper>("PySide::PyObjectWrapper");
SbkConverter *converter = Shiboken::Conversions::createConverter(&PyBaseObject_Type, nullptr);
Shiboken::Conversions::setCppPointerToPythonFunction(converter, PyObject_PTR_CppToPython_PyObject);
@@ -411,13 +393,6 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id,
case QMetaObject::ReadProperty:
case QMetaObject::WriteProperty:
case QMetaObject::ResetProperty:
-# if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- case QMetaObject::QueryPropertyDesignable:
- case QMetaObject::QueryPropertyScriptable:
- case QMetaObject::QueryPropertyStored:
- case QMetaObject::QueryPropertyEditable:
- case QMetaObject::QueryPropertyUser:
-# endif // < Qt 6
pp->d->metaCallHandler(pp, pySelf, call, args);
break;
#endif
@@ -456,15 +431,7 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id,
if (data && !data->jsWrapper.isNullOrUndefined()) {
QV4::ExecutionEngine *engine = data->jsWrapper.engine();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
if (engine->currentStackFrame != nullptr) {
-#elif QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
- if (engine->currentContext->d() != engine->rootContext()->d()) {
-#else
- QV4::ExecutionContext *ctx = engine->currentContext();
- if (ctx->type == QV4::Heap::ExecutionContext::Type_CallContext ||
- ctx->type == QV4::Heap::ExecutionContext::Type_SimpleCallContext) {
-#endif
PyObject *errType, *errValue, *errTraceback;
PyErr_Fetch(&errType, &errValue, &errTraceback);
// PYSIDE-464: The error is only valid before PyErr_Restore,
@@ -477,7 +444,6 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id,
PyErr_Print(); // Note: PyErr_Print clears the error.
-#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
if (isSyntaxError) {
return engine->throwSyntaxError(errString);
} else if (isTypeError) {
@@ -485,18 +451,9 @@ int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id,
} else {
return engine->throwError(errString);
}
-#else
- if (isSyntaxError) {
- return ctx->throwSyntaxError(errString);
- } else if (isTypeError) {
- return ctx->throwTypeError(errString);
- } else {
- return ctx->throwError(errString);
- }
-#endif
}
}
-#endif
+#endif // PYSIDE_QML_PRIVATE_API_SUPPORT
int reclimit = Py_GetRecursionLimit();
// Inspired by Python's errors.c: PyErr_GivenExceptionMatches() function.
@@ -572,11 +529,7 @@ static MetaObjectBuilder *metaBuilderFromDict(PyObject *dict)
// PyDict_GetItem would touch PyThreadState_GET and the global error state.
// PyDict_GetItemWithError instead can work without GIL.
PyObject *pyBuilder = PyDict_GetItemWithError(dict, metaObjectAttr);
-#ifdef IS_PY3K
return reinterpret_cast<MetaObjectBuilder *>(PyCapsule_GetPointer(pyBuilder, nullptr));
-#else
- return reinterpret_cast<MetaObjectBuilder *>(PyCObject_AsVoidPtr(pyBuilder));
-#endif
}
int SignalManager::registerMetaMethodGetIndex(QObject *source, const char *signature, QMetaMethod::MethodType type)
@@ -602,12 +555,7 @@ int SignalManager::registerMetaMethodGetIndex(QObject *source, const char *signa
// Create a instance meta object
if (!dmo) {
dmo = new MetaObjectBuilder(Py_TYPE(pySelf), metaObject);
-#ifdef IS_PY3K
PyObject *pyDmo = PyCapsule_New(dmo, 0, destroyMetaObject);
-#else
- PyObject *pyDmo = PyCObject_FromVoidPtr(dmo, destroyMetaObject);
-#endif
-
PyObject_SetAttr(pySelf, metaObjectAttr, pyDmo);
Py_DECREF(pyDmo);
}
diff --git a/sources/pyside2/plugins/CMakeLists.txt b/sources/pyside2/plugins/CMakeLists.txt
index c9e652800..9be985198 100644
--- a/sources/pyside2/plugins/CMakeLists.txt
+++ b/sources/pyside2/plugins/CMakeLists.txt
@@ -1,21 +1,20 @@
project(plugins)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS UiPlugin)
+
set(ui_plugin_src
customwidgets.cpp
customwidget.cpp
)
-set(ui_plugin_moc
- customwidget.h
- customwidgets.h
-)
-include_directories(${Qt${QT_MAJOR_VERSION}Designer_INCLUDE_DIRS})
-
-if (${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- qt6_wrap_cpp(MOC_FILES ${ui_plugin_moc})
-else()
- qt5_wrap_cpp(MOC_FILES ${ui_plugin_moc})
-endif()
+qt_wrap_cpp(MOC_FILES ${ui_plugin_moc})
add_library(uiplugin STATIC ${ui_plugin_src} ${MOC_FILES})
if(CMAKE_HOST_UNIX AND NOT CYGWIN)
@@ -30,7 +29,10 @@ else()
endif()
target_link_libraries(uiplugin
- ${Qt${QT_MAJOR_VERSION}UiTools_LIBRARY}
+ Qt::Core
+ Qt::Gui
+ Qt::UiPlugin
+ Qt::Widgets
Shiboken2::libshiboken)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_DEBUG_POSTFIX})
diff --git a/sources/pyside2/tests/CMakeLists.txt b/sources/pyside2/tests/CMakeLists.txt
index 285ea872f..86150ac1f 100644
--- a/sources/pyside2/tests/CMakeLists.txt
+++ b/sources/pyside2/tests/CMakeLists.txt
@@ -1,56 +1,52 @@
-if(CMAKE_VERSION VERSION_LESS 2.8)
- message("CMake version greater than 2.8 necessary to run tests")
-else()
- if(NOT CTEST_TESTING_TIMEOUT)
- set(CTEST_TESTING_TIMEOUT 60)
- endif()
-
- # BUILD_DIR and QT_DIR are used by init_paths.py for setting
- # the path to the testbinding module
- get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY)
- get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY)
- set(QT_DIR "${_qt5Core_install_prefix}")
+if(NOT CTEST_TESTING_TIMEOUT)
+ set(CTEST_TESTING_TIMEOUT 60)
+endif()
- macro(TEST_QT_MODULE var name)
- if(NOT DISABLE_${name} AND ${var})
- add_subdirectory(${name})
- endif()
- endmacro()
+# BUILD_DIR and QT_DIR are used by init_paths.py for setting
+# the path to the testbinding module
+get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY)
+get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY)
+set(QT_DIR "${_qt5Core_install_prefix}")
- macro(PYSIDE_TEST)
- string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
- set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
- if (${ARGC} EQUAL 1)
- set(EXPECT_TO_FAIL 0)
- elseif(${ARGC} EQUAL 2)
- set(EXPECT_TO_FAIL ${ARGV1})
- else()
- message(WARNING "Invalid call of macro PYSIDE_TEST")
- endif()
- set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
- add_test(${TEST_NAME} ${TEST_CMD})
- # QT_NO_GLIB=1 is required to avoid crashes on CI RHEL 6.6 machines.
- # See QTBUG-64716 for details.
- set_tests_properties(${TEST_NAME} PROPERTIES
- TIMEOUT ${CTEST_TESTING_TIMEOUT}
- WILL_FAIL ${EXPECT_TO_FAIL}
- ENVIRONMENT "BUILD_DIR=${BUILD_DIR};QT_DIR=${QT_DIR};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1")
- endmacro()
+macro(TEST_QT_MODULE var name)
+ if(NOT DISABLE_${name} AND ${var})
+ add_subdirectory(${name})
+ endif()
+endmacro()
- if (NOT DISABLE_QtCore AND NOT DISABLE_QtGui AND NOT DISABLE_QtWidgets)
- add_subdirectory(pysidetest)
+macro(PYSIDE_TEST)
+ string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
+ set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
+ if (${ARGC} EQUAL 1)
+ set(EXPECT_TO_FAIL 0)
+ elseif(${ARGC} EQUAL 2)
+ set(EXPECT_TO_FAIL ${ARGV1})
+ else()
+ message(WARNING "Invalid call of macro PYSIDE_TEST")
endif()
- add_subdirectory(registry)
- add_subdirectory(signals)
- add_subdirectory(support)
+ set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
+ add_test(${TEST_NAME} ${TEST_CMD})
+ # QT_NO_GLIB=1 is required to avoid crashes on CI RHEL 6.6 machines.
+ # See QTBUG-64716 for details.
+ set_tests_properties(${TEST_NAME} PROPERTIES
+ TIMEOUT ${CTEST_TESTING_TIMEOUT}
+ WILL_FAIL ${EXPECT_TO_FAIL}
+ ENVIRONMENT "BUILD_DIR=${BUILD_DIR};QT_DIR=${QT_DIR};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1")
+endmacro()
- foreach(shortname IN LISTS all_module_shortnames)
- message(STATUS "preparing tests for module 'Qt${shortname}'")
- TEST_QT_MODULE(Qt${QT_MAJOR_VERSION}${shortname}_FOUND Qt${shortname})
- endforeach()
-
- #platform specific
- if (ENABLE_MAC)
- add_subdirectory(mac)
- endif ()
+if (NOT DISABLE_QtCore AND NOT DISABLE_QtGui AND NOT DISABLE_QtWidgets)
+ add_subdirectory(pysidetest)
endif()
+add_subdirectory(registry)
+add_subdirectory(signals)
+add_subdirectory(support)
+
+foreach(shortname IN LISTS all_module_shortnames)
+ message(STATUS "preparing tests for module 'Qt${shortname}'")
+ TEST_QT_MODULE(Qt${QT_MAJOR_VERSION}${shortname}_FOUND Qt${shortname})
+endforeach()
+
+#platform specific
+if (ENABLE_MAC)
+ add_subdirectory(mac)
+endif ()
diff --git a/sources/pyside2/tests/QtCore/CMakeLists.txt b/sources/pyside2/tests/QtCore/CMakeLists.txt
index 9d268e079..ee87345db 100644
--- a/sources/pyside2/tests/QtCore/CMakeLists.txt
+++ b/sources/pyside2/tests/QtCore/CMakeLists.txt
@@ -23,7 +23,6 @@ PYSIDE_TEST(bug_953.py)
PYSIDE_TEST(bug_987.py)
PYSIDE_TEST(bug_994.py)
PYSIDE_TEST(bug_1019.py)
-PYSIDE_TEST(bug_1031.py)
PYSIDE_TEST(bug_1063.py)
PYSIDE_TEST(bug_1069.py)
PYSIDE_TEST(bug_1313.py)
@@ -46,10 +45,8 @@ PYSIDE_TEST(multiple_feature_test.py)
PYSIDE_TEST(python_conversion.py)
PYSIDE_TEST(qabs_test.py)
PYSIDE_TEST(qabstractitemmodel_test.py)
-PYSIDE_TEST(qabstracttransition_test.py)
PYSIDE_TEST(qanimationgroup_test.py)
PYSIDE_TEST(qbitarray_test.py)
-PYSIDE_TEST(qbytearray_buffer_protocol_test.py)
PYSIDE_TEST(qbytearray_concatenation_operator_test.py)
PYSIDE_TEST(qbytearray_operator_iadd_test.py)
PYSIDE_TEST(qbytearray_operator_test.py)
@@ -99,7 +96,6 @@ PYSIDE_TEST(qpoint_test.py)
PYSIDE_TEST(qprocess_test.py)
PYSIDE_TEST(qproperty_decorator.py)
PYSIDE_TEST(qrect_test.py)
-PYSIDE_TEST(qregexp_test.py)
PYSIDE_TEST(qregularexpression_test.py)
PYSIDE_TEST(qresource_test.py)
PYSIDE_TEST(qsettings_test.py)
@@ -108,12 +104,9 @@ PYSIDE_TEST(qslot_object_test.py)
PYSIDE_TEST(qsocketnotifier_test.py)
PYSIDE_TEST(qsrand_test.py)
PYSIDE_TEST(qstandardpaths_test.py)
-PYSIDE_TEST(qstatemachine_test.py)
-PYSIDE_TEST(qstate_test.py)
PYSIDE_TEST(qstorageinfo_test.py)
PYSIDE_TEST(qstring_test.py)
PYSIDE_TEST(qsysinfo_test.py)
-PYSIDE_TEST(qtext_codec_test.py)
PYSIDE_TEST(qtextstream_test.py)
PYSIDE_TEST(qthread_prod_cons_test.py)
PYSIDE_TEST(qthread_signal_test.py)
diff --git a/sources/pyside2/tests/QtCore/bug_1031.py b/sources/pyside2/tests/QtCore/bug_1031.py
deleted file mode 100644
index 6a7f248cc..000000000
--- a/sources/pyside2/tests/QtCore/bug_1031.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths()
-
-from PySide2.QtCore import QStateMachine, QState
-
-mach = QStateMachine()
-state = QState(mach)
-print(state.machine())
diff --git a/sources/pyside2/tests/QtCore/bug_1063.py b/sources/pyside2/tests/QtCore/bug_1063.py
index 73291bffc..db55dc1e0 100644
--- a/sources/pyside2/tests/QtCore/bug_1063.py
+++ b/sources/pyside2/tests/QtCore/bug_1063.py
@@ -38,7 +38,7 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2 import QtCore
-import py3kcompat as py3k
+
class QTextStreamTestCase(unittest.TestCase):
def setUp(self):
@@ -46,7 +46,7 @@ class QTextStreamTestCase(unittest.TestCase):
self.temp_file.close()
self.f = QtCore.QFile(self.temp_file.name)
self.f.open(QtCore.QIODevice.WriteOnly)
- self.strings = (py3k.unicode_('foo'), py3k.unicode_('bar'))
+ self.strings = ('foo', 'bar')
self.stream = QtCore.QTextStream(self.f)
def testIt(self):
diff --git a/sources/pyside2/tests/QtCore/bug_1313.py b/sources/pyside2/tests/QtCore/bug_1313.py
index a24c53b99..9f7742c84 100644
--- a/sources/pyside2/tests/QtCore/bug_1313.py
+++ b/sources/pyside2/tests/QtCore/bug_1313.py
@@ -37,7 +37,6 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2 import QtCore
-import py3kcompat as py3k
class MyQObject(QtCore.QObject):
@@ -51,11 +50,9 @@ async def demo_coroutine():
"""
-if py3k.IS_PY3K:
- exec(demo_coroutine_definition_code)
+exec(demo_coroutine_definition_code)
-@unittest.skipIf(not py3k.IS_PY3K, "Requires Python 3 due to use of async def")
class CoroutineRaisesStopIterationTestCase(unittest.TestCase):
def setUp(self):
self.coroutine = demo_coroutine()
diff --git a/sources/pyside2/tests/QtCore/bug_938.py b/sources/pyside2/tests/QtCore/bug_938.py
index bbac1845b..4e70a8604 100644
--- a/sources/pyside2/tests/QtCore/bug_938.py
+++ b/sources/pyside2/tests/QtCore/bug_938.py
@@ -35,14 +35,14 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import *
-import py3kcompat as py3k
+
class TestBug938 (unittest.TestCase):
def testIt(self):
b = QBuffer()
b.open(QBuffer.WriteOnly)
- b.write(py3k.b("\x0023\x005"))
+ b.write(bytes("\x0023\x005", "UTF-8"))
b.close()
self.assertEqual(b.buffer().size(), 5)
diff --git a/sources/pyside2/tests/QtCore/bug_994.py b/sources/pyside2/tests/QtCore/bug_994.py
index 1a9649a10..5465f4e01 100644
--- a/sources/pyside2/tests/QtCore/bug_994.py
+++ b/sources/pyside2/tests/QtCore/bug_994.py
@@ -34,16 +34,15 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtCore import QIODevice, QTextStream
class MyIODevice (QIODevice):
def readData(self, amount):
- return py3k.b("\0a" * int(amount/2))
+ return bytes("\0a" * int(amount/2), "UTF-8")
def readLineData(self, maxSize):
- return py3k.b("\0b" * 4)
+ return bytes("\0b" * 4, "UTF-8")
def atEnd(self):
return False
diff --git a/sources/pyside2/tests/QtCore/deepcopy_test.py b/sources/pyside2/tests/QtCore/deepcopy_test.py
index ab17a2e14..2fafea354 100644
--- a/sources/pyside2/tests/QtCore/deepcopy_test.py
+++ b/sources/pyside2/tests/QtCore/deepcopy_test.py
@@ -37,7 +37,6 @@ init_test_paths(False)
from PySide2.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF
from PySide2.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QDir, QPoint, QPointF
-import py3kcompat as py3k
try:
from PySide2.QtCore import QUuid
HAVE_Q = True
@@ -52,7 +51,7 @@ class DeepCopyHelper:
class QByteArrayDeepCopy(DeepCopyHelper, unittest.TestCase):
def setUp(self):
- self.original = QByteArray(py3k.b('the quick brown fox jumps over the lazy dog'))
+ self.original = QByteArray(bytes('the quick brown fox jumps over the lazy dog', "UTF-8"))
class QDateDeepCopy(DeepCopyHelper, unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qabstracttransition_test.py b/sources/pyside2/tests/QtCore/qabstracttransition_test.py
deleted file mode 100644
index 063d266d2..000000000
--- a/sources/pyside2/tests/QtCore/qabstracttransition_test.py
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-from sys import getrefcount
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import *
-
-def addStates(transition):
- sx = QState()
- sy = QState()
- transition.setTargetStates([sx, sy])
-
-def addAnimation(transition):
- animation = QParallelAnimationGroup()
- transition.addAnimation(animation)
-
-class QAbstractTransitionTest(unittest.TestCase):
-
- def testBasic(self):
- app = QCoreApplication([])
-
- o = QObject()
- o.setProperty("text", "INdT")
-
- machine = QStateMachine()
- s1 = QState()
- s1.assignProperty(o, "text", "Rocks")
-
- s2 = QFinalState()
- t = s1.addTransition(o, SIGNAL("change()"), s2)
-
- self.assertEqual(t.targetStates(), [s2])
-
- addStates(t)
- self.assertEqual(len(t.targetStates()), 2)
-
- animation = QParallelAnimationGroup()
- t.addAnimation(animation)
-
- self.assertEqual(t.animations(), [animation])
-
- addAnimation(t)
- self.assertEqual(t.animations()[0].parent(), None)
-
- machine.addState(s1)
- machine.addState(s2)
- machine.setInitialState(s1)
- machine.start()
-
- QTimer.singleShot(100, app.quit)
- app.exec_()
-
- def testRefCountOfTargetState(self):
- transition = QEventTransition()
- state1 = QState()
- refcount1 = getrefcount(state1)
-
- transition.setTargetState(state1)
-
- self.assertEqual(transition.targetState(), state1)
- self.assertEqual(getrefcount(transition.targetState()), refcount1 + 1)
-
- state2 = QState()
- refcount2 = getrefcount(state2)
-
- transition.setTargetState(state2)
-
- self.assertEqual(transition.targetState(), state2)
- self.assertEqual(getrefcount(transition.targetState()), refcount2 + 1)
- self.assertEqual(getrefcount(state1), refcount1)
-
- del transition
-
- self.assertEqual(getrefcount(state2), refcount2)
-
- def testRefCountOfTargetStates(self):
- transition = QEventTransition()
- state1 = QState()
- state2 = QState()
- states = [state1, state2]
- refcount1 = getrefcount(state1)
- refcount2 = getrefcount(state2)
-
- transition.setTargetStates(states)
-
- self.assertEqual(transition.targetStates(), states)
- self.assertEqual(transition.targetState(), state1)
- self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1)
- self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1)
-
- del states
- del transition
-
- self.assertEqual(getrefcount(state1), refcount1 - 1)
- self.assertEqual(getrefcount(state2), refcount2 - 1)
-
- def testRefCountOfTargetStatesAfterSingleTargetState(self):
- transition = QEventTransition()
- state0 = QState()
- refcount0 = getrefcount(state0)
-
- transition.setTargetState(state0)
-
- self.assertEqual(transition.targetState(), state0)
- self.assertEqual(getrefcount(transition.targetState()), refcount0 + 1)
-
- state1 = QState()
- state2 = QState()
- states = [state1, state2]
- refcount1 = getrefcount(state1)
- refcount2 = getrefcount(state2)
-
- transition.setTargetStates(states)
-
- self.assertEqual(getrefcount(state0), refcount0)
- self.assertEqual(transition.targetStates(), states)
- self.assertEqual(transition.targetState(), state1)
- self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1)
- self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1)
-
- del states
- del transition
-
- self.assertEqual(getrefcount(state1), refcount1 - 1)
- self.assertEqual(getrefcount(state2), refcount2 - 1)
-
- def testRefCountOfTargetStatesBeforeSingleTargetState(self):
- transition = QEventTransition()
- state1 = QState()
- state2 = QState()
- states = [state1, state2]
- refcount1 = getrefcount(state1)
- refcount2 = getrefcount(state2)
-
- transition.setTargetStates(states)
-
- self.assertEqual(transition.targetStates(), states)
- self.assertEqual(transition.targetState(), state1)
- self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1)
- self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1)
-
- state3 = QState()
- refcount3 = getrefcount(state3)
-
- transition.setTargetState(state3)
-
- self.assertEqual(transition.targetState(), state3)
- self.assertEqual(getrefcount(transition.targetState()), refcount3 + 1)
-
- del states
-
- self.assertEqual(getrefcount(state1), refcount1 - 1)
- self.assertEqual(getrefcount(state2), refcount2 - 1)
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py
deleted file mode 100644
index 20f8fa915..000000000
--- a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-'''Tests QByteArray implementation of Python buffer protocol'''
-
-import os
-from os.path import isdir
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-import py3kcompat as py3k
-
-from PySide2.QtCore import QByteArray
-
-
-class QByteArrayBufferProtocolTest(unittest.TestCase):
- '''Tests QByteArray implementation of Python buffer protocol'''
-
- def testQByteArrayBufferProtocol(self):
- if py3k.IS_PY3K:
- return
- #Tests QByteArray implementation of Python buffer protocol using the os.path.isdir
- #function which an unicode object or other object implementing the Python buffer protocol
- isdir(QByteArray('/tmp'))
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py
index 1375c3ab3..6d369bf0b 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py
@@ -40,25 +40,25 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QByteArray
-import py3kcompat as py3k
+
class QByteArrayConcatenationOperatorTest(unittest.TestCase):
'''Test cases for QByteArray concatenation with '+' operator'''
def testConcatQByteArrayAndPythonString(self):
#Test concatenation of a QByteArray with a Python bytes, in this order
- qba = QByteArray(py3k.b('foo'))
- result = qba + py3k.b('\x00bar')
+ qba = QByteArray(bytes('foo', "UTF-8"))
+ result = qba + bytes('\x00bar', "UTF-8")
self.assertEqual(type(result), QByteArray)
- self.assertEqual(result, py3k.b('foo\x00bar'))
+ self.assertEqual(result, bytes('foo\x00bar', "UTF-8"))
def testConcatPythonStringAndQByteArray(self):
#Test concatenation of a Python bytes with a QByteArray, in this order
concat_python_string_add_qbytearray_worked = True
- qba = QByteArray(py3k.b('foo'))
- result = py3k.b('bar\x00') + qba
+ qba = QByteArray(bytes('foo', "UTF-8"))
+ result = bytes('bar\x00', "UTF-8") + qba
self.assertEqual(type(result), QByteArray)
- self.assertEqual(result, py3k.b('bar\x00foo'))
+ self.assertEqual(result, bytes('bar\x00foo', "UTF-8"))
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py
index d0a65465b..da9ca5b38 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py
@@ -36,7 +36,7 @@ init_test_paths(False)
from PySide2.QtCore import QByteArray
from helper.docmodifier import DocModifier
-import py3kcompat as py3k
+
class BaseQByteArrayOperatorIAdd(object):
'''Base class for QByteArray += operator tests.
@@ -49,21 +49,21 @@ class BaseQByteArrayOperatorIAdd(object):
def testSingleString(self):
'''QByteArray += bytes of size 1'''
- s = py3k.b('0')
+ s = bytes('0', "UTF-8")
self.obj += s
self.assertEqual(self.obj, self.orig_obj + s)
self.assertEqual(self.obj.size(), self.orig_obj.size() + len(s))
def testString(self):
'''QByteArray += bytes of size > 1'''
- s = bytearray(py3k.b('dummy'))
+ s = bytearray(bytes('dummy', "UTF-8"))
self.obj += s # XXx iadd support abytearray
self.assertEqual(self.obj, self.orig_obj + s)
self.assertEqual(self.obj.size(), self.orig_obj.size() + len(s))
def testQByteArray(self):
'''QByteArray += QByteArray'''
- s = QByteArray(py3k.b('array'))
+ s = QByteArray(bytes('array', "UTF-8"))
self.obj += s
self.assertEqual(self.obj, self.orig_obj + s)
@@ -86,8 +86,8 @@ class ValidQByteArrayOperatorIAdd(unittest.TestCase, BaseQByteArrayOperatorIAdd)
doc_filter = lambda x: x.startswith('test')
def setUp(self):
- self.obj = QByteArray(py3k.b('some byte array'))
- self.orig_obj = QByteArray(py3k.b('some byte array'))
+ self.obj = QByteArray(bytes('some byte array', "UTF-8"))
+ self.orig_obj = QByteArray(bytes('some byte array', "UTF-8"))
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py
index b19179429..01000341c 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py
@@ -39,8 +39,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import QByteArray
class QByteArrayOperatorEqual(unittest.TestCase):
@@ -54,12 +52,12 @@ class QByteArrayOperatorEqual(unittest.TestCase):
def testSimple(self):
#QByteArray(some_string) == QByteArray(some_string)
- string = py3k.b('egg snakes')
+ string = bytes('egg snakes', "UTF-8")
self.assertEqual(QByteArray(string), QByteArray(string))
def testPyString(self):
#QByteArray(string) == string
- string = py3k.b('my test string')
+ string = bytes('my test string', "UTF-8")
self.assertEqual(QByteArray(string), string)
class QByteArrayOperatorAt(unittest.TestCase):
@@ -68,30 +66,30 @@ class QByteArrayOperatorAt(unittest.TestCase):
def testInRange(self):
#QByteArray[x] where x is a valid index
string = 'abcdefgh'
- obj = QByteArray(py3k.b(string))
+ obj = QByteArray(bytes(string, "UTF-8"))
for i in range(len(string)):
- self.assertEqual(obj[i], py3k.b(string[i]))
+ self.assertEqual(obj[i], bytes(string[i], "UTF-8"))
def testInRangeReverse(self):
#QByteArray[x] where x is a valid index (reverse order)
string = 'abcdefgh'
- obj = QByteArray(py3k.b(string))
+ obj = QByteArray(bytes(string, "UTF-8"))
for i in range(len(string)-1, 0, -1):
- self.assertEqual(obj[i], py3k.b(string[i]))
+ self.assertEqual(obj[i], bytes(string[i], "UTF-8"))
def testOutOfRange(self):
#QByteArray[x] where x is out of index
- string = py3k.b('1234567')
+ string = bytes('1234567', "UTF-8")
obj = QByteArray(string)
self.assertRaises(IndexError, lambda :obj[len(string)])
def testNullStrings(self):
- ba = QByteArray(py3k.b('\x00'))
+ ba = QByteArray(bytes('\x00', "UTF-8"))
self.assertEqual(ba.at(0), '\x00')
- self.assertEqual(ba[0], py3k.b('\x00'))
+ self.assertEqual(ba[0], bytes('\x00', "UTF-8"))
class QByteArrayOperatorLen(unittest.TestCase):
'''Test case for __len__ operator of QByteArray'''
@@ -99,9 +97,9 @@ class QByteArrayOperatorLen(unittest.TestCase):
def testBasic(self):
'''QByteArray __len__'''
self.assertEqual(len(QByteArray()), 0)
- self.assertEqual(len(QByteArray(py3k.b(''))), 0)
- self.assertEqual(len(QByteArray(py3k.b(' '))), 1)
- self.assertEqual(len(QByteArray(py3k.b('yabadaba'))), 8)
+ self.assertEqual(len(QByteArray(bytes('', "UTF-8"))), 0)
+ self.assertEqual(len(QByteArray(bytes(' ', "UTF-8"))), 1)
+ self.assertEqual(len(QByteArray(bytes('yabadaba', "UTF-8"))), 8)
class QByteArrayOperatorStr(unittest.TestCase):
@@ -110,8 +108,8 @@ class QByteArrayOperatorStr(unittest.TestCase):
def testBasic(self):
'''QByteArray __str__'''
self.assertEqual(QByteArray().__str__(), str(b''))
- self.assertEqual(QByteArray(py3k.b('')).__str__(), str(b''))
- self.assertEqual(QByteArray(py3k.b('aaa')).__str__(), str(b'aaa'))
+ self.assertEqual(QByteArray(bytes('', "UTF-8")).__str__(), str(b''))
+ self.assertEqual(QByteArray(bytes('aaa', "UTF-8")).__str__(), str(b'aaa'))
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtCore/qbytearray_test.py b/sources/pyside2/tests/QtCore/qbytearray_test.py
index c17b7efb1..529941706 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_test.py
@@ -41,32 +41,31 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtCore import QByteArray, QSettings, QObject, QDataStream, QIODevice
class QByteArrayTestToNumber(unittest.TestCase):
def testToNumberInt(self):
- obj = QByteArray(py3k.b('37'))
+ obj = QByteArray(bytes('37', "UTF8"))
self.assertEqual((37, True), obj.toInt())
def testToNumberUShort(self):
- obj = QByteArray(py3k.b('37'))
+ obj = QByteArray(bytes('37', "UTF8"))
self.assertEqual((37, True), obj.toUShort())
def testToNumberFloat(self):
- obj = QByteArray(py3k.b('37.109'))
+ obj = QByteArray(bytes('37.109', "UTF8"))
self.assertEqual((ctypes.c_float(37.109).value, True),
obj.toFloat())
def testToNumberDouble(self):
- obj = QByteArray(py3k.b('37.109'))
+ obj = QByteArray(bytes('37.109', "UTF8"))
self.assertEqual((ctypes.c_double(37.109).value, True),
obj.toDouble())
def testSetNum(self):
b = QByteArray()
- b.setNum(py3k.long(-124124))
+ b.setNum(int(-124124))
self.assertEqual(b, "-124124")
b = QByteArray()
b.setNum(-124124)
@@ -76,7 +75,7 @@ class QByteArrayTestToNumber(unittest.TestCase):
self.assertEqual(b, "-0.5")
def testNumber(self):
- b = QByteArray.number(py3k.long(-124124))
+ b = QByteArray.number(int(-124124))
self.assertEqual(b, "-124124")
b = QByteArray.number(-124124)
self.assertEqual(b, "-124124")
@@ -85,9 +84,9 @@ class QByteArrayTestToNumber(unittest.TestCase):
def testAppend(self):
b = QByteArray()
- b.append(py3k.b("A"))
+ b.append(bytes("A", "UTF8"))
self.assertEqual(b.size(), 1)
- b.append(py3k.b("AB"))
+ b.append(bytes("AB", "UTF8"))
self.assertEqual(b.size(), 3)
@@ -96,7 +95,7 @@ class QByteArraySplit(unittest.TestCase):
def testPathSeparator(self):
#QByteArray.split('/')
- obj = QByteArray(py3k.b(unittest.__file__))
+ obj = QByteArray(bytes(unittest.__file__, "UTF8"))
self.assertEqual(obj.split('/'), unittest.__file__.split('/'))
class QByteArrayData(unittest.TestCase):
@@ -104,14 +103,14 @@ class QByteArrayData(unittest.TestCase):
'''Test case for QByteArray.data'''
def testData(self):
- url = QByteArray(py3k.b("http://pyside.org"))
- self.assertEqual(url.data(), py3k.b("http://pyside.org"))
+ url = QByteArray(bytes("http://pyside.org", "UTF8"))
+ self.assertEqual(url.data(), bytes("http://pyside.org", "UTF8"))
def testDataWithZeros(self):
- s1 = py3k.b("123\000321")
+ s1 = bytes("123\000321", "UTF8")
ba = QByteArray(s1)
s2 = ba.data()
- self.assertEqual(py3k.b(s1), s2)
+ self.assertEqual(s1, s2)
self.assertEqual(s1, ba)
class QByteArrayOperatorAtSetter(unittest.TestCase):
@@ -119,9 +118,9 @@ class QByteArrayOperatorAtSetter(unittest.TestCase):
def testSetterString(self):
'''QByteArray[x] = pythonstring'''
- obj = QByteArray(py3k.b('123456'))
- obj[1] = py3k.b('0')
- self.assertEqual(obj, QByteArray(py3k.b('103456')))
+ obj = QByteArray(bytes('123456', "UTF8"))
+ obj[1] = bytes('0', "UTF8")
+ self.assertEqual(obj, QByteArray(bytes('103456', "UTF8")))
class QByteArrayOnQDataStream(unittest.TestCase):
'''
@@ -139,11 +138,9 @@ class TestBug664(unittest.TestCase):
QByteArray.data() should return correct data
'''
def testIt(self):
- a = QByteArray(py3k.unicode_('hi 猫').encode('utf-8'))
- if py3k.IS_PY3K:
- self.assertEqual(repr(a), "PySide2.QtCore.QByteArray(b'hi \\xe7\\x8c\\xab')")
- else:
- self.assertEqual(repr(a), "PySide2.QtCore.QByteArray('hi \\xe7\\x8c\\xab')")
+ a = QByteArray(bytes('hi 猫', "UTF-8"))
+ self.assertEqual(repr(a), "PySide2.QtCore.QByteArray(b'hi \\xe7\\x8c\\xab')")
+
class QByteArrayOnQVariant(unittest.TestCase):
def testQByteArrayOnQVariant(self):
@@ -155,7 +152,7 @@ class TestBug567(unittest.TestCase):
QByteArray should support slices
'''
def testIt(self):
- ba = QByteArray(py3k.b('1234567890'))
+ ba = QByteArray(bytes('1234567890', "UTF8"))
self.assertEqual(ba[2:4], '34')
self.assertEqual(ba[:4], '1234')
self.assertEqual(ba[4:], '567890')
@@ -165,123 +162,114 @@ class TestBug567(unittest.TestCase):
self.assertEqual(ba[::-2], '08642')
self.assertEqual(ba[2:8:3], '36')
-class QByteArrayBug514(unittest.TestCase):
- def testIt(self):
- data = py3k.b("foobar")
- a = QByteArray.fromRawData(data)
- self.assertEqual(type(a), QByteArray)
- self.assertEqual(a.data(), data)
class TestPickler(unittest.TestCase):
def testIt(self):
- ba = QByteArray(py3k.b("321\x00123"))
+ ba = QByteArray(bytes("321\x00123", "UTF8"))
output = pickle.dumps(str(ba))
ba2 = pickle.loads(output)
self.assertEqual(str(ba), str(ba2))
class QByteArrayBug720(unittest.TestCase):
def testIt(self):
- ba = QByteArray(py3k.b("32\"1\x00123"))
- self.assertEqual(str(ba), str(py3k.b("32\"1\x00123")))
- if py3k.IS_PY3K:
- self.assertEqual(repr(ba), "PySide2.QtCore.QByteArray(b'32\"1\\x00123')")
- else:
- self.assertEqual(repr(ba), "PySide2.QtCore.QByteArray('32\"1\\x00123')")
+ ba = QByteArray(bytes("32\"1\x00123", "UTF8"))
+ self.assertEqual(str(ba), str(bytes("32\"1\x00123", "UTF-8")))
+ self.assertEqual(repr(ba), "PySide2.QtCore.QByteArray(b'32\"1\\x00123')")
class QByteArrayImplicitConvert(unittest.TestCase):
def testString(self):
# No implicit conversions from QByteArray to python string
- ba = QByteArray(py3k.b("object name"))
+ ba = QByteArray(bytes("object name", "UTF8"))
obj = QObject()
self.assertRaises(TypeError, obj.setObjectName, ba)
class QByteArraySliceAssignment(unittest.TestCase):
def testIndexAssignment(self):
- a = QByteArray(py3k.b('abc'))
- a[0] = py3k.b('x')
- self.assertEqual(a[0], py3k.b('x'))
+ a = QByteArray(bytes('abc', "UTF8"))
+ a[0] = bytes('x', "UTF8")
+ self.assertEqual(a[0], bytes('x', "UTF8"))
def test_1():
- a[0] = py3k.b('xy')
+ a[0] = bytes('xy', "UTF8")
self.assertRaises(ValueError, test_1)
def testSliceAssignmentBytes(self):
- b = QByteArray(py3k.b('0123456789'))
- b[2:8] = py3k.b('abcdef')
- self.assertEqual(b[2:8], py3k.b('abcdef'))
+ b = QByteArray(bytes('0123456789', "UTF8"))
+ b[2:8] = bytes('abcdef', "UTF8")
+ self.assertEqual(b[2:8], bytes('abcdef', "UTF8"))
# Delete behavior
b[2:8] = None
- self.assertEqual(b, py3k.b('0189'))
+ self.assertEqual(b, bytes('0189', "UTF8"))
# number of slots and number of values doesn't match
def test_2():
- b[2:8:2] = py3k.b('')
+ b[2:8:2] = bytes('', "UTF8")
self.assertRaises(ValueError, test_2)
- b = QByteArray(py3k.b('0123456789'))
+ b = QByteArray(bytes('0123456789', "UTF8"))
# reverse slice
- b[5:2:-1] = py3k.b('ABC')
- self.assertEqual(b, py3k.b('012CBA6789'))
+ b[5:2:-1] = bytes('ABC', "UTF8")
+ self.assertEqual(b, bytes('012CBA6789', "UTF8"))
# step is not 1
- b[2:9:3] = py3k.b('XYZ')
- self.assertEqual(b, py3k.b('01XCBY67Z9'))
- b = QByteArray(py3k.b('0123456789'))
- b[9:2:-3] = py3k.b('XYZ')
- self.assertEqual(b, py3k.b('012Z45Y78X'))
+ b[2:9:3] = bytes('XYZ', "UTF8")
+ self.assertEqual(b, bytes('01XCBY67Z9', "UTF8"))
+ b = QByteArray(bytes('0123456789', "UTF8"))
+ b[9:2:-3] = bytes('XYZ', "UTF8")
+ self.assertEqual(b, bytes('012Z45Y78X', "UTF8"))
def testSliceAssignmentQByteArray(self):
- b = QByteArray(py3k.b('0123456789'))
- b[2:8] = QByteArray(py3k.b('abcdef'))
- self.assertEqual(b[2:8], py3k.b('abcdef'))
+ b = QByteArray(bytes('0123456789', "UTF8"))
+ b[2:8] = QByteArray(bytes('abcdef', "UTF8"))
+ self.assertEqual(b[2:8], bytes('abcdef', "UTF8"))
# shrink
- b[2:8] = QByteArray(py3k.b('aaa'))
- self.assertEqual(b, py3k.b('01aaa89'))
+ b[2:8] = QByteArray(bytes('aaa', "UTF8"))
+ self.assertEqual(b, bytes('01aaa89', "UTF8"))
# expanse
- b[2:5] = QByteArray(py3k.b('uvwxyz'))
- self.assertEqual(b, py3k.b('01uvwxyz89'))
+ b[2:5] = QByteArray(bytes('uvwxyz', "UTF8"))
+ self.assertEqual(b, bytes('01uvwxyz89', "UTF8"))
# Delete behavior
b[2:8] = QByteArray()
- self.assertEqual(b, py3k.b('0189'))
+ self.assertEqual(b, bytes('0189', "UTF8"))
- b = QByteArray(py3k.b('0123456789'))
+ b = QByteArray(bytes('0123456789', "UTF8"))
# reverse assginment
- b[5:2:-1] = QByteArray(py3k.b('ABC'))
- self.assertEqual(b, py3k.b('012CBA6789'))
+ b[5:2:-1] = QByteArray(bytes('ABC', "UTF8"))
+ self.assertEqual(b, bytes('012CBA6789', "UTF8"))
# step is not 1
- b[2:9:3] = QByteArray(py3k.b('XYZ'))
- self.assertEqual(b, py3k.b('01XCBY67Z9'))
- b = QByteArray(py3k.b('0123456789'))
- b[9:2:-3] = QByteArray(py3k.b('XYZ'))
- self.assertEqual(b, py3k.b('012Z45Y78X'))
+ b[2:9:3] = QByteArray(bytes('XYZ', "UTF8"))
+ self.assertEqual(b, bytes('01XCBY67Z9', "UTF8"))
+ b = QByteArray(bytes('0123456789', "UTF8"))
+ b[9:2:-3] = QByteArray(bytes('XYZ', "UTF8"))
+ self.assertEqual(b, bytes('012Z45Y78X', "UTF8"))
def testSliceAssignmentByteArray(self):
- b = QByteArray(py3k.b('0123456789'))
+ b = QByteArray(bytes('0123456789', "UTF8"))
# replace
- b[2:8] = bytearray(py3k.b('abcdef'))
- self.assertEqual(b[2:8], py3k.b('abcdef'))
+ b[2:8] = bytearray(bytes('abcdef', "UTF8"))
+ self.assertEqual(b[2:8], bytes('abcdef', "UTF8"))
# shrink
- b[2:8] = bytearray(py3k.b('aaa'))
- self.assertEqual(b, py3k.b('01aaa89'))
+ b[2:8] = bytearray(bytes('aaa', "UTF8"))
+ self.assertEqual(b, bytes('01aaa89', "UTF8"))
# expanse
- b[2:5] = bytearray(py3k.b('uvwxyz'))
- self.assertEqual(b, py3k.b('01uvwxyz89'))
+ b[2:5] = bytearray(bytes('uvwxyz', "UTF8"))
+ self.assertEqual(b, bytes('01uvwxyz89', "UTF8"))
# Delete behavior
- b[2:8] = bytearray(py3k.b(''))
- self.assertEqual(b, py3k.b('0189'))
+ b[2:8] = bytearray(bytes('', "UTF8"))
+ self.assertEqual(b, bytes('0189', "UTF8"))
- b = QByteArray(py3k.b('0123456789'))
+ b = QByteArray(bytes('0123456789', "UTF8"))
# reverse assginment
- b[5:2:-1] = bytearray(py3k.b('ABC'))
- self.assertEqual(b, py3k.b('012CBA6789'))
+ b[5:2:-1] = bytearray(bytes('ABC', "UTF8"))
+ self.assertEqual(b, bytes('012CBA6789', "UTF8"))
# step is not 1
- b[2:9:3] = bytearray(py3k.b('XYZ'))
- self.assertEqual(b, py3k.b('01XCBY67Z9'))
- b = QByteArray(py3k.b('0123456789'))
- b[9:2:-3] = bytearray(py3k.b('XYZ'))
- self.assertEqual(b, py3k.b('012Z45Y78X'))
+ b[2:9:3] = bytearray(bytes('XYZ', "UTF8"))
+ self.assertEqual(b, bytes('01XCBY67Z9', "UTF8"))
+ b = QByteArray(bytes('0123456789', "UTF8"))
+ b[9:2:-3] = bytearray(bytes('XYZ', "UTF8"))
+ self.assertEqual(b, bytes('012Z45Y78X', "UTF8"))
def testBufferProtocol(self):
- orig_bytes = py3k.b('0123456789')
+ orig_bytes = bytes('0123456789', "UTF8")
byte_array = QByteArray(orig_bytes)
actual_bytes = bytes(byte_array)
self.assertEqual(orig_bytes, actual_bytes)
diff --git a/sources/pyside2/tests/QtCore/qdatastream_test.py b/sources/pyside2/tests/QtCore/qdatastream_test.py
index a2d2908b2..2ea3460af 100644
--- a/sources/pyside2/tests/QtCore/qdatastream_test.py
+++ b/sources/pyside2/tests/QtCore/qdatastream_test.py
@@ -38,8 +38,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import QBitArray, QByteArray, QIODevice, QDataStream, QDate, QTime, QDateTime
def create_bitarray(string):
@@ -48,6 +46,14 @@ def create_bitarray(string):
array.setBit(i, char != '0')
return array
+
+def serialize_bitarray(bit_array):
+ buffer = QByteArray()
+ stream = QDataStream(buffer, QIODevice.WriteOnly)
+ stream << bit_array
+ return buffer
+
+
class QDataStreamWrite(unittest.TestCase):
'''Test case for QDatastream write* functions'''
@@ -115,32 +121,32 @@ class QDataStreamShift(unittest.TestCase):
self.stream.writeQChar(42)
res = self.read_stream.readQChar()
- self.assertEqual(res, py3k.unichr(42))
+ self.assertEqual(res, chr(42))
def testQCharNull(self):
'''QDataStream <<>> QChar - null'''
self.stream.writeQChar(None)
res = self.read_stream.readQChar()
- self.assertEqual(res, py3k.unicode_('\x00'))
+ self.assertEqual(res, '\x00')
def testQByteArrayValid(self):
'''QDataStream <<>> QByteArray - valid'''
- self.stream << QByteArray(py3k.b("hello"))
+ self.stream << QByteArray(bytes("hello", "UTF-8"))
res = QByteArray()
self.read_stream >> res
- self.assertEqual(res, QByteArray(py3k.b("hello")))
+ self.assertEqual(res, QByteArray(bytes("hello", "UTF-8")))
def testQByteArrayEmpty(self):
'''QDataStream <<>> QByteArray - empty'''
- self.stream << QByteArray(py3k.b(""))
+ self.stream << QByteArray(bytes("", "UTF-8"))
res = QByteArray()
self.read_stream >> res
- self.assertEqual(res, QByteArray(py3k.b("")))
+ self.assertEqual(res, QByteArray(bytes("", "UTF-8")))
self.assertTrue(res.isEmpty())
self.assertFalse(res.isNull())
@@ -160,21 +166,21 @@ class QDataStreamShift(unittest.TestCase):
self.stream.writeQString('Ka-boom')
res = self.read_stream.readQString()
- self.assertEqual(res, py3k.unicode_('Ka-boom'))
+ self.assertEqual(res, 'Ka-boom')
def testQStringEmpty(self):
'''QDataStream <<>> QString - empty'''
self.stream.writeQString('')
res = self.read_stream.readQString()
- self.assertEqual(res, py3k.unicode_(''))
+ self.assertEqual(res, '')
def testQStringNull(self):
'''QDataStream <<>> QString - null'''
self.stream.writeQString(None)
res = self.read_stream.readQString()
- self.assertEqual(res, py3k.unicode_(''))
+ self.assertEqual(res, '')
def testQBitArrayNull(self):
'''QDataStream <<>> QBitArray - null'''
@@ -282,67 +288,23 @@ class QDataStreamShiftBitArray(unittest.TestCase):
def testOk(self):
'''QDataStream with valid QBitArray'''
- data = []
-
- data.append((QByteArray(py3k.b('\x00\x00\x00\x00')), QDataStream.Ok,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x01\x00')), QDataStream.Ok,
- create_bitarray('0')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x01\x01')), QDataStream.Ok,
- create_bitarray('1')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x02\x03')), QDataStream.Ok,
- create_bitarray('11')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x03\x07')), QDataStream.Ok,
- create_bitarray('111')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x04\x0f')), QDataStream.Ok,
- create_bitarray('1111')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x05\x1f')), QDataStream.Ok,
- create_bitarray('11111')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x06\x3f')), QDataStream.Ok,
- create_bitarray('111111')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x07\x7f')), QDataStream.Ok,
- create_bitarray('1111111')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x07\x7e')), QDataStream.Ok,
- create_bitarray('0111111')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x07\x00')), QDataStream.Ok,
- create_bitarray('0000000')))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x07\x39')), QDataStream.Ok,
- create_bitarray('1001110')))
+ test_set = [QBitArray()]
+ for i in range(1, 7):
+ test_set.append(create_bitarray(i * '1'))
+ for s in ['0111111', '0000000', '1001110']:
+ test_set.append(create_bitarray(s))
+ data = []
+ for expected in test_set:
+ data.append((serialize_bitarray(expected), QDataStream.Ok, expected))
self._check_bitarray(data)
def testPastEnd(self):
'''QDataStream >> QBitArray reading past the end of the data'''
- data = []
+ serialized = serialize_bitarray(create_bitarray('1001110'))
+ serialized.resize(serialized.size() - 2)
+ self._check_bitarray([(serialized, QDataStream.ReadPastEnd, QBitArray())])
- data.append((QByteArray(), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00')), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00')), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00\x00')), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x01')), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x02')), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x03')), QDataStream.ReadPastEnd,
- QBitArray()))
- data.append((QByteArray(py3k.b('\x00\x00\x00\x04')), QDataStream.ReadPastEnd,
- QBitArray()))
-
- self._check_bitarray(data)
-
- def testCorruptData(self):
- '''QDataStream reading corrupt data'''
- data = []
-
- data.append((QByteArray(py3k.b('\x00\x00\x00\x01\x02')),
- QDataStream.ReadCorruptData,
- QBitArray()))
-
- self._check_bitarray(data)
class QDataStreamRawData(unittest.TestCase):
def testRawData(self):
@@ -352,10 +314,10 @@ class QDataStreamRawData(unittest.TestCase):
ba = QByteArray()
data = QDataStream(ba, QIODevice.WriteOnly)
data.writeRawData('AB\x00C')
- self.assertEqual(ba.data(), py3k.b('AB\x00C'))
+ self.assertEqual(ba.data(), bytes('AB\x00C', "UTF-8"))
data = QDataStream(ba)
- self.assertEqual(data.readRawData(4), py3k.b('AB\x00C'))
+ self.assertEqual(data.readRawData(4), bytes('AB\x00C', "UTF-8"))
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qfile_test.py b/sources/pyside2/tests/QtCore/qfile_test.py
index 960d0d1d8..57f9f4ee8 100644
--- a/sources/pyside2/tests/QtCore/qfile_test.py
+++ b/sources/pyside2/tests/QtCore/qfile_test.py
@@ -35,8 +35,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import QDir, QFile, QIODevice, QSaveFile, QTemporaryDir
class GetCharTest(unittest.TestCase):
@@ -45,7 +43,7 @@ class GetCharTest(unittest.TestCase):
def setUp(self):
'''Acquire resources'''
handle, self.filename = tempfile.mkstemp()
- os.write(handle, py3k.b('a'))
+ os.write(handle, bytes('a', "UTF-8"))
os.close(handle)
def tearDown(self):
@@ -71,7 +69,7 @@ class GetCharTest(unittest.TestCase):
if sys.version_info[0] >= 3:
self.assertEqual(memory[0], ord('a'))
else:
- self.assertEqual(memory[0], py3k.b('a'))
+ self.assertEqual(memory[0], bytes('a', "UTF-8"))
# now memory points to wild bytes... :-)
# uncommenting this must cause a segfault.
# self.assertEqual(memory[0], 'a')
@@ -84,7 +82,7 @@ class GetCharTest(unittest.TestCase):
self.assertTrue(dir.isValid())
saveFile = QSaveFile(dir.path() + "/test.dat")
self.assertTrue(saveFile.open(QIODevice.WriteOnly))
- saveFile.write(py3k.b("Test"))
+ saveFile.write(bytes("Test", "UTF-8"))
self.assertTrue(saveFile.commit())
self.assertTrue(os.path.exists(QDir.toNativeSeparators(saveFile.fileName())))
diff --git a/sources/pyside2/tests/QtCore/qfileread_test.py b/sources/pyside2/tests/QtCore/qfileread_test.py
index 1a9afd1ab..291bf6f54 100644
--- a/sources/pyside2/tests/QtCore/qfileread_test.py
+++ b/sources/pyside2/tests/QtCore/qfileread_test.py
@@ -35,7 +35,7 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QIODevice, QTemporaryFile
-import py3kcompat as py3k
+
class FileChild1(QTemporaryFile):
pass
@@ -53,11 +53,11 @@ class readDataTest(unittest.TestCase):
'''Acquire resources'''
self.filename1 = FileChild1()
self.assertTrue(self.filename1.open())
- self.filename1.write(py3k.b('Test text for testing'))
+ self.filename1.write(bytes('Test text for testing', "UTF-8"))
self.filename2 = FileChild2()
self.assertTrue(self.filename2.open())
- self.filename2.write(py3k.b('Test text for testing'))
+ self.filename2.write(bytes('Test text for testing', "UTF-8"))
def tearDown(self):
'''release resources'''
diff --git a/sources/pyside2/tests/QtCore/qjsondocument_test.py b/sources/pyside2/tests/QtCore/qjsondocument_test.py
index 3f8a9c848..8ce56d6b9 100644
--- a/sources/pyside2/tests/QtCore/qjsondocument_test.py
+++ b/sources/pyside2/tests/QtCore/qjsondocument_test.py
@@ -39,24 +39,18 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QJsonDocument
-import py3kcompat as py3k
+
class QJsonDocumentTest(unittest.TestCase):
def testToVariant(self):
a = QJsonDocument.fromJson(b'{"test": null}')
self.assertIsInstance(a, QJsonDocument)
- if py3k.IS_PY3K:
- self.assertEqual(str(a.toVariant()), "{'test': None}")
- else:
- self.assertEqual(str(a.toVariant()), "{u'test': None}")
+ self.assertEqual(str(a.toVariant()), "{'test': None}")
b = QJsonDocument.fromJson(b'{"test": [null]}')
self.assertIsInstance(b, QJsonDocument)
- if py3k.IS_PY3K:
- self.assertEqual(str(b.toVariant()), "{'test': [None]}")
- else:
- self.assertEqual(str(b.toVariant()), "{u'test': [None]}")
+ self.assertEqual(str(b.toVariant()), "{'test': [None]}")
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtCore/qlinef_test.py b/sources/pyside2/tests/QtCore/qlinef_test.py
index 084937c06..3d7a42296 100644
--- a/sources/pyside2/tests/QtCore/qlinef_test.py
+++ b/sources/pyside2/tests/QtCore/qlinef_test.py
@@ -44,7 +44,7 @@ class TestQLineF (unittest.TestCase):
def testIntersect(self):
l1 = QLineF(0, 0, 1, 0)
l2 = QLineF(1, -1, 1, 1)
- tuple_ = l1.intersect(l2)
+ tuple_ = l1.intersects(l2)
self.assertEqual(tuple, tuple_.__class__)
(value, p) = tuple_
self.assertEqual(QLineF.BoundedIntersection, value)
diff --git a/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py b/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py
index 225807b9e..52838c95e 100644
--- a/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py
+++ b/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py
@@ -39,11 +39,10 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QCryptographicHash, QMessageAuthenticationCode
-import py3kcompat as py3k
class TestQMessageAuthenticationCode (unittest.TestCase):
def test(self):
- code = QMessageAuthenticationCode(QCryptographicHash.Sha1, py3k.b('bla'))
+ code = QMessageAuthenticationCode(QCryptographicHash.Sha1, bytes('bla', "UTF-8"))
result = code.result()
self.assertTrue(result.size() > 0)
print(result.toHex())
diff --git a/sources/pyside2/tests/QtCore/qobject_parent_test.py b/sources/pyside2/tests/QtCore/qobject_parent_test.py
index 0a02fbc26..386209e8a 100644
--- a/sources/pyside2/tests/QtCore/qobject_parent_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_parent_test.py
@@ -148,10 +148,6 @@ class ParentCase(unittest.TestCase):
res = parent.findChildren(QObject, QRegularExpression("^fo+"))
self.assertEqual(res, test_children)
- # test findChildren with a QRegExp (deprecated)
- res = parent.findChildren(QObject, QRegExp("^fo+"))
- self.assertEqual(res, test_children)
-
def testParentEquality(self):
#QObject.parent() == parent
parent = QObject()
diff --git a/sources/pyside2/tests/QtCore/qobject_test.py b/sources/pyside2/tests/QtCore/qobject_test.py
index dd577ecdc..47a9869d7 100644
--- a/sources/pyside2/tests/QtCore/qobject_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_test.py
@@ -39,8 +39,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import QObject, Signal, Qt
class Obj(QObject):
@@ -73,7 +71,7 @@ class ObjectNameCase(unittest.TestCase):
self.assertEqual('', obj.objectName())
def testUnicode(self):
- name = py3k.unicode_('não')
+ name = 'não'
#FIXME Strange error on upstream when using equal(name, obj)
obj = QObject()
obj.setObjectName(name)
diff --git a/sources/pyside2/tests/QtCore/qprocess_test.py b/sources/pyside2/tests/QtCore/qprocess_test.py
index ec0c9251d..1667f37b3 100644
--- a/sources/pyside2/tests/QtCore/qprocess_test.py
+++ b/sources/pyside2/tests/QtCore/qprocess_test.py
@@ -38,21 +38,19 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import *
class TestQProcess (unittest.TestCase):
def testStartDetached(self):
value, pid = QProcess.startDetached("dir", [], os.getcwd())
self.assertTrue(isinstance(value, bool))
- self.assertTrue(isinstance(pid, py3k.long))
+ self.assertTrue(isinstance(pid, int))
def testPid(self):
p = QProcess()
p.start("dir", [])
p.waitForStarted()
- pid = p.pid()
+ pid = p.processId()
# We can't test the pid method result because it returns 0 when the
# process isn't running
if p.state() == QProcess.Running:
diff --git a/sources/pyside2/tests/QtCore/qregexp_test.py b/sources/pyside2/tests/QtCore/qregexp_test.py
deleted file mode 100644
index a031137fd..000000000
--- a/sources/pyside2/tests/QtCore/qregexp_test.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QRegExp
-
-class QRegExpTest(unittest.TestCase):
-
- def testReplace1(self):
- re = QRegExp('a[mn]')
- string = re.replace('Banana', 'ox')
- self.assertEqual(string, 'Boxoxa')
-
- def testReplace2(self):
- re = QRegExp('<i>([^<]*)</i>')
- string = re.replace('A <i>bon mot</i>.', '\\emph{\\1}')
- self.assertEqual(string, 'A \\emph{bon mot}.')
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/sources/pyside2/tests/QtCore/qregularexpression_test.py b/sources/pyside2/tests/QtCore/qregularexpression_test.py
index fb2e9c24c..50c755d0e 100644
--- a/sources/pyside2/tests/QtCore/qregularexpression_test.py
+++ b/sources/pyside2/tests/QtCore/qregularexpression_test.py
@@ -48,6 +48,7 @@ class QRegularExpressionTest(unittest.TestCase):
match = re.match('word1 word2 word3')
self.assertTrue(match.isValid())
self.assertEqual(match.captured(1), 'word2')
+ self.assertEqual(match.capturedView(1), 'word2')
def testMatchIterator(self):
re = QRegularExpression('(\w+)')
diff --git a/sources/pyside2/tests/QtCore/qsettings_test.py b/sources/pyside2/tests/QtCore/qsettings_test.py
index 639f6d276..814053a85 100644
--- a/sources/pyside2/tests/QtCore/qsettings_test.py
+++ b/sources/pyside2/tests/QtCore/qsettings_test.py
@@ -37,7 +37,6 @@ from init_paths import init_test_paths
init_test_paths(False)
from helper.helper import adjust_filename
-import py3kcompat as py3k
from PySide2.QtCore import QSettings
class TestQSettings(unittest.TestCase):
@@ -49,10 +48,7 @@ class TestQSettings(unittest.TestCase):
self.assertEqual(type(r), list)
r = settings.value('var2')
- if py3k.IS_PY3K:
- self.assertEqual(type(r), str)
- else:
- self.assertEqual(type(r), unicode)
+ self.assertEqual(type(r), str)
r = settings.value('var2', type=list)
self.assertEqual(type(r), list)
diff --git a/sources/pyside2/tests/QtCore/qstate_test.py b/sources/pyside2/tests/QtCore/qstate_test.py
deleted file mode 100644
index 4c97fecca..000000000
--- a/sources/pyside2/tests/QtCore/qstate_test.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import *
-
-
-class QStateTest(unittest.TestCase):
- def testBasic(self):
- app = QCoreApplication([])
-
- o = QObject()
- o.setProperty("text", "INdT")
-
- machine = QStateMachine()
- s1 = QState()
- s1.assignProperty(o, "text", "Rocks");
-
- s2 = QFinalState()
- t = s1.addTransition(o, SIGNAL("change()"), s2);
- self.assertTrue(isinstance(t, QSignalTransition))
-
- machine.addState(s1)
- machine.addState(s2)
- machine.setInitialState(s1)
- machine.start()
-
- o.emit(SIGNAL("change()"))
-
- QTimer.singleShot(100, app.quit)
- app.exec_()
-
- txt = o.property("text")
- self.assertTrue(txt, "Rocks")
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qstatemachine_test.py b/sources/pyside2/tests/QtCore/qstatemachine_test.py
deleted file mode 100644
index 19dcb1e81..000000000
--- a/sources/pyside2/tests/QtCore/qstatemachine_test.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QObject, QState, QFinalState, SIGNAL
-from PySide2.QtCore import QTimer, QStateMachine
-from PySide2.QtCore import QParallelAnimationGroup
-
-from helper.usesqcoreapplication import UsesQCoreApplication
-
-
-class StateMachineTest(unittest.TestCase):
- '''Check presence of State Machine classes'''
-
- def testBasic(self):
- '''State machine classes'''
- import PySide2.QtCore
- PySide2.QtCore.QSignalTransition
- PySide2.QtCore.QPropertyAnimation
-
-
-
-class QStateMachineTest(UsesQCoreApplication):
-
- def cb(self, *args):
- self.assertEqual(self.machine.defaultAnimations(), [self.anim])
-
- def testBasic(self):
- self.machine = QStateMachine()
- s1 = QState()
- s2 = QState()
- s3 = QFinalState()
-
- QObject.connect(self.machine, SIGNAL("started()"), self.cb)
-
- self.anim = QParallelAnimationGroup()
-
- self.machine.addState(s1)
- self.machine.addState(s2)
- self.machine.addState(s3)
- self.machine.setInitialState(s1)
- self.machine.addDefaultAnimation(self.anim)
- self.machine.start()
-
- QTimer.singleShot(100, self.app.quit)
- self.app.exec_()
-
-
-class QSetConverterTest(UsesQCoreApplication):
- '''Test converter of QSet toPython using QStateAnimation.configuration'''
-
- def testBasic(self):
- '''QStateMachine.configuration converting QSet to python set'''
- machine = QStateMachine()
- s1 = QState()
- machine.addState(s1)
- machine.setInitialState(s1)
- machine.start()
-
- QTimer.singleShot(100, self.app.quit)
- self.app.exec_()
-
- configuration = machine.configuration()
-
- self.assertTrue(isinstance(configuration, set))
- self.assertTrue(s1 in configuration)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qstring_test.py b/sources/pyside2/tests/QtCore/qstring_test.py
index c415fdc3d..59512b5a3 100644
--- a/sources/pyside2/tests/QtCore/qstring_test.py
+++ b/sources/pyside2/tests/QtCore/qstring_test.py
@@ -39,7 +39,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtCore import QObject
class QStringConstructor(unittest.TestCase):
@@ -48,11 +47,11 @@ class QStringConstructor(unittest.TestCase):
def testQStringDefault(self):
obj = QObject()
obj.setObjectName('foo')
- self.assertEqual(obj.objectName(), py3k.unicode_('foo'))
- obj.setObjectName(py3k.unicode_('áâãà'))
- self.assertEqual(obj.objectName(), py3k.unicode_('áâãà'))
+ self.assertEqual(obj.objectName(), 'foo')
+ obj.setObjectName('áâãà')
+ self.assertEqual(obj.objectName(), 'áâãà')
obj.setObjectName(None)
- self.assertEqual(obj.objectName(), py3k.unicode_(''))
+ self.assertEqual(obj.objectName(), '')
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qtext_codec_test.py b/sources/pyside2/tests/QtCore/qtext_codec_test.py
deleted file mode 100644
index 9e41c38c6..000000000
--- a/sources/pyside2/tests/QtCore/qtext_codec_test.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import gc
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QTextCodec
-
-class TestCodecGetters(unittest.TestCase):
-
- def testCodecsNames(self):
- for codec_name in QTextCodec.availableCodecs():
- codec = QTextCodec.codecForName(codec_name)
- self.assertTrue(type(codec), QTextCodec)
-
- def testCodecsMibs(self):
- for codec_num in QTextCodec.availableMibs():
- codec = QTextCodec.codecForMib(codec_num)
- self.assertTrue(type(codec), QTextCodec)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtCore/qtextstream_test.py b/sources/pyside2/tests/QtCore/qtextstream_test.py
index bd25367c3..99c231eec 100644
--- a/sources/pyside2/tests/QtCore/qtextstream_test.py
+++ b/sources/pyside2/tests/QtCore/qtextstream_test.py
@@ -36,9 +36,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
-from PySide2.QtCore import QByteArray, QTextStream, QIODevice, QTextCodec, QFile
+from PySide2.QtCore import QByteArray, QTextStream, QIODevice, QFile
class QTextStreamShiftTest(unittest.TestCase):
@@ -53,7 +51,7 @@ class QTextStreamShiftTest(unittest.TestCase):
self.write << '4'
self.write.flush()
res = self.read.readLine()
- self.assertTrue(isinstance(res, py3k.unicode))
+ self.assertTrue(isinstance(res, str))
self.assertEqual(res, '4')
class QTextStreamGetSet(unittest.TestCase):
@@ -61,14 +59,6 @@ class QTextStreamGetSet(unittest.TestCase):
def setUp(self):
self.obj = QTextStream()
-
- def testCodec(self):
- '''QTextStream set/get Codec'''
-
- codec = QTextCodec.codecForName('ISO8859-1')
- self.obj.setCodec(codec)
- self.assertEqual(codec, self.obj.codec())
-
def testDevice(self):
'''QTextStream get/set Device'''
device = QFile()
@@ -83,7 +73,6 @@ class QTextStreamInitialization(unittest.TestCase):
'''QTextStream construction'''
obj = QTextStream()
- self.assertEqual(obj.codec(), QTextCodec.codecForLocale())
self.assertEqual(obj.device(), None)
self.assertEqual(obj.string(), None)
@@ -109,12 +98,12 @@ class QTextStreamReadLinesFromDevice(unittest.TestCase):
data = []
data.append((QByteArray(), []))
- data.append((QByteArray(py3k.b('\n')), ['']))
- data.append((QByteArray(py3k.b('\r\n')), ['']))
- data.append((QByteArray(py3k.b('ole')), ['ole']))
- data.append((QByteArray(py3k.b('ole\n')), ['ole']))
- data.append((QByteArray(py3k.b('ole\r\n')), ['ole']))
- data.append((QByteArray(py3k.b('ole\r\ndole\r\ndoffen')), ['ole', 'dole', 'doffen']))
+ data.append((QByteArray(bytes('\n', "UTF-8")), ['']))
+ data.append((QByteArray(bytes('\r\n', "UTF-8")), ['']))
+ data.append((QByteArray(bytes('ole', "UTF-8")), ['ole']))
+ data.append((QByteArray(bytes('ole\n', "UTF-8")), ['ole']))
+ data.append((QByteArray(bytes('ole\r\n', "UTF-8")), ['ole']))
+ data.append((QByteArray(bytes('ole\r\ndole\r\ndoffen', "UTF-8")), ['ole', 'dole', 'doffen']))
self._check_data(data)
diff --git a/sources/pyside2/tests/QtCore/qtimezone_test.py b/sources/pyside2/tests/QtCore/qtimezone_test.py
index 8c960371f..f22ce73f9 100644
--- a/sources/pyside2/tests/QtCore/qtimezone_test.py
+++ b/sources/pyside2/tests/QtCore/qtimezone_test.py
@@ -35,11 +35,10 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QTimeZone
-import py3kcompat as py3k
class TestQTimeZone (unittest.TestCase):
def testTimeZone(self):
- id = py3k.b('Europe/Berlin')
+ id = bytes('Europe/Berlin', "UTF-8")
timeZone = QTimeZone(id)
self.assertTrue(timeZone.isValid())
self.assertEqual(timeZone.id(), id)
diff --git a/sources/pyside2/tests/QtCore/qurlquery_test.py b/sources/pyside2/tests/QtCore/qurlquery_test.py
index ac7ab69b0..6e538c919 100644
--- a/sources/pyside2/tests/QtCore/qurlquery_test.py
+++ b/sources/pyside2/tests/QtCore/qurlquery_test.py
@@ -45,8 +45,6 @@ class QUrlQueryTest(unittest.TestCase):
def testConstructing(self):
empty = QUrlQuery()
self.assertTrue(empty.isEmpty())
- self.assertEqual(empty.queryPairDelimiter(), QUrlQuery.defaultQueryPairDelimiter())
- self.assertEqual(empty.queryValueDelimiter(), QUrlQuery.defaultQueryValueDelimiter())
empty.clear();
self.assertTrue(empty.isEmpty())
diff --git a/sources/pyside2/tests/QtCore/quuid_test.py b/sources/pyside2/tests/QtCore/quuid_test.py
index da34429f9..ecb4a9562 100644
--- a/sources/pyside2/tests/QtCore/quuid_test.py
+++ b/sources/pyside2/tests/QtCore/quuid_test.py
@@ -43,7 +43,8 @@ from PySide2.QtCore import QUuid
class QUuidTest(unittest.TestCase):
def testFromString(self):
uuidString = '{fc69b59e-cc34-4436-a43c-ee95d128b8c5}'
- uuid = QUuid(uuidString)
+# testing overload QUUid::fromString(QStringView)
+ uuid = QUuid.fromString(uuidString)
self.assertTrue(not uuid.isNull())
self.assertEqual(uuid.toString(), uuidString)
diff --git a/sources/pyside2/tests/QtCore/repr_test.py b/sources/pyside2/tests/QtCore/repr_test.py
index 71bab8330..8a3a1519a 100644
--- a/sources/pyside2/tests/QtCore/repr_test.py
+++ b/sources/pyside2/tests/QtCore/repr_test.py
@@ -37,7 +37,6 @@ init_test_paths(False)
import PySide2
from PySide2.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF
from PySide2.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QPoint, QPointF
-import py3kcompat as py3k
try:
from PySide2.QtCore import QUuid
HAVE_Q = True
@@ -52,7 +51,7 @@ class ReprCopyHelper:
class QByteArrayReprCopy(ReprCopyHelper, unittest.TestCase):
def setUp(self):
- self.original = QByteArray(py3k.b('the quick brown fox jumps over the lazy dog'))
+ self.original = QByteArray(bytes('the quick brown fox jumps over the lazy dog', "UTF-8"))
class QDateReprCopy(ReprCopyHelper, unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py b/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py
index e149f8ffb..2d208cb69 100644
--- a/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py
+++ b/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py
@@ -36,13 +36,13 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import *
+from PySide2.QtCore import QTimer
class SetPropOnCtorTest(unittest.TestCase):
def testIt(self):
- obj = QEventTransition(targetStates = [QState()])
- self.assertEqual(len(obj.targetStates()), 1);
+ timer = QTimer(interval = 42)
+ self.assertEqual(timer.interval(), 42);
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtCore/translation_test.py b/sources/pyside2/tests/QtCore/translation_test.py
index 0f36067bd..beca3a717 100644
--- a/sources/pyside2/tests/QtCore/translation_test.py
+++ b/sources/pyside2/tests/QtCore/translation_test.py
@@ -39,7 +39,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtCore import QObject, QTranslator, QCoreApplication
from helper.usesqcoreapplication import UsesQCoreApplication
@@ -59,7 +58,7 @@ class TranslationTest(UsesQCoreApplication):
obj = QObject()
obj.setObjectName(obj.tr('Hello World!'))
- self.assertEqual(obj.objectName(), py3k.unicode_('Orbis, te saluto!'))
+ self.assertEqual(obj.objectName(), 'Orbis, te saluto!')
def testRussian(self):
#Set string value to Russian
@@ -69,7 +68,7 @@ class TranslationTest(UsesQCoreApplication):
obj = QObject()
obj.setObjectName(obj.tr('Hello World!'))
- self.assertEqual(obj.objectName(), py3k.unicode_('привет мир!'))
+ self.assertEqual(obj.objectName(), 'привет мир!')
def testUtf8(self):
translator = QTranslator()
@@ -78,12 +77,12 @@ class TranslationTest(UsesQCoreApplication):
obj = QObject()
obj.setObjectName(obj.tr('Hello World!'))
- self.assertEqual(obj.objectName(), py3k.unicode_('привет мир!'))
+ self.assertEqual(obj.objectName(), 'привет мир!')
def testTranslateWithNoneDisambiguation(self):
value = 'String here'
obj = QCoreApplication.translate('context', value, None)
- self.assertTrue(isinstance(obj, py3k.unicode))
+ self.assertTrue(isinstance(obj, str))
self.assertEqual(obj, value)
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtCore/unicode_test.py b/sources/pyside2/tests/QtCore/unicode_test.py
index 3f1a4d8dc..28bbafbb0 100644
--- a/sources/pyside2/tests/QtCore/unicode_test.py
+++ b/sources/pyside2/tests/QtCore/unicode_test.py
@@ -39,8 +39,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import QObject
from PySide2.QtCore import QByteArray
@@ -57,13 +55,13 @@ class UnicodeConversion(unittest.TestCase):
#Set regular Python string retrieve unicode
obj = QObject()
obj.setObjectName('test')
- self.assertEqual(obj.objectName(), py3k.unicode_('test'))
+ self.assertEqual(obj.objectName(), 'test')
def testSetUnicodeRetrieveUnicode(self):
#Set Python unicode string and retrieve unicode
obj = QObject()
- obj.setObjectName(py3k.unicode_('ümlaut'))
- self.assertEqual(obj.objectName(), py3k.unicode_('ümlaut'))
+ obj.setObjectName('ümlaut')
+ self.assertEqual(obj.objectName(), 'ümlaut')
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtGui/CMakeLists.txt b/sources/pyside2/tests/QtGui/CMakeLists.txt
index 172703ab9..179e88fd6 100644
--- a/sources/pyside2/tests/QtGui/CMakeLists.txt
+++ b/sources/pyside2/tests/QtGui/CMakeLists.txt
@@ -26,8 +26,6 @@ PYSIDE_TEST(qfontmetrics_test.py)
PYSIDE_TEST(qguiapplication_test.py)
PYSIDE_TEST(qicon_test.py)
PYSIDE_TEST(qitemselection_test.py)
-PYSIDE_TEST(qmatrix_test.py)
-PYSIDE_TEST(qopenglbuffer_test.py)
PYSIDE_TEST(qpainter_test.py)
PYSIDE_TEST(qpdfwriter_test.py)
PYSIDE_TEST(qpixelformat_test.py)
@@ -37,7 +35,6 @@ PYSIDE_TEST(qpolygonf_test.py)
PYSIDE_TEST(qkeysequence_test.py)
PYSIDE_TEST(qradialgradient_test.py)
PYSIDE_TEST(qrasterwindow_test.py)
-PYSIDE_TEST(qopenglwindow_test.py)
PYSIDE_TEST(qregion_test.py)
PYSIDE_TEST(qstylehints_test.py)
PYSIDE_TEST(qtextdocument_functions.py)
diff --git a/sources/pyside2/tests/QtGui/bug_660.py b/sources/pyside2/tests/QtGui/bug_660.py
index 058364d1d..066387498 100644
--- a/sources/pyside2/tests/QtGui/bug_660.py
+++ b/sources/pyside2/tests/QtGui/bug_660.py
@@ -34,7 +34,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtGui import QStandardItemModel, QStandardItem
class MyItemModel(QStandardItemModel):
@@ -44,12 +43,12 @@ class MyItemModel(QStandardItemModel):
def mimeTypes(self):
mtypes = super(MyItemModel,self).mimeTypes()
- mtypes.append(py3k.unicode_('application/my-form'))
+ mtypes.append('application/my-form')
return mtypes
def mimeData(self,indexes):
self.__mimedata = super(MyItemModel,self).mimeData(indexes)
- self.__mimedata.setData(py3k.unicode_('application/my-form'), py3k.b('hi'))
+ self.__mimedata.setData('application/my-form',bytes('hi', "UTF-8"))
return self.__mimedata
class TestBug660(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/bug_740.py b/sources/pyside2/tests/QtGui/bug_740.py
index a4db6e5a8..456749eaa 100644
--- a/sources/pyside2/tests/QtGui/bug_740.py
+++ b/sources/pyside2/tests/QtGui/bug_740.py
@@ -34,14 +34,13 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QSize
from PySide2.QtGui import QBitmap, QImage
class TestQBitmap(UsesQApplication):
def testFromDataMethod(self):
- dataBits = py3k.b('\x38\x28\x38\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\xfe\xfe\x7c\x7c\x38\x38\x10\x10')
+ dataBits = bytes('\x38\x28\x38\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\xfe\xfe\x7c\x7c\x38\x38\x10\x10', "UTF-8")
bim = QBitmap.fromData(QSize(8, 48), dataBits, QImage.Format_Mono) # missing function
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtGui/deepcopy_test.py b/sources/pyside2/tests/QtGui/deepcopy_test.py
index d4dcdd64c..0fa82150f 100644
--- a/sources/pyside2/tests/QtGui/deepcopy_test.py
+++ b/sources/pyside2/tests/QtGui/deepcopy_test.py
@@ -36,7 +36,6 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QPoint
-from PySide2.QtGui import QMatrix
from PySide2.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4
from PySide2.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4
from PySide2.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4
@@ -81,7 +80,7 @@ class QColorCMYKDeepCopy(DeepCopyColorHelperF, unittest.TestCase):
class QTransformDeepCopy(DeepCopyHelper, unittest.TestCase):
def setUp(self):
- self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8)
+ self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8, 9)
class QKeySequenceDeepCopy(DeepCopyHelper, unittest.TestCase):
def setUp(self):
@@ -107,10 +106,6 @@ class QPolygonDeepCopy(DeepCopyHelper, unittest.TestCase):
def setUp(self):
self.original = QPolygon([QPoint(1, 2), QPoint(3, 4), QPoint(5, 6)])
-class QMatrixDeepCopy(DeepCopyHelper, unittest.TestCase):
- def setUp(self):
- self.original = QMatrix(1, 2, 3, 4, 5, 6)
-
# Avoid these tests until get gcc fixed
# Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247
diff --git a/sources/pyside2/tests/QtGui/pyside_reload_test.py b/sources/pyside2/tests/QtGui/pyside_reload_test.py
index f3c7c3e8d..75994f4e4 100644
--- a/sources/pyside2/tests/QtGui/pyside_reload_test.py
+++ b/sources/pyside2/tests/QtGui/pyside_reload_test.py
@@ -26,6 +26,8 @@
##
#############################################################################
+import importlib
+import importlib.util
import os
import shutil
import sys
@@ -35,7 +37,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
orig_path = os.path.join(os.path.dirname(__file__))
workdir = os.getcwd()
@@ -45,11 +46,8 @@ shutil.copyfile(src, dst)
sys.path.append(workdir)
def reload_module(moduleName):
- if py3k.IS_PY3K:
- import importlib
- importlib.reload(moduleName)
- else:
- reload(moduleName)
+ importlib.reload(moduleName)
+
def increment_module_value():
modfile = open(dst, 'a')
@@ -57,11 +55,8 @@ def increment_module_value():
modfile.flush()
modfile.close()
if not sys.dont_write_bytecode:
- if py3k.IS_PY3K:
- import importlib.util
- cacheFile = importlib.util.cache_from_source(dst)
- else:
- cacheFile = dst + 'c'
+ import importlib.util
+ cacheFile = importlib.util.cache_from_source(dst)
os.remove(cacheFile)
class TestModuleReloading(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/qmatrix_test.py b/sources/pyside2/tests/QtGui/qmatrix_test.py
deleted file mode 100644
index 48380faf6..000000000
--- a/sources/pyside2/tests/QtGui/qmatrix_test.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QPoint
-from PySide2.QtGui import QMatrix, QMatrix2x2, QMatrix4x4
-
-
-def qpointTimesQMatrix(point, matrix):
- '''As seen in "QPoint QMatrix::map(const QPoint &p) const" C++ implementation.'''
- return QPoint(matrix.m11() * point.x() + matrix.m21() * point.y() + matrix.dx(),
- matrix.m12() * point.x() + matrix.m22() * point.y() + matrix.dy())
-
-class QMatrixTest(unittest.TestCase):
-
- def testMatrix(self):
- matrix = QMatrix(11, 12, 21, 22, 100, 200)
- point = QPoint(3, 3)
- self.assertEqual(matrix.map(point), qpointTimesQMatrix(point, matrix))
-
- def testMatrixWithWrongType(self):
- matrix = QMatrix(11, 12, 21, 22, 100, 200)
- point = QPoint(3, 3)
- # This exception may move from a TypeError to a ValueError.
- self.assertRaises((TypeError, ValueError), matrix.__mul__, point)
-
- def testMatrix2x2(self):
- matrix = QMatrix2x2([1.0, 2.0, 3.0, 4.0])
-
- expectedTransposed = QMatrix2x2([1.0, 3.0, 2.0, 4.0])
- self.assertEqual(matrix.transposed(), expectedTransposed)
-
- expectedMultiplied = QMatrix2x2([2.0, 4.0, 6.0, 8.0])
- matrix *= 2.0
- self.assertEqual(matrix, expectedMultiplied)
-
- matrix.setToIdentity()
- self.assertTrue(matrix.isIdentity())
-
- def testMatrix4x4(self):
- self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0])
- self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I',
- 4.0, 5.0, 6.0, 7.0,
- 8.0, 9.0, 'N', 11.0,
- 12.0, 'd', 14.0, 'T'])
-
- my_data = [0.0, 1.0, 2.0, 3.0,
- 4.0, 5.0, 6.0, 7.0,
- 8.0, 9.0, 10.0, 11.0,
- 12.0, 13.0, 14.0, 15.0]
- my_datac = [0.0, 4.0, 8.0, 12.0,
- 1.0, 5.0, 9.0, 13.0,
- 2.0, 6.0, 10.0, 14.0,
- 3.0, 7.0, 11.0, 15.0]
-
- m = QMatrix4x4(my_data)
- d = m.data()
- self.assertTrue(my_datac, d)
-
- d = m.copyDataTo()
- self.assertTrue(my_data == list(d))
-
- def testMatrixMapping(self):
- m = QMatrix(1.0, 2.0, 1.0, 3.0, 100.0, 200.0)
- res = m.map(5, 5)
- self.assertAlmostEqual(res[0], 5 * 1.0 + 5 * 1.0 + 100.0)
- self.assertAlmostEqual(res[1], 5 * 2.0 + 5 * 3.0 + 200.0)
- res = m.map(5.0, 5.0)
- self.assertAlmostEqual(res[0], 5.0 * 1.0 + 5.0 * 1.0 + 100.0)
- self.assertAlmostEqual(res[1], 5.0 * 2.0 + 5.0 * 3.0 + 200.0)
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/sources/pyside2/tests/QtGui/qtextdocument_functions.py b/sources/pyside2/tests/QtGui/qtextdocument_functions.py
index 765a6b5b7..bd1462049 100644
--- a/sources/pyside2/tests/QtGui/qtextdocument_functions.py
+++ b/sources/pyside2/tests/QtGui/qtextdocument_functions.py
@@ -35,7 +35,6 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtGui import Qt
-from PySide2.QtCore import QTextCodec
class QTextDocumentFunctions(unittest.TestCase):
@@ -45,8 +44,6 @@ class QTextDocumentFunctions(unittest.TestCase):
self.assertTrue(Qt.mightBeRichText('<html><head/><body><p>bla</p></body></html>'))
html = Qt.convertFromPlainText("A & B", Qt.WhiteSpaceNormal)
self.assertEqual(html, '<p>A &amp; B</p>')
- codec = Qt.codecForHtml(b'bla')
- self.assertTrue(codec)
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py b/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py
index d9d96dd34..7c825b62f 100644
--- a/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py
+++ b/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py
@@ -36,7 +36,7 @@ init_test_paths(False)
from PySide2.QtGui import QTextDocumentWriter, QTextDocument
from PySide2.QtCore import QBuffer
-import py3kcompat as py3k
+
class QTextDocumentWriterTest(unittest.TestCase):
@@ -45,7 +45,7 @@ class QTextDocumentWriterTest(unittest.TestCase):
doc = QTextDocument(text)
b = QBuffer()
b.open(QBuffer.ReadWrite)
- writer = QTextDocumentWriter(b, py3k.b("plaintext"));
+ writer = QTextDocumentWriter(b, bytes("plaintext", "UTF-8"));
writer.write(doc);
b.close()
self.assertEqual(b.buffer(), text)
diff --git a/sources/pyside2/tests/QtGui/repr_test.py b/sources/pyside2/tests/QtGui/repr_test.py
index e06f4d487..6e632b68d 100644
--- a/sources/pyside2/tests/QtGui/repr_test.py
+++ b/sources/pyside2/tests/QtGui/repr_test.py
@@ -36,7 +36,6 @@ init_test_paths(False)
import PySide2
from PySide2.QtCore import QPoint
-from PySide2.QtGui import QMatrix
from PySide2.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4
from PySide2.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4
from PySide2.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4
@@ -52,11 +51,7 @@ class ReprCopyHelper:
class QTransformReprCopy(ReprCopyHelper, unittest.TestCase):
def setUp(self):
- self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8)
-
-class QKeySequenceReprCopy(ReprCopyHelper, unittest.TestCase):
- def setUp(self):
- self.original = QKeySequence("Ctrl+P")
+ self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8, 9)
class QQuaternionReprCopy(ReprCopyHelper, unittest.TestCase):
def setUp(self):
@@ -74,10 +69,6 @@ class QVector4DReprCopy(ReprCopyHelper, unittest.TestCase):
def setUp(self):
self.original = QVector4D(1, 2, 3, 4)
-class QMatrixReprCopy(ReprCopyHelper, unittest.TestCase):
- def setUp(self):
- self.original = QMatrix(1, 2, 3, 4, 5, 6)
-
# Avoid these tests until get gcc fixed
# Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247
diff --git a/sources/pyside2/tests/QtNetwork/bug_1084.py b/sources/pyside2/tests/QtNetwork/bug_1084.py
index d2c273fca..cd8dd7621 100644
--- a/sources/pyside2/tests/QtNetwork/bug_1084.py
+++ b/sources/pyside2/tests/QtNetwork/bug_1084.py
@@ -37,7 +37,7 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2 import QtNetwork
-import py3kcompat as py3k
+
class QTcpSocketTestCase(unittest.TestCase):
def setUp(self):
@@ -45,7 +45,7 @@ class QTcpSocketTestCase(unittest.TestCase):
self.sock.connectToHost('127.0.0.1', 25)
def testIt(self):
- self.sock.write(py3k.b('quit'))
+ self.sock.write(bytes('quit', "UTF-8"))
if __name__ == "__main__":
unittest.main()
diff --git a/sources/pyside2/tests/QtNetwork/bug_446.py b/sources/pyside2/tests/QtNetwork/bug_446.py
index f15ff01f9..7e7242515 100644
--- a/sources/pyside2/tests/QtNetwork/bug_446.py
+++ b/sources/pyside2/tests/QtNetwork/bug_446.py
@@ -38,18 +38,18 @@ from PySide2.QtCore import *
from PySide2.QtNetwork import *
from helper.usesqcoreapplication import UsesQCoreApplication
-import py3kcompat as py3k
+
class HttpSignalsCase(UsesQCoreApplication):
'''Test case for launching QHttp signals'''
- DATA = py3k.b("PySide rocks")
+ DATA = bytes("PySide rocks", "UTF-8")
def onError(self):
self.assertTrue(False)
def onNewConnection(self):
self.serverConnection = self.server.nextPendingConnection()
- self.serverConnection.error.connect(self.onError)
+ self.serverConnection.errorOccurred.connect(self.onError)
self.serverConnection.write(HttpSignalsCase.DATA)
self.server.close()
diff --git a/sources/pyside2/tests/QtNetwork/udpsocket_test.py b/sources/pyside2/tests/QtNetwork/udpsocket_test.py
index da5a21c29..7ef567294 100644
--- a/sources/pyside2/tests/QtNetwork/udpsocket_test.py
+++ b/sources/pyside2/tests/QtNetwork/udpsocket_test.py
@@ -38,7 +38,7 @@ init_test_paths(False)
from PySide2.QtCore import QUrl, QObject, SIGNAL, QCoreApplication, QTimer
from PySide2.QtNetwork import QUdpSocket, QHostAddress
-import py3kcompat as py3k
+
class HttpSignalsCase(unittest.TestCase):
'''Test case for bug #124 - readDatagram signature
@@ -64,7 +64,7 @@ class HttpSignalsCase(unittest.TestCase):
def sendPackage(self):
addr = QHostAddress(QHostAddress.LocalHost)
- self.socket.writeDatagram(py3k.b('datagram'), addr, 45454)
+ self.socket.writeDatagram(bytes('datagram', "UTF-8"), addr, 45454)
def callback(self):
while self.server.hasPendingDatagrams():
diff --git a/sources/pyside2/tests/QtOpenGL/CMakeLists.txt b/sources/pyside2/tests/QtOpenGL/CMakeLists.txt
index b37a9ddce..92b4afbac 100644
--- a/sources/pyside2/tests/QtOpenGL/CMakeLists.txt
+++ b/sources/pyside2/tests/QtOpenGL/CMakeLists.txt
@@ -1,2 +1,2 @@
-PYSIDE_TEST(qglbuffer_test.py)
-PYSIDE_TEST(qglwidget_test.py)
+PYSIDE_TEST(qopenglbuffer_test.py)
+PYSIDE_TEST(qopenglwindow_test.py)
diff --git a/sources/pyside2/tests/QtOpenGL/qglwidget_test.py b/sources/pyside2/tests/QtOpenGL/qglwidget_test.py
deleted file mode 100644
index c3bb7e27d..000000000
--- a/sources/pyside2/tests/QtOpenGL/qglwidget_test.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtGui import *
-from PySide2.QtWidgets import *
-from PySide2.QtOpenGL import *
-
-class TestQGLWidget (unittest.TestCase):
- def testIt(self):
- """Just test if the bindTexture(*, GLenum, GLint) methods overloads exists"""
- app = QApplication([])
- img = QImage()
- w = QGLWidget()
- a = w.bindTexture(img, 0, 0) # ok if it throws nothing.. :-)
-
-
-
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py b/sources/pyside2/tests/QtOpenGL/qopenglbuffer_test.py
index a5d8385c9..a5d8385c9 100644
--- a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py
+++ b/sources/pyside2/tests/QtOpenGL/qopenglbuffer_test.py
diff --git a/sources/pyside2/tests/QtGui/qopenglwindow_test.py b/sources/pyside2/tests/QtOpenGL/qopenglwindow_test.py
index e39cfb19c..22f7fd202 100644
--- a/sources/pyside2/tests/QtGui/qopenglwindow_test.py
+++ b/sources/pyside2/tests/QtOpenGL/qopenglwindow_test.py
@@ -40,7 +40,9 @@ from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QSize, QTimer, Qt
from PySide2.QtGui import (QColor, QGuiApplication, QImage, QOpenGLContext,
- QOpenGLTexture, QSurfaceFormat, QOpenGLWindow)
+ QSurfaceFormat)
+from PySide2.QtOpenGL import (QOpenGLTexture, QOpenGLWindow)
+
try:
from OpenGL import GL
diff --git a/sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt b/sources/pyside2/tests/QtOpenGLWidgets/CMakeLists.txt
index 2f7cb08b9..2f7cb08b9 100644
--- a/sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt
+++ b/sources/pyside2/tests/QtOpenGLWidgets/CMakeLists.txt
diff --git a/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py b/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
index 573ca9940..0a3a72fc0 100644
--- a/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
+++ b/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
@@ -71,12 +71,6 @@ class ReturnsQuadruplesOfNumbers(UsesQApplication):
obj = GraphicsLayoutItem()
self.assertTrue(self.compareTuples(obj.getContentsMargins(), (0.0, 0.0, 0.0, 0.0)))
- def testQWidgetGetContentsMargins(self):
- obj = QWidget()
- values = (10, 20, 30, 40)
- obj.setContentsMargins(*values)
- self.assertTrue(self.compareTuples(obj.getContentsMargins(), values))
-
def testQLayoutGetContentsMargins(self):
obj = Layout()
values = (10, 20, 30, 40)
diff --git a/sources/pyside2/tests/QtQml/CMakeLists.txt b/sources/pyside2/tests/QtQml/CMakeLists.txt
index e2beb951e..e35831f25 100644
--- a/sources/pyside2/tests/QtQml/CMakeLists.txt
+++ b/sources/pyside2/tests/QtQml/CMakeLists.txt
@@ -11,10 +11,13 @@ PYSIDE_TEST(bug_951.py)
PYSIDE_TEST(bug_995.py)
PYSIDE_TEST(bug_997.py)
PYSIDE_TEST(bug_1029.py)
+PYSIDE_TEST(listproperty.py)
PYSIDE_TEST(qqmlnetwork_test.py)
PYSIDE_TEST(qquickview_test.py)
PYSIDE_TEST(connect_python_qml.py)
PYSIDE_TEST(registertype.py)
+PYSIDE_TEST(registeruncreatabletype.py)
+PYSIDE_TEST(registersingletontype.py)
PYSIDE_TEST(javascript_exceptions.py)
PYSIDE_TEST(qqmlincubator_incubateWhile.py)
PYSIDE_TEST(qquickitem_grabToImage.py)
diff --git a/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py b/sources/pyside2/tests/QtQml/listproperty.py
index e633d6ee2..6337e5fa4 100644
--- a/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py
+++ b/sources/pyside2/tests/QtQml/listproperty.py
@@ -1,8 +1,6 @@
-#!/usr/bin/python
-
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -28,51 +26,56 @@
##
#############################################################################
-'''Unit tests for QGLBuffer'''
-
-import os
-import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
+from PySide2.QtCore import QObject
+from PySide2.QtQml import ListProperty
-from PySide2.QtCore import QByteArray
-from PySide2.QtOpenGL import QGLBuffer, QGLWidget
-import py3kcompat as py3k
-from helper.usesqapplication import UsesQApplication
+class InheritsQObject(QObject):
+ pass
-class QGLBufferTest(UsesQApplication):
+def dummyFunc():
+ pass
+
+class TestListProperty(unittest.TestCase):
def testIt(self):
- w = QGLWidget()
- w.makeCurrent()
-
- b = QGLBuffer()
- b.setUsagePattern(QGLBuffer.DynamicDraw)
-
- self.assertTrue(b.create())
- self.assertTrue(b.bufferId() != 0)
- self.assertTrue(b.bind())
-
- data = QByteArray(py3k.b("12345"))
- b.allocate(data)
- self.assertEqual(b.size(), data.size())
-
- m = b.map(QGLBuffer.ReadOnly)
- if m:
- self.assertEqual(m, py3k.buffer(py3k.b(data.data())))
- b.unmap()
-
- m = b.map(QGLBuffer.ReadWrite)
- m[3] = py3k.b('A')[0]
- b.unmap()
- result, rdata = b.read(3, 1)
- self.assertTrue(result)
- self.assertEqual(py3k.b('A'), rdata.data())
- else:
- print(" memory mapping is not possible in this OpenGL implementation.")
- b.release()
+
+ # Verify that type checking works properly
+ type_check_error = False
+
+ try:
+ ListProperty(QObject)
+ ListProperty(InheritsQObject)
+ except:
+ type_check_error = True
+
+ self.assertFalse(type_check_error)
+
+ try:
+ ListProperty(int)
+ except TypeError:
+ type_check_error = True
+
+ self.assertTrue(type_check_error)
+
+ # Verify that method validation works properly
+ method_check_error = False
+
+ try:
+ ListProperty(QObject, append=None, at=None, count=None, replace=None, clear=None, removeLast=None) # Explicitly setting None
+ ListProperty(QObject, append=dummyFunc)
+ ListProperty(QObject, count=dummyFunc, at=dummyFunc)
+ except:
+ method_check_error = True
+
+ self.assertFalse(method_check_error)
+
+ try:
+ ListPropery(QObject, append=QObject())
+ except:
+ method_check_error = True
+
+ self.assertTrue(method_check_error)
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtQml/qquickview_test.py b/sources/pyside2/tests/QtQml/qquickview_test.py
index 0b723612e..9694cf56e 100644
--- a/sources/pyside2/tests/QtQml/qquickview_test.py
+++ b/sources/pyside2/tests/QtQml/qquickview_test.py
@@ -40,7 +40,7 @@ from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
from PySide2.QtCore import QUrl, QObject, Property, Slot
-from PySide2.QtQml import QtQml
+from PySide2.QtQml import QtQml, QQmlEngine
from PySide2.QtQuick import QQuickView
class MyObject(QObject):
@@ -76,8 +76,9 @@ class TestQQuickView(TimedQApplication):
self.assertEqual(view.status(), QQuickView.Ready)
rootObject = view.rootObject()
self.assertTrue(rootObject)
- self.assertTrue(QtQml.qmlEngine(rootObject))
- self.assertTrue(QtQml.qmlContext(rootObject))
+ context = QQmlEngine.contextForObject(rootObject)
+ self.assertTrue(context)
+ self.assertTrue(context.engine())
def testModelExport(self):
view = QQuickView()
diff --git a/sources/pyside2/tests/QtScript/property_test.py b/sources/pyside2/tests/QtQml/registersingletontype.py
index 372bba2ba..fe3f749f5 100644
--- a/sources/pyside2/tests/QtScript/property_test.py
+++ b/sources/pyside2/tests/QtQml/registersingletontype.py
@@ -1,6 +1,6 @@
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -34,63 +34,53 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import QObject, Property, QCoreApplication
-from PySide2.QtScript import QScriptEngine
+from helper.helper import adjust_filename
-class MyObject(QObject):
+from PySide2.QtCore import Property, Signal, QTimer, QUrl, QObject
+from PySide2.QtGui import QGuiApplication
+from PySide2.QtQml import qmlRegisterSingletonType
+from PySide2.QtQuick import QQuickView
+
+finalResult = 0
+
+class SingletonQObject(QObject):
def __init__(self, parent = None):
QObject.__init__(self, parent)
- self._p = 100
-
- def setX(self, value):
- self._p = value
-
- def getX(self):
- return self._p
-
- def resetX(self):
- self._p = 100
-
- def delX(self):
- self._p = 0
-
- x = Property(int, getX, setX, resetX, delX)
-
-
-class QPropertyTest(unittest.TestCase):
-
- def testSimple(self):
- o = MyObject()
- self.assertEqual(o.x, 100)
- o.x = 42
- self.assertEqual(o.x, 42)
-
- def testHasProperty(self):
- o = MyObject()
- o.setProperty("x", 10)
- self.assertEqual(o.x, 10)
- self.assertEqual(o.property("x"), 10)
-
- def testMetaProperty(self):
- o = MyObject()
- m = o.metaObject()
- found = False
- for i in range(m.propertyCount()):
- mp = m.property(i)
- if mp.name() == "x":
- found = True
- break
- self.assertTrue(found)
-
- def testScriptQProperty(self):
- qapp = QCoreApplication([])
- myEngine = QScriptEngine()
- obj = MyObject()
- scriptObj = myEngine.newQObject(obj)
- myEngine.globalObject().setProperty("obj", scriptObj)
- myEngine.evaluate("obj.x = 42")
- self.assertEqual(scriptObj.property("x").toInt32(), 42)
- self.assertEqual(obj.property("x"), 42)
+ self._data = 100
+
+ def getData(self):
+ return self._data
+
+ def setData(self, data):
+ global finalResult
+ finalResult = self._data = data
+
+ data = Property(int, getData, setData)
+
+def singletonQObjectCallback(engine):
+ obj = SingletonQObject()
+ obj.setData(50)
+ return obj
+
+def singletonQJSValueCallback(engine):
+ return engine.evaluate("new Object({data: 50})")
+
+class TestQmlSupport(unittest.TestCase):
+ def testIt(self):
+ app = QGuiApplication([])
+
+ qmlRegisterSingletonType(SingletonQObject, 'Singletons', 1, 0, 'SingletonQObjectNoCallback')
+ qmlRegisterSingletonType(SingletonQObject, 'Singletons', 1, 0, 'SingletonQObjectCallback',
+ singletonQObjectCallback)
+
+ qmlRegisterSingletonType('Singletons', 1, 0, 'SingletonQJSValue', singletonQJSValueCallback)
+
+ view = QQuickView()
+ view.setSource(QUrl.fromLocalFile(adjust_filename('registersingletontype.qml', __file__)))
+ view.show()
+ QTimer.singleShot(250, view.close)
+ app.exec_()
+ self.assertEqual(finalResult, 200)
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/QtQml/registersingletontype.qml b/sources/pyside2/tests/QtQml/registersingletontype.qml
new file mode 100644
index 000000000..c8b34e69a
--- /dev/null
+++ b/sources/pyside2/tests/QtQml/registersingletontype.qml
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Singletons 1.0
+
+Item {
+ Component.onCompleted: {
+ SingletonQObjectCallback.data += SingletonQObjectNoCallback.data + SingletonQJSValue.data
+ }
+}
diff --git a/sources/pyside2/tests/QtQml/registertype.py b/sources/pyside2/tests/QtQml/registertype.py
index 7e6fe8d29..e4dcd36f9 100644
--- a/sources/pyside2/tests/QtQml/registertype.py
+++ b/sources/pyside2/tests/QtQml/registertype.py
@@ -36,7 +36,7 @@ init_test_paths(False)
from helper.helper import adjust_filename
-from PySide2.QtCore import Property, QTimer, QUrl
+from PySide2.QtCore import Property, QObject, QTimer, QUrl
from PySide2.QtGui import QGuiApplication, QPen, QColor, QPainter
from PySide2.QtQml import qmlRegisterType, ListProperty
from PySide2.QtQuick import QQuickView, QQuickItem, QQuickPaintedItem
@@ -108,8 +108,8 @@ class TestQmlSupport(unittest.TestCase):
def testIt(self):
app = QGuiApplication([])
- qmlRegisterType(PieChart, 'Charts', 1, 0, 'PieChart');
- qmlRegisterType(PieSlice, "Charts", 1, 0, "PieSlice");
+ self.assertTrue(qmlRegisterType(PieChart, 'Charts', 1, 0, 'PieChart') != -1)
+ self.assertTrue(qmlRegisterType(PieSlice, "Charts", 1, 0, "PieSlice") != -1)
view = QQuickView()
view.setSource(QUrl.fromLocalFile(adjust_filename('registertype.qml', __file__)))
diff --git a/sources/pyside2/tests/QtQml/registeruncreatable.qml b/sources/pyside2/tests/QtQml/registeruncreatable.qml
new file mode 100644
index 000000000..bebf68d82
--- /dev/null
+++ b/sources/pyside2/tests/QtQml/registeruncreatable.qml
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Charts 1.0
+
+Item {
+ width: 300; height: 200
+
+ Uncreatable {
+ name : 'uncreatable'
+ }
+}
diff --git a/sources/pyside2/tests/QtWebKit/webframe_test.py b/sources/pyside2/tests/QtQml/registeruncreatabletype.py
index d46c1b229..820dc6cc1 100644
--- a/sources/pyside2/tests/QtWebKit/webframe_test.py
+++ b/sources/pyside2/tests/QtQml/registeruncreatabletype.py
@@ -1,6 +1,6 @@
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -34,34 +34,47 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import QObject, SIGNAL, QUrl
-from PySide2.QtWebKit import *
-from PySide2.QtNetwork import QNetworkRequest
-
from helper.helper import adjust_filename
-from helper.usesqapplication import UsesQApplication
+from PySide2.QtCore import Property, QObject, QUrl
+from PySide2.QtGui import QGuiApplication
+from PySide2.QtQml import qmlRegisterUncreatableType, QQmlEngine, QQmlComponent
+
+noCreationReason = 'Cannot create an item of type: Uncreatable (expected)';
+
+class Uncreatable(QObject):
+ def __init__(self, parent = None):
+ QObject.__init__(self, parent)
+ self._name = 'uncreatable'
+
+ def getName(self):
+ return self._name
+
+ def setName(self, value):
+ self._name = value
-class TestWebFrame(UsesQApplication):
- def load_finished(self, ok):
- self.assertTrue(ok)
- page = self.view.page()
- self.assertTrue(page)
- frame = page.mainFrame()
- self.assertTrue(frame)
- meta = frame.metaData()
- self.assertEqual(meta['description'], ['PySide Test METADATA.'])
- self.app.quit()
+ name = Property(str, getName, setName)
- def testMetaData(self):
- self.view = QWebView()
- QObject.connect(self.view, SIGNAL('loadFinished(bool)'),
- self.load_finished)
- url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__))
- self.view.setUrl(url)
- self.app.exec_()
+class TestQmlSupport(unittest.TestCase):
+
+ def testIt(self):
+ app = QGuiApplication([])
+
+ self.assertTrue(qmlRegisterUncreatableType(Uncreatable, 'Charts', 1, 0,
+ 'Uncreatable', noCreationReason) != -1);
+
+ engine = QQmlEngine()
+ component = QQmlComponent(engine, QUrl.fromLocalFile(adjust_filename('registeruncreatable.qml', __file__)))
+
+ # Check that the uncreatable item produces the correct error
+ self.assertEqual(component.status(), QQmlComponent.Error)
+ errorFound = False
+ for e in component.errors():
+ if noCreationReason in e.toString():
+ errorFound = True
+ break
+ self.assertTrue(errorFound)
if __name__ == '__main__':
unittest.main()
-
diff --git a/sources/pyside2/tests/QtScript/CMakeLists.txt b/sources/pyside2/tests/QtScript/CMakeLists.txt
deleted file mode 100644
index dfea68df0..000000000
--- a/sources/pyside2/tests/QtScript/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-PYSIDE_TEST(base_test.py)
-PYSIDE_TEST(bug_1022.py)
-PYSIDE_TEST(engine_test.py)
-PYSIDE_TEST(property_test.py)
-PYSIDE_TEST(qscriptvalue_test.py)
diff --git a/sources/pyside2/tests/QtScript/base_test.py b/sources/pyside2/tests/QtScript/base_test.py
deleted file mode 100644
index 3cde8ad83..000000000
--- a/sources/pyside2/tests/QtScript/base_test.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2 import QtScript
-
-
-#only test if the module import works fine bug #278
diff --git a/sources/pyside2/tests/QtScript/bug_1022.py b/sources/pyside2/tests/QtScript/bug_1022.py
deleted file mode 100644
index 2c2699de6..000000000
--- a/sources/pyside2/tests/QtScript/bug_1022.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import *
-from PySide2.QtScript import *
-
-class QScriptValueTest(unittest.TestCase):
- def testQScriptValue(self):
- app = QCoreApplication([])
- engine = QScriptEngine()
- repr(engine.evaluate('1 + 1'))
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtScript/engine_test.py b/sources/pyside2/tests/QtScript/engine_test.py
deleted file mode 100644
index f88b98d69..000000000
--- a/sources/pyside2/tests/QtScript/engine_test.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QObject
-from PySide2.QtScript import QScriptEngine
-
-class QScriptEngineTest(unittest.TestCase):
-
- def testQScriptEngine(self):
- engine = QScriptEngine()
- obj = engine.evaluate("({ unitName: 'Celsius', toKelvin: function(x) { return x + 273; } })")
- toKelvin = obj.property("toKelvin")
- result = toKelvin.call(obj, [100])
- self.assertEqual(result.toNumber(), 373)
diff --git a/sources/pyside2/tests/QtScript/qscriptvalue_test.py b/sources/pyside2/tests/QtScript/qscriptvalue_test.py
deleted file mode 100644
index 06a029232..000000000
--- a/sources/pyside2/tests/QtScript/qscriptvalue_test.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-from __future__ import print_function
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtScript import *
-
-# Required for eval() to work
-import PySide2.QtScript
-
-from helper.usesqapplication import UsesQApplication
-
-class TestQScriptValue (UsesQApplication):
-
- def testOperator(self):
- engine = QScriptEngine()
- value = engine.evaluate('x = {"a": 1, "b":2}')
- self.assertEqual(value['a'], 1)
- self.assertRaises(KeyError, value.__getitem__, 'c')
- value = engine.evaluate('x = ["x", "y", "z"]')
- self.assertEqual(value[2], 'z')
- self.assertRaises(IndexError, value.__getitem__, 23)
-
- def testRepr(self):
- value = QScriptValue("somePerson = { firstName: 'John', lastName: 'Doe' }")
- print(repr(value))
- value2 = eval(repr(value))
- self.assertEqual(value.toString(), value2.toString())
- self.assertEqual(value.toVariant(), value2.toVariant())
-
- def testIteratorProtocol(self):
- engine = QScriptEngine()
- value = engine.evaluate('x = {"a": 1, "b":2}')
- d = {}
- for k, v in QScriptValueIterator(value):
- d[k] = v
- self.assertEqual(d, {'a': 1, 'b': 2})
-
- d = {}
- for k, v in value:
- d[k] = v
- self.assertEqual(d, {'a': 1, 'b': 2})
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtScriptTools/CMakeLists.txt b/sources/pyside2/tests/QtScriptTools/CMakeLists.txt
deleted file mode 100644
index ee22737c6..000000000
--- a/sources/pyside2/tests/QtScriptTools/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-PYSIDE_TEST(debugger_test.py)
diff --git a/sources/pyside2/tests/QtScriptTools/debugger_test.py b/sources/pyside2/tests/QtScriptTools/debugger_test.py
deleted file mode 100644
index cefe48f5b..000000000
--- a/sources/pyside2/tests/QtScriptTools/debugger_test.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import SIGNAL, QTimer
-from PySide2.QtScript import QScriptEngine
-from PySide2.QtScriptTools import QScriptEngineDebugger
-
-from helper.usesqapplication import UsesQApplication
-
-class DebuggerTest(UsesQApplication):
-
- def setUp(self):
- UsesQApplication.setUp(self)
- self.engine = QScriptEngine()
- self.debugger = QScriptEngineDebugger()
- self.has_suspended = 0
- self.has_resumed = 0
- self.count = 3
-
- def suspended(self):
- self.has_suspended += 1
- # Will emit evaluationResumed until there are more instructions to be run
- QTimer.singleShot(100, self.debugger.action(QScriptEngineDebugger.StepIntoAction).trigger)
-
- def resumed(self):
- # Will be called when debugger.state() change from Suspended to Running
- # except for the first time.
- self.has_resumed += 1
-
- def testBasic(self):
- '''Interrupt and resume evaluation with QScriptEngineDebugger'''
-
- self.debugger.attachTo(self.engine)
- self.debugger.setAutoShowStandardWindow(False)
- self.debugger.connect(SIGNAL('evaluationSuspended()'), self.suspended)
- self.debugger.connect(SIGNAL('evaluationResumed()'), self.resumed)
-
- # For some reason StepIntoAction does not actually continue execution, and thus interrupting
- # causes the test to hang. The same behavior is present in a Qt5.6 C++ code equivalent. It
- # seems like a bug in QtScript, thus the interruption is commented out for now, which will
- # force the test to fail.
- #self.debugger.action(QScriptEngineDebugger.InterruptAction).trigger()
- self.engine.evaluate("3+4\n2+1\n5+1")
- self.assertTrue(self.has_resumed >= 1)
- self.assertTrue(self.has_suspended >= 1)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtSql/qvarianttype_test.py b/sources/pyside2/tests/QtSql/qvarianttype_test.py
index 3175a178f..05d456e28 100644
--- a/sources/pyside2/tests/QtSql/qvarianttype_test.py
+++ b/sources/pyside2/tests/QtSql/qvarianttype_test.py
@@ -35,16 +35,15 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtSql import QSqlField
class QVariantTypeTest(unittest.TestCase):
def testQVariantType(self):
f = QSqlField("name", str)
- self.assertEqual(f.type(), py3k.unicode)
+ self.assertEqual(f.type(), str)
f = QSqlField("name", "QString")
- self.assertEqual(f.type(), py3k.unicode)
+ self.assertEqual(f.type(), str)
f = QSqlField("name", "double")
self.assertEqual(f.type(), float)
@@ -55,13 +54,6 @@ class QVariantTypeTest(unittest.TestCase):
f = QSqlField("name", int)
self.assertEqual(f.type(), int)
- if not py3k.IS_PY3K:
- f = QSqlField("name", long)
- self.assertEqual(f.type(), int) # long isn't registered in QVariant:Type, just in QMetaType::Type
-
- #f = QSqlField("name", QObject)
- #self.assertEqual(f.type(), None)
-
f = QSqlField("name", None)
self.assertEqual(f.type(), None)
diff --git a/sources/pyside2/tests/QtSvg/CMakeLists.txt b/sources/pyside2/tests/QtSvg/CMakeLists.txt
index 4f5e2805f..53d15e857 100644
--- a/sources/pyside2/tests/QtSvg/CMakeLists.txt
+++ b/sources/pyside2/tests/QtSvg/CMakeLists.txt
@@ -1,3 +1,2 @@
PYSIDE_TEST(qsvggenerator_test.py)
PYSIDE_TEST(qsvgrenderer_test.py)
-PYSIDE_TEST(qsvgwidget_test.py)
diff --git a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
index 88537edfe..3dd5b61f6 100644
--- a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
+++ b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
@@ -2,7 +2,7 @@
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -36,15 +36,15 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import *
-from PySide2.QtWidgets import *
-from PySide2.QtSvg import *
+from PySide2.QtCore import QFile
+from PySide2.QtGui import QGuiApplication
+from PySide2.QtSvg import QSvgRenderer
class QSvgRendererTest(unittest.TestCase):
def testLoad(self):
tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg')
- app = QApplication([])
+ app = QGuiApplication([])
fromFile = QSvgRenderer(tigerPath)
self.assertTrue(fromFile.isValid())
diff --git a/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt b/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt
new file mode 100644
index 000000000..61952169a
--- /dev/null
+++ b/sources/pyside2/tests/QtSvgWidgets/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(qsvgwidget_test.py)
diff --git a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py b/sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py
index 17bf6527b..a3749c0ee 100644
--- a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py
+++ b/sources/pyside2/tests/QtSvgWidgets/qsvgwidget_test.py
@@ -2,7 +2,7 @@
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -36,14 +36,16 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtCore import *
-from PySide2.QtWidgets import *
-from PySide2.QtSvg import *
+from PySide2.QtCore import QFile, QFileInfo, QDir
+from PySide2.QtWidgets import QApplication
+from PySide2.QtSvgWidgets import QSvgWidget
class QSvgWidgetTest(unittest.TestCase):
def testLoad(self):
- tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg')
+ dir = os.path.dirname(__file__)
+ tigerPath = QDir.cleanPath("{}/../QtSvg/tiger.svg".format(dir))
+ self.assertTrue(QFileInfo.exists(tigerPath))
app = QApplication([])
fromFile = QSvgWidget()
diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py
index 2439e7203..1a049b89e 100644
--- a/sources/pyside2/tests/QtUiTools/bug_392.py
+++ b/sources/pyside2/tests/QtUiTools/bug_392.py
@@ -36,29 +36,31 @@ init_test_paths(False)
from helper.usesqapplication import UsesQApplication
-from PySide2 import QtWidgets
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QComboBox, QWidget
from PySide2.QtUiTools import QUiLoader
-class MyWidget(QtWidgets.QComboBox):
+class MyWidget(QComboBox):
def __init__(self, parent=None):
- QtWidgets.QComboBox.__init__(self, parent)
+ QComboBox.__init__(self, parent)
def isPython(self):
return True
class BugTest(UsesQApplication):
def testCase(self):
- w = QtWidgets.QWidget()
+ w = QWidget()
loader = QUiLoader()
filePath = os.path.join(os.path.dirname(__file__), 'action.ui')
result = loader.load(filePath, w)
- self.assertTrue(isinstance(result.actionFoo, QtWidgets.QAction))
+ self.assertTrue(isinstance(result.actionFoo, QAction))
def testPythonCustomWidgets(self):
- w = QtWidgets.QWidget()
+ w = QWidget()
loader = QUiLoader()
loader.registerCustomWidget(MyWidget)
+ self.assertTrue('MyWidget' in loader.availableWidgets())
filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget.ui')
result = loader.load(filePath, w)
@@ -66,9 +68,10 @@ class BugTest(UsesQApplication):
self.assertTrue(result.custom.isPython())
def testPythonCustomWidgetsTwice(self):
- w = QtWidgets.QWidget()
+ w = QWidget()
loader = QUiLoader()
loader.registerCustomWidget(MyWidget)
+ self.assertTrue('MyWidget' in loader.availableWidgets())
filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget2.ui')
result = loader.load(filePath, w)
diff --git a/sources/pyside2/tests/QtUiTools/bug_426.py b/sources/pyside2/tests/QtUiTools/bug_426.py
index e84da0382..488ba5c8d 100644
--- a/sources/pyside2/tests/QtUiTools/bug_426.py
+++ b/sources/pyside2/tests/QtUiTools/bug_426.py
@@ -34,19 +34,22 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2 import QtCore, QtWidgets
+from PySide2.QtCore import QTimer
+from PySide2.QtGui import QAction, QActionGroup
+from PySide2.QtWidgets import QApplication, QWidget
from PySide2.QtUiTools import QUiLoader
+
class Window(object):
def __init__(self):
loader = QUiLoader()
filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui')
self.widget = loader.load(filePath)
- self.group = QtWidgets.QActionGroup(self.widget)
+ self.group = QActionGroup(self.widget)
self.widget.show()
- QtCore.QTimer.singleShot(0, self.widget.close)
+ QTimer.singleShot(0, self.widget.close)
if __name__ == "__main__":
- app = QtWidgets.QApplication(sys.argv)
+ app = QApplication(sys.argv)
win = Window()
sys.exit(app.exec_())
diff --git a/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py b/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py
index 190810edb..9604e957c 100644
--- a/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py
+++ b/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py
@@ -42,7 +42,6 @@ from PySide2.QtWebEngine import QtWebEngine
from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEngineProfile
from PySide2.QtWebEngineCore import (QWebEngineUrlScheme,
QWebEngineUrlSchemeHandler)
-import py3kcompat as py3k
class TestSchemeHandler(QWebEngineUrlSchemeHandler):
def requestStarted(self, request):
@@ -51,9 +50,9 @@ class TestSchemeHandler(QWebEngineUrlSchemeHandler):
return
self.buffer = QBuffer()
- self.buffer.setData(py3k.b("Really nice goodbye text."))
+ self.buffer.setData(bytes("Really nice goodbye text.", "UTF-8"))
self.buffer.aboutToClose.connect(self.buffer.deleteLater)
- request.reply(py3k.b("text/plain;charset=utf-8"), self.buffer)
+ request.reply(bytes("text/plain;charset=utf-8", "UTF-8"), self.buffer)
class MainTest(unittest.TestCase):
@@ -64,7 +63,7 @@ class MainTest(unittest.TestCase):
QtWebEngine.initialize()
app = QApplication([])
- scheme_name = py3k.b("testpy")
+ scheme_name = bytes("testpy", "UTF-8")
scheme = QWebEngineUrlScheme(scheme_name)
scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
QWebEngineUrlScheme.registerScheme(scheme)
diff --git a/sources/pyside2/tests/QtWebKit/CMakeLists.txt b/sources/pyside2/tests/QtWebKit/CMakeLists.txt
deleted file mode 100644
index 7fab64773..000000000
--- a/sources/pyside2/tests/QtWebKit/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-PYSIDE_TEST(bug_448.py)
-PYSIDE_TEST(bug_694.py)
-PYSIDE_TEST(bug_803.py)
-PYSIDE_TEST(bug_899.py)
-PYSIDE_TEST(bug_959.py)
-PYSIDE_TEST(qvariantlist_property_test.py)
-PYSIDE_TEST(qml_plugin_test.py)
-PYSIDE_TEST(shouldInterruptjavascript_test.py)
-PYSIDE_TEST(webpage_test.py)
-PYSIDE_TEST(webview_test.py)
-PYSIDE_TEST(webframe_test.py)
diff --git a/sources/pyside2/tests/QtWebKit/bug_448.py b/sources/pyside2/tests/QtWebKit/bug_448.py
deleted file mode 100644
index 98ebb1958..000000000
--- a/sources/pyside2/tests/QtWebKit/bug_448.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-'''Test cases for bug: http://bugs.openbossa.org/show_bug.cgi?id=448'''
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtWidgets import QApplication
-from PySide2.QtWebKit import QWebView
-
-class Bug448(unittest.TestCase):
- def onError(self, erros):
- pass
-
- def testReturnOwnership(self):
- app = QApplication(sys.argv)
- webview = QWebView()
- webview.page().networkAccessManager().sslErrors.connect(self.onError)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/bug_694.py b/sources/pyside2/tests/QtWebKit/bug_694.py
deleted file mode 100644
index b18d658f6..000000000
--- a/sources/pyside2/tests/QtWebKit/bug_694.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import *
-from PySide2.QtWidgets import *
-from PySide2.QtWebKit import *
-
-class ErrorPage (QWebPage):
-
- def __init__(self):
- QWebPage.__init__(self)
- self.rcv_extension = None
- self.rcv_url = None
- self.rcv_url_copy = None
- self.rcv_option_type = None
- self.rcv_output_type = None
-
-
- def supportsExtension(self, extension):
- return extension == QWebPage.ErrorPageExtension
-
- def extension(self, extension, option, output):
- self.rcv_extension = extension
- self.rcv_url = option.url
- self.rcv_url_copy = QUrl(option.url)
- self.rcv_option_type = type(option)
- self.rcv_output_type = type(output)
- return True
-
-class TestWebPageExtension(unittest.TestCase):
- def testIt(self):
- app = QApplication([])
- ep = ErrorPage()
- view = QWebView()
- view.setPage(ep)
- view.load("foo://bar") # Some malformmed url
- view.show()
-
- # If the timeout is 0 the webpage isn't even loaded on Qt4.6-i386, so we use 100 :-)
- QTimer.singleShot(100, app.quit)
- app.exec_()
-
- self.assertEqual(ep.rcv_extension, QWebPage.ErrorPageExtension)
- self.assertRaises(RuntimeError, ep.rcv_url.__str__)
-
- self.assertEqual(ep.rcv_url_copy, "foo://bar")
- self.assertEqual(ep.rcv_option_type, QWebPage.ErrorPageExtensionOption)
- self.assertEqual(ep.rcv_output_type, QWebPage.ErrorPageExtensionReturn)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/bug_803.py b/sources/pyside2/tests/QtWebKit/bug_803.py
deleted file mode 100644
index ec6f93c33..000000000
--- a/sources/pyside2/tests/QtWebKit/bug_803.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtWidgets import *
-from PySide2.QtWebKit import *
-
-class TestBug803 (unittest.TestCase):
-
- def testIt(self):
- app = QApplication([])
- page = QWebPage()
- frame = page.mainFrame()
- frame.setHtml("<html><head></head><body><p>1</p><p>2</p></body></html>")
- elems = frame.findAllElements("p")
- self.assertEqual(len(elems), 2)
- self.assertEqual(elems[0].toPlainText(), "1")
- self.assertEqual(elems[1].toPlainText(), "2")
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/bug_899.py b/sources/pyside2/tests/QtWebKit/bug_899.py
deleted file mode 100644
index cb8e76784..000000000
--- a/sources/pyside2/tests/QtWebKit/bug_899.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import Property, QObject
-from PySide2.QtWebKit import QWebView
-from helper.timedqapplication import TimedQApplication
-
-class TestLambdaPropery(TimedQApplication):
-
- def testBug899(self):
- html = '''
- <html><body>
- <script type="text/javascript">
- document.write("<p>"+py_obj.list1+"</p>")
- document.write("<p>"+py_obj.list2+"</p>")
- </script>
- </body></html>
- '''
-
- class Obj(object):
- list1 = ['foo', 'bar', 'baz']
- list2 = ['fi', 'fo', 'fum']
-
- obj = Obj()
-
- wrapper_dict = {}
- for name in ('list1', 'list2'):
- getter = lambda arg=None, name=name: getattr(obj, name)
- wrapper_dict[name] = Property('QVariantList', getter)
- wrapper = type('PyObj', (QObject,), wrapper_dict)
-
- view = QWebView()
- view.page().mainFrame().addToJavaScriptWindowObject('py_obj', wrapper())
- view.setHtml(html)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/bug_959.py b/sources/pyside2/tests/QtWebKit/bug_959.py
deleted file mode 100644
index 5214ee1e1..000000000
--- a/sources/pyside2/tests/QtWebKit/bug_959.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-from PySide2.QtCore import QObject, Slot, QTimer
-from PySide2.QtWebKit import QWebView
-from PySide2.QtWidgets import QApplication
-from PySide2 import QtCore
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from helper.usesqapplication import UsesQApplication
-
-functionID = -1
-currentWebView = None
-
-class JSFuncs(QObject):
- @Slot(str,result=str)
- def slot_str_str(self, x):
- global functionID
- functionID = 0
- return x.upper()
-
- @Slot(str,result='QVariant')
- def slot_str_list(self, x):
- global functionID
- functionID = 1
- return [x, x]
-
- @Slot('QStringList',result=str)
- def slot_strlist_str(self, x):
- global functionID
- functionID = 2
- return x[-1]
-
- @Slot('QVariant',result=str)
- def slot_variant_str(self, x):
- global functionID
- functionID = 3
- return str(x)
-
- @Slot('QVariantList',result=str)
- def slot_variantlist_str(self, x):
- global functionID
- functionID = 4
- return str(x[-1])
-
- @Slot('QVariantMap',result=str)
- def slot_variantmap_str(self, x):
- global functionID
- functionID = 5
- return str(x["foo"])
-
-
-
-PAGE_DATA = "data:text/html,<!doctype html><html><body onload='%s'></body></html>"
-FUNCTIONS_LIST = ['jsfuncs.slot_str_str("hello")',
- 'jsfuncs.slot_str_list("hello")',
- 'jsfuncs.slot_strlist_str(["hello","world"])',
- 'jsfuncs.slot_variant_str("hello")',
- 'jsfuncs.slot_variantlist_str(["hello","world"])',
- 'jsfuncs.slot_variantmap_str({"foo": "bar"})']
-
-
-def onLoadFinished( result ):
- QTimer.singleShot( 100, createNextWebView )
-
-def createNextWebView():
- global functionID
-
- nListCount = len(FUNCTIONS_LIST) - 1
- functionID = functionID + 1
- print functionID
-
- if functionID < nListCount:
- createWebView( functionID )
- else:
- QTimer.singleShot(300, QApplication.instance().quit)
-
-
-def createWebView( nIndex ):
- global functionID
- global currentWebView
-
- functionID = nIndex
- currentWebView = QWebView()
- currentWebView._jsfuncs = JSFuncs()
- currentWebView.page().mainFrame().addToJavaScriptWindowObject("jsfuncs", currentWebView._jsfuncs)
- QObject.connect( currentWebView, QtCore.SIGNAL('loadFinished( bool )'), onLoadFinished )
- currentWebView.load(PAGE_DATA % FUNCTIONS_LIST[ nIndex ])
- currentWebView.show()
-
-class Bug959(UsesQApplication):
-
- def testJavaScriptInWebViewForCrash( self ):
- # wait for the webview load to be finished before creating the next webview
- # don't create the webview inside of onLoadFinished
- # also call onLoadFinished with the correct number of variables
- createNextWebView()
- self.app.exec_()
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/fox.html b/sources/pyside2/tests/QtWebKit/fox.html
deleted file mode 100644
index da873b1cc..000000000
--- a/sources/pyside2/tests/QtWebKit/fox.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<title>Title</title>
-<meta name="description" content="PySide Test METADATA." />
-<body>
-<p>The quick <b>brown</b> fox <i>jumps</i> over the lazy dog.</p>
-</body>
-</html>
diff --git a/sources/pyside2/tests/QtWebKit/qml_plugin_test.py b/sources/pyside2/tests/QtWebKit/qml_plugin_test.py
deleted file mode 100644
index 33497bdc1..000000000
--- a/sources/pyside2/tests/QtWebKit/qml_plugin_test.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QUrl, QTimer
-from PySide2.QtWidgets import QApplication, QLabel
-from PySide2.QtWebKit import QWebPluginFactory, QWebView, QWebSettings
-
-from helper.usesqapplication import UsesQApplication
-
-class PluginFactory(QWebPluginFactory):
-
- def plugins(self):
- plugins = []
-
- mime = self.MimeType()
- mime.name = 'DummyFile'
- mime.fileExtensions = ['.pys']
-
- plugin = self.Plugin()
- plugin.name = 'DummyPlugin'
- plugin.mimeTypes = [mime]
-
- plugins.append(plugin)
-
- return plugins
-
- def create(self, mimeType, url, argumentNames, argumentValues):
- if mimeType != 'application/x-dummy':
- return None
-
- for name, value in zip(argumentNames, argumentValues):
- if name == 'text':
- text = value
- else:
- text = "Webkit plugins!"
-
- widget = QLabel(text)
- return widget
-
-class TestPlugin(UsesQApplication):
-
- def testPlugin(self):
- view = QWebView()
- fac = PluginFactory()
- view.page().setPluginFactory(fac)
- QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled, True)
-
- view.load(QUrl(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'qmlplugin', 'index.html')))
-
- view.resize(840, 600)
- view.show()
-
- QTimer.singleShot(500, self.app.quit)
-
- self.app.exec_()
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys b/sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys
deleted file mode 100644
index 0b7469da4..000000000
--- a/sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys
+++ /dev/null
@@ -1 +0,0 @@
-Foobar!
diff --git a/sources/pyside2/tests/QtWebKit/qmlplugin/index.html b/sources/pyside2/tests/QtWebKit/qmlplugin/index.html
deleted file mode 100644
index db0d6b5b2..000000000
--- a/sources/pyside2/tests/QtWebKit/qmlplugin/index.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html><body>
- <h1>Custom Plugin</h1>
- <object type="application/x-dummy" data="./dummy.pys" text="My text">
- </object>
-</body></html>
diff --git a/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py b/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py
deleted file mode 100644
index 6a51a6488..000000000
--- a/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import Property, QObject
-from PySide2.QtWebKit import QWebView
-from helper.timedqapplication import TimedQApplication
-
-class TestLoadFinished(TimedQApplication):
-
- def setUp(self):
- TimedQApplication.setUp(self, timeout=1000)
-
- def tearDown(self):
- TimedQApplication.tearDown(self)
-
- def testQVariantListProperty(self):
- class Obj(object):
- list = ['foo', 'bar', 'baz']
-
- obj = Obj()
-
- wrapper_dict = {}
- for name in ['list']:
- getter = lambda arg=None, name=name: getattr(obj, name)
- wrapper_dict[name] = Property('QVariantList', getter)
- wrapper = type('PyObj', (QObject,), wrapper_dict)
-
- view = QWebView()
- frame = view.page().mainFrame()
- frame.addToJavaScriptWindowObject('py_obj', wrapper())
-
- html = '''
- <html><body>
- <script type="text/javascript">
- document.write(py_obj.list)
- </script>
- </body></html>
- '''
- view.setHtml(html)
- view.show()
- self.app.exec_()
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py b/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py
deleted file mode 100644
index 4db5adbb5..000000000
--- a/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2 import QtCore, QtWebKit
-
-from helper.usesqapplication import UsesQApplication
-
-class QWebPageHeadless(QtWebKit.QWebPage):
- # FIXME: This is not working, the slot is not overriden!
- # http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#shouldInterruptJavaScript
- @QtCore.Slot()
- def shouldInterruptJavaScript(self):
- self._interrupted = True
- QtCore.QTimer.singleShot(300, self._app.quit)
- return True
-
-class TestSlotOverride(UsesQApplication):
- def testFunctionCall(self):
- page = QWebPageHeadless()
- page._interrupted = False
- page._app = self.app
- page.mainFrame().setHtml('<script>while(1);</script>')
- self.app.exec_()
- self.assertTrue(page._interrupted)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/webpage_test.py b/sources/pyside2/tests/QtWebKit/webpage_test.py
deleted file mode 100644
index 0c37befa2..000000000
--- a/sources/pyside2/tests/QtWebKit/webpage_test.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-'''Test cases for QWebPage'''
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import QObject, SIGNAL, QUrl
-from PySide2.QtWebKit import QWebPage
-from PySide2.QtNetwork import QNetworkAccessManager
-
-from helper.helper import adjust_filename
-from helper.timedqapplication import TimedQApplication
-
-#Define a global timeout because TimedQApplication uses a singleton!
-#Use a value big enough to run all the tests.
-TIMEOUT = 1000
-
-class TestFindText(TimedQApplication):
- '''Test cases for finding text'''
-
- def setUp(self):
- TimedQApplication.setUp(self, timeout=TIMEOUT)
- self.page = QWebPage()
- QObject.connect(self.page, SIGNAL('loadFinished(bool)'),
- self.load_finished)
- self.called = False
-
- def tearDown(self):
- #Release resources
- del self.page
- self.called = False
- TimedQApplication.tearDown(self)
-
- def testFindSelectText(self):
- url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__))
- self.page.mainFrame().load(url)
- self.app.exec_()
- self.assertTrue(self.called)
-
- def load_finished(self, ok):
- #Callback to check if load was successful
- if ok:
- self.called = True
- self.assertTrue(self.page.findText('fox'))
- self.assertEqual(self.page.selectedText(), 'fox')
- self.app.quit()
-
-class SetNetworkAccessManagerCase(TimedQApplication):
-
- def setUp(self):
- TimedQApplication.setUp(self, timeout=TIMEOUT)
-
- def testSetNetworkAccessManager(self):
- page = QWebPage()
- manager = QNetworkAccessManager()
- page.setNetworkAccessManager(manager)
-
- def testNetWorkAccessManager(self):
- page = QWebPage()
- a = page.networkAccessManager()
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWebKit/webview_test.py b/sources/pyside2/tests/QtWebKit/webview_test.py
deleted file mode 100644
index 5ecac5387..000000000
--- a/sources/pyside2/tests/QtWebKit/webview_test.py
+++ /dev/null
@@ -1,101 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-'''Test cases for QWebView'''
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-import py3kcompat as py3k
-
-from PySide2.QtCore import QObject, SIGNAL, QUrl
-from PySide2.QtWebKit import QWebPage, QWebView
-from PySide2.QtNetwork import QNetworkRequest
-
-from helper.helper import adjust_filename
-from helper.timedqapplication import TimedQApplication
-
-
-class testWebPage(QWebPage):
- def sayMyName(self):
- return 'testWebPage'
-
-class TestLoadFinished(TimedQApplication):
- '''Test case for signal QWebView.loadFinished(bool)'''
-
- def setUp(self):
- #Acquire resources
- TimedQApplication.setUp(self, timeout=1000)
- self.view = QWebView()
- QObject.connect(self.view, SIGNAL('loadFinished(bool)'),
- self.load_finished)
- self.called = False
-
- def tearDown(self):
- #Release resources
- del self.view
- self.called = False
- TimedQApplication.tearDown(self)
-
- def testLoadFinishedFromFile(self):
- url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__))
- self.view.setUrl(url)
- self.app.exec_()
-
- self.assertTrue(self.called)
-
- def testSetPageAndGetPage(self):
- twp = testWebPage()
- self.view.setPage(twp)
- del twp
- p = self.view.page()
- self.assertEqual(p.sayMyName(), 'testWebPage')
-
- # Setting the same webpage should not incref the python obj
- refCount = sys.getrefcount(p)
- self.view.setPage(p)
- self.assertEqual(sys.getrefcount(p), refCount)
-
- # Changing the webpage obj should decref the old one
- twp2 = testWebPage()
- self.view.setPage(twp2)
- self.assertEqual(sys.getrefcount(p), refCount - 1)
-
- def load_finished(self, ok):
- #Callback to check if load was successful
- self.app.quit()
- if ok:
- self.called = True
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWidgets/CMakeLists.txt
index 28372f437..afa5eae0a 100644
--- a/sources/pyside2/tests/QtWidgets/CMakeLists.txt
+++ b/sources/pyside2/tests/QtWidgets/CMakeLists.txt
@@ -9,10 +9,8 @@ PYSIDE_TEST(bug_243.py)
PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(bug_338.py)
-PYSIDE_TEST(bug_363.py)
PYSIDE_TEST(bug_389.py)
PYSIDE_TEST(bug_400.py)
-PYSIDE_TEST(bug_416.py)
PYSIDE_TEST(bug_429.py)
PYSIDE_TEST(bug_430.py)
PYSIDE_TEST(bug_433.py)
@@ -28,7 +26,6 @@ PYSIDE_TEST(bug_575.py)
PYSIDE_TEST(bug_576.py)
PYSIDE_TEST(bug_585.py)
PYSIDE_TEST(bug_589.py)
-PYSIDE_TEST(bug_632.py)
PYSIDE_TEST(bug_635.py)
PYSIDE_TEST(bug_640.py)
PYSIDE_TEST(bug_653.py)
@@ -41,7 +38,6 @@ PYSIDE_TEST(bug_688.py)
PYSIDE_TEST(bug_693.py)
PYSIDE_TEST(bug_696.py)
PYSIDE_TEST(bug_711.py)
-PYSIDE_TEST(bug_714.py)
PYSIDE_TEST(bug_722.py)
PYSIDE_TEST(bug_728.py)
PYSIDE_TEST(bug_736.py)
diff --git a/sources/pyside2/tests/QtWidgets/add_action_test.py b/sources/pyside2/tests/QtWidgets/add_action_test.py
index c8a7c2269..d4af8b5d1 100644
--- a/sources/pyside2/tests/QtWidgets/add_action_test.py
+++ b/sources/pyside2/tests/QtWidgets/add_action_test.py
@@ -37,7 +37,8 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import SLOT
-from PySide2.QtWidgets import QMenuBar, QAction, QPushButton
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QMenuBar, QPushButton
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_363.py b/sources/pyside2/tests/QtWidgets/bug_363.py
deleted file mode 100644
index 910525fed..000000000
--- a/sources/pyside2/tests/QtWidgets/bug_363.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-''' Test bug 363: http://bugs.openbossa.org/show_bug.cgi?id=363'''
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from helper.usesqapplication import UsesQApplication
-from PySide2 import QtCore, QtWidgets
-
-# Check for desktop object lifetime
-class BugTest(UsesQApplication):
- def mySlot(self):
- pass
-
- # test if it is possible to connect with a desktop object after storing that on an auxiliar variable
- def testCase1(self):
- desktop = QtWidgets.QApplication.desktop()
- desktop.resized[int].connect(self.mySlot)
- self.assertTrue(True)
-
- # test if it is possible to connect with a desktop object without storing that on an auxiliar variable
- def testCase2(self):
- QtWidgets.QApplication.desktop().resized[int].connect(self.mySlot)
- self.assertTrue(True)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/bug_416.py b/sources/pyside2/tests/QtWidgets/bug_416.py
deleted file mode 100644
index 092abebaf..000000000
--- a/sources/pyside2/tests/QtWidgets/bug_416.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from helper.timedqapplication import TimedQApplication
-from PySide2.QtCore import QSignalTransition, QState, Qt, QStateMachine
-from PySide2.QtWidgets import QCheckBox
-
-class CheckedTransition(QSignalTransition):
- def __init__(self, check):
- QSignalTransition.__init__(self, check.stateChanged[int])
- self.eventTested = False
-
- def eventTest(self, event):
- self.eventTested = True
- if not QSignalTransition.eventTest(self, event):
- return False
- return event.arguments()[0] == Qt.Checked
-
-class TestBug(TimedQApplication):
- def testCase(self):
- check = QCheckBox()
- check.setTristate(True)
-
- s1 = QState()
- s2 = QState()
-
- t1 = CheckedTransition(check)
- t1.setTargetState(s2)
- s1.addTransition(t1)
-
- machine = QStateMachine()
- machine.addState(s1)
- machine.addState(s2)
- machine.setInitialState(s1)
- machine.start()
-
- check.stateChanged[int].emit(1)
- check.show()
- self.app.exec_()
- self.assertTrue(t1.eventTested)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/bug_632.py b/sources/pyside2/tests/QtWidgets/bug_632.py
deleted file mode 100644
index d836b2ff6..000000000
--- a/sources/pyside2/tests/QtWidgets/bug_632.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtWidgets import QLineEdit, QApplication
-
-
-class Bug589(unittest.TestCase):
- def testWrongSignature(self):
- text = QLineEdit("PySide bug 632")
- a = b = c = d = 0
- self.assertRaises(TypeError, text.getTextMargins, (a, b, c, d))
-
- def testTupleReturn(self):
- text = QLineEdit("PySide bug 632")
- text.setTextMargins(10, 20, 30, 40)
- (a, b, c, d) = text.getTextMargins()
- self.assertTrue((a, b, c, d), (10, 20, 30, 40))
-
-if __name__ == "__main__":
- app = QApplication(sys.argv)
- unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/bug_711.py b/sources/pyside2/tests/QtWidgets/bug_711.py
index 43e4b7bb2..3898e23f5 100644
--- a/sources/pyside2/tests/QtWidgets/bug_711.py
+++ b/sources/pyside2/tests/QtWidgets/bug_711.py
@@ -34,7 +34,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtWidgets import QToolBar, QApplication, QAction, QToolButton
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QToolBar, QApplication, QToolButton
try:
xrange
diff --git a/sources/pyside2/tests/QtWidgets/bug_714.py b/sources/pyside2/tests/QtWidgets/bug_714.py
deleted file mode 100644
index 76cf0295b..000000000
--- a/sources/pyside2/tests/QtWidgets/bug_714.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtGui import QPixmap
-from PySide2.QtWidgets import QLabel, QApplication
-
-class TestLabelPixmap(unittest.TestCase):
- def testReference(self):
- l = QLabel()
- p = QPixmap()
- l.setPixmap(p) # doesn't increment pixmap ref because this makes a copy
- self.assertEqual(sys.getrefcount(p), 2)
-
- p = l.pixmap()
- # this used to increment the reference because this is
- # an internal pointer, but not anymore since we don't create
- # a copy
- # self.assertEqual(sys.getrefcount(p), 3)
- self.assertEqual(sys.getrefcount(p), 2)
-
- p2 = l.pixmap()
- self.assertEqual(p, p2)
-
-if __name__ == '__main__':
- app = QApplication([])
- unittest.main()
-
diff --git a/sources/pyside2/tests/QtWidgets/bug_860.py b/sources/pyside2/tests/QtWidgets/bug_860.py
index 8cdab2e45..483973fdb 100644
--- a/sources/pyside2/tests/QtWidgets/bug_860.py
+++ b/sources/pyside2/tests/QtWidgets/bug_860.py
@@ -52,7 +52,7 @@ class MultipleSlotTest(UsesQApplication):
box.stateChanged.connect(checkboxMapper.map)
checkboxMapper.setMapping(box, box.text())
- checkboxMapper.mapped[str].connect(self.cb_changed)
+ checkboxMapper.mappedString[str].connect(self.cb_changed)
self._changed = False
box.setChecked(True)
self.assertTrue(self._changed)
diff --git a/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py b/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py
index 8e291bb63..8699c7971 100644
--- a/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py
+++ b/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py
@@ -34,8 +34,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
-
from PySide2.QtCore import QSizeF, QTimer
from PySide2.QtGui import QTextFormat, QTextCharFormat, QPyTextObject
from PySide2.QtWidgets import QTextEdit
@@ -60,7 +58,7 @@ class QAbstractTextDocumentLayoutTest(UsesQApplication):
fmt.setObjectType(QAbstractTextDocumentLayoutTest.objectType)
cursor = self.textEdit.textCursor()
- cursor.insertText(py3k.unichr(0xfffc), fmt)
+ cursor.insertText(chr(0xfffc), fmt)
self.textEdit.setTextCursor(cursor)
self.textEdit.close()
diff --git a/sources/pyside2/tests/QtWidgets/qaction_test.py b/sources/pyside2/tests/QtWidgets/qaction_test.py
index 8fc8f6c05..d587a59b1 100644
--- a/sources/pyside2/tests/QtWidgets/qaction_test.py
+++ b/sources/pyside2/tests/QtWidgets/qaction_test.py
@@ -34,7 +34,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtWidgets import QAction, QWidget
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QWidget
from helper.usesqapplication import UsesQApplication
class QPainterDrawText(UsesQApplication):
diff --git a/sources/pyside2/tests/QtWidgets/qimage_test.py b/sources/pyside2/tests/QtWidgets/qimage_test.py
index 8bb83c51a..11b9d2193 100644
--- a/sources/pyside2/tests/QtWidgets/qimage_test.py
+++ b/sources/pyside2/tests/QtWidgets/qimage_test.py
@@ -36,7 +36,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from helper.helper import adjust_filename
@@ -292,17 +291,11 @@ class QImageTest(UsesQApplication):
data2 = img1.scanLine(0)
self.assertEqual(data1, data2)
- # PySide python 3.x does not support slice yet
- if not py3k.IS_PY3K:
- buff = py3k.buffer(img0.bits()[:img0.bytesPerLine()])
- self.assertEqual(data1, buff)
- self.assertEqual(data2, buff)
-
def testEmptyBuffer(self):
- img = QImage(py3k.buffer(''), 100, 100, QImage.Format_ARGB32)
+ img = QImage(bytes('', "UTF-8"), 100, 100, QImage.Format_ARGB32)
def testEmptyStringAsBuffer(self):
- img = QImage(py3k.b(''), 100, 100, QImage.Format_ARGB32)
+ img = QImage(bytes('', "UTF-8"), 100, 100, QImage.Format_ARGB32)
def testXpmConstructor(self):
label = QLabel()
diff --git a/sources/pyside2/tests/QtWidgets/qshortcut_test.py b/sources/pyside2/tests/QtWidgets/qshortcut_test.py
index 18aec285d..dbe99167c 100644
--- a/sources/pyside2/tests/QtWidgets/qshortcut_test.py
+++ b/sources/pyside2/tests/QtWidgets/qshortcut_test.py
@@ -38,11 +38,13 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2 import QtCore, QtGui, QtWidgets
+from PySide2.QtCore import Qt, QTimer
+from PySide2.QtGui import QKeySequence, QShortcut
+from PySide2.QtWidgets import QApplication, QWidget
-class Foo(QtWidgets.QWidget):
+class Foo(QWidget):
def __init__(self):
- QtWidgets.QWidget.__init__(self)
+ QWidget.__init__(self)
self.ok = False
self.copy = False
@@ -52,22 +54,22 @@ class Foo(QtWidgets.QWidget):
def slot_of_copy(self):
self.copy = True
-class MyShortcut(QtWidgets.QShortcut):
+class MyShortcut(QShortcut):
def __init__(self, keys, wdg, slot):
- QtWidgets.QShortcut.__init__(self, keys, wdg, slot)
+ QShortcut.__init__(self, keys, wdg, slot)
def emit_signal(self):
- self.emit(QtCore.SIGNAL("activated()"))
+ self.activated.emit()
class QAppPresence(unittest.TestCase):
def testQShortcut(self):
- self.qapp = QtWidgets.QApplication([])
+ self.qapp = QApplication([])
f = Foo()
- self.sc = MyShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return), f, f.slot_of_foo)
- self.scstd = MyShortcut(QtGui.QKeySequence.Copy, f, f.slot_of_copy)
- QtCore.QTimer.singleShot(0, self.init);
+ self.sc = MyShortcut(QKeySequence(Qt.Key_Return), f, f.slot_of_foo)
+ self.scstd = MyShortcut(QKeySequence.Copy, f, f.slot_of_copy)
+ QTimer.singleShot(0, self.init);
self.qapp.exec_()
self.assertEqual(f.ok, True)
self.assertEqual(f.copy, True)
diff --git a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
index 0321b69a4..a8b572d05 100644
--- a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
+++ b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
@@ -39,11 +39,10 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from helper.usesqapplication import UsesQApplication
-from PySide2.QtGui import QKeySequence
-from PySide2.QtWidgets import QAction
+from PySide2.QtGui import QAction, QKeySequence
+
class QStringQKeySequenceTest(UsesQApplication):
'''Tests conversions of QString to and from QKeySequence.'''
@@ -56,7 +55,7 @@ class QStringQKeySequenceTest(UsesQApplication):
def testPythonStringAsQKeySequence(self):
'''Passes a Python string to an argument expecting a QKeySequence.'''
- keyseq = py3k.unicode_('Ctrl+A')
+ keyseq = 'Ctrl+A'
action = QAction(None)
action.setShortcut(keyseq)
shortcut = action.shortcut()
diff --git a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
index 856bf07f3..a70305c4a 100644
--- a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
@@ -36,7 +36,8 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide2.QtWidgets import QToolBar, QMainWindow, QAction
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QToolBar, QMainWindow
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/wrong_return_test.py b/sources/pyside2/tests/QtWidgets/wrong_return_test.py
index d95ae7639..27b5309e9 100644
--- a/sources/pyside2/tests/QtWidgets/wrong_return_test.py
+++ b/sources/pyside2/tests/QtWidgets/wrong_return_test.py
@@ -37,7 +37,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(False)
-import py3kcompat as py3k
from PySide2 import QtWidgets
from helper.usesqapplication import UsesQApplication
@@ -56,10 +55,7 @@ class testCase(UsesQApplication):
def testVirtualReturn(self):
w = MyWidget()
- if py3k.IS_PY3K:
- self.assertWarns(RuntimeWarning, w.show)
- else:
- self.assertRaises(RuntimeWarning, w.show)
+ self.assertWarns(RuntimeWarning, w.show)
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtXml/CMakeLists.txt b/sources/pyside2/tests/QtXml/CMakeLists.txt
index 2c21bf87d..feb230af3 100644
--- a/sources/pyside2/tests/QtXml/CMakeLists.txt
+++ b/sources/pyside2/tests/QtXml/CMakeLists.txt
@@ -1,2 +1 @@
PYSIDE_TEST(qdomdocument_test.py)
-PYSIDE_TEST(qxmlsimplereader_test.py)
diff --git a/sources/pyside2/tests/QtXml/qdomdocument_test.py b/sources/pyside2/tests/QtXml/qdomdocument_test.py
index 67da9952c..37774288c 100644
--- a/sources/pyside2/tests/QtXml/qdomdocument_test.py
+++ b/sources/pyside2/tests/QtXml/qdomdocument_test.py
@@ -38,25 +38,25 @@ init_test_paths(False)
from PySide2.QtCore import QByteArray
from PySide2.QtXml import QDomDocument, QDomElement
-import py3kcompat as py3k
+
class QDomDocumentTest(unittest.TestCase):
def setUp(self):
self.dom = QDomDocument()
- self.goodXmlData = QByteArray(py3k.b('''
+ self.goodXmlData = QByteArray(bytes('''
<typesystem package="PySide2.QtXml">
<value-type name="QDomDocument"/>
<value-type name="QDomElement"/>
</typesystem>
- '''))
+ ''', "UTF-8"))
- self.badXmlData = QByteArray(py3k.b('''
+ self.badXmlData = QByteArray(bytes('''
<typesystem package="PySide2.QtXml">
<value-type name="QDomDocument">
</typesystem>
- '''))
+ ''', "UTF-8"))
def tearDown(self):
del self.dom
@@ -67,7 +67,7 @@ class QDomDocumentTest(unittest.TestCase):
'''Sets invalid xml as the QDomDocument contents.'''
ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.badXmlData, True)
self.assertFalse(ok)
- self.assertEqual(errorStr, 'tag mismatch')
+ self.assertEqual(errorStr, 'Opening and ending tag mismatch.')
self.assertEqual(errorLine, 4)
self.assertEqual(errorColumn, 21)
diff --git a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py b/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py
deleted file mode 100644
index a30d68cde..000000000
--- a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtXml import QXmlSimpleReader
-
-class QXmlSimpleReaderTest(unittest.TestCase):
-
- def testQXmlSimpleReaderInstatiation(self):
- '''QXmlSimpleReader must be a concrete class not an abstract one.'''
- reader = QXmlSimpleReader()
-
- def testQXmlSimpleReaderFeatures(self):
- '''Calls the QXmlSimpleReader.features method. The features checked
- (at least the first two) can be found in the QXmlSimpleReader documentation:
- http://qt.nokia.com/doc/4.6/qxmlsimplereader.html#setFeature
- '''
- reader = QXmlSimpleReader()
- hasFeature, ok = reader.feature('http://xml.org/sax/features/namespaces')
- self.assertEqual((hasFeature, ok), (True, True))
-
- hasFeature, ok = reader.feature('http://xml.org/sax/features/namespace-prefixes')
- self.assertEqual((hasFeature, ok), (False, True))
-
- hasFeature, ok = reader.feature('foobar')
- self.assertEqual((hasFeature, ok), (False, False))
-
- def testQXmlSimpleReaderProperty(self):
- '''Tries to get a non existent property.'''
- reader = QXmlSimpleReader()
- prop, ok = reader.property('foo')
- self.assertEqual((prop, ok), (None, False))
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt b/sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt
deleted file mode 100644
index 7f570f156..000000000
--- a/sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-PYSIDE_TEST(import_test.py)
diff --git a/sources/pyside2/tests/QtXmlPatterns/import_test.py b/sources/pyside2/tests/QtXmlPatterns/import_test.py
deleted file mode 100644
index 09032909f..000000000
--- a/sources/pyside2/tests/QtXmlPatterns/import_test.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/python
-
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-import os
-import sys
-import unittest
-
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from init_paths import init_test_paths
-init_test_paths(False)
-
-from PySide2.QtCore import *
-from PySide2.QtXmlPatterns import QXmlSchema
-from helper.usesqcoreapplication import UsesQCoreApplication
-import py3kcompat as py3k
-
-class QXmlPatternsTest(UsesQCoreApplication):
-
- def testSchema(self):
- data = QByteArray(py3k.b('''<?xml version=\"1.0\" encoding=\"UTF-8\"?>
- <xsd:schema
- xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
- xmlns=\"http://qt.nokia.com/xmlschematest\"
- targetNamespace=\"http://qt.nokia.com/xmlschematest\"
- version=\"1.0\"
- elementFormDefault=\"qualified\">
- </xsd:schema>'''))
-
- buf = QBuffer(data)
- buf.open(QIODevice.ReadOnly)
-
- schema = QXmlSchema()
- schema.load(buf)
- self.assertTrue(schema.isValid())
-
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt
index 577b51815..bbdeb6a98 100644
--- a/sources/pyside2/tests/pysidetest/CMakeLists.txt
+++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt
@@ -1,11 +1,14 @@
project(pysidetest)
project(testbinding)
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.16)
set(QT_USE_QTCORE 1)
# no more supported: include(${QT_USE_FILE})
-add_definitions(${Qt${QT_MAJOR_VERSION}Core_DEFINITIONS})
+
+# removed after qtbase/054b66a65748c9ebfafeca88bf31669a24994237, is this required?
+# add_definitions(${Qt${QT_MAJOR_VERSION}Core_DEFINITIONS})
+
add_definitions(-DQT_SHARED)
add_definitions(-DRXX_ALLOCATOR_INIT_0)
@@ -25,11 +28,7 @@ testview.h
hiddenobject.h
)
-if (${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- qt6_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
-else()
- qt5_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
-endif()
+qt_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
set(testbinding_SRC
${CMAKE_CURRENT_BINARY_DIR}/testbinding/flagsnamespace_classforenum_wrapper.cpp
@@ -51,9 +50,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp
# Thus we use the second direct path, which contains the actual header files.
if(${QT_MAJOR_VERSION} GREATER_EQUAL 6)
- set(Qt6Core_DIRECT_INCLUDE_DIR Qt6Core_INCLUDE_DIRS)
- set(Qt6Gui_DIRECT_INCLUDE_DIR Qt6Gui_INCLUDE_DIRS)
- set(Qt6Widgets_DIRECT_INCLUDE_DIR Qt6Widgets_INCLUDE_DIRS)
+ set(Qt6Core_DIRECT_INCLUDE_DIR ${Qt6Core_INCLUDE_DIRS})
+ set(Qt6Gui_DIRECT_INCLUDE_DIR ${Qt6Gui_INCLUDE_DIRS})
+ set(Qt6Widgets_DIRECT_INCLUDE_DIR ${Qt6Widgets_INCLUDE_DIRS})
else()
list(GET Qt5Core_INCLUDE_DIRS 1 Qt5Core_DIRECT_INCLUDE_DIR)
list(GET Qt5Gui_INCLUDE_DIRS 1 Qt5Gui_DIRECT_INCLUDE_DIR)
diff --git a/sources/pyside2/tests/pysidetest/modelview_test.py b/sources/pyside2/tests/pysidetest/modelview_test.py
index a4ae9dd40..e9d376801 100644
--- a/sources/pyside2/tests/pysidetest/modelview_test.py
+++ b/sources/pyside2/tests/pysidetest/modelview_test.py
@@ -36,7 +36,6 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from init_paths import init_test_paths
init_test_paths(True)
-import py3kcompat as py3k
from testbinding import TestView
from PySide2.QtCore import QAbstractListModel, QObject, QModelIndex
@@ -98,7 +97,7 @@ class ModelViewTest(unittest.TestCase):
model = ListModelThatReturnsString()
view = TestView(model)
obj = view.getData()
- self.assertEqual(type(obj), py3k.unicode)
+ self.assertEqual(type(obj), str)
self.assertEqual(obj, 'string')
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
index 81a764986..55953ad69 100644
--- a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
+++ b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
@@ -57,7 +57,6 @@ new_functions = """
"""
new_functions += """
- PySide2.QtGui.QBitmap().transformed(qMatrix,transformationMode)
PySide2.QtGui.QStandardItemModel().insertColumn(int,qModelIndex)
PySide2.QtGui.QStandardItemModel().parent()
# PySide2.QtGui.QTextList(qTextDocument).setFormat(qTextFormat) # Segmentation fault: 11
@@ -71,8 +70,6 @@ new_functions += """
PySide2.QtWidgets.QApplication.setPalette(qPalette)
PySide2.QtWidgets.QBoxLayout(direction).addWidget(qWidget)
PySide2.QtWidgets.QColorDialog().open()
- PySide2.QtWidgets.QDirModel().index(int,int,qModelIndex)
- PySide2.QtWidgets.QDirModel().parent()
PySide2.QtWidgets.QFileDialog().open()
PySide2.QtWidgets.QFileSystemModel().index(int,int,qModelIndex)
PySide2.QtWidgets.QFileSystemModel().parent()
@@ -145,7 +142,6 @@ class MainTest(unittest.TestCase):
try:
PySide2.QtGui
#qPaintDevice = PySide2.QtGui.QPaintDevice() # NotImplementedError
- qMatrix = PySide2.QtGui.QMatrix()
qTextDocument = PySide2.QtGui.QTextDocument()
qTextFormat = PySide2.QtGui.QTextFormat()
quintptr = long(42) if sys.version_info[0] < 3 else 42
@@ -158,7 +154,7 @@ class MainTest(unittest.TestCase):
direction = PySide2.QtWidgets.QBoxLayout.Direction()
qWidget = PySide2.QtWidgets.QWidget()
qStyleOptionFrame = PySide2.QtWidgets.QStyleOptionFrame()
- qAction = PySide2.QtWidgets.QAction(qObject)
+ qAction = PySide2.QtGui.QAction(qObject)
renderFlags = PySide2.QtWidgets.QWidget.RenderFlags
except AttributeError:
pass
diff --git a/sources/pyside2/tests/pysidetest/qvariant_test.py b/sources/pyside2/tests/pysidetest/qvariant_test.py
index 0efece889..547cca441 100644
--- a/sources/pyside2/tests/pysidetest/qvariant_test.py
+++ b/sources/pyside2/tests/pysidetest/qvariant_test.py
@@ -45,7 +45,7 @@ class QVariantTest(UsesQApplication):
def testQKeySequenceQVariantOperator(self):
# bug #775
ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R)
- self.assertEqual(TestObject.checkType(ks), 75)
+ self.assertEqual(TestObject.checkType(ks), 4107)
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/signals/signal_enum_test.py b/sources/pyside2/tests/signals/signal_enum_test.py
index 3a24b919d..d48aa10cf 100644
--- a/sources/pyside2/tests/signals/signal_enum_test.py
+++ b/sources/pyside2/tests/signals/signal_enum_test.py
@@ -26,6 +26,7 @@
##
#############################################################################
+from enum import Enum
import os
import sys
import unittest
@@ -36,47 +37,44 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide2.QtCore import QObject, Signal, Slot
-import py3kcompat as py3k
-if py3k.IS_PY3K:
- from enum import Enum
+class Colors(Enum):
+ red = 1
+ green = 2
+ blue = 3
- class Colors(Enum):
- red = 1
- green = 2
- blue = 3
+class Obj(QObject):
+ enum_signal = Signal(Colors)
+ object_signal = Signal(object)
- class Obj(QObject):
- enum_signal = Signal(Colors)
- object_signal = Signal(object)
+ def __init__(self, parent=None):
+ QObject.__init__(self, parent)
+ self.enum_signal.connect(self.get_result)
+ self.object_signal.connect(self.get_result)
+ self.value = -1
- def __init__(self, parent=None):
- QObject.__init__(self, parent)
- self.enum_signal.connect(self.get_result)
- self.object_signal.connect(self.get_result)
- self.value = -1
+ @Slot()
+ def get_result(self, i):
+ self.value = i
- @Slot()
- def get_result(self, i):
- self.value = i
+class SignalEnumTests(unittest.TestCase):
+ '''Test Signal with enum.Enum'''
- class SignalEnumTests(unittest.TestCase):
- '''Test Signal with enum.Enum'''
+ def testSignal(self):
+ o = Obj()
+ # Default value
+ self.assertEqual(o.value, -1)
- def testSignal(self):
- o = Obj()
- # Default value
- self.assertEqual(o.value, -1)
+ # Enum Signal
+ o.enum_signal.emit(Colors.green)
+ self.assertEqual(o.value, Colors.green)
- # Enum Signal
- o.enum_signal.emit(Colors.green)
- self.assertEqual(o.value, Colors.green)
+ # object Signal
+ o.object_signal.emit(Colors.red)
+ self.assertEqual(o.value, Colors.red)
- # object Signal
- o.object_signal.emit(Colors.red)
- self.assertEqual(o.value, Colors.red)
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside2/tests/support/voidptr_test.py b/sources/pyside2/tests/support/voidptr_test.py
index 9e3668eb1..367d250da 100644
--- a/sources/pyside2/tests/support/voidptr_test.py
+++ b/sources/pyside2/tests/support/voidptr_test.py
@@ -53,7 +53,7 @@ class PySide2Support(unittest.TestCase):
self.assertIsInstance(vp, shiboken.VoidPtr)
# Create QByteArray from voidptr byte interpretation
- nba = QByteArray.fromRawData(vp.toBytes())
+ nba = QByteArray(vp.toBytes())
# Compare original bytes to toBytes()
self.assertTrue(b, vp.toBytes())
# Compare original with new QByteArray data
diff --git a/sources/pyside2/tests/tools/list-class-hierarchy.py b/sources/pyside2/tests/tools/list-class-hierarchy.py
index b734ae69e..70075b27e 100755
--- a/sources/pyside2/tests/tools/list-class-hierarchy.py
+++ b/sources/pyside2/tests/tools/list-class-hierarchy.py
@@ -87,7 +87,6 @@ if __name__=='__main__':
'QtSvg',
'QtTest',
#'QtUiTools',
- 'QtWebKit',
'QtXml',
'QtXmlPatterns' ]
diff --git a/sources/pyside2/tests/util/httpd.py b/sources/pyside2/tests/util/httpd.py
index 41ac126fb..82bec337d 100644
--- a/sources/pyside2/tests/util/httpd.py
+++ b/sources/pyside2/tests/util/httpd.py
@@ -26,23 +26,17 @@
##
#############################################################################
+import http.server as BaseHTTPServer
import os
import random
import select
import sys
+import socketserver as SocketServer
import tempfile
import threading
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
-import py3kcompat as py3k
-
-if py3k.IS_PY3K:
- import socketserver as SocketServer
- import http.server as BaseHTTPServer
-else:
- import SocketServer
- import BaseHTTPServer
class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
DATA = "PySide Server"
diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py
deleted file mode 100644
index bffc79968..000000000
--- a/sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py
+++ /dev/null
@@ -1,2 +0,0 @@
-
-from PyQt4.QtWebKit import *
diff --git a/sources/pyside2/tests/util/py3kcompat.py b/sources/pyside2/tests/util/py3kcompat.py
deleted file mode 100644
index bd90973ec..000000000
--- a/sources/pyside2/tests/util/py3kcompat.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-
-#############################################################################
-##
-## Copyright (C) 2020 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-# Copy of ../../../shiboken2/tests/py3kcompat.py
-
-import sys
-
-IS_PY3K = sys.version_info[0] == 3
-
-if IS_PY3K:
- def b(s):
- if type(s) == bytes:
- return s
- return bytes(s, "UTF8")
-
- def buffer_(s):
- if s == None:
- return None
- elif type(s) == str:
- return bytes(s, "UTF8")
- elif type(s) == bytes:
- return s
- else:
- memoryview(s)
-
- def l(n):
- return n
-
- def unicode_(s):
- return s
-
- unicode = str
- unichr = chr
- long = int
- unichr = chr
- buffer = buffer_
-else:
- def b(s):
- return s
-
- def l(n):
- return long(n)
-
- def unicode_(s):
- if type(s) == str:
- import codecs
- c = codecs.lookup('utf-8')
- s2 = c.decode(s, 'ignore')
- return s2[0]
- return u'%s' % s
-
- unicode = unicode
- unichr = unichr
- long = long
- buffer = buffer