summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-03-02 07:30:53 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-03-03 00:39:11 (GMT)
commit585ddb51909db49c51e9e8019d3b5d45c48a1a08 (patch)
treeabee2f963f350d35f4700f645f6eb70e8c6b4e8c /src/gui
parent2123a7ff6a04aec331fada5e03aa99395a0de1db (diff)
downloadQt-585ddb51909db49c51e9e8019d3b5d45c48a1a08.zip
Qt-585ddb51909db49c51e9e8019d3b5d45c48a1a08.tar.gz
Qt-585ddb51909db49c51e9e8019d3b5d45c48a1a08.tar.bz2
Position the TextInput cursor correctly after IM text is commited.
If text is removed before the cursor position decrement not increment the cursor by the by the difference. Change-Id: If9558c88157cc884652af7aaf9bd5fad0ea822d8 Task-number: QTBUG-17863 Reviewed-by: Martin Jones
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index d108ad9..bffc2b5 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -420,7 +420,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
int c = m_cursor; // cursor position after insertion of commit string
if (event->replacementStart() <= 0)
- c += event->commitString().length() + qMin(-event->replacementStart(), event->replacementLength());
+ c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
m_cursor += event->replacementStart();