diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-20 21:57:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-20 21:57:08 +0200 |
commit | a6c3806c49db404d27d953a66d923eddedc51839 (patch) | |
tree | d8dc329fb2f31a2caa7ff1d230c1c2ad1f6664a9 /sources/pyside2 | |
parent | 08444a16c910bc0648cf937c83d14b910b86b020 (diff) | |
parent | 639456cabd032b60aa371000a8ca98ddb9d08504 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I32c79055fc1382c9a9d1390b59ce04827aea9b13
Diffstat (limited to 'sources/pyside2')
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 4 | ||||
-rw-r--r-- | sources/pyside2/PySide2/glue/qtcore.cpp | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 53ab29382..272f9a766 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -789,7 +789,7 @@ </modify-function> </object-type> - <value-type name="QBasicTimer"/> + <object-type name="QBasicTimer"/> <value-type name="QByteArrayMatcher"/> <value-type name="QCalendar" since="5.14"> <value-type name="YearMonthDay"/> @@ -1541,7 +1541,7 @@ <enum-type name="SelectionFlag" flags="SelectionFlags"/> </object-type> - <value-type name="QItemSelectionRange" hash-function="qHash"> + <value-type name="QItemSelectionRange"> </value-type> <object-type name="QAbstractProxyModel" polymorphic-id-expression="qobject_cast<QAbstractProxyModel*>(%1)"> <extra-includes> diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index 834383679..83c8f8656 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -1681,11 +1681,19 @@ Py_END_ALLOW_THREADS // @snippet conversion-pyunicode #ifndef Py_LIMITED_API Py_UNICODE *unicode = PyUnicode_AS_UNICODE(%in); -# if defined(Py_UNICODE_WIDE) +# if defined(Py_UNICODE_WIDE) // cast as Py_UNICODE can be a different type -%out = QString::fromUcs4((const uint *)unicode); -# else -%out = QString::fromUtf16((const ushort *)unicode, PepUnicode_GetLength(%in)); +# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +%out = QString::fromUcs4(reinterpret_cast<const char32_t *>(unicode)); +# else +%out = QString::fromUcs4(reinterpret_cast<const uint *>(unicode)); +# endif // Qt 6 +# else // Py_UNICODE_WIDE +# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +%out = QString::fromUtf16(reinterpret_cast<const char16_t *>(unicode), PepUnicode_GetLength(%in)); +# else +%out = QString::fromUtf16(reinterpret_cast<const ushort *>(unicode), PepUnicode_GetLength(%in)); +# endif // Qt 6 # endif #else wchar_t *temp = PyUnicode_AsWideCharString(%in, NULL); |