diff options
Diffstat (limited to 'src/widgets/kernel/qstandardgestures.cpp')
-rw-r--r-- | src/widgets/kernel/qstandardgestures.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/widgets/kernel/qstandardgestures.cpp b/src/widgets/kernel/qstandardgestures.cpp index 53e5d091fa..6656903e70 100644 --- a/src/widgets/kernel/qstandardgestures.cpp +++ b/src/widgets/kernel/qstandardgestures.cpp @@ -38,7 +38,6 @@ #include "qwidget.h" #include "qabstractscrollarea.h" #include <qgraphicssceneevent.h> -#include <QtGui/QTouchDevice> #include "qdebug.h" #ifndef QT_NO_GESTURES @@ -68,26 +67,8 @@ static QPointF panOffset(const QList<QTouchEvent::TouchPoint> &touchPoints, int return result / qreal(count); } -// ### fixme: Remove this -// Use single finger pan to scroll QPlainTextEdit/QTextEdit -// by changing the number of pan points to 1 for these classes. -// This used to be Qt 4's behavior on Windows which was achieved using native -// Windows gesture recognizers for these classes. -// The other classes inheriting QScrollArea still use standard 2 finger pan. -// In the long run, they should also use single finger pan to -// scroll on touch screens, however, this requires a distinct Tap&Hold-followed-by-pan -// type gesture to avoid clashes with item view selection and DnD. - -static inline int panTouchPoints(const QTouchEvent *event, const QObject *object, - int defaultTouchPoints) -{ - return event->device()->type() == QTouchDevice::TouchScreen && object && object->parent() - && (object->parent()->inherits("QPlainTextEdit") || object->parent()->inherits("QTextEdit")) - ? 1 : defaultTouchPoints; -} - QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state, - QObject *object, + QObject *, QEvent *event) { QPanGesture *q = static_cast<QPanGesture *>(state); @@ -100,7 +81,7 @@ QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state, result = QGestureRecognizer::MayBeGesture; QTouchEvent::TouchPoint p = ev->touchPoints().at(0); d->lastOffset = d->offset = QPointF(); - d->pointCount = panTouchPoints(ev, object, m_pointCount); + d->pointCount = m_pointCount; break; } case QEvent::TouchEnd: { |