Created function value to class QTreeWidgetItemIterator using the
operator *. Fixes bug #400. Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
5c9afb798e
commit
d75bd8367d
3 changed files with 38 additions and 2 deletions
|
|
@ -518,11 +518,20 @@
|
||||||
</modify-function>
|
</modify-function>
|
||||||
</value-type>
|
</value-type>
|
||||||
<value-type name="QTreeWidgetItemIterator" >
|
<value-type name="QTreeWidgetItemIterator" >
|
||||||
|
<modify-function signature="QTreeWidgetItemIterator(QTreeWidget *, QFlags<QTreeWidgetItemIterator::IteratorFlag>)">
|
||||||
|
<inject-code class="target" position="end">
|
||||||
|
Shiboken::setParent(%PYARG_1, (PyObject*)sbkSelf);
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<add-function signature="value()" return-type="QTreeWidgetItem*">
|
||||||
|
<inject-code>
|
||||||
|
%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%CPPSELF.operator*());
|
||||||
|
SbkBaseWrapper_setOwnership(%PYARG_0, false);
|
||||||
|
</inject-code>
|
||||||
|
</add-function>
|
||||||
<enum-type name="IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
|
<enum-type name="IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
|
||||||
<modify-function signature="operator++(int)" remove="all"/>
|
<modify-function signature="operator++(int)" remove="all"/>
|
||||||
<modify-function signature="operator--(int)" remove="all"/>
|
<modify-function signature="operator--(int)" remove="all"/>
|
||||||
<modify-function signature="operator+=(int)" remove="all"/>
|
|
||||||
<modify-function signature="operator-=(int)" remove="all"/>
|
|
||||||
<modify-function signature="operator++()" remove="all"/>
|
<modify-function signature="operator++()" remove="all"/>
|
||||||
<modify-function signature="operator--()" remove="all"/>
|
<modify-function signature="operator--()" remove="all"/>
|
||||||
<modify-function signature="operator*()const" remove="all"/>
|
<modify-function signature="operator*()const" remove="all"/>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ PYSIDE_TEST(bug_338.py)
|
||||||
PYSIDE_TEST(bug_363.py)
|
PYSIDE_TEST(bug_363.py)
|
||||||
PYSIDE_TEST(bug_367.py)
|
PYSIDE_TEST(bug_367.py)
|
||||||
PYSIDE_TEST(bug_389.py)
|
PYSIDE_TEST(bug_389.py)
|
||||||
|
PYSIDE_TEST(bug_400.py)
|
||||||
PYSIDE_TEST(customproxywidget_test.py)
|
PYSIDE_TEST(customproxywidget_test.py)
|
||||||
PYSIDE_TEST(deepcopy_test.py)
|
PYSIDE_TEST(deepcopy_test.py)
|
||||||
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
|
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
|
||||||
|
|
|
||||||
26
tests/QtGui/bug_400.py
Normal file
26
tests/QtGui/bug_400.py
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
from helper import UsesQApplication
|
||||||
|
from PySide.QtGui import QTreeWidgetItemIterator, QTreeWidgetItem, QTreeWidget
|
||||||
|
|
||||||
|
class BugTest(UsesQApplication):
|
||||||
|
def testCase(self):
|
||||||
|
treeWidget = QTreeWidget()
|
||||||
|
treeWidget.setColumnCount(1)
|
||||||
|
items = []
|
||||||
|
for i in range(10):
|
||||||
|
items.append(QTreeWidgetItem(None, ["item: %i" % i]))
|
||||||
|
|
||||||
|
treeWidget.insertTopLevelItems(0, items);
|
||||||
|
_iter = QTreeWidgetItemIterator(treeWidget)
|
||||||
|
index = 0
|
||||||
|
while(_iter.value()):
|
||||||
|
item = _iter.value()
|
||||||
|
self.assert_(item is items[index])
|
||||||
|
index += 1
|
||||||
|
_iter += 1
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue