summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qtreeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qtreeview.cpp')
-rw-r--r--src/widgets/itemviews/qtreeview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 2c040b2d635..23588d4917c 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -2177,7 +2177,12 @@ void QTreeView::doItemsLayout()
}
QAbstractItemView::doItemsLayout();
d->header->doItemsLayout();
- d->updateAccessibility();
+ // reset the accessibility representation of the view once control has
+ // returned to the event loop. This avoids that we destroy UI tree elements
+ // in the platform layer as part of a model-reset notification, while those
+ // elements respond to a query (i.e. of rect, which results in a call to
+ // doItemsLayout().
+ QMetaObject::invokeMethod(this, [d]{ d->updateAccessibility(); }, Qt::QueuedConnection);
}
/*!