aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue/qtgui.cpp
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-11-29 09:29:48 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-11-29 14:36:49 +0000
commit36a9cd48344c8cfb776dea78c60e7d6760711197 (patch)
treed698778c95c8c891e01f683a1dd52dceb0d9026e /sources/pyside2/PySide2/glue/qtgui.cpp
parent6007f0785a0107204c522e466f82bd817fcf60f9 (diff)
Move add-conversion and native-to-target code
Now we are able to include snippets for the previously mentioned typesystem's tags, so this patch removes the current C/C++ code from the typesystems. Task-number: PYSIDE-834 Change-Id: I2929020fa1dc0859db780dffb12fa292627697b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtgui.cpp')
-rw-r--r--sources/pyside2/PySide2/glue/qtgui.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp
index b308d7ff1..759d0a85a 100644
--- a/sources/pyside2/PySide2/glue/qtgui.cpp
+++ b/sources/pyside2/PySide2/glue/qtgui.cpp
@@ -37,6 +37,10 @@
**
****************************************************************************/
+/*********************************************************************
+ * INJECT CODE
+ ********************************************************************/
+
// @snippet qtransform-quadtoquad
QTransform _result;
if (QTransform::quadToQuad(%1, %2, _result)) {
@@ -492,8 +496,18 @@ if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
}
// @snippet qguiapplication-2
-// @snippet qtransform-quadtoquad
-// @snippet qtransform-quadtoquad
+/*********************************************************************
+ * CONVERSIONS
+ ********************************************************************/
-// @snippet qtransform-quadtosquare
-// @snippet qtransform-quadtosquare
+// @snippet conversion-pylong
+%out = reinterpret_cast<%OUTTYPE>(PyLong_AsVoidPtr(%in));
+// @snippet conversion-pylong
+
+/*********************************************************************
+ * NATIVE TO TARGET CONVERSIONS
+ ********************************************************************/
+
+// @snippet return-pylong-voidptr
+return PyLong_FromVoidPtr(reinterpret_cast<void *>(%in));
+// @snippet return-pylong-voidptr