Ensure the TextEdit cursor delegate is repositioned on mouse events.

Update the micro focus when a mouse press changes the cursor position
of a read only TextEdit.

Change-Id: I11855037f7938b2cd23ac6ad165722b5289b4f46
Task-number: QTBUG-19109
Reviewed-by: Martin Jones
Reviewed-on: http://codereview.qt.nokia.com/291
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
This commit is contained in:
Andrew den Exter 2011-05-09 13:57:34 +10:00 committed by Qt Continuous Integration System
parent 3c7793acc0
commit 16bd22b1bc

View File

@ -1579,8 +1579,10 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
emit q->cursorPositionChanged(); emit q->cursorPositionChanged();
_q_updateCurrentCharFormatAndSelection(); _q_updateCurrentCharFormatAndSelection();
} else { } else {
if (cursor.position() != oldCursorPos) if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged(); emit q->cursorPositionChanged();
emit q->microFocusChanged();
}
selectionChanged(); selectionChanged();
} }
repaintOldAndNewSelection(oldSelection); repaintOldAndNewSelection(oldSelection);