Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
4.6.2, 4.7.3, 4.7.4
-
None
-
Windows 7, Windows XP
Description
Creating a QTreeView with QStandardItemModel backing it, and then calling QStandardItemModel::setItem() triggers a crash in QTreeView. QTreeView keeps a list of the visible QModelIndexes in the QStandardItemModel, but QStandardItemModel::setItem() invalidates that cache (by deleting previously extant QStandardItems). setItem() doesn't cause QTreeView to reevaluate those indices, however, so QTreeView can crash when it starts trying to get parents from those indices.
To get the included demonstration to crash, expand the node with the text "Test" in it.