aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/typesystem_templates.xml
diff options
context:
space:
mode:
Diffstat (limited to 'PySide/typesystem_templates.xml')
-rw-r--r--PySide/typesystem_templates.xml9
1 files changed, 9 insertions, 0 deletions
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 2903ae408..61b1471de 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -413,6 +413,15 @@
%out << cppItem;
}
</template>
+ <template name="pyseq_to_cppvector_conversion">
+ int the_size = PySequence_Size(%in);
+ %out.reserve(the_size);
+ for (int i = 0; i &lt; the_size; ++i) {
+ Shiboken::AutoDecRef pyItem(PySequence_GetItem(%in, i));
+ %OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);
+ %out &lt;&lt; cppItem;
+ }
+ </template>
<template name="checkPyCapsuleOrPyCObject_func">
static bool checkPyCapsuleOrPyCObject(PyObject* pyObj)