diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-02-09 00:23:03 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-02-16 01:01:43 (GMT) |
commit | 6c3868572d8f109884a1b3fb806331fda3ef84d4 (patch) | |
tree | 0a3d2f691e460a8acd155483d502e6e663d595cc /src/gui/widgets | |
parent | 3997977cdb712042c540b143f2ce2f5376e9d1e0 (diff) | |
download | Qt-6c3868572d8f109884a1b3fb806331fda3ef84d4.zip Qt-6c3868572d8f109884a1b3fb806331fda3ef84d4.tar.gz Qt-6c3868572d8f109884a1b3fb806331fda3ef84d4.tar.bz2 |
Update the input context when the pre-edit cursor position changes.
The micro focus rect changes both when the regular cursor position
and the pre-edit cursor positions change. Ensure updateMicroFocus
is called TextInput in both cases.
Change-Id: I6822a710b841e106ce2462f74fea398250596913
Task-number: QTBUG-17396
Reviewed-by: Martin Jones
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol_p.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index c7a3913..d108ad9 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -456,6 +456,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) #ifndef QT_NO_IM setPreeditArea(m_cursor, event->preeditString()); #endif //QT_NO_IM + const int oldPreeditCursor = m_preeditCursor; m_preeditCursor = event->preeditString().length(); m_hideCursor = false; QList<QTextLayout::FormatRange> formats; @@ -479,6 +480,8 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) updateDisplayText(/*force*/ true); if (cursorPositionChanged) emitCursorPositionChanged(); + else if (m_preeditCursor != oldPreeditCursor) + emit updateMicroFocus(); if (isGettingInput) finishChange(priorState); } diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index bfe50fe..3c505c8 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -425,6 +425,7 @@ Q_SIGNALS: void textEdited(const QString &); void resetInputContext(); + void updateMicroFocus(); void accepted(); void editingFinished(); |