summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-12-03 15:33:10 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2014-12-04 18:51:39 +0100
commitfd29be6a6beafe4bfaf5a73d19a0d6a924217d16 (patch)
treedea0459e8f94882a0fbaedbb272e9b3d2abaf6f8 /src/widgets/kernel
parent20d10d90f2715e6cee46be63c1314eb62f06bc5f (diff)
Revert "Use single finger pan to scroll text edits on touch screens."
This reverts commit 2ffa46054d13c639cf9f7846a74ad3ebd07b9f5c. It completely broke text selection in text edits on iOS, and wasn't even tested on that platform before landing. It's also changing behavior in a patch release for multiple platforms, from being able to both scroll and select text, to only being able to scroll, which would be considered a feature-regression and an automatic -2 on the original patch. This means QTBUG-40461, a P2 regression from Qt 4 on Windows, will have to be re-opened, so that we can fix it properly. Task-number: QTBUG-43101 Change-Id: I26a2bafb4500b1ff4dc3fb942f197d11038b630b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qstandardgestures.cpp23
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: {