summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-07-13 14:37:00 +0200
committerAndy Shaw <andy.shaw@qt.io>2017-07-24 09:51:17 +0000
commitfcfee98f62b8a8b8c3b1ac11cbb23620788a586c (patch)
tree136e33e78f0afdafba23ff060a751e9414881435 /src/widgets/widgets
parent3becc8527e632e5d54e3d05d5c4f72246100c963 (diff)
QLineEdit: 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: Ic0f5fad6999ddd367e435ec4409a5db5b9eacb7b Reviewed-by: Daniel Teske <qt@squorn.de> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 97df3427b0..976cd173c5 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -548,10 +548,10 @@ void QWidgetLineControl::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) {