[Interest] [SOLVED] Re: QGraphicsView viewport touch event on iOS through event filter

maitai maitai at virtual-winds.org
Wed Aug 26 10:02:16 CEST 2015


Hello,

Finally it was all my bad (as often)... well hidden somewhere in my code 
I had a processEvents() that could be called during pinching, hence the 
mess in the pinch events orders.

Conclusion is: never ever call processEvents() from a eventFilter or 
similar event() routines

Sorry for the disturbance
Philippe.

Hello again,

Le 24-08-2015 20:27, maitai a écrit :
> 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
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list