Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.1
-
None
-
c15a069830baf87f57c84e86326cf86ba9a39713 (qt/qtbase/5.14)
Description
QTreeview::setModel(nullptr) first calls QHeaderView::setModel and only after that QAbstractItemView::setModel. QHeaderView::setModel emits sectionCountChanged signal leading to QTreeView::updateGeometries call. As QTreeView still thinks it has old model, it starts to ask data from the old model. But if that old model now is broken (e.g contains pointers to deleted objects), it will crash.
Attached example will crash after one second of work inside setModel function.
Attachments
For Gerrit Dashboard: QTBUG-75982 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
264885,3 | QTreeView: make sure to not ask the old model during setModel | 5.14 | qt/qtbase | Status: MERGED | +2 | 0 |