diff options
-rw-r--r-- | src/gui/text/qtextcursor.cpp | 1 | ||||
-rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index 63aa946..daa40a1 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -81,6 +81,7 @@ QTextCursorPrivate::QTextCursorPrivate(const QTextCursorPrivate &rhs) currentCharFormat = rhs.currentCharFormat; visualNavigation = rhs.visualNavigation; keepPositionOnInsert = rhs.keepPositionOnInsert; + changed = rhs.changed; priv->addCursor(this); } diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 54bf36b..7b3f985 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -1229,12 +1229,15 @@ void QTextDocumentPrivate::finishEdit() } } + QList<QTextCursor> changedCursors; foreach (QTextCursorPrivate *curs, cursors) { if (curs->changed) { curs->changed = false; - emit q->cursorPositionChanged(QTextCursor(curs)); + changedCursors.append(QTextCursor(curs)); } } + foreach (const QTextCursor &cursor, changedCursors) + emit q->cursorPositionChanged(cursor); contentsChanged(); |