summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-06-12 20:49:06 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-11-14 20:47:45 +0200
commitc15a069830baf87f57c84e86326cf86ba9a39713 (patch)
tree3eb2afa9c6f22bb35ba647f17bb82dd5485fe5af /src/widgets
parent80ac9e8b7ce8e3f79af0b00610a0a4b0ff17abe4 (diff)
QTreeView: make sure to not ask the old model during setModel
Within QTreeView::setModel() the header might emit columnCountChanged which then tries to update the geometries based on the old model which is wrong. Fix it by setting geometryRecursionBlock to true so QTreeView::updateGeometries() will not ask the old model for it's data. Fixes: QTBUG-75982 Change-Id: Ia0dd36cd7c6c5347fbc285deac43da6941accbe7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qtreeview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 413cc2a9cd..034c1f4b4f 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -233,7 +233,9 @@ void QTreeView::setModel(QAbstractItemModel *model)
d->viewItems.clear();
d->expandedIndexes.clear();
d->hiddenIndexes.clear();
+ d->geometryRecursionBlock = true; // do not update geometries due to signals from the headers
d->header->setModel(model);
+ d->geometryRecursionBlock = false;
QAbstractItemView::setModel(model);
// QAbstractItemView connects to a private slot