summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJani Honkonen <jani.honkonen@digia.com>2012-08-16 16:08:35 +0300
committerQt by Nokia <qt-info@nokia.com>2012-08-19 08:52:09 +0200
commitd2bba5e5535726f277e8dc67b1478168f57b24bd (patch)
treed14397cc20ef509ca6910f6582c811010494cebb /src
parentd4385e48b8566a5587048a3c6d8b2396ba587ed5 (diff)
Fix a QListViewItem width when spacing is set
The listitem width was calculated incorrectly because spacing was not considered. This fixes the second part of the reported bug where spacing is set. Added some tests to catch the issue relating to the reported bug. Also added a test to check spacing in general. Task-number: QTBUG-21804 Change-Id: Icc6326bce914264d882a60a9fc0ebe7d2a08dbf6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qlistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 11ef2430f8..80d9e27159 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -2274,7 +2274,7 @@ QListViewItem QListModeViewBase::indexToListViewItem(const QModelIndex &index) c
: segmentPositions.at(segment + 1));
size.setWidth(right - pos.x());
} else { // make the items as wide as the viewport
- size.setWidth(qMax(size.width(), viewport()->width()));
+ size.setWidth(qMax(size.width(), viewport()->width() - 2 * spacing()));
}
}