Results 1 to 2 of 2

Thread: Qgesture mouse or touch event

  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 Qgesture mouse or touch event

    Hello all,

    I am struggling with QGestureEvents, QMouseEvents inside a QGraphicsScene and view (and items)

    I understand that gestures are not limited to touch events, and can be triggered by mouse actions too. Moreover, a touch event can be translated automagically in a mouse event. My problem is that I'm developing for several machines/os/hardware, some of them have only a mouse/keyboard, some others have only a touch-screen, and some others have both.

    A touch event is automatically translated in a mousePressed/mouseReleased event (well, in some cases). I cannot find a way to know if it comes from a touch or from a real mouse-click. A long-mouse-click is automatically translated in a tapAndHoldGesture... apparently no way to know if it comes from a mouse or from a touch event.

    It's a real problem if you want to write code that will accommodate all situations (for instance I dont want a long-click to be consider as a tapAndHoldGesture, nor do I want a touch-tap being translated in a mouse-click event).

    So the question is:

    Is there a way to know what is the input of an event (touch or mouse, say) ?

    PS: using qt5.2.1 on Windows/Linux/Mac-OS/Android
    Last edited by maitai; 15th February 2014 at 14:46.

  2. #2
    Join Date
    Jan 2008
    Posts
    10
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qgesture mouse or touch event

    Hi Matai,
    did you ever find a solution to this problem?
    Thanks,
    Andres

Similar Threads

  1. touch event
    By leoalvesmachado in forum Newbie
    Replies: 12
    Last Post: 20th February 2014, 09:07
  2. Replies: 3
    Last Post: 7th January 2012, 08:38
  3. QT 4.7 and Multi-touch (Which input event dev does QT use?)
    By liangbowen in forum Qt Programming
    Replies: 0
    Last Post: 19th December 2011, 08:36
  4. how to manually create touch event?
    By harshita in forum Qt Programming
    Replies: 4
    Last Post: 9th September 2011, 12:10
  5. Disable touch event when using QWebkit
    By chika in forum Qt Programming
    Replies: 1
    Last Post: 28th February 2011, 11:09

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.