From cd6fa8abed473936af55055a3ebe209bb7241a85 Mon Sep 17 00:00:00 2001 From: Christoph Feck Date: Mon, 11 May 2009 21:58:22 +0200 Subject: Respect PM_ScrollView_ScrollBarSpacing in QAbstractScrollArea::minimumSizeHint() Reviewed-by: Olivier Goffart Request-url: http://qt.gitorious.org/qt/qt/merge_requests/382 --- src/gui/widgets/qabstractscrollarea.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 0d8b4de..5eed745 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -1265,6 +1265,12 @@ QSize QAbstractScrollArea::minimumSizeHint() const int hsbExt = d->hbar->sizeHint().height(); int vsbExt = d->vbar->sizeHint().width(); int extra = 2 * d->frameWidth; + QStyleOption opt; + opt.initFrom(this); + if ((d->frameStyle != QFrame::NoFrame) + && style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, &opt, this)) { + extra += style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing, &opt, this); + } return QSize(d->scrollBarContainers[Qt::Horizontal]->sizeHint().width() + vsbExt + extra, d->scrollBarContainers[Qt::Vertical]->sizeHint().height() + hsbExt + extra); } -- cgit v0.12