aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2')
-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
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 &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">