diff options
author | Liang Qi <liang.qi@qt.io> | 2019-09-12 08:01:21 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-09-12 08:01:21 +0200 |
commit | c80eb38354854f2ccc7ea070a9857409acc36792 (patch) | |
tree | 806cb68b337ac7c8ab8f9a48538e6e0211f57ed8 /src/quick/items/qquicktextcontrol.cpp | |
parent | d38bac596946c3dd9cce3c0b4127509421dc917d (diff) | |
parent | f19ec4561b4975d68290593b599d3c38d0f9f6d3 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
src/qml/jsruntime/qv4engine.cpp
src/quick/handlers/qquicktaphandler.cpp
src/quick/items/qquicktableview.cpp
Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Done-With: Ulf Hermann <ulf.hermann@qt.io>
Done-With: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
Diffstat (limited to 'src/quick/items/qquicktextcontrol.cpp')
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 5c4ecd60aa..ab3b0c4605 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -794,8 +794,6 @@ void QQuickTextControl::timerEvent(QTimerEvent *e) d->cursorOn = !d->cursorOn; d->repaintCursor(); - } else if (e->timerId() == d->tripleClickTimer.timerId()) { - d->tripleClickTimer.stop(); } } @@ -1058,7 +1056,7 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po commitPreedit(); #endif - if (tripleClickTimer.isActive() + if ((e->timestamp() < (timestampAtLastDoubleClick + QGuiApplication::styleHints()->mouseDoubleClickInterval())) && ((pos - tripleClickPoint).toPoint().manhattanLength() < QGuiApplication::styleHints()->startDragDistance())) { cursor.movePosition(QTextCursor::StartOfBlock); @@ -1068,7 +1066,7 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po anchorOnMousePress = QString(); - tripleClickTimer.stop(); + timestampAtLastDoubleClick = 0; // do not enter this condition in case of 4(!) rapid clicks } else { int cursorPos = q->hitTest(pos, Qt::FuzzyHit); if (cursorPos == -1) { @@ -1267,7 +1265,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin selectedWordOnDoubleClick = cursor; tripleClickPoint = pos; - tripleClickTimer.start(QGuiApplication::styleHints()->mouseDoubleClickInterval(), q); + timestampAtLastDoubleClick = e->timestamp(); if (doEmit) { selectionChanged(); #if QT_CONFIG(clipboard) |