aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-04-05 17:52:26 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:22 -0300
commitb926ac5defe8f198d397344337ebadd09e278dde (patch)
tree6b07b2a55d4c5419ce3ab3c7b827e921c6bb46bb /tests
parentc057f74ce3c72d8a4d4a4f2a5357a5d3b7625fb2 (diff)
Added tests for bug #716 - QPersistentModelIndex isn't convertible to QModelIndex
The main test (exactly the same as reported) was added to QtGui tests, but also extended QAbstractItemModel test with a case that is the essence of the problem. http://bugs.pyside.org/show_bug.cgi?id=716 Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtCore/qabstractitemmodel_test.py7
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_716.py9
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/QtCore/qabstractitemmodel_test.py b/tests/QtCore/qabstractitemmodel_test.py
index 93306ca5f..52e6f8d2d 100644
--- a/tests/QtCore/qabstractitemmodel_test.py
+++ b/tests/QtCore/qabstractitemmodel_test.py
@@ -16,6 +16,13 @@ class TestQModelIndexInternalPointer(unittest.TestCase):
foo = Foo()
idx = m.createIndex(0,0, foo)
+ def testPassQPersistentModelIndexAsQModelIndex(self):
+ # Related to bug #716
+ m = MyModel()
+ idx = QPersistentModelIndex()
+ m.span(idx)
+
+
if __name__ == '__main__':
unittest.main()
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 338f2e8f2..3c58dcb93 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -46,6 +46,7 @@ PYSIDE_TEST(bug_688.py)
PYSIDE_TEST(bug_696.py)
PYSIDE_TEST(bug_693.py)
PYSIDE_TEST(bug_714.py)
+PYSIDE_TEST(bug_716.py)
PYSIDE_TEST(bug_722.py)
PYSIDE_TEST(bug_728.py)
PYSIDE_TEST(bug_736.py)
diff --git a/tests/QtGui/bug_716.py b/tests/QtGui/bug_716.py
new file mode 100644
index 000000000..fe5315e5b
--- /dev/null
+++ b/tests/QtGui/bug_716.py
@@ -0,0 +1,9 @@
+from PySide.QtCore import Qt, QPersistentModelIndex
+from PySide.QtGui import QStringListModel
+
+if __name__ == '__main__':
+ stringListModel = QStringListModel(['one', 'two'])
+ idx = stringListModel.index(1, 0)
+ persistentModelIndex = QPersistentModelIndex(idx)
+ stringListModel.data(persistentModelIndex, Qt.DisplayRole)
+