summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJani Honkonen <jani.honkonen@digia.com>2012-08-17 11:25:13 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-08-23 21:43:15 (GMT)
commit98ed9ba14a91c941d48cc5c946c4df1d7ed47945 (patch)
tree68d410993161f6daedb40fe3038ea691493cce5a /src/gui
parentb97d1e01c9c76a1ab87fc791dfb8c5708457286c (diff)
downloadQt-98ed9ba14a91c941d48cc5c946c4df1d7ed47945.zip
Qt-98ed9ba14a91c941d48cc5c946c4df1d7ed47945.tar.gz
Qt-98ed9ba14a91c941d48cc5c946c4df1d7ed47945.tar.bz2
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. Backported from Qt5 commit: d2bba5e5535726f277e8dc67b1478168f57b24bd Task-number: QTBUG-21804 Change-Id: I20cae3a2b9d42650052441f9f15b43f72418f58b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qlistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index e6949fd..3a8cedb 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2299,7 +2299,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()));
}
}