Results 1 to 2 of 2

Thread: How hide the scroll bar in QGraphicsWebView without disabling it.

  1. #1
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default How hide the scroll bar in QGraphicsWebView without disabling it.

    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.

  2. #2
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How hide the scroll bar in QGraphicsWebView without disabling it.

    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 )

Similar Threads

  1. How to display a html page in qgraphicswebview
    By ejoshva in forum Qt Programming
    Replies: 8
    Last Post: 11th February 2015, 12:02
  2. Replies: 0
    Last Post: 3rd March 2012, 09:46
  3. QT 4.7.1. Carbon + QGraphicsWebView
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2011, 15:10
  4. How to disable the shortCuts in QGraphicsWebView
    By fzhu in forum Qt Programming
    Replies: 0
    Last Post: 15th October 2010, 08:37
  5. QDial disabling key scroll and mouse wheel scroll
    By ldg20 in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2010, 00:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.