summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-05-18 15:35:14 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-05-18 15:40:41 (GMT)
commit2102c0eae57881560a5ddd4d3224167730a06d11 (patch)
treea035ed2d223fa47fd16df2e270b4e2b156e2e90f
parent58298a5a7316e40fc73054b82a451cd013e237ae (diff)
downloadQt-2102c0eae57881560a5ddd4d3224167730a06d11.zip
Qt-2102c0eae57881560a5ddd4d3224167730a06d11.tar.gz
Qt-2102c0eae57881560a5ddd4d3224167730a06d11.tar.bz2
Make sure cursorPositionChanged is emitted when doing undo/redo
Done-by: mae Reviewed-by: Thorbjørn Lindeijer
-rw-r--r--src/gui/text/qtextcontrol.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index a2ee659..3d34687 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -747,7 +747,11 @@ void QTextControl::undo()
{
Q_D(QTextControl);
d->repaintSelection();
+ const int oldCursorPos = d->cursor.position();
d->doc->undo(&d->cursor);
+ if (d->cursor.position() != oldCursorPos)
+ emit cursorPositionChanged();
+ emit microFocusChanged();
ensureCursorVisible();
}
@@ -755,7 +759,11 @@ void QTextControl::redo()
{
Q_D(QTextControl);
d->repaintSelection();
+ const int oldCursorPos = d->cursor.position();
d->doc->redo(&d->cursor);
+ if (d->cursor.position() != oldCursorPos)
+ emit cursorPositionChanged();
+ emit microFocusChanged();
ensureCursorVisible();
}