Qt 5 has a function :

QPoint QWheelEvent::angleDelta() const 

It returns the angle of the mouse wheel. Why does it return a QPoint, and not an int or at least double / float? How to get a number from this QPoint, how many conventional units did the mouse wheel turn?

  • Apparently because some mice have two wheels. - KoVadim

1 answer 1

It was possible to find out that this was done for mice with two wheels (vertical and horizontal); for ordinary mice, the wheel scroll delta can be obtained as follows:

 int delta = evnt.angleDelta().x(); 

The second QPoint component will be zero.