Results 1 to 6 of 6

Thread: QGraphicsView and QGesture issues

  1. #1
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QGraphicsView and QGesture issues

    Hi all,

    I am having troubles with QGraphicsView and QGesture:

    I am running this on windows 7, on a dell inspiron duo. I am using qt 4.7.1.

    I have a myscene derived from QGraphicsScene and a view, not derived. If I do
    view->viewport()->grabGesture(Qt::PanGesture) and reimplement event() in the scene, I do receive some gesture events, but not those expected...

    The first problem is that in order to receive these events I have to move my fingers like if I am doing a "pinch" (i.e. with 2 fingers, enlarge or reduce movement). When I do that, the event I receive is in fact recognized as a pan gesture (i.e. event->gesture(Qt::PanGesture) returns something, which is quite normal since it is the only type of gesture grabbed). But if I do the finger movement for a pan (with only one finger), I receive nothing.

    The second problem is that when I add view->viewport()->grabGesture(Qt::PinchGesture) I don't receive anything anymore, not even the "wrong" pan gestures. Seems like the events are eaten somewhere.

    If I leave only grabGesture(Qt::PinchGesture) and remove the grab for PanGesture, same thing, I do not receive any gesture events.

    I have tried to do grabGesture at the view level also and not only at the viewport level, but this didn't improve anything...

    I have other non-qt applications on this PC, provided by Dell, and I can see that the touchScreen accepts and reacts to pan and/or pinch gestures in those applications, so I believe the hardware/drivers are ok.

    Any idea about what I am doing wrong?

  2. #2
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView and QGesture issues

    To complete a bit my post:

    I also compiled and ran the exemple given in Qt documentation (which is without scene and view, btw)

    The result is that pinch gesture is nicely detected, but swipe is never detected. Pan is detected only if I do it with 2 fingers, and it ends up as a pinch. Single finger gestures are never detected.

    Please note that I have plenty of dell and non-dell applications using touch gestures working very well on this pc, so something is wrong here maybe?

  3. #3
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView and QGesture issues

    I understand that this is not your main concern, but I spent my last 5 days trying to debug this thing, no luck so I guess I need some help...

    I have recompiled qt with -native-gestures (I am currently testing under windows 7)... same pb. The f** screen recognizes only 2 fingers gestures, one finger gestures are detected as such but cancelled because associated to a mouseMove.

    This is a very normal W7 tablet (dell inspiron duo). The gesture example in qt given does not work for pan and swipe, only pinch is correct.

    Anyone has qt's gesture example running ok in W7?

    Any clue or even hello is welcomed
    Last edited by maitai; 19th April 2011 at 22:02.

  4. #4
    Join Date
    Mar 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsView and QGesture issues

    Got the same trouble on android.
    pinch, tap and tapandhold work well, pan no.
    anybody?

    here seems to work:https://sites.google.com/site/pierre...hgesturesinvtk
    ciao

  5. #5
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView and QGesture issues

    Same issue here, using qt5.2.1 on Android

    The strange thing being that I can see very randomly some panGestures mixed up between pinchGestures only if I use 3 (!) fingers. I actually never succeeded to see a single swipeGesture, whatever I tried.

    I tried to catch these events a the scene/view level, then I tried at QGraphicsItem level, no joy. tapGestures, tapAndHoldGestures and swipeGestures seem ok, not panGestures and swipeGestures. I don't really need the swipeGesture but not being able to catch a pan is a real problem here...

    Any idea or advice?

  6. #6
    Join Date
    Apr 2012
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsView and QGesture issues

    The pan gesture as defined by Qt is two fingers. Despite what the documentation pictures suggest (they show one finger being used.) You can confirm this yourself by looking at the Qt source code standardgestures.cpp, where QPanGestureRecognizer is defined.

    On most desktops, a single finger touch just moves the cursor, in other words, acts like a mouse device. The user expects that. I think it is unstated by the platform interface designers that few gestures should be made with a single touch, since then it interferes with acting like a mouse (excepting a flick or swipe, where the speed of it differentiates it from a mouse movement.) I could be wrong, I don't know the Android platform.

    I am not sure why Qt defines the QPanGesture. The QPinchGesture has a panning component, that is it tells you when the center between the two fingers moves. If all you want to do is 'let the user move the document or view with two fingers' then you don't need the QPanGesture, just the QPinchGesture. Just because the pan gesture exists, you don't need to use it.

    But if you subscribe to both, your app should expect to receive them both at the same time for certain user inputs. That is, since they are both two finger gestures, it seems likely that a given user multitouch could be interpreted as either a pan gesture or a pinch gesture, at least for a short period until the user moves the two fingers to distinguish the gesture.

Similar Threads

  1. scale a QGraphicsView, and it's issues..
    By been_1990 in forum Qt Programming
    Replies: 7
    Last Post: 14th November 2016, 20:25
  2. Regarding QGesture
    By chandantheracer in forum Newbie
    Replies: 1
    Last Post: 20th April 2011, 09:15
  3. QGraphicsView move item issues.
    By mrothe in forum Newbie
    Replies: 3
    Last Post: 28th June 2010, 16:23
  4. QGraphicsView animation issues?
    By m41n1 in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2008, 07:48
  5. Using QGraphicsView as a Splash Screen (repaint issues)
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2008, 21:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.