aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-05-25 11:19:15 +0300
committerSimo Fält <simo.falt@qt.io>2023-05-25 11:19:15 +0300
commitd8f02ce77a4143aa4e7e6c4f7892e6a943c46b3c (patch)
treeeb92573ddeb44c25697f2d883d243a89c0d98b68
parentca0519cb3f6b62e3b61ba74f0c60eac891dd3a15 (diff)
parentbd4180ffdd47d423b0bd2b995b09df474b8c5a81 (diff)
Merge tag 'v5.15.5-lts' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Qt For Python Release 5.15.5 Change-Id: Id8648afb982e4f1354257a0b523bc9c6f1acce2a
-rw-r--r--coin/dependencies.yaml2
-rw-r--r--coin/module_config.yaml2
-rw-r--r--dist/changes-5.15.530
-rw-r--r--examples/widgets/mainwindows/application/application.py14
-rw-r--r--examples/widgets/mainwindows/mdi/mdi.py18
-rw-r--r--sources/pyside2/PySide2/QtGui/CMakeLists.txt2
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml19
-rw-r--r--sources/pyside2/PySide2/glue/qtgui.cpp10
-rw-r--r--sources/pyside2/PySide2/templates/gui_common.xml5
-rw-r--r--sources/pyside2/pyside_version.py2
-rw-r--r--sources/pyside2/tests/QtCore/snake_prop_feature_test.py2
-rw-r--r--sources/shiboken2/libshiboken/signature/signature.cpp2
-rw-r--r--sources/shiboken2/shiboken_version.py2
-rw-r--r--sources/shiboken2/shibokenmodule/files.dir/shibokensupport/feature.py11
14 files changed, 86 insertions, 35 deletions
diff --git a/coin/dependencies.yaml b/coin/dependencies.yaml
index c2717bc08..af5c36172 100644
--- a/coin/dependencies.yaml
+++ b/coin/dependencies.yaml
@@ -1,6 +1,6 @@
product_dependency:
../../qt/tqtc-qt5.git:
- ref: "ce5066de40100b04dee7087c7b860693b379c990"
+ ref: "743ae9f98d7cc67c4956886209f39fcd5a28466f"
dependency_source: supermodule
dependencies: [
"../../qt/qt3d",
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
index 6169ce910..99778cce6 100644
--- a/coin/module_config.yaml
+++ b/coin/module_config.yaml
@@ -18,7 +18,7 @@ accept_configuration:
not_contains_value: -no-gui
- condition: property # Following configs are not supported
property: target.osVersion
- not_in_values: [OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15]
+ not_in_values: [OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15, MacOS_10_15]
- condition: property # MibnGW and msvc2015 are not supported
property: target.compiler
not_in_values: [Mingw, MSVC2015]
diff --git a/dist/changes-5.15.5 b/dist/changes-5.15.5
new file mode 100644
index 000000000..02c98b0d2
--- /dev/null
+++ b/dist/changes-5.15.5
@@ -0,0 +1,30 @@
+Qt for Python 5.15.5 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 *
+****************************************************************************
+
+ - Crashes in QClipboard.mimeData(), QTextCursor.currentList() and
+ QTextCursor.currentTable() have been fixed.
+ - Fixed issues where __feature__ was affected by other imports.
+ - Fixed crashes on QImage(uchar *) constructors, related to GIL handling.
+ - QOpenGLPaintDevice has been added.
+
+****************************************************************************
+* Shiboken2 *
+****************************************************************************
+
+ - No changes
diff --git a/examples/widgets/mainwindows/application/application.py b/examples/widgets/mainwindows/application/application.py
index 8c4626f9b..5645a0746 100644
--- a/examples/widgets/mainwindows/application/application.py
+++ b/examples/widgets/mainwindows/application/application.py
@@ -189,16 +189,14 @@ class MainWindow(QtWidgets.QMainWindow):
self.statusBar().showMessage("Ready")
def readSettings(self):
- settings = QtCore.QSettings("Trolltech", "Application Example")
- pos = settings.value("pos", QtCore.QPoint(200, 200))
- size = settings.value("size", QtCore.QSize(400, 400))
- self.resize(size)
- self.move(pos)
+ settings = QtCore.QSettings('QtProject', 'Application Example')
+ geometry = settings.value('geometry', QtCore.QByteArray())
+ if geometry.size():
+ self.restoreGeometry(geometry)
def writeSettings(self):
- settings = QtCore.QSettings("Trolltech", "Application Example")
- settings.setValue("pos", self.pos())
- settings.setValue("size", self.size())
+ settings = QtCore.QSettings('QtProject', 'Application Example')
+ settings.setValue('geometry', self.saveGeometry())
def maybeSave(self):
if self.textEdit.document().isModified():
diff --git a/examples/widgets/mainwindows/mdi/mdi.py b/examples/widgets/mainwindows/mdi/mdi.py
index 9daca826d..9eca5fdba 100644
--- a/examples/widgets/mainwindows/mdi/mdi.py
+++ b/examples/widgets/mainwindows/mdi/mdi.py
@@ -42,8 +42,8 @@
"""PySide2 port of the widgets/draganddrop/draggabletext example from Qt v5.x, originating from PyQt"""
-from PySide2.QtCore import (QFile, QFileInfo, QPoint, QSettings, QSignalMapper,
- QSaveFile, QSize, QTextStream, Qt)
+from PySide2.QtCore import (QByteArray, QFile, QFileInfo, QPoint, QSettings,
+ QSignalMapper, QSaveFile, QSize, QTextStream, Qt)
from PySide2.QtGui import QIcon, QKeySequence
from PySide2.QtWidgets import (QAction, QApplication, QFileDialog, QMainWindow,
QMdiArea, QMessageBox, QTextEdit, QWidget)
@@ -405,16 +405,14 @@ class MainWindow(QMainWindow):
self.statusBar().showMessage("Ready")
def readSettings(self):
- settings = QSettings('Trolltech', 'MDI Example')
- pos = settings.value('pos', QPoint(200, 200))
- size = settings.value('size', QSize(400, 400))
- self.move(pos)
- self.resize(size)
+ settings = QSettings('QtProject', 'MDI Example')
+ geometry = settings.value('geometry', QByteArray())
+ if geometry.size():
+ self.restoreGeometry(geometry)
def writeSettings(self):
- settings = QSettings('Trolltech', 'MDI Example')
- settings.setValue('pos', self.pos())
- settings.setValue('size', self.size())
+ settings = QSettings('QtProject', 'MDI Example')
+ settings.setValue('geometry', self.saveGeometry())
def activeMdiChild(self):
activeSubWindow = self.mdiArea.activeSubWindow()
diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
index c4a38a184..88d8be93f 100644
--- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
@@ -100,7 +100,7 @@ ${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}/qopenglpaintdevice_wrapper.cpp
${QtGui_GEN_DIR}/qopenglpixeltransferoptions_wrapper.cpp
${QtGui_GEN_DIR}/qopenglshaderprogram_wrapper.cpp
${QtGui_GEN_DIR}/qopengltexture_wrapper.cpp
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index b0c61fe64..e66ee48ce 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -643,6 +643,16 @@
<define-ownership class="target" owner="default"/>
</modify-argument>
</modify-function>
+ <modify-function signature="currentTable()const">
+ <modify-argument index="return">
+ <define-ownership class="target" owner="default"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="currentList()const">
+ <modify-argument index="return">
+ <define-ownership class="target" owner="default"/>
+ </modify-argument>
+ </modify-function>
<modify-function signature="insertTable(int,int,const QTextTableFormat &amp;)">
<modify-argument index="return">
<define-ownership class="target" owner="default"/>
@@ -758,6 +768,8 @@
<include file-name="QStringList" location="global"/>
<include file-name="QMatrix" location="global"/>
</extra-includes>
+ <inject-code class="native" position="beginning"
+ file="../glue/qtgui.cpp" snippet="qimage-decref-image-data"/>
<modify-function signature="load(const QString&amp;, const char*)" allow-thread="yes"/>
<modify-function signature="load(QIODevice*,const char*)" allow-thread="yes"/>
@@ -1760,6 +1772,11 @@
</modify-argument>
<inject-code class="target" position="end" file="../glue/qtgui.cpp" snippet="qclipboard-text"/>
</modify-function>
+ <modify-function signature="mimeData(QClipboard::Mode)const">
+ <modify-argument index="return">
+ <define-ownership class="target" owner="default"/>
+ </modify-argument>
+ </modify-function>
</object-type>
<object-type name="QPaintEngineState">
<extra-includes>
@@ -2625,9 +2642,7 @@
<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"/>
- -->
<object-type name="QOpenGLExtraFunctions" since="5.6">
<!-- Exlusions due to compile errors -->
<modify-function signature="glEndTransformFeedback()" remove="all"/>
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp
index 1c74c73d2..00d045787 100644
--- a/sources/pyside2/PySide2/glue/qtgui.cpp
+++ b/sources/pyside2/PySide2/glue/qtgui.cpp
@@ -190,6 +190,16 @@ for (int i = 0, i_max = %CPPSELF.count(); i < i_max; ++i){
%0 = new %TYPE(QPixmap::fromImage(%1));
// @snippet qpixmap
+// @snippet qimage-decref-image-data
+static void imageDecrefDataHandler(void *data)
+{
+ // Avoid "Python memory allocator called without holding the GIL"
+ auto state = PyGILState_Ensure();
+ Py_DECREF(reinterpret_cast<PyObject *>(data));
+ PyGILState_Release(state);
+}
+// @snippet qimage-decref-image-data
+
// @snippet qimage-constbits
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
// @snippet qimage-constbits
diff --git a/sources/pyside2/PySide2/templates/gui_common.xml b/sources/pyside2/PySide2/templates/gui_common.xml
index 16116877f..1a7406799 100644
--- a/sources/pyside2/PySide2/templates/gui_common.xml
+++ b/sources/pyside2/PySide2/templates/gui_common.xml
@@ -80,8 +80,9 @@
</template>
<template name="qimage_buffer_constructor">
- auto *ptr = reinterpret_cast&lt;uchar *&gt;(Shiboken::Buffer::copyData(%PYARG_1));
- %0 = new %TYPE(ptr, %ARGS, std::free);
+ Py_INCREF(%PYARG_1);
+ auto ptr = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_1));
+ %0 = new %TYPE(ptr, %ARGS, imageDecrefDataHandler, %PYARG_1);
</template>
<template name="qcolor_repr">
diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py
index ecc975ddf..876a0e401 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 = "4"
+patch_version = "5"
# For example: "a", "b", "rc"
# (which means "alpha", "beta", "release candidate").
diff --git a/sources/pyside2/tests/QtCore/snake_prop_feature_test.py b/sources/pyside2/tests/QtCore/snake_prop_feature_test.py
index 779b8a408..aea6a22ab 100644
--- a/sources/pyside2/tests/QtCore/snake_prop_feature_test.py
+++ b/sources/pyside2/tests/QtCore/snake_prop_feature_test.py
@@ -88,6 +88,8 @@ class FeatureTest(unittest.TestCase):
window.modal
from __feature__ import snake_case, true_property
+ #PYSIDE-1548: Make sure that another import does not clear the features.
+ import sys
self.assertTrue(isinstance(QtWidgets.QWidget.modal, property))
self.assertTrue(isinstance(window.modal, bool))
diff --git a/sources/shiboken2/libshiboken/signature/signature.cpp b/sources/shiboken2/libshiboken/signature/signature.cpp
index 601df4730..3051c50d5 100644
--- a/sources/shiboken2/libshiboken/signature/signature.cpp
+++ b/sources/shiboken2/libshiboken/signature/signature.cpp
@@ -454,7 +454,7 @@ static PyObject *adjustFuncName(const char *func_name)
* Note that fget is impossible because there are no parameters.
*/
static const char mapping_name[] = "shibokensupport.signature.mapping";
- static PyObject *sys_modules = PySys_GetObject("modules");
+ static PyObject *sys_modules = PySys_GetObject(const_cast<char *>("modules"));
static PyObject *mapping = PyDict_GetItemString(sys_modules, mapping_name);
static PyObject *ns = PyModule_GetDict(mapping);
diff --git a/sources/shiboken2/shiboken_version.py b/sources/shiboken2/shiboken_version.py
index ecc975ddf..876a0e401 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 = "4"
+patch_version = "5"
# For example: "a", "b", "rc"
# (which means "alpha", "beta", "release candidate").
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/feature.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/feature.py
index ece3d2edb..e2edfe391 100644
--- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/feature.py
+++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/feature.py
@@ -132,13 +132,10 @@ def _import(name, *args, **kwargs):
sys.modules["PySide2.QtCore"].__init_feature__()
return sys.modules["__feature__"]
- if name.split(".")[0] == "PySide2":
- # This is a module that imports PySide2.
- flag = existing if isinstance(existing, int) else 0
- else:
- # This is some other module. Ignore it in switching.
- flag = -1
- pyside_feature_dict[importing_module] = flag
+ if importing_module not in pyside_feature_dict:
+ # Ignore new modules if not from PySide.
+ default = 0 if name.split(".")[0] == "PySide2" else -1
+ pyside_feature_dict[importing_module] = default
return original_import(name, *args, **kwargs)
_is_initialized = False