I have a QWheelEvent and I use it to zoom a QGLWidget scene in and out. Is it possible to intercept when the mouse wheel has stopped, something similar to mouseReleaseEvent(QMouseEvent *event) ?
Thanks
I have a QWheelEvent and I use it to zoom a QGLWidget scene in and out. Is it possible to intercept when the mouse wheel has stopped, something similar to mouseReleaseEvent(QMouseEvent *event) ?
Thanks
The wheel will have stopped when you stop receiving wheel events. Just run a timer that is reset in every wheel event and when it times out, you'll know the user stopped scrolling.
papillon (30th September 2011)
Thanks wysota, I have difficulties understanding this.
Shall I actually timer->start(0) in my main loop, and call again timer->start(0) in the wheelevent routine to restart the timer again?
No, zero timeout timer is not correct. Set the timeout to something like 500ms (or less if you want the mechanism to be more responsive at the cost of having some false positives).
papillon (30th September 2011)
Thanks wysota, infact now it's working perfectly!
Bookmarks