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

QWheelEvent::angleDelta() sometimes messed up when too many events are generated

    XMLWordPrintable

Details

    Description

      QWheelEvent::angleDelta() sometimes report wrong (reversed) angles during fast rotation of mouse wheel. When trying to scroll or zoom something this produces very disturbing behaviour. Also, it seems like this problem appears only when events are produced faster than they could be processed.

      I've made simple test case, which works as follows:
      1) simple QWidget reports QWheelEvents to console
      2) timer is started with interval 10 ms, timerEvents are processed for 40 ms (using QThread::msleep)
      3) after scrolling fast with a mouse wheel for a couple of seconds in one direction, then reversing direction for another second and then scrolling in original direction QWheelEvent::angleDelta becomes messed up

      Disabling timer removes this behavior, but at first I noticed this problem in real application with heavy processing in paint event, so the timer in test case is used to simulate that heavy processing.

      Another thing is that I was unable to reproduce this bug when trying to scroll with notebook's touchpad, while it was easily reproducible with real mouse (specifically 3 different mouses from different vendors on 2 different PCs).

      I also tried to run test case with other Qt versions and found that Qt 5.4.2 also have this problem, while Qt 5.2.1 works fine. I didn't check other intermediate versions yet.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            skhoroshavin Sergey Khoroshavin
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes