From 964f8be1d281b56d6721b66baecd2a301a09ff0d Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Mon, 5 Sep 2011 17:42:08 +1000 Subject: [PATCH] Fix TextInput test failures. emitCursorPositionChanged won't emit cursorPositionChanged if the cursor position hasn't changed but that doesn't mean the micro focus hasn't changed, so emit updateMicroFocus changed when cursorPositionChanged isn't. Task-number: QTBUG-21017 QTBUG-21011 Change-Id: Id0b6bd5aed16563b7b5cce643745e453ba4857a5 Reviewed-on: http://codereview.qt.nokia.com/4181 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones --- src/gui/widgets/qlinecontrol.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 18b4490729..0769bb9697 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -520,6 +520,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) cursorPositionChanged = true; } } + #ifndef QT_NO_IM setPreeditArea(m_cursor, event->preeditString()); #endif //QT_NO_IM @@ -688,6 +689,8 @@ bool QLineControl::finishChange(int validateFromState, bool update, bool edited) m_selDirty = false; emit selectionChanged(); } + if (m_cursor == m_lastCursorPos) + updateMicroFocus(); emitCursorPositionChanged(); return true; }