From 6246e142a48dd66a8cba4ac2846276db5da952ed Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sun, 25 Jan 2015 23:36:08 +0100 Subject: [PATCH] Improve QTextDocument::setPlainText/Html doc related to undo stack This patch aims to improve the documentation of setPlainText/setHtml to let the user know that the undo stack is cleared when both these function are called. Change-Id: I079f9f1dd407387941777ebbc7b5a7bc6dc005ec Reviewed-by: Konstantin Ritt Reviewed-by: Sze Howe Koh --- src/gui/text/qtextdocument.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index ea2b794feb..77e0fec80d 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -1171,7 +1171,7 @@ QString QTextDocument::toPlainText() const /*! Replaces the entire contents of the document with the given plain - \a text. + \a text. The undo/redo history is reset when this function is called. \sa setHtml() */ @@ -1189,7 +1189,8 @@ void QTextDocument::setPlainText(const QString &text) /*! Replaces the entire contents of the document with the given - HTML-formatted text in the \a html string. + HTML-formatted text in the \a html string. The undo/redo history + is reset when this function is called. The HTML formatting is respected as much as possible; for example, "bold text" will produce text where the first word has a font