diff options
author | Simo Fält <simo.falt@qt.io> | 2023-06-29 15:16:51 +0300 |
---|---|---|
committer | Simo Fält <simo.falt@qt.io> | 2023-06-29 15:16:51 +0300 |
commit | 643237181d15086816d38cdb17f18147c7ebcbd8 (patch) | |
tree | c2ab871bcba6a7b7ec6b65ceed246ff21ddaebb8 | |
parent | 8d8e799cb7ab0bebe8f6dd4172848159eb3c8087 (diff) | |
parent | 0e70b038a6a777cf1001fd2fbf75336b6ddfa047 (diff) |
Merge tag 'v5.15.10-lts' into tqtc/lts-5.15-opensourcev5.15.10-lts-lgpl
Qt For Python Release 5.15.10
Change-Id: Ie11dd2ac7278359128c19174cb4becd1cb5edbbe
-rw-r--r-- | coin/dependencies.yaml | 2 | ||||
-rw-r--r-- | dist/changes-5.15.10 | 29 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml | 5 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml | 6 | ||||
-rw-r--r-- | sources/pyside2/libpyside/signalmanager.cpp | 5 | ||||
-rw-r--r-- | sources/pyside2/pyside_version.py | 2 | ||||
-rw-r--r-- | sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken2/libshiboken/bindingmanager.cpp | 12 | ||||
-rw-r--r-- | sources/shiboken2/shiboken_version.py | 2 |
9 files changed, 62 insertions, 5 deletions
diff --git a/coin/dependencies.yaml b/coin/dependencies.yaml index 4652d72b6..c2e475643 100644 --- a/coin/dependencies.yaml +++ b/coin/dependencies.yaml @@ -1,6 +1,6 @@ product_dependency: ../../qt/tqtc-qt5.git: - ref: "36519195612b6596da28e19ea369c22c26ea4ba2" + ref: "67ee8a740e8a46c7dd470889ac182f465081dd1c" dependency_source: supermodule dependencies: [ "../../qt/qt3d", diff --git a/dist/changes-5.15.10 b/dist/changes-5.15.10 new file mode 100644 index 000000000..70e2ff69b --- /dev/null +++ b/dist/changes-5.15.10 @@ -0,0 +1,29 @@ +Qt for Python 5.5.10 is a bug-fix release. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qtforpython/ + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* PySide2 * +**************************************************************************** + + - [PYSIDE-1893] Error "Internal C++ object already deleted." when + using QWidget::nativeParentWidget() has been fixed. + - [PYSIDE-1939] A crash in QTextBlock.layout() has been fixed. + +**************************************************************************** +* Shiboken2 * +**************************************************************************** + + - [PYSIDE-1933] Converters for all smart pointee base classes are now + generated. diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index 617d64355..e1c3bca5d 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -479,6 +479,11 @@ </modify-argument> <inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qtextblock-userdata"/> </modify-function> + <modify-function signature="layout()const"> <!-- Suppress return value heuristics --> + <modify-argument index="return"> + <define-ownership class="target" owner="default"/> + </modify-argument> + </modify-function> </value-type> <value-type name="QTextBlockFormat"> <enum-type name="LineHeightTypes" since="4.8" revision="4800"/> diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml index 6a6845f58..c20351723 100644 --- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -2083,6 +2083,12 @@ </modify-argument> </modify-function> + <modify-function signature="nativeParentWidget()const"> <!-- Suppress return value heuristics --> + <modify-argument index="return"> + <define-ownership class="target" owner="default"/> + </modify-argument> + </modify-function> + <modify-function signature="actionEvent(QActionEvent*)"> <modify-argument index="1" invalidate-after-use="yes"> <rename to="event"/> diff --git a/sources/pyside2/libpyside/signalmanager.cpp b/sources/pyside2/libpyside/signalmanager.cpp index 93847e066..679281132 100644 --- a/sources/pyside2/libpyside/signalmanager.cpp +++ b/sources/pyside2/libpyside/signalmanager.cpp @@ -656,6 +656,11 @@ static int callMethod(QObject *object, int id, void **args) QByteArray methodName = method.methodSignature(); methodName.truncate(methodName.indexOf('(')); Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(self, methodName)); + if (pyMethod.isNull()) { + PyErr_Format(PyExc_AttributeError, "Slot '%s::%s' not found.", + metaObject->className(), method.methodSignature().constData()); + return -1; + } return SignalManager::callPythonMetaMethod(method, args, pyMethod, false); } return -1; diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py index 34caf4590..80dd16ae0 100644 --- a/sources/pyside2/pyside_version.py +++ b/sources/pyside2/pyside_version.py @@ -39,7 +39,7 @@ major_version = "5" minor_version = "15" -patch_version = "9" +patch_version = "10" # For example: "a", "b", "rc" # (which means "alpha", "beta", "release candidate"). diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 1ebe38fbc..670427d3f 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -1770,7 +1770,7 @@ void CppGenerator::writeSmartPointerConverterFunctions(QTextStream &s, const Abs // TODO: Missing conversion to smart pointer pointer type: s << "// Register smartpointer conversion for all derived classes\n"; - const auto classes = getBaseClasses(targetClass); + const auto classes = getAllAncestors(targetClass); for (auto k : classes) { if (smartPointerTypeEntry->matchesInstantiation(k->typeEntry())) { if (auto smartTargetType = findSmartPointerInstantiation(k->typeEntry())) { @@ -4016,7 +4016,7 @@ void CppGenerator::writeSmartPointerConverterInitialization(QTextStream &s, cons if (!klass) return; - const auto classes = getBaseClasses(klass); + const auto classes = getAllAncestors(klass); if (classes.isEmpty()) return; diff --git a/sources/shiboken2/libshiboken/bindingmanager.cpp b/sources/shiboken2/libshiboken/bindingmanager.cpp index 5d69e923f..13e0f9e7e 100644 --- a/sources/shiboken2/libshiboken/bindingmanager.cpp +++ b/sources/shiboken2/libshiboken/bindingmanager.cpp @@ -49,6 +49,7 @@ #include <cstddef> #include <fstream> +#include <mutex> #include <unordered_map> namespace Shiboken @@ -141,6 +142,11 @@ struct BindingManager::BindingManagerPrivate { using DestructorEntries = std::vector<DestructorEntry>; WrapperMap wrapperMapper; + // Guard wrapperMapper mainly for QML which calls into the generated + // QObject::metaObject() and elsewhere from threads without GIL, causing + // crashes for example in retrieveWrapper(). std::shared_mutex was rejected due to: + // https://stackoverflow.com/questions/50972345/when-is-stdshared-timed-mutex-slower-than-stdmutex-and-when-not-to-use-it + std::recursive_mutex wrapperMapLock; Graph classHierarchy; DestructorEntries deleteInMainThread; bool destroying; @@ -156,6 +162,7 @@ bool BindingManager::BindingManagerPrivate::releaseWrapper(void *cptr, SbkObject // The wrapper argument is checked to ensure that the correct wrapper is released. // Returns true if the correct wrapper is found and released. // If wrapper argument is NULL, no such check is performed. + std::lock_guard<std::recursive_mutex> guard(wrapperMapLock); auto iter = wrapperMapper.find(cptr); if (iter != wrapperMapper.end() && (wrapper == nullptr || iter->second == wrapper)) { wrapperMapper.erase(iter); @@ -167,6 +174,7 @@ bool BindingManager::BindingManagerPrivate::releaseWrapper(void *cptr, SbkObject void BindingManager::BindingManagerPrivate::assignWrapper(SbkObject *wrapper, const void *cptr) { assert(cptr); + std::lock_guard<std::recursive_mutex> guard(wrapperMapLock); auto iter = wrapperMapper.find(cptr); if (iter == wrapperMapper.end()) wrapperMapper.insert(std::make_pair(cptr, wrapper)); @@ -193,6 +201,7 @@ BindingManager::~BindingManager() * the BindingManager is being destroyed the interpreter is alredy * shutting down. */ if (Py_IsInitialized()) { // ensure the interpreter is still valid + std::lock_guard<std::recursive_mutex> guard(m_d->wrapperMapLock); while (!m_d->wrapperMapper.empty()) { Object::destroy(m_d->wrapperMapper.begin()->second, const_cast<void *>(m_d->wrapperMapper.begin()->first)); } @@ -208,6 +217,7 @@ BindingManager &BindingManager::instance() { bool BindingManager::hasWrapper(const void *cptr) { + std::lock_guard<std::recursive_mutex> guard(m_d->wrapperMapLock); return m_d->wrapperMapper.find(cptr) != m_d->wrapperMapper.end(); } @@ -268,6 +278,7 @@ void BindingManager::addToDeletionInMainThread(const DestructorEntry &e) SbkObject *BindingManager::retrieveWrapper(const void *cptr) { + std::lock_guard<std::recursive_mutex> guard(m_d->wrapperMapLock); auto iter = m_d->wrapperMapper.find(cptr); if (iter == m_d->wrapperMapper.end()) return nullptr; @@ -357,6 +368,7 @@ SbkObjectType *BindingManager::resolveType(void **cptr, SbkObjectType *type) std::set<PyObject *> BindingManager::getAllPyObjects() { std::set<PyObject *> pyObjects; + std::lock_guard<std::recursive_mutex> guard(m_d->wrapperMapLock); const WrapperMap &wrappersMap = m_d->wrapperMapper; auto it = wrappersMap.begin(); for (; it != wrappersMap.end(); ++it) diff --git a/sources/shiboken2/shiboken_version.py b/sources/shiboken2/shiboken_version.py index 34caf4590..80dd16ae0 100644 --- a/sources/shiboken2/shiboken_version.py +++ b/sources/shiboken2/shiboken_version.py @@ -39,7 +39,7 @@ major_version = "5" minor_version = "15" -patch_version = "9" +patch_version = "10" # For example: "a", "b", "rc" # (which means "alpha", "beta", "release candidate"). |