diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-11-15 12:55:30 +0100 |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-11-15 13:29:15 +0100 |
commit | 4f04081759fb9bb9f58412765fd9252053585e06 (patch) | |
tree | 3256e02d3cba057f30814ff677f73e7bda1fcf79 /qdeclarativegesturerecognizers.cpp | |
parent | 076cbd5e649a638c723a069b46f0a41f9f891d5d (diff) |
Added a temporary workaround for Tap and Pan gesturesresearch-event-delivery-4.8
The current behavior is to cancel Tap when Pan is active, however
with multiple gesture contexts Tap gesture recognizer might not
get the QGestureEvent containing Pan if Pan is handled in an item
"below" the Tap gesture area.
The temporary solution is to handle canceling in the Pan gesture
recognizer - it cancels other gestures when necesseraly.
Reviewed-by: Zeno Albisser
Diffstat (limited to 'qdeclarativegesturerecognizers.cpp')
-rw-r--r-- | qdeclarativegesturerecognizers.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qdeclarativegesturerecognizers.cpp b/qdeclarativegesturerecognizers.cpp index 2943a26..1aa5b6b 100644 --- a/qdeclarativegesturerecognizers.cpp +++ b/qdeclarativegesturerecognizers.cpp @@ -305,6 +305,15 @@ QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state, } return QGestureRecognizer::CancelGesture; #endif + case QEvent::Gesture: { + // We check for other gesture events: TapAndHold and Pan both cancel the simple Tap + QGestureEvent *ge = static_cast<QGestureEvent *>(event); + if (QGesture *g = ge->gesture(Qt::TapGesture)) + g->setGestureCancelPolicy(QGesture::CancelAllInContext); + if (QGesture *g = ge->gesture(Qt::TapAndHoldGesture)) + g->setGestureCancelPolicy(QGesture::CancelAllInContext); + return QGestureRecognizer::Ignore; + } default: result = QGestureRecognizer::Ignore; break; |