[Qt-interest] QWheelEvent (deltas)

Joshua Grauman jnfo-c at grauman.com
Thu Dec 2 21:36:45 CET 2010


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 
what I can see with limited testing, there are some mice that have a 
scroll wheel that clicks in intervals, and each scroll of the wheel will 
cause a QWheelEvent with a delta of say 120. But there are also laptops 
with touchpads that have a special area on the side for scrolling, and I 
believe these also emit QWheelEvents, but with smaller deltas? And there 
are also Macs with two finger scrolling that I believe also emit 
QWheelEvents, also with smaller deltas. What will the delta be in each of 
these cases? Will it be in intervals (say of 15 or something, or could it 
be any number that represents how far the user has scrolled their finger?) 
Does anyone have more information about all these types of wheel/scrolling 
events (it seems the docs don't have much)? Is there any way to tell if I 
have a 'discrete' wheel event (where it is a mouse wheel that has a small 
number finite clicks)? With touchpads and Macs with two finger scrolling, 
do multiple wheel events get sent while they are slowly scrolling their 
finger? What determines the delta for various types of wheel events, do I 
need to be able to accomodate deltas of any value, or will they be set 
values? I don't have easy access to all the different types of hardware, 
so some information about how it works would be helpful so I can write up 
a test program to go test on other machines. Thanks!

Josh



More information about the Qt-interest-old mailing list