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

QWebEngineView::wheelEvent ignored

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes