diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-06-02 09:33:24 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-06-02 10:47:13 (GMT) |
commit | 4ebe96275944643a06ac4119ef707e1436df5781 (patch) | |
tree | 8e69d8e6baf31241cb4a789db8c0e793087901c0 /src/gui | |
parent | e79086f1a90a733cb06fd50773dbcabde0481988 (diff) | |
download | Qt-4ebe96275944643a06ac4119ef707e1436df5781.zip Qt-4ebe96275944643a06ac4119ef707e1436df5781.tar.gz Qt-4ebe96275944643a06ac4119ef707e1436df5781.tar.bz2 |
Reset gesture when in MayBeGesture state.
When a gesture recognizer switches from MayBeGesture to Cancelled gesture we
need to reset the state of the recognizer, but do not send any events to the
user.
Reviewed-by: Thomas Zander
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 43facef..7363d70 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -284,6 +284,9 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, // check if a running gesture switched back to maybe state QSet<QGesture *> activeToMaybeGestures = m_activeGestures & newMaybeGestures; + // check if a maybe gesture switched to canceled - reset it but don't send an event + QSet<QGesture *> maybeToCanceledGestures = m_maybeGestures & notGestures; + // check if a running gesture switched back to not gesture state, // i.e. were canceled QSet<QGesture *> canceledGestures = m_activeGestures & notGestures; @@ -343,7 +346,8 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, << "\n\tstarted:" << startedGestures << "\n\ttriggered:" << triggeredGestures << "\n\tfinished:" << finishedGestures - << "\n\tcanceled:" << canceledGestures; + << "\n\tcanceled:" << canceledGestures + << "\n\tmaybe-canceled:" << maybeToCanceledGestures; } QSet<QGesture *> undeliveredGestures; @@ -364,7 +368,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, // reset gestures that ended QSet<QGesture *> endedGestures = - finishedGestures + canceledGestures + undeliveredGestures; + finishedGestures + canceledGestures + undeliveredGestures + maybeToCanceledGestures; foreach (QGesture *gesture, endedGestures) { recycle(gesture); m_gestureTargets.remove(gesture); |