aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-09-05 21:15:13 +0200
committerAndy Shaw <andy.shaw@qt.io>2017-10-20 06:32:22 +0000
commit95517128d2b5ed6b3e993df3276c012199ec8ab9 (patch)
tree27047d48f3c39e3a2262a351c91d62d2bcc7c16c /src
parentffca73c79d7733f06416f211d5d544dd037c9532 (diff)
Update the cursor rectangle when select all is triggered
When select all is triggered then the cursor rectangle should be updated to ensure that the selection handles are visible if they are displayed on a given platform. For instance, on iOS the loupe handles should appear in this case. This also has the added effect that when using Backspace on the iOS keyboard, it will delete the selected text as opposed to just a single character as it will handle that situation correctly. The tst_qquicktextedit::inputMethodUpdate() test is modified to account for the extra event sent now when selectAll() is called. Task-number: QTBUG-63835 Change-Id: I94fb0576b286c006dd12c65d0b322d712ed2a96f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquicktextcontrol.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 2e23d69e5b..874c02fc99 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -432,6 +432,7 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /
#endif
emit q->selectionChanged();
}
+ q->updateCursorRectangle(true);
}
void QQuickTextControlPrivate::_q_updateCurrentCharFormatAndSelection()
@@ -1150,7 +1151,6 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
if (interactionFlags & Qt::TextEditable) {
if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
- q->updateCursorRectangle(true);
}
_q_updateCurrentCharFormatAndSelection();
#if QT_CONFIG(im)
@@ -1159,7 +1159,6 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
#endif
} else if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
- q->updateCursorRectangle(true);
}
selectionChanged(true);
repaintOldAndNewSelection(oldSelection);