Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Scroll a QWebengineView
Forum Updated to NodeBB v4.3 + New Features

Scroll a QWebengineView

Scheduled Pinned Locked Moved Unsolved QtWebEngine
4 Posts 3 Posters 5.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    minnit_s
    wrote on last edited by
    #1

    Hello everyone,

    i try to scroll a QWebengine view from the c++ code, i used to do this with qwebview without a problem but i can't find a way to do it with webengine.

    Is there a way to do this?

    Thx.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      minnit_s
      wrote on last edited by
      #2

      Which class manage scrolling in QWebengineview? I try so send a qwheelevent to the widget and nothing append, so i suppose that i'm not sending it to the right objet. I try to send to the QWebEngineView, to the page, to the view object in the page. Is it a wy to access to the scollbars?

      Why scroll function doesn't works on this widget?

      Thx

      T 1 Reply Last reply
      0
      • J Offline
        J Offline
        julrich
        wrote on last edited by
        #3

        There is a feature request to implement this: https://bugreports.qt.io/browse/QTBUG-48323

        For now, there is only a workaround which is to scroll using JavaScript:

        QWebEngineView()->page()->runJavaScript(QString("window.scrollTo(%1, %2);").arg(scrollX).arg(scrollY));
        

        See Henrique Santiago's comment.

        1 Reply Last reply
        0
        • M minnit_s

          Which class manage scrolling in QWebengineview? I try so send a qwheelevent to the widget and nothing append, so i suppose that i'm not sending it to the right objet. I try to send to the QWebEngineView, to the page, to the view object in the page. Is it a wy to access to the scollbars?

          Why scroll function doesn't works on this widget?

          Thx

          T Offline
          T Offline
          ThatDud3
          wrote on last edited by ThatDud3
          #4

          @minnit_s said in Scroll a QWebengineView:

          Which class manage scrolling in QWebengineview? I try so send a qwheelevent to the widget and nothing append, so i suppose that i'm not sending it to the right objet. I try to send to the QWebEngineView, to the page, to the view object in the page. Is it a wy to access to the scollbars?

          Why scroll function doesn't works on this widget?

          Thx

          It is not working because first you have to find the right child for which to send the event - see below

          https://forum.qt.io/topic/69439/how-do-you-send-key-events-to-qwebengineview-if-sendkey-doesn-t-work/2

          HTH

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved