path: root/src/widgets/accessible/itemviews_p.h
diff options
authorAndy Shaw <>2016-10-21 17:14:31 +0200
committerAndy Shaw <>2016-11-17 06:48:31 +0000
commitbd591064be388216f91d48522b3bdbc1be93bb92 (patch)
tree51ddfb98d4fc34334770e50097f82c7497eef9e1 /src/widgets/accessible/itemviews_p.h
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 <>
Diffstat (limited to 'src/widgets/accessible/itemviews_p.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h
index 6a18a1231b..b3cd456585 100644
--- a/src/widgets/accessible/itemviews_p.h
+++ b/src/widgets/accessible/itemviews_p.h
@@ -207,7 +207,7 @@ private:
QHeaderView *verticalHeader() const;
QHeaderView *horizontalHeader() const;
QPointer<QAbstractItemView > view;
- QModelIndex m_index;
+ QPersistentModelIndex m_index;
QAccessible::Role m_role;
void selectCell();