diff options
author | Simo Fält <simo.falt@qt.io> | 2023-05-25 11:19:15 +0300 |
---|---|---|
committer | Simo Fält <simo.falt@qt.io> | 2023-05-25 11:19:15 +0300 |
commit | d8f02ce77a4143aa4e7e6c4f7892e6a943c46b3c (patch) | |
tree | eb92573ddeb44c25697f2d883d243a89c0d98b68 /sources/pyside2/PySide2 | |
parent | ca0519cb3f6b62e3b61ba74f0c60eac891dd3a15 (diff) | |
parent | bd4180ffdd47d423b0bd2b995b09df474b8c5a81 (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
Diffstat (limited to 'sources/pyside2/PySide2')
-rw-r--r-- | sources/pyside2/PySide2/QtGui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml | 19 | ||||
-rw-r--r-- | sources/pyside2/PySide2/glue/qtgui.cpp | 10 | ||||
-rw-r--r-- | sources/pyside2/PySide2/templates/gui_common.xml | 5 |
4 files changed, 31 insertions, 5 deletions
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 &)"> <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&, 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<uchar *>(Shiboken::Buffer::copyData(%PYARG_1)); - %0 = new %TYPE(ptr, %ARGS, std::free); + Py_INCREF(%PYARG_1); + auto ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1)); + %0 = new %TYPE(ptr, %ARGS, imageDecrefDataHandler, %PYARG_1); </template> <template name="qcolor_repr"> |