Switch off scrollbars when in dragToScroll mode

They don't work with dragging, anyway since flicking and scrollbars
operate in different directions.
This commit is contained in:
Sebastian Kügler 2011-04-24 16:21:19 +02:00
parent 547231f381
commit 6de3205490

View File

@ -179,6 +179,14 @@ QWebFrame *WebView::mainFrame() const
void WebView::setDragToScroll(bool drag)
{
// enable / disable scrollbars
if (drag) {
mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
} else {
mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded);
mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded);
}
d->webView->setDragToScroll(drag);
d->scrollWidget->setFiltersChildEvents(drag);
}