Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.0
-
None
-
At least Visual Studio 2013, 32 bit
-
2042a091a3e88a77d52b6cdb62f3fc9153d7f5d7 (qtbase/5.6, 19.10.2015, 5.6b)
Description
Program crashes if you call QAbstractItemView::sizeHintForColumn() and there's no delegate for an index.
Problem is on row 3056 of file qabstractitemview.cpp:
int hint = d->delegateForIndex(index)->sizeHint(option, index).width();
It is legitimate for delegateForIndex() to return nullptr.
Suggest to write it similar to:
QAbstractItemDelegate *id = d->delegateForIndex(index);
int hint = id ? id->sizeHint(option, index).width() : 0;