summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-17 09:21:48 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-17 10:25:56 (GMT)
commitecc202c0410125c944f156b5d0de67f093c02723 (patch)
treea3f22d9e3e7f8ceafd5cc920f22ff9852841039e
parentc535df0f286826c5575ec00c7e4c3f811a73918b (diff)
downloadQt-ecc202c0410125c944f156b5d0de67f093c02723.zip
Qt-ecc202c0410125c944f156b5d0de67f093c02723.tar.gz
Qt-ecc202c0410125c944f156b5d0de67f093c02723.tar.bz2
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
-rw-r--r--src/gui/itemviews/qlistview.cpp4
1 files 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))