diff options
Diffstat (limited to 'sources/pyside2/PySide2/templates/widgets_common.xml')
-rw-r--r-- | sources/pyside2/PySide2/templates/widgets_common.xml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/templates/widgets_common.xml b/sources/pyside2/PySide2/templates/widgets_common.xml index b68739533..e63785bb2 100644 --- a/sources/pyside2/PySide2/templates/widgets_common.xml +++ b/sources/pyside2/PySide2/templates/widgets_common.xml @@ -51,4 +51,41 @@ Shiboken::Object::setParent(%PYSELF, $PYARG); </template> + <template name="qgraphicsitem_pysequence"> + int numItems = PySequence_Size(%PYARG_1); + Shiboken::AutoArrayPointer<QGraphicsItem*> %out(numItems); + for (int i=0; i < numItems; i++) { + %out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i)); + } + </template> + + <template name="qgraphicsitem_pyobject"> + Shiboken::AutoDecRef object(PyList_New(0)); + for (int i=0, max=numItems; i < max; i++) { + PyList_Append(object, %CONVERTTOPYTHON[QGraphicsItem*](%in[i])); + } + PyObject *%out = object.object(); + </template> + + <template name="qstyleoptiongraphicsitem_pyobject"> + Shiboken::AutoDecRef option_object(PyList_New(0)); + for (int i=0, max=numItems; i < max; i++) { + const QStyleOptionGraphicsItem* item = &%in[i]; + PyList_Append(option_object, %CONVERTTOPYTHON[QStyleOptionGraphicsItem](item)); + } + PyObject* %out = option_object.object(); + </template> + + <template name="pysequence_qstyleoptiongraphicsitem"> + int numOptions = PySequence_Size(%PYARG_2); + Shiboken::AutoArrayPointer<QStyleOptionGraphicsItem> %out(numOptions); + for (int i=0; i < numOptions; i++) { + %out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i)); + } + </template> + + <template name="pysequencesize_int"> + int %out = PySequence_Size(%PYARG_1); + </template> + </typesystem> |