[Qt-interest] QWheelEvent (deltas)

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Fri Dec 3 17:07:13 CET 2010


On 2010-12-02 Joshua Joshua Grauman wrote:

> Hello all,
> 
> I am implementing custom scrolling of a QTextEdit in my program and I
> want it to work for all the different kinds of wheel events out there.

>From the Qt docs: "Most mouse types work in steps of 15 degrees" which emphasis on MOST. That is it is almost certain that you will find other devices which return a different delta() than a multiple of 120. Or even if they send out a multiple of 120, that does not necessarily correspond "to 15 degrees of wheel motion".

Qt doesn't offer you any API to query for a given device the "sensitivity". So the best you can probably do is to adjust the sensitivity "in software" (read: provide some settings and multiply the received delta with some adjustment factor in your code).

Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22





More information about the Qt-interest-old mailing list