summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-17 09:21:48 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-11-18 03:51:04 (GMT)
commit964474223ea45587059802dcd52cde9fdaeb4bee (patch)
treeb8659ce879bb56900c5a9c166184aa6078322abd
parent67c3594e810013ddb2b202881b9277adb17123f7 (diff)
downloadQt-964474223ea45587059802dcd52cde9fdaeb4bee.zip
Qt-964474223ea45587059802dcd52cde9fdaeb4bee.tar.gz
Qt-964474223ea45587059802dcd52cde9fdaeb4bee.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 (cherry picked from commit ecc202c0410125c944f156b5d0de67f093c02723)
-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))