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:
graphicsView->setAttribute(Qt::WA_AcceptTouchEvents); graphicsView->viewport()->setAttribute(Qt::WA_AcceptTouchEvents); graphicsView->grabGesture(Qt::PinchGesture); 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 !
Bookmarks