summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2016-10-21 17:14:31 +0200
committerAndy Shaw <andy.shaw@qt.io>2016-11-17 06:48:31 +0000
commitbd591064be388216f91d48522b3bdbc1be93bb92 (patch)
tree51ddfb98d4fc34334770e50097f82c7497eef9e1 /tests/auto/other/qaccessibility/tst_qaccessibility.cpp
parentbebbaa43fd21baf0b2235199e84898f18d6cc861 (diff)
Use QPersistentModelIndex for storing a model index
QModelIndex is not safe to be used to store an index as it is designed to be discarded right after use as the index information can change. Therefore a QPersistentModelIndex should be used instead to store the index. Subsequently the m_index does not need to be updated whenever the model changes anymore as this is already done for us. Task-number: QTBUG-49907 Change-Id: Icc93e410de2821c503ea15a7a1dd9ae32634914e Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 62c2c0a916..3d78749024 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -2903,7 +2903,10 @@ void tst_QAccessibility::listTest()
QAccessibleInterface *cellMunich3 = table2->cellAt(2,0);
QCOMPARE(cell4, cellMunich3);
QCOMPARE(axidMunich, QAccessible::uniqueId(cellMunich3));
-
+ delete listView->takeItem(2);
+ // list: Oslo, Helsinki
+ // verify that it doesn't return an invalid item from the cache
+ QVERIFY(table2->cellAt(2,0) == 0);
delete listView;
}