[Qt-interest] QGestureRecognizer TouchBegin
Wathek LOUED
wathek at gmail.com
Tue Apr 26 21:06:43 CEST 2011
I see that's great thank you so much Sean. However did you read my mail
about QMultiGestureRecognizer ? I was thinking about that.
On Tue, Apr 26, 2011 at 9:00 PM, Sean T. Hayes
<sean.t.hayes at vanderbilt.edu>wrote:
> Sorry for the slow reply. I have been having problems with my email
> account.
>
> On Fri, Apr 22, 2011 at 6:03 AM, Wathek LOUED <wathek at gmail.com> wrote:
>
> 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 ?
>>
>
> No, I do not think that is the case. TouchBegin only occurs when the first
> touch point is added.
>
> In order to determine if there are new touch points, use the QTouchEvent's touchPointStates()
> <http://doc.qt.nokia.com/latest/qtouchevent.html#touchPointStates>method.
>
> On Fri, Apr 22, 2011 at 6:03 AM, Wathek LOUED <wathek at gmail.com> wrote:
>
>> 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
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at qt.nokia.com
>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110426/3f7b091c/attachment.html
More information about the Qt-interest-old
mailing list