[neon/qt/pyside2/Neon/unstable] /: New upstream version 5.15.10

Dmitry Shachnev null at kde.org
Thu Jun 15 10:12:13 BST 2023


Git commit 6c8926c3d286e4d25b6c09f6735231a5ef72e21b by Dmitry Shachnev.
Committed on 10/06/2023 at 21:07.
Pushed by carlosdem into branch 'Neon/unstable'.

New upstream version 5.15.10

M  +1    -1    coin/dependencies.yaml
A  +29   -0    dist/changes-5.15.10
M  +5    -0    sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
M  +6    -0    sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
M  +5    -0    sources/pyside2/libpyside/signalmanager.cpp
M  +1    -1    sources/pyside2/pyside_version.py
M  +2    -2    sources/shiboken2/generator/shiboken2/cppgenerator.cpp
M  +12   -0    sources/shiboken2/libshiboken/bindingmanager.cpp
M  +1    -1    sources/shiboken2/shiboken_version.py

https://invent.kde.org/neon/qt/pyside2/-/commit/6c8926c3d286e4d25b6c09f6735231a5ef72e21b

diff --git a/coin/dependencies.yaml b/coin/dependencies.yaml
index 4652d72b..c2e47564 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 00000000..70e2ff69
--- /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 617d6435..e1c3bca5 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 6a6845f5..c2035172 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 93847e06..67928113 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 34caf459..80dd16ae 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 1ebe38fb..670427d3 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 5d69e923..13e0f9e7 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 34caf459..80dd16ae 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").



More information about the Neon-commits mailing list