aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-10-15 17:04:30 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-10-15 18:19:46 -0300
commitd75bd8367d26e4049b6748cc001ec7482fbda832 (patch)
tree985fcf6fe08349e89583cc33eeea795bc3794a9e /tests
parent5c9afb798ecc9ec29622464c9c96909a2e79f220 (diff)
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_400.py26
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index f40ebfd70..4a293f2dd 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -11,6 +11,7 @@ PYSIDE_TEST(bug_338.py)
PYSIDE_TEST(bug_363.py)
PYSIDE_TEST(bug_367.py)
PYSIDE_TEST(bug_389.py)
+PYSIDE_TEST(bug_400.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_400.py b/tests/QtGui/bug_400.py
new file mode 100644
index 000000000..0038a3e62
--- /dev/null
+++ b/tests/QtGui/bug_400.py
@@ -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()