diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-13 08:11:54 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-22 14:59:18 (GMT) |
commit | d1a60dcbddbae46aaea655bb55c0c8fd46f38b2c (patch) | |
tree | 7da27d0d94a66a7806acffc57211c8d8556b5e5f /src/gui/graphicsview/qgraphicsview.cpp | |
parent | 1b154ddf00473700d697411304804ac065ef32ac (diff) | |
download | Qt-d1a60dcbddbae46aaea655bb55c0c8fd46f38b2c.zip Qt-d1a60dcbddbae46aaea655bb55c0c8fd46f38b2c.tar.gz Qt-d1a60dcbddbae46aaea655bb55c0c8fd46f38b2c.tar.bz2 |
Improved gesture event filtering inside QGraphicsView for QGraphicObjects
Reviewed-by: trustme
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 32747cc..710c745 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2701,6 +2701,19 @@ bool QGraphicsView::viewportEvent(QEvent *event) return true; } + case QEvent::Gesture: + case QEvent::GestureOverride: + { + if (!isEnabled()) + return false; + + if (d->scene && d->sceneInteractionAllowed) { + QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(event); + gestureEvent->setWidget(viewport()); + (void) QApplication::sendEvent(d->scene, gestureEvent); + } + return true; + } default: break; } |