Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
5.2.0 Beta1
-
None
-
6c04c21c101b70401ad9cb08de1562dc90166e9c
Description
QTreeView crashes sometimes, when calling collapseAll() since 7e6fbb.
It happens in QTreeView::sizeHintForColumn(int), when d->firstVisibleItem() (qtreeview.cpp:2859) returns "-1".
This case is not handled in d->lastVisibleColumn() and also not in sizeHintForColumn() itself.
In QTreeView::firstVisibleItem() the verticalScrollMode is set to QAbstractItemView::ScrollPerItem and the vbar position is at bottom.
The maximum of the vbar is > viewItems.count().
Workaround for me is calling scrollToTop() before collapseAll().
It's quite easy to reproduce here, but I didn't manage to isolate the bug.
Backtrace attached.