summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qlistview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index cbb54d8..a4cebe3 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -965,6 +965,12 @@ void QListView::paintEvent(QPaintEvent *e)
for (QVector<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
Q_ASSERT((*it).isValid());
option.rect = visualRect(*it);
+
+ if (flow() == TopToBottom)
+ option.rect.setWidth(qMin(viewport()->size().width(), option.rect.width()));
+ else
+ option.rect.setHeight(qMin(viewport()->size().height(), option.rect.height()));
+
option.state = state;
if (selections && selections->isSelected(*it))
option.state |= QStyle::State_Selected;