summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-11-03 12:56:42 (GMT)
committeraxis <qt-info@nokia.com>2009-11-03 13:18:15 (GMT)
commit381247326743888075979664f50ea804d6123c42 (patch)
treefe6b082b8123ff35b06703d7e993f9463d051b22
parent95f7076937065a78029fc50d506fba58f8c6199c (diff)
downloadQt-381247326743888075979664f50ea804d6123c42.zip
Qt-381247326743888075979664f50ea804d6123c42.tar.gz
Qt-381247326743888075979664f50ea804d6123c42.tar.bz2
Fixed an input method bug when erasing the last character.
Previously we didn't update the editor contents if the new preedit string was empty. However, it could be empty because the user just erased it, so the bug was fixed by checking whether the preedit string in the event and in the editor are different. RevBy: Denis Dzyubenko
-rw-r--r--src/gui/text/qtextcontrol.cpp3
-rw-r--r--src/gui/widgets/qlinecontrol.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 3f6545c..9497b6f 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1831,7 +1831,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
e->ignore();
return;
}
- bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty()
+ bool isGettingInput = !e->commitString().isEmpty()
+ || e->preeditString() != cursor.block().layout()->preeditAreaText()
|| e->replacementLength() > 0;
if (isGettingInput) {
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 8f17e98..0fc94c9 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -401,7 +401,8 @@ void QLineControl::moveCursor(int pos, bool mark)
void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
{
int priorState = 0;
- bool isGettingInput = !event->commitString().isEmpty() || !event->preeditString().isEmpty()
+ bool isGettingInput = !event->commitString().isEmpty()
+ || event->preeditString() != preeditAreaText()
|| event->replacementLength() > 0;
bool cursorPositionChanged = false;