From 16bd22b1bce3add1827d6cfa47d2641e5d4c2d71 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Mon, 9 May 2011 13:57:34 +1000 Subject: 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 Reviewed-by: Andrew den Exter --- src/gui/text/qtextcontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 347761a1ee..e1f42a5fb5 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1579,8 +1579,10 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con emit q->cursorPositionChanged(); _q_updateCurrentCharFormatAndSelection(); } else { - if (cursor.position() != oldCursorPos) + if (cursor.position() != oldCursorPos) { emit q->cursorPositionChanged(); + emit q->microFocusChanged(); + } selectionChanged(); } repaintOldAndNewSelection(oldSelection); -- cgit v1.2.3