diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-05-25 10:34:31 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-05-25 11:29:11 +0000 |
commit | 7337408d6c213a4b5b6abd277e59af715fabeb0a (patch) | |
tree | 4b3dadb0d39de8220798ade5fda1745f4ea1cb96 /sources | |
parent | c4c47cd152c864f6ffcd745aa07ce9d4e1affde5 (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.
Task-number: PYSIDE-1563
Change-Id: Ib0d58662a4257a315865436a32e99d9ee6369e03
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit 4daaa2edd881865172f19c007c69113bf4afc8cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside6/PySide6/templates/gui_common.xml | 4 |
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<uchar *>(Shiboken::Buffer::copyData(%PYARG_1)); - %0 = new %TYPE(ptr, %ARGS, std::free); + auto ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1)); + %0 = new %TYPE(ptr, %ARGS); </template> <template name="qcolor_repr"> |