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

QAbstractSlider should accept wheel events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.6.0 Alpha
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Mac OS X and Windows

      Description

      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.

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes