diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-07-25 16:58:46 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-28 11:02:16 +0200 |
commit | 4f59b5b5308011fdc4bb08bc179d5298077fd9ad (patch) | |
tree | 524fb6b07d89c5ecc4c76cbe27c365e077d70ebc /src/gui | |
parent | a7860d8bf18d1330718fd0dfdc694c92ec69f069 (diff) |
Emit selectionChanged signals when input method alters selection.
Mark the selection as dirty if an input method event contains a
selection and emit selectionChanged() if it's not emitted by
finishChange().
Task-number: QTBUG-19731
Change-Id: Ief6f06f40071f64dae4db0ba365676c059a39c7e
Reviewed-on: http://codereview.qt.nokia.com/2081
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 550b5cf947..59374466d6 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -494,6 +494,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) if (m_selend < m_selstart) { qSwap(m_selstart, m_selend); } + m_selDirty = true; } else { m_selstart = m_selend = 0; } @@ -525,12 +526,18 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) } m_textLayout.setAdditionalFormats(formats); updateDisplayText(/*force*/ true); - if (cursorPositionChanged) - emitCursorPositionChanged(); - else if (m_preeditCursor != oldPreeditCursor) - emit updateMicroFocus(); - if (isGettingInput) + if (isGettingInput) { finishChange(priorState); + } else { + if (cursorPositionChanged) + emitCursorPositionChanged(); + else if (m_preeditCursor != oldPreeditCursor) + emit updateMicroFocus(); + if (m_selDirty) { + m_selDirty = false; + emit selectionChanged(); + } + } } /*! |