From ecc202c0410125c944f156b5d0de67f093c02723 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 17 Nov 2009 10:21:48 +0100 Subject: Fix long text regression in listview that does not fits into the viewport. In commit f44fe888ee82b9e04, we adjusted the item size to the size of the viewport. It should really be adjusted to the size of the content. Task-number: QTBUG-5854 Reviewed-by: Gabi --- src/gui/itemviews/qlistview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index 15db9a6..c6622cb 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -972,9 +972,9 @@ void QListView::paintEvent(QPaintEvent *e) option.rect = visualRect(*it); if (flow() == TopToBottom) - option.rect.setWidth(qMin(viewport()->size().width() - 2 * d->spacing(), option.rect.width())); + option.rect.setWidth(qMin(d->contentsSize().width() - 2 * d->spacing(), option.rect.width())); else - option.rect.setHeight(qMin(viewport()->size().height() - 2 * d->spacing(), option.rect.height())); + option.rect.setHeight(qMin(d->contentsSize().height() - 2 * d->spacing(), option.rect.height())); option.state = state; if (selections && selections->isSelected(*it)) -- cgit v0.12