aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-03 17:19:05 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-15 08:27:11 +0100
commit017a9099115c97ddec31a4335677ac43e9539b9f (patch)
tree94f014ea95d7b1143d866ebfd01d1725540523a4
parentf96e2fc175f073c823d208fbf068ebd621dfb593 (diff)
Fix broken return type conversions of QOpenGLExtraFunctions::glGetStringi()
The function returns const unsigned char*, which was converted using the wrong snippet (QString conversion of parameter 1). Add a new snippet using the char *conversion of the return value at the end. Fixes warning: PySide6/QtGui/PySide6/QtGui/qopenglextrafunctions_wrapper.cpp:4630:35: warning: unused variable cppResunused-variable] const unsigned char * cppResult = cppSelf->glGetStringi(cppArg0, cppArg1); Change-Id: Iae3f0abd4a34fb3b6a41534508fb5d64a3eae224 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 7cd7141e43e98d4862de3aadf128b0d0080090c9)
-rw-r--r--sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml3
-rw-r--r--sources/pyside6/PySide6/glue/qtgui.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
index 3268c88b8..c8a9b2be2 100644
--- a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
@@ -2690,7 +2690,8 @@
<modify-argument index="return">
<replace-type modified-type="QString"/>
</modify-argument>
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qstring-return"/>
+ <inject-code class="target" position="end" file="../glue/qtgui.cpp"
+ snippet="glgetstring-return"/>
</modify-function>
</object-type>
<object-type name="QOpenGLFunctions" since="5.0">
diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp
index f70875865..8dd59e068 100644
--- a/sources/pyside6/PySide6/glue/qtgui.cpp
+++ b/sources/pyside6/PySide6/glue/qtgui.cpp
@@ -63,6 +63,10 @@ const char *sources[] = {buffer.constData()};
%CPPSELF->%FUNCTION_NAME(%1, 1, sources, nullptr);
// @snippet glshadersource
+// @snippet glgetstring-return
+%PYARG_0 = %CONVERTTOPYTHON[const char *](%0);
+// @snippet glgetstring-return
+
// @snippet qtransform-quadtoquad
QTransform _result;
if (QTransform::quadToQuad(%1, %2, _result)) {