aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-25 10:34:31 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-25 12:03:35 +0200
commit4daaa2edd881865172f19c007c69113bf4afc8cd (patch)
treefd8f5325ca752359d7f3a879bbaa99de11f1ed3b
parent0d7a8f100836608297286f02138f5c1c10992e31 (diff)
Revert "Fix crashes when using the QImage(uchar *) data constructors"
It breaks a use case in pyqtgraph, which expects to be able to manipulate the image by modifying the data. This reverts commit cc011c8980cc4ce02e3d9cceb74ee028c204214e. The helper Shiboken::Buffer::copyData() is left in place since it can be useful for other cases. Pick-to: 6.1 5.15 Task-number: PYSIDE-1563 Change-Id: Ib0d58662a4257a315865436a32e99d9ee6369e03 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/pyside6/PySide6/templates/gui_common.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/pyside6/PySide6/templates/gui_common.xml b/sources/pyside6/PySide6/templates/gui_common.xml
index 9a6ce100a..4cc6358b4 100644
--- a/sources/pyside6/PySide6/templates/gui_common.xml
+++ b/sources/pyside6/PySide6/templates/gui_common.xml
@@ -80,8 +80,8 @@
</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);
+ auto ptr = reinterpret_cast&lt;uchar*&gt;(Shiboken::Buffer::getPointer(%PYARG_1));
+ %0 = new %TYPE(ptr, %ARGS);
</template>
<template name="qcolor_repr">