summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 14:13:46 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:55 -0300
commitbd26ec914fc417d535c129f46ca54f85e42982bf (patch)
tree3e41eb35d07bc9523e4140066a9971b58fac0f61
parenta1d4eb3d867a4434db076b572d615f028000a9d5 (diff)
Implemented support for iterator on QTextBlock.
Fixes bug #662. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml17
1 files changed, 17 insertions, 0 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 2af6f484..2227103a 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -488,7 +488,24 @@
<modify-function signature="operator--()" remove="all"/>
<modify-function signature="operator++(int)" remove="all"/>
<modify-function signature="operator--(int)" remove="all"/>
+ <add-function signature="__iter__()" return-type="PyObject*">
+ <inject-code class="target" position="beginning">
+ Py_INCREF(%PYSELF);
+ %PYARG_0 = %PYSELF;
+ </inject-code>
+ </add-function>
+ <add-function signature="__next__()" return-type="PyObject*">
+ <inject-code class="target" position="beginning">
+ if (!%CPPSELF.atEnd())
+ %PYARG_0 = %CONVERTTOPYTHON[QTextBlock::iterator]((*%CPPSELF)++);
+ </inject-code>
+ </add-function>
</value-type>
+ <add-function signature="__iter__()" return-type="PyObject*">
+ <inject-code class="target" position="beginning">
+ %PYARG_0 = %CONVERTTOPYTHON[QTextBlock::iterator](%CPPSELF.begin());
+ </inject-code>
+ </add-function>
<modify-function signature="setUserData(QTextBlockUserData*)">
<modify-argument index="1">
<parent index="this" action="add"/>