I\'m working with mouse events, specifically OnMouseWheel
. Many code samples refer to distance the view changes (or zoom f.i. in 3D application) as Distance =
The Qt Documentation elaborates a bit more on why it is actually 120:
QPoint QWheelEvent::angleDelta() const
Returns the distance that the wheel is rotated, in eighths of a degree. A positive value indicates that the wheel was rotated forwards away from the user; a negative value indicates that the wheel was rotated backwards toward the user.
Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e., 120 units * 1/8 = 15 degrees.
However, some mice have finer-resolution wheels and send delta values that are less than 120 units (less than 15 degrees). To support this possibility, you can either cumulatively add the delta values from events until the value of 120 is reached, then scroll the widget, or you can partially scroll the widget in response to each wheel event.
https://doc.qt.io/qt-5/qwheelevent.html#angleDelta