Why do I get NativeGestures in Qt rather than just Gestures
I thought I should take a look at Gesture and touch events with my Qt application following the documentation:
http://doc.qt.n开发者_开发知识库okia.com/latest/gestures-overview.html
However the event I am getting is a QEvent::NativeGesture not the QEvent::Gesture the documentation talks about. The Qt labs blog post I found says NativeGestures should be converted to Qt Gestures:
http://labs.qt.nokia.com/2009/04/23/gestures-in-short/
Do I have to recompile Qt now that I have a touch screen?
(I have Windows 7 with a Dell touch screen monitor so I have the equipment)
To answer my own question, I think I need to accept the touch events at the same time as grabbing the Gesture. Where as initially I was just grabbing the gesture.
viewport()->grabGesture(Qt::PinchGesture);
viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
精彩评论