diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-04-20 17:18:53 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-27 13:47:21 +0200 |
commit | 7c288f1a61173f1904960c96c703ee89ab5a847e (patch) | |
tree | 0ff0842eebab0a9f188a1f0efe20490844909176 /src/quick/items/qquicktextcontrol.cpp | |
parent | a150d1211f9ec49f963227452ee4818746b8c6ed (diff) |
Fix TextEdit with right aligned text when size changes
Geometry change was avoiding updating size of the QTextDocument, thus
it was not able to right align before something else triggered size
change, e.g. a modification to the text. Also removed unnecessary
cursorRectangleChanged signal that was emitted when moving focus with
mouse.
Change-Id: I293fd5119473eb3def5acd1b3fbb951c12e14412
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktextcontrol.cpp')
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 7fa990ba9f..8bc94b919c 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -1206,18 +1206,14 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po } } - if (interactionFlags & Qt::TextEditable) { + if (cursor.position() != oldCursorPos) { q->updateCursorRectangle(true); - if (cursor.position() != oldCursorPos) - emit q->cursorPositionChanged(); + emit q->cursorPositionChanged(); + } + if (interactionFlags & Qt::TextEditable) _q_updateCurrentCharFormatAndSelection(); - } else { - if (cursor.position() != oldCursorPos) { - emit q->cursorPositionChanged(); - q->updateCursorRectangle(true); - } + else selectionChanged(); - } repaintOldAndNewSelection(oldSelection); hadSelectionOnMousePress = cursor.hasSelection(); } |