[Qt-interest] QGestureRecognizer TouchBegin

Wathek LOUED wathek at gmail.com
Fri Apr 22 13:03:16 CEST 2011


Hi all,

I got a question about QGestureRecognizer when trying to grab a gesture
let's say a pan gesture the recognize function goes through 3 events :
TouchBegin => Check the number of touch Point and intialize the QGesture and
set the QGesture state to MayBeGesture only if there's one touch point
TouchUpdate => Change the QGesture's state to TriggerGesture and updating
the QGesture
TouchEnd => Change the QGesture's state to FinishGesture


so for the TouchBegin what I'm doing is get all the touchPoints and
filtering that list so that I get only the touchPoints contained into the
watched QObject. There are two cases :

* the watched QObject is a QGraphicsObject in that case I use bool
QGraphicsItem::contains(const QPointF &) method.
* the watched QObject isn't a QGraphicsObject so it's certainly a
QGraphicsView in that case I get the last appended touchPoint.

with that I update the QGesture vars, and in my TouchUpdate I use the points
saved earlier.

So my problem is that I was guessing what if a new touch point is added ? It
should call once again TouchBegin and then it'll change the list of my
touchpoints saved the first time, won't it ?

Thank you so much

Sincerely
Wathek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110422/fbe8ee95/attachment.html 


More information about the Qt-interest-old mailing list