2 Qt Software task ID : none
3 bugs.kde.org number : none
5 author: Aurélien Gâteau <agateau@kde.org>
7 Do not deduce scrollbar extent twice if scrollbar policy is
10 This patch has been merged in master but won't be in 4.5.
11 http://qt.gitorious.org/qt/qt/merge_requests/432
13 --- src/gui/itemviews/qlistview.cpp
14 +++ src/gui/itemviews/qlistview.cpp
15 @@ -1969,10 +1969,16 @@ void QListViewPrivate::prepareItemsLayout()
16 int frameAroundContents = 0;
17 if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents))
18 frameAroundContents = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth) * 2;
19 - int verticalMargin = vbarpolicy==Qt::ScrollBarAlwaysOff ? 0 :
20 - q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->verticalScrollBar()) + frameAroundContents;
21 - int horizontalMargin = hbarpolicy==Qt::ScrollBarAlwaysOff ? 0 :
22 - q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->horizontalScrollBar()) + frameAroundContents;
24 + // maximumViewportSize() already takes scrollbar into account if policy is
25 + // Qt::ScrollBarAlwaysOn but scrollbar extent must be deduced if policy
26 + // is Qt::ScrollBarAsNeeded
27 + int verticalMargin = vbarpolicy==Qt::ScrollBarAsNeeded
28 + ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->verticalScrollBar()) + frameAroundContents
30 + int horizontalMargin = hbarpolicy==Qt::ScrollBarAsNeeded
31 + ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q->horizontalScrollBar()) + frameAroundContents
34 layoutBounds.adjust(0, 0, -verticalMargin, -horizontalMargin);