[Qt-interest] Multi Gesture

Sean Hayes sean.t.hayes at vanderbilt.edu
Sun Mar 20 19:59:30 CET 2011


Wathek,

You are right, you only get the QGesture that is given to
the QGestureRecognizer and you cannot create two separate gestures of the
same type (as far as I know). I did not think about that before. However, a
unique QGesture is given to each QGestureRecognizer. Also,
each QGestureRecognizer receives all the events that all the
other QGestureRecognizers receive. Therefore, you should be able to have
simultanious gestures limited only by the number of
registered QGestureRecognizers.

I have never tried this with the same gesture type, but you should be able
to get two gestures of the same type by registering two instances of that
gesture recognizer. This may only work for custom gestures (not the Qt's
built in ones) because each regestered QGestureRecognizer may need a unique
Qt::GestureType. That is just speculation. I am not sure how practical this
idea is, but I suspect it would work.

Let me know what you think.

Sean

On Sun, Mar 20, 2011 at 12:36 PM, Wathek LOUED <wathek at gmail.com> wrote:

> Sean,
>
> Yes but the problem is that since that QGestureRecognizer doesn't free the
> QGesture and it uses always the same QGesture it only resets it I cannot
> have two (or more) same gestures at the same time.
>
> Let's say that the gesture is a Tap and Hold so it needs about 700ms
> without moving to recognize the gesture. So first touched Point the
> GestureRecognizer setted the QGesture parameters (Position, Timer, etc). At
> 400ms a second Touched Point arrived, the GestureRecognizer cannot do
> anything since it's busy with the first one. You see ?
>
>
> On Sun, Mar 20, 2011 at 5:44 PM, Wathek LOUED <wathek at gmail.com> wrote:
>
>> I see I got an other question. I'd like to know when the
>> QGestureRecognizer changes the QGesture::state to
>> QGestureRecognizer::CancelGesture or QGestureRecognizer::FinishGesture is
>> the QGesture killed ?
>>
>>  On Sun, Mar 20, 2011 at 3:53 PM, Sean Hayes <sean.t.hayes at vanderbilt.edu
>> > wrote:
>>
>>> Wathek,
>>>
>>> You could probably do  this by created you own gesture classes that
>>> subclass QGesture. The key would be how you recognize the gestures in your
>>> gesture recognizer. For example, you could monitor all the touch points
>>> received and see any one of them match your gestures (as opposed to only
>>> checking the first point or two). If you are use some gestures that utilize
>>> more than one touch point, you could test if any combinational of two points
>>> matches your gesture.
>>>
>>> Sean
>>>
>>> On Sun, Mar 20, 2011 at 7:38 AM, Wathek LOUED <wathek at gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I was thinking how can I do to get a multi gesture ? let's say a finger
>>>> to do a Tap And Hold Gesture and another finger where the user does a Pan
>>>> Gesture. Using the QGesture of Qt it won't work. Any idea how can I do so
>>>> that it'll be possible ?
>>>>
>>>> Thank you
>>>>
>>>> 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/20110320/f856d41e/attachment.html 


More information about the Qt-interest-old mailing list