aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2016-03-04 11:34:59 +0100
committerAndy Shaw <andy.shaw@qt.io>2017-07-26 18:10:36 +0000
commitbb199cc8ad4111808260f6255312b08c7d81dcbc (patch)
treeb8be1091223205ba8f1299563c72ae4436e5a1c2 /src
parented90226834f8d4ef76149e995e2aecff68e4df43 (diff)
QQuickTextInput: Don't move the cursor after internalInsert() has done so
internalInsert() will set the cursor to the right position which accounts for any input mask set on the control as well. Therefore it will already be placed at the next correct position and should not be changed again after that. Task-number: QTBUG-40943 Change-Id: Ic80193ee94d2aa002b5a14a88df719a5a2cf51b1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquicktextinput.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index a378359c95..43899ba457 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -3407,10 +3407,10 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event)
if (!event->commitString().isEmpty()) {
internalInsert(event->commitString());
cursorPositionChanged = true;
+ } else {
+ m_cursor = qBound(0, c, m_text.length());
}
- m_cursor = qBound(0, c, m_text.length());
-
for (int i = 0; i < event->attributes().size(); ++i) {
const QInputMethodEvent::Attribute &a = event->attributes().at(i);
if (a.type == QInputMethodEvent::Selection) {