diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2010-01-27 15:54:25 +0100 |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2010-03-03 17:27:24 +0100 |
commit | 65e7400babb0625f4d7616ec5d71490a2dcd3c6f (patch) | |
tree | 0a6f77584204e9e58bc63efca8e61f6a562875fb /src/gui/widgets/qlinecontrol.cpp | |
parent | c7f2181a25243ed07f1406c7023dfdd5fb75d77d (diff) | |
download | qt4-tools-65e7400babb0625f4d7616ec5d71490a2dcd3c6f.tar.gz |
Always redraw the complete control when an input event comes in.
The problem here is that a pre-edit string won't be detected by
updateDisplayText(), so the control thinks nothing has changed when
a new pre-edit string is set.
Reviewed-By: Simon Hausmann
(cherry picked from commit 16f30906f6eea3e00351478555f153697a6e186d)
Diffstat (limited to 'src/gui/widgets/qlinecontrol.cpp')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index db099e8a5b..9ec0feb851 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE Updates the display text based of the current edit text If the text has changed will emit displayTextChanged() */ -void QLineControl::updateDisplayText() +void QLineControl::updateDisplayText(bool forceUpdate) { QString orig = m_textLayout.text(); QString str; @@ -102,7 +102,7 @@ void QLineControl::updateDisplayText() m_textLayout.endLayout(); m_ascent = qRound(l.ascent()); - if (str != orig) + if (str != orig || forceUpdate) emit displayTextChanged(str); } @@ -476,7 +476,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) } } m_textLayout.setAdditionalFormats(formats); - updateDisplayText(); + updateDisplayText(/*force*/ true); if (cursorPositionChanged) emitCursorPositionChanged(); if (isGettingInput) |