diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2012-12-19 17:12:58 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-01 00:52:44 +0100 |
commit | 561ab99ad65711b61c47df9bd78ea928de525a53 (patch) | |
tree | 5b3faf30dbcee3066e37886cb9702a462f004137 /src/quick/items/qquicktextinput.cpp | |
parent | 49651307807fc097d14ae13fb71013e46944eb2a (diff) |
Ensure the cursorRectangle is updated as the width of the text changes.
Outside of when of a monospace font is used, if the text changes the
visual position of the cursor will have most likely changed as well
even when the cursor index hasn't.
Task-number: QTBUG-28677
Change-Id: If8077772d8541a677d5875976e6cd9fc453731df
Reviewed-by: Alan Alpert <aalpert@rim.com>
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 906758903d..b305ad116a 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -3275,6 +3275,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo bool inputMethodAttributesChanged = m_textDirty || m_selDirty; #endif bool alignmentChanged = false; + bool textChanged = false; if (m_textDirty) { // do validation @@ -3309,6 +3310,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo } if (m_textDirty) { + textChanged = true; m_textDirty = false; #ifndef QT_NO_IM m_preeditDirty = false; @@ -3344,7 +3346,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo #endif emitUndoRedoChanged(); - if (!emitCursorPositionChanged() && alignmentChanged) + if (!emitCursorPositionChanged() && (alignmentChanged || textChanged)) q->updateCursorRectangle(); return true; |