I have a QListView working with a custom model and a custom delegate, mainly for displaying two strings of word-wrapped text vertically on top of each other as one item.
I've reimplemented QStyledItemDelegate::sizeHint() and everything seems to work fine.
Except:
1) When I resize the QListView horizontally so its width increases, the height of the individual items should shrink (due to word-wrapping). I know my delegate reports decreasing heights via its sizeHint().
2) But somehow the view doesn't seem to "get" the items' new heights internally, which leads to gaps between the rows/items i. e. the next item is drawn further down than necessary.
3) When I decrease the width of the widget my QListView is in the individual items' height increases. No problem with that.
4) It only happens on horizontal resize. As soon as I vertically resize the window/widget QListView is in, all rows just "snap" into place.
5) Similarly, as soon as my model emits a dataChanged() signal for a row with a height too large, it just snaps into place.
6) I do call QListView::setResizeMode(QListView::Adjust);
7) I'm using Qt 4.8.1.
Am I missing something? Do I need to hack around this?
Bookmarks