summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-03-12 16:06:17 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 13:52:22 (GMT)
commitf8c5c2720b4a48dad0f68b83d9c494185e012cd1 (patch)
treee31419e4008a9dc6766764a4434bfcfc67a9e807
parent3e2cef8f6a58949b887add8ff1bb5e457e7be542 (diff)
downloadQt-f8c5c2720b4a48dad0f68b83d9c494185e012cd1.zip
Qt-f8c5c2720b4a48dad0f68b83d9c494185e012cd1.tar.gz
Qt-f8c5c2720b4a48dad0f68b83d9c494185e012cd1.tar.bz2
Moved the code that translated QGestureEvent to
QGraphicsSceneGestureEvent to a viewport, so that the user could subscribe to gestures in a viewport as well.
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 925763c..6f142e3 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2862,16 +2862,8 @@ bool QGraphicsView::event(QEvent *event)
}
}
break;
- 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;
- }
+ case QEvent::Gesture:
+ viewportEvent(event);
break;
default:
break;
@@ -2953,6 +2945,17 @@ bool QGraphicsView::viewportEvent(QEvent *event)
d->scene->d_func()->updateAll = false;
}
break;
+ 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;
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd: