Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58317

QWebEngineView::wheelEvent ignored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.7.1
    • WebEngine
    • None
    • Debian GNU/Linux sid amd64

    Description

      I was not able to get custom wheel events working with QWebEngineView. In particular:

      • If I intercept the event in an overridden method, and call ignore(), the page is still scrolled;
      • It is impossible to send custom wheel events, they just get ignored.

      The test case for the first issue:

      #include <QtCore/QDebug>
      #include <QtCore/QUrl>
      #include <QtGui/QWheelEvent>
      #include <QtWidgets/QApplication>
      #include <QtWebEngineWidgets/QWebEngineView>
      
      class MyWebView: public QWebEngineView {
      public:
          void wheelEvent(QWheelEvent *event) override {
              qDebug() << "Intercepted event" << event;
              event->ignore();
          }
      };
      
      int main(int argc, char **argv) {
          QApplication app(argc, argv);
          MyWebView view;
          view.load(QUrl("https://www.qt.io/"));
          view.show();
          return app.exec();
      }
      

      Expected result is that scrolling is blocked and does not work. However it does work.

      The debug messages are printed, so the override works.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              mandriver Dmitry Shachnev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes