diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-12 11:43:12 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-10-12 11:45:12 (GMT) |
commit | c214bde28cc346967471023a8046fd3866407277 (patch) | |
tree | 271d3f1b4bf186fdd153e5b856c823ce754e8f95 /src/gui/kernel/qgesturemanager.cpp | |
parent | 4e44097d77a55b88e2664fc0043203278a9a2d20 (diff) | |
download | Qt-c214bde28cc346967471023a8046fd3866407277.zip Qt-c214bde28cc346967471023a8046fd3866407277.tar.gz Qt-c214bde28cc346967471023a8046fd3866407277.tar.bz2 |
Added support for singleshot gestures.
When a gesture recognizer claims to be in Finished state without any
Triggered states before, that probably means that was a singleshot
gesture that has started and ended right away, so we'll send a fake
gesture in the GestureStarted state.
Reviewed-by: trustme
Diffstat (limited to 'src/gui/kernel/qgesturemanager.cpp')
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 000f44f..b0ef703 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -279,8 +279,10 @@ bool QGestureManager::filterEvent(QObject *receiver, QEvent *event) QSet<QGesture *> notStarted = finishedGestures - activeGestures; if (!notStarted.isEmpty()) { // there are some gestures that claim to be finished, but never started. - qWarning("QGestureManager::filterEvent: some gestures were finished even though they've never started"); - finishedGestures -= notStarted; + // probably those are "singleshot" gestures so we'll fake the started state. + foreach (QGesture *gesture, notStarted) + gesture->d_func()->state = Qt::GestureStarted; + deliverEvents(notStarted, receiver); } activeGestures += startedGestures; |