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>
This commit is contained in:
Marcelo Lira 2011-04-05 17:52:26 -03:00
commit 5ae1e6460b
3 changed files with 17 additions and 0 deletions

9
tests/QtGui/bug_716.py Normal file
View file

@ -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)