diff options
author | Simo Fält <simo.falt@qt.io> | 2023-05-25 11:12:40 +0300 |
---|---|---|
committer | Simo Fält <simo.falt@qt.io> | 2023-05-25 11:12:40 +0300 |
commit | ca0519cb3f6b62e3b61ba74f0c60eac891dd3a15 (patch) | |
tree | 46e94d1b9a77648ca080a36b7d266f2322031d67 /sources/pyside2/PySide2/glue/qtgui.cpp | |
parent | 72d32f66685fbb7fefc41eee629e63f4824cb10b (diff) | |
parent | 7c386888b453b7f2ac78ef1da59d077b25e372b3 (diff) |
Merge tag 'v5.15.4-lts' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Qt For Python Release 5.15.4
Change-Id: I8457501ba90fc481fb9de686eb8a2f880ecc06cd
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtgui.cpp')
-rw-r--r-- | sources/pyside2/PySide2/glue/qtgui.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp index e802a9f59..1c74c73d2 100644 --- a/sources/pyside2/PySide2/glue/qtgui.cpp +++ b/sources/pyside2/PySide2/glue/qtgui.cpp @@ -41,6 +41,27 @@ * INJECT CODE ********************************************************************/ +// @snippet qopenglcontext-versionfunctions + +// %CPPSELF.%FUNCTION_NAME(%1, %2); Pretend to shiboken we call the function + +// Import QtOpenGLFunctions and call the factory function +// QOpenGLVersionFunctionsFactory.get() +PyObject *module = PyImport_ImportModule("PySide2.QtOpenGLFunctions"); +if (module == nullptr) + return nullptr; +PyObject *loc = PyModule_GetDict(module); +static PyObject *const factoryName = + Shiboken::String::createStaticString("QOpenGLVersionFunctionsFactory"); +auto factory = PyDict_GetItem(loc, factoryName); +if (factory == nullptr) + return nullptr; + +static PyObject *const getMethod = Shiboken::String::createStaticString("get"); +%PYARG_0 = PyObject_CallMethodObjArgs(factory, getMethod, pyArgs[0], %PYSELF, + nullptr); +// @snippet qopenglcontext-versionfunctions + // @snippet glgetshadersource GLsizei bufSize = 4096; GLsizei length = bufSize - 1; @@ -63,6 +84,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)) { |