How to receive touch Events on MacOS X?
-
Hi,
im creating a desktop application and want to have a native user expierience. So how can i interact with a multi touch mouse or trackpad on MacOS X in a GraphicsScene? setting acceptTouchEvents(true) doesnt help and neither QEvent::TouchBegin, TouchEnd, TouchUpdate and Gesture is deliverd to my items. Is there a way to get it working?
thanks
-
Did you ever find a solution for this? I am facing the same problem, developing a Qt application for MacOS and I'd like to be able to handle the multi finger swipe events on the trackpad, just like safari.
I'd appreciate any help or pointers.
Thanks! -
Multi Touch support is available in Qt since 4.6:
"The Labs Post announcing it":http://labs.qt.nokia.com/2009/04/20/multi-touch-support-in-qt/
"Multitouch on MacBooks":http://labs.qt.nokia.com/2009/06/23/multi-touch-on-mac/
"Documentation on QTouchEvent":http://doc.qt.nokia.com/4.7-snapshot/qtouchevent.htmlEDIT: To get it to work with GraphicsView/Scene, you'll have to subclass QGraphicsView and handle the events there.
-
Ok, this will give access to the TouchEvents and touch points, as far as I can tell. But in that case I have to then implement the gesture recognizer myself, right?
Does Qt capture the Gesture events (not touch events) generated by MacOS and encapsulate them in Qt Events?
I'm interested in events like 2 and 3 finger swipes and pinch-zoom gestures. And if possible, I'd like to use the Os gesture recognizers, and not have to reinvent the wheel. -
Qt does recognize gestures see "here":http://doc.qt.nokia.com/4.8-snapshot/gestures-overview.html
-
have you made it? i am facing this problem now.
[quote author="Jupiter" date="1309935386"]Hi,im creating a desktop application and want to have a native user expierience. So how can i interact with a multi touch mouse or trackpad on MacOS X in a GraphicsScene? setting acceptTouchEvents(true) doesnt help and neither QEvent::TouchBegin, TouchEnd, TouchUpdate and Gesture is deliverd to my items. Is there a way to get it working?
thanks[/quote]
-
I think its just broken on OSX, see here:
https://bugreports.qt-project.org/browse/QTBUG-28126Odd thing is the bug report hasn't had more votes, seems like core functionality broken to me.