diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-03-12 15:07:36 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-11 13:49:16 (GMT) |
commit | 3e2cef8f6a58949b887add8ff1bb5e457e7be542 (patch) | |
tree | b1f34bff7d54fe94a0e1599650a94b71a892f9ef /src/gui/graphicsview/qgraphicsview.cpp | |
parent | ed24f677a411c449a2a3f862906aff2a313b4425 (diff) | |
download | Qt-3e2cef8f6a58949b887add8ff1bb5e457e7be542.zip Qt-3e2cef8f6a58949b887add8ff1bb5e457e7be542.tar.gz Qt-3e2cef8f6a58949b887add8ff1bb5e457e7be542.tar.bz2 |
Added QGraphicsSceneGestureEvent that extends plain QGestureEvent by
providing some additional info (like a widget that received a gesture
- for coordinates conversions).
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 97903d3..925763c 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2862,10 +2862,16 @@ bool QGraphicsView::event(QEvent *event) } } break; - case QEvent::Gesture: - QApplication::sendEvent(d->scene, event); - if (event->isAccepted()) + case QEvent::Gesture: { + QGraphicsSceneGestureEvent gestureEvent; + gestureEvent.setWidget(this); + QGestureEvent *ev = static_cast<QGestureEvent*>(event); + gestureEvent.setGestures(ev->gestures()); + gestureEvent.setCancelledGestures(ev->cancelledGestures()); + QApplication::sendEvent(d->scene, &gestureEvent); + if (gestureEvent.isAccepted()) return true; + } break; default: break; |