Results 1 to 2 of 2

Thread: How to receive gesture events on a QGraphicsItem?

  1. #1
    Join Date
    Sep 2013
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default How to receive gesture events on a QGraphicsItem?

    I asked this same question on Stackoverflow and also on the Qt forums but nobody answers. I'm facing some problems with gesture events on the QGraphicsItem objects.

    I already set:

    Qt Code:
    1. graphicsView->setAttribute(Qt::WA_AcceptTouchEvents);
    2. graphicsView->viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
    3. graphicsView->grabGesture(Qt::PinchGesture);
    4. graphicsView->viewport()->grabGesture(Qt::PinchGesture);
    To copy to clipboard, switch view to plain text mode 

    And I’m still unable to receive gestures on the sceneEvent method of a QGraphicsItem using Qt 5.1, does anyone knows why ?

    The Qt 5.1 documentation says:

    "When the user performs a gesture, QGestureEvent events will be delivered to the target object, and these can be handled by reimplementing the QWidget::event() handler function for widgets or QGraphicsItem::sceneEvent() for graphics objects."

    I'm implementing the QGraphicsItem::sceneEvent() and I'm receiving TouchBegin/TouchEnd/TouchUpdate events, but I never receive gesture events. It is weird that the QGraphicsItem doesn't have the method grabGesture() but the QGraphicsObject has this method.

    Thanks !

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to receive gesture events on a QGraphicsItem?

    Does your screen device support multitouch?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QGraphicsItem can't receive mouse leave/enter event
    By wshn13 in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2011, 08:32
  2. Tablet Events in QGraphicsItem
    By Soapbubble in forum Newbie
    Replies: 1
    Last Post: 15th May 2011, 09:01
  3. Replies: 0
    Last Post: 18th November 2010, 16:48
  4. Receive HotKey events with QAbstractEventDispatcher?
    By V4Friend in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2010, 20:26
  5. QGraphicsItem hover events
    By stefan in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2008, 11:01

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.