Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75982

QTreeview::setModel calls functions from previous model leading to crash

XMLWordPrintable

    • c15a069830baf87f57c84e86326cf86ba9a39713 (qt/qtbase/5.14)

      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.

        For Gerrit Dashboard: QTBUG-75982
        # Subject Branch Project Status CR V

            chehrlic Christian Ehrlicher
            alexey.telishev Alexey Telishev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes