summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgesturestandardrecognizers.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-22 13:00:56 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 14:51:54 (GMT)
commit9337786ca073b185f82898e10be473ea4177f787 (patch)
tree8c850598363a5eb6c222c7b8a5971dfd174a1788 /src/gui/kernel/qgesturestandardrecognizers.cpp
parentec94be7f23bfd9c13e42b9b20f01af69bae83660 (diff)
downloadQt-9337786ca073b185f82898e10be473ea4177f787.zip
Qt-9337786ca073b185f82898e10be473ea4177f787.tar.gz
Qt-9337786ca073b185f82898e10be473ea4177f787.tar.bz2
Allow to start a Pan gesture only with the left mouse button.
Diffstat (limited to 'src/gui/kernel/qgesturestandardrecognizers.cpp')
-rw-r--r--src/gui/kernel/qgesturestandardrecognizers.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/kernel/qgesturestandardrecognizers.cpp b/src/gui/kernel/qgesturestandardrecognizers.cpp
index 00b4a39..cf2bb41 100644
--- a/src/gui/kernel/qgesturestandardrecognizers.cpp
+++ b/src/gui/kernel/qgesturestandardrecognizers.cpp
@@ -96,15 +96,19 @@ QGestureRecognizer::Result QGestureRecognizerPan::filterEvent(const QEvent *even
reset();
return QGestureRecognizer::NotGesture;
}
+ if (ev->button() != Qt::LeftButton) {
+ return QGestureRecognizer::NotGesture;
+ }
DEBUG() << "Pan: MouseButtonPress: maybe gesture started";
mousePressed = true;
pressedPos = lastPos = currentPos = ev->pos();
return QGestureRecognizer::MaybeGesture;
} else if (event->type() == QEvent::MouseButtonRelease) {
- if (mousePressed && currentDirection != Qt::NoDirection) {
+ const QMouseEvent *ev = static_cast<const QMouseEvent*>(event);
+ if (mousePressed && currentDirection != Qt::NoDirection
+ && ev->button() == Qt::LeftButton) {
DEBUG() << "Pan: MouseButtonRelease: pan detected";
gestureState = Qt::GestureFinished;
- const QMouseEvent *ev = static_cast<const QMouseEvent*>(event);
currentPos = ev->pos();
internalReset();
return QGestureRecognizer::GestureFinished;