summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 14:13:46 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 15:46:25 -0300
commit0fe1c15cbfc841205d490939f54614fedd1c99cc (patch)
tree7d3473d5c32763b3d7ce8dcbd651b211a4826524
parent88c38236d4cbbbcff1fa4f0e34b6249796a370c7 (diff)
downloadpyside-0fe1c15cbfc841205d490939f54614fedd1c99cc.tar.gz
pyside-0fe1c15cbfc841205d490939f54614fedd1c99cc.tar.xz
pyside-0fe1c15cbfc841205d490939f54614fedd1c99cc.zip
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 2af6f48..2227103 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"/>