Results 1 to 2 of 2

Thread: QScroller with QWebView

  1. #1
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    1

    Default QScroller with QWebView

    Hello,

    I'm having an issue getting touch screen scrolling to work in a QWebView with Qt 5.5 and QtWebKit. It only seems to allow scrolling in the scroll bar, if you scroll in the page as you would on a smart phone, it selects text instead of scrolling.

    I have tried using the scroller/plot example in webkitwidgets and with it, the QListWidget page scrolls as expected, but the QWebView page has the same issue.

    I dont know if this is the expected operation or not, if so, is there a way to get QWebView to perform scrolling across the whole page and not just the scroll bar?

    Thanks,
    Will.

  2. #2
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    1

    Default Re: QScroller with QWebView

    The issue I was having was fixed by making these changes:

    QGraphicsView view;
    QGraphicsWebView webview;
    QGraphicsScene scene;
    ...
    webview.setResizesToContents(true);
    webview.page()->setPreferredContentsSize(QSize(SCREEN_WIDTH, SCREEN_HEIGHT));

    ...
    view.setScene(&scene);
    scene.addItem(&webview);

    QScroller::grabGesture(&view, QScroller::LeftMouseButtonGesture);

    Will.

Similar Threads

  1. QScroller sensitivity on QComboBox
    By adutzu89 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd June 2015, 21:07
  2. QScroller choppy animation on Android
    By Andre92 in forum Newbie
    Replies: 2
    Last Post: 21st March 2015, 14:13
  3. QScroller speed and touch screen
    By Talei in forum Qt Programming
    Replies: 4
    Last Post: 4th November 2014, 10:38
  4. Scrolling using QScroller class ..
    By p3c0 in forum Newbie
    Replies: 4
    Last Post: 16th July 2014, 03:38
  5. Replies: 0
    Last Post: 22nd May 2014, 20:44

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.