aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/tests/QtCore/qabstractitemmodel_test.py')
-rw-r--r--sources/pyside2/tests/QtCore/qabstractitemmodel_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py b/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
index 66c17894..3f321c7d 100644
--- a/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
+++ b/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
@@ -50,6 +50,15 @@ class TestQModelIndexInternalPointer(unittest.TestCase):
idx = QPersistentModelIndex()
m.span(idx)
+ def testQIdentityProxyModel(self):
+ sourceModel = QStringListModel(['item1', 'item2'])
+ sourceIndex = sourceModel.index(0, 0)
+ sourceData = str(sourceModel.data(sourceIndex, Qt.DisplayRole))
+ proxyModel = QIdentityProxyModel()
+ proxyModel.setSourceModel(sourceModel)
+ proxyIndex = proxyModel.mapFromSource(sourceIndex)
+ proxyData = str(proxyModel.data(proxyIndex, Qt.DisplayRole))
+ self.assertEqual(sourceData, proxyData)
if __name__ == '__main__':
unittest.main()