diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-02 18:26:44 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-03 10:26:08 (GMT) |
commit | 93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827 (patch) | |
tree | b4e677abcb3b69dc602e29fe113041895f1e0e5f /src/gui/graphicsview/qgraphicsscene.cpp | |
parent | cfcfae65778f2e1e7fc3936c66689e3685f1cc77 (diff) | |
download | Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.zip Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.tar.gz Qt-93e9bc06427c6a8e1b6d6f939cf53ae5c95e0827.tar.bz2 |
Gesture api review.
Changes to the gesture api after the review.
Reviewed-by: Jasmin Blanchette
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index f5bb408..aed2837 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1060,9 +1060,8 @@ bool QGraphicsScenePrivate::filterEvent(QGraphicsItem *item, QEvent *event) bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event) { if (QGraphicsObject *object = item->toGraphicsObject()) { - QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); - if (qAppPriv->gestureManager) { - if (qAppPriv->gestureManager->filterEvent(object, event)) + if (qt_gestureManager) { + if (qt_gestureManager->filterEvent(object, event)) return true; } } @@ -5761,7 +5760,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QWidget *viewport = event->widget(); if (!viewport) return; - QList<QGesture *> allGestures = event->allGestures(); + QList<QGesture *> allGestures = event->gestures(); DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:" << "Delivering gestures:" << allGestures; @@ -5900,11 +5899,11 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event) QGraphicsItemPrivate *gid = item->QGraphicsItem::d_func(); foreach(QGesture *g, alreadyIgnoredGestures) { - QMap<Qt::GestureType, Qt::GestureContext>::iterator contextit = + QMap<Qt::GestureType, Qt::GestureFlags>::iterator contextit = gid->gestureContext.find(g->gestureType()); bool deliver = contextit != gid->gestureContext.end() && (g->state() == Qt::GestureStarted || - (contextit.value() & Qt::GestureContextHint_Mask) & Qt::AcceptPartialGesturesHint); + (contextit.value() & Qt::ReceivePartialGestures)); if (deliver) gestures += g; } @@ -6046,10 +6045,9 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original, QWidge } } - QGestureManager *gm = QApplicationPrivate::instance()->gestureManager; - Q_ASSERT(gm); // it would be very odd if we got called without a manager. + Q_ASSERT(qt_gestureManager); // it would be very odd if we got called without a manager. for (setIter = canceledGestures.begin(); setIter != canceledGestures.end(); ++setIter) { - gm->recycle(*setIter); + qt_gestureManager->recycle(*setIter); gestureTargets.remove(*setIter); } } |