Get vertical wheel delta value compatible with Qt5 and Qt6.
This function provides a unified interface to retrieve the vertical scroll delta from a QWheelEvent, supporting both Qt5 (using delta()) and Qt6 (using angleDelta().y()) without changing the calling code.
The return value represents the vertical scroll amount:
- Positive value: Wheel scrolled up
- Negative value: Wheel scrolled down
- The magnitude follows the standard wheel step (typically ±120 per notch)
- Parameters
-
| e | Pointer to the QWheelEvent object (must not be nullptr) |
- Returns
- Integer delta value of vertical wheel movement
- Note
- The function only returns vertical wheel delta (ignores horizontal scroll via angleDelta().x())
- Warning
- Ensure the input QWheelEvent pointer is valid to avoid null pointer dereference