PDA

View Full Version : How hide the scroll bar in QGraphicsWebView without disabling it.



ejoshva
20th February 2015, 07:25
After going through so many post did something like below.
QWebFrame* frame = webView->page()->mainFrame();
frame->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
frame->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );

This code did hide the scrollbar, also it disabled scrolling using downArrow as well.
I want to allow scrolling using mouseWheel or downArrow key but hide scroll bar.

How do I do this.

Thanks in advance.

StrikeByte
20th February 2015, 17:15
You will have to handle the scrolling your self, install a eventfilter on the frame and filter for wheel and up,down buttons etc.
you can change the scroll by setting setScrollPosition ( const QPoint & pos )