[Interest] QGraphicsView viewport touch event on iOS through event filter

maitai maitai at virtual-winds.org
Mon Aug 24 20:27:27 CEST 2015


Hello all

As usual, I am filtering a QGraphicsView viewport events through an 
eventFilter.

This works fine on all platform except iOS.

As it seems, I am receiving gesture events just like it should, except 
if the user goes mad and start touching the screen very fast. In 
practice I receive for instance a pinchEvent with a start state, then a 
second one wile I have not yet received anything from the first start 
(no update, no finish, no cancel, nothing)

After a lot of investigations, it seems that although all is in the same 
thread, I receive an event in eventFilter while the previous eventFilter 
sequence has not even returned. As a consequence instead of having

pinchGesture started
... some pinchGesture updates
pinchGesture finished
pinchGesture started
... some pinchGesture updates
pinchGesture finished
pinchGesture started
... some pinchGesture updates
pinchGesture finished

I have

pinchGesture started
.. some pinchGesture updates
pinchGesture started
pinchGesture started
..
pinchGesture finished
pinchGesture finished
.. some pinchGesture updates
pinchGesture finished
.. some pinchGesture updates

and of course it crashes at some point

I tried many things (including various combinations of QMutex and 
processEvents, ignoring double starts,  and so on), but my very first 
question is: eventFilter is running, how comes from the same thread (I 
have checked the threadId is indeed the same) I can get interrupted with 
a new event since I have not yet finished to treat the previous one? I 
mean in fact eventFilter is called while still running, the previous run 
resumes when the interrupting one finished... resulting in a big mess.

As it seems this problem does not exist on Android, events are delivered 
in order as I was expecting

A bit confused here to be honest...

Thanks for any idea

Philippe



More information about the Interest mailing list