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.xml15
1 files changed, 15 insertions, 0 deletions
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 24c531e96..81aa2eaca 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -320,5 +320,20 @@
%PYARG_0 = %PYARG_#;
</template>
+ <!-- Iterator -->
+ <template name="__iter__">
+ Py_INCREF(%PYSELF);
+ %PYARG_0 = %PYSELF;
+ </template>
+
+ <template name="__iter_parent__">
+ %PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE](%CPPSELF.begin());
+ </template>
+
+ <template name="__next__">
+ if (!%CPPSELF.atEnd())
+ %PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE]((*%CPPSELF)++);
+ </template>
+
</typesystem>