Search code examples
qtscrollmouse

Scroll event detection in qt


How do I detect a scroll event in a Qt widget?.
I want to use it to scroll a QWT plot. I have tried using a QMouseEvent, but I could only find options for movement and pressing/releasing the mouse.


Solution

  • void QWidget::wheelEvent(QWheelEvent* event) will be what you are after (docs here).