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

QAbstractSlider should accept wheel events

XMLWordPrintable

    • macOS

      If you position the mouse over a QScrollBar and move the mousewheel, you trigger this code in qabstractslider.cpp:

      bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::KeyboardModifiers modifiers, int delta)
      {
      ...
              offset_accumulated -= int(offset_accumulated);
              if (stepsToScroll == 0)
                  return false;
          }
      

      causes the calling function, QScrollBar::wheelEvent() in qscrollbar.cpp to call event->ignore(), which in turn causes the event to propagate to the parent. But the accumulation code has actually used the event (it accumulated the wheel delta) and event->accept() should be called.

      This causes the parent widget to get scroll wheel events that really are intended for the scroll bar.

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

            allan.jensen Allan Sandfeld Jensen
            johnweeks John Weeks
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes