aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui
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/QtGui
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/QtGui')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_716.py9
2 files changed, 10 insertions, 0 deletions
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)
+