[Development] Should gestures consume events?

Rafael Roquetto rafael.roquetto at kdab.com
Thu Nov 8 23:07:31 CET 2012


Hello,

I was wondering if some gestures, such as QTapGesture or QTapAndHoldGesture
should consume QEvent::TouchBegin || QEvent::TouchEnd. The reason I am asking
this is that, if these events are not consumed somewhere along the chain, Qt
assumes that the touch events haven't been handled at all, and then
synthethizes and delivers corresponding MouseEvents (using
QApplicationPrivate::translateTouchToMouse), causing additional mouse events
to be delivered. Now, I am not sure if this is the intended behavior, but
I am assuming that applications watching for GestureEvents are not monitoring
TouchEvent directly, and thus receiving wasted mouse events. On the other
hand, "provide mechanism, not policy".

Any thoughts?

The reason I am bringing this up is that currently on Qt5,
QApplicationPrivate::translateTouchToMouse (or something related) is broken,
causing these mouse events that are synthethized from touch events to have a
position() of (0, 0). These mouse events are then also handled by the gesture
recognizers, which update the gesture position to that of this event - (0 ,0),
in a cascading effect. I am working on fixing that, patch will be in gerrit
soon.

Thanks a lot,
Rafael
-- 
** Qt Developer Conference: http://qtconference.kdab.com/ **

Rafael Roquetto | rafael.roquetto at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3721 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121108/7c16a7b3/attachment.bin>


More information about the Development mailing list