summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgesturemanager.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-06-02 09:33:24 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-06-02 10:47:13 (GMT)
commit4ebe96275944643a06ac4119ef707e1436df5781 (patch)
tree8e69d8e6baf31241cb4a789db8c0e793087901c0 /src/gui/kernel/qgesturemanager.cpp
parente79086f1a90a733cb06fd50773dbcabde0481988 (diff)
downloadQt-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/kernel/qgesturemanager.cpp')
-rw-r--r--src/gui/kernel/qgesturemanager.cpp8
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);