diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-07-27 14:45:25 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-07-27 21:54:46 +0200 |
| commit | b9864c4f27b93d6c6948c0fc750af6fb976fe8dc (patch) | |
| tree | aa5ed8d875023c8e8184cae3d88b64bd736b909d /sources/pyside6 | |
| parent | 0949e3f35590783867a87e4e340ce4c44c79546f (diff) | |
PySide6: Use constData() in snippets where applicable
Pick-to: 6.1
Change-Id: Iafa3a7f4e0a81733c5a99a907e808391270ce8c6
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtcore.cpp | 6 | ||||
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtgui.cpp | 2 | ||||
| -rw-r--r-- | sources/pyside6/PySide6/templates/gui_common.xml | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp index 66fd3b004..fd41586d8 100644 --- a/sources/pyside6/PySide6/glue/qtcore.cpp +++ b/sources/pyside6/PySide6/glue/qtcore.cpp @@ -649,8 +649,8 @@ static void msgHandlerCallback(QtMsgType type, const QMessageLogContext &ctx, co PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QtMsgType](type)); PyTuple_SET_ITEM(arglist, 1, %CONVERTTOPYTHON[QMessageLogContext &](ctx)); QByteArray array = msg.toUtf8(); // Python handler requires UTF-8 - char *data = array.data(); - PyTuple_SET_ITEM(arglist, 2, %CONVERTTOPYTHON[char *](data)); + const char *data = array.constData(); + PyTuple_SET_ITEM(arglist, 2, %CONVERTTOPYTHON[const char *](data)); Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist)); } static void QtCoreModuleExit() @@ -1429,7 +1429,7 @@ if (result == -1) { Py_INCREF(Py_None); %PYARG_0 = Py_None; } else { - %PYARG_0 = PyBytes_FromStringAndSize(data.data(), result); + %PYARG_0 = PyBytes_FromStringAndSize(data.constData(), result); } // @snippet qdatastream-readrawdata diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index 6b30952d2..5b91790cf 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -474,7 +474,7 @@ const auto points = PySide::Numpy::xyDataToQPointFList(%PYARG_1, %PYARG_2); // @snippet qpainter-drawpointsnp-numpy-x-y // @snippet qpainter-drawpolygon -%CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2); +%CPPSELF.%FUNCTION_NAME(%1.constData(), %1.size(), %2); // @snippet qpainter-drawpolygon // @snippet qmatrix4x4 diff --git a/sources/pyside6/PySide6/templates/gui_common.xml b/sources/pyside6/PySide6/templates/gui_common.xml index 874f8df5f..b802054a8 100644 --- a/sources/pyside6/PySide6/templates/gui_common.xml +++ b/sources/pyside6/PySide6/templates/gui_common.xml @@ -172,7 +172,7 @@ </template> <template name="qpainter_drawlist"> - %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size()); + %CPPSELF.%FUNCTION_NAME(%1.constData(), %1.size()); </template> <template name="inplace_add"> |
