diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-05-18 15:35:14 (GMT) |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-05-18 15:40:41 (GMT) |
commit | 2102c0eae57881560a5ddd4d3224167730a06d11 (patch) | |
tree | a035ed2d223fa47fd16df2e270b4e2b156e2e90f /src/gui/text/qtextcontrol.cpp | |
parent | 58298a5a7316e40fc73054b82a451cd013e237ae (diff) | |
download | Qt-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
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 8 |
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(); } |