Set page step of scrollbars

This way the size of the scrollbar slider represents the visible portion of
the scrolled widget.

svn path=/trunk/KDE/kdelibs/; revision=1151665
This commit is contained in:
Aurélien Gâteau 2010-07-19 09:59:59 +00:00
parent 78119ec9f4
commit beca8835e1

View File

@ -169,6 +169,7 @@ public:
}
verticalScrollBar->nativeWidget()->setMaximum(qMax(0, int((widget.data()->size().height() - scrollingWidget->size().height())/10)));
verticalScrollBar->nativeWidget()->setPageStep(int(scrollingWidget->size().height())/10);
if (verticalScrollBarPolicy == Qt::ScrollBarAlwaysOff ||
verticalScrollBar->nativeWidget()->maximum() == 0) {
@ -184,6 +185,7 @@ public:
}
horizontalScrollBar->nativeWidget()->setMaximum(qMax(0, int((widget.data()->size().width() - scrollingWidget->size().width())/10)));
horizontalScrollBar->nativeWidget()->setPageStep(int(scrollingWidget->size().width())/10);
if (horizontalScrollBarPolicy == Qt::ScrollBarAlwaysOff ||
horizontalScrollBar->nativeWidget()->maximum() == 0) {