path: root/src/corelib
diff options
authorVolker Hilsheimer <>2020-01-30 17:37:09 +0100
committerVolker Hilsheimer <>2020-02-06 16:46:21 +0000
commitef7773e5664dd8278831ed4d7d24dd4fc1aaefd3 (patch)
treeb8d9793713f3e44ab4819952ee9e7817e7688df6 /src/corelib
parenteb45c37be7e32a20612b23f54a830ea0c4db7119 (diff)
Doc: QPersistentModelIndex cannot be stored in a QStandardItem
As discussed in the bug report, making sure that the reference counts are correct in such scenarios adds substantial complexity to the code, only to support a bad use-case for which QStandardItemModel was not designed. Change-Id: I663b490ed3471875386add17e7eadb7d8df50489 Fixes: QTBUG-78142 Reviewed-by: Paul Wicking <>
Diffstat (limited to 'src/corelib')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 6e97c2fd39..5caddf6aea 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -107,6 +107,9 @@ void QPersistentModelIndexData::destroy(QPersistentModelIndexData *data)
It is good practice to check that persistent model indexes are valid
before using them.
+ \note You cannot store a QStandardItemModel's QPersistentModelIndex
+ in one of the model's items.
\sa {Model/View Programming}, QModelIndex, QAbstractItemModel