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

Wheel event has wrong coordinates in some cases.

    XMLWordPrintable

Details

    • Windows
    • 1a14f7e91b065ed287a4982d4bea0027121926f4 (qt/qtbase/5.12)

    Description

      1. Take the `corelib/threads/Mandelbrot` example (I want it only for mouse wheel usage)
      2. Replace main with the following (`winId` call here is important to make widget native):

      #include "mandelbrotwidget.h"
      #include <QApplication>
      #include <QTableView>
      #include <QHBoxLayout>//! [0]
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWidget widget;
          auto mwidget = new MandelbrotWidget ();
          mwidget->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
          auto mtable = new QTableView ();
          mtable->setMaximumWidth (100);
          auto layout = new QHBoxLayout (&widget);
          layout->addWidget (mtable);
          layout->addWidget (mwidget);
          widget.show();
          mwidget->winId ();
          widget.resize (500, 500);
          return app.exec();
      }
      //! [0]
      

      3. Scrolling doesn't work on 100 left pixels of Mandelbrot widget.

      or just extract the attachment which contains the same thing.

      Seems to be caused by
      https://codereview.qt-project.org/#/c/252059/7/src/plugins/platforms/windows/qwindowspointerhandler.cpp

      In the following code `localPos` is found relative to `receiver` yet `handleWheeEvent` is sent to `window` which may be different, causing inconsistency:

      QPoint localPos = QWindowsGeometryHint::mapFromGlobal(receiver, globalPos);
      QWindowSystemInterface::handleWheelEvent(window, localPos, globalPos, QPoint(), angleDelta, keyM
      odifiers);
      

      Attachments

        Issue Links

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

          Activity

            People

              anrocha André De La Rocha (Inactive)
              predelnik Sergey Semushin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes