summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 07aec6f019..61bab2dbfd 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1145,9 +1145,28 @@ void QTextDocument::setMetaInformation(MetaInformation info, const QString &stri
}
/*!
+ Returns the raw text contained in the document without any
+ formatting information. If you want formatting information
+ use a QTextCursor instead.
+
+ \since 5.9
+ \sa toPlainText()
+*/
+QString QTextDocument::toRawText() const
+{
+ Q_D(const QTextDocument);
+ return d->plainText();
+}
+
+/*!
Returns the plain text contained in the document. If you want
formatting information use a QTextCursor instead.
+ This function returns the same as toRawText(), but will replace
+ some unicode characters, such as line separators and non-breaking
+ spaces, with ASCII alternatives. If you need the precise contents
+ of the document, use toRawText() instead.
+
\note Embedded objects, such as images, are represented by a
Unicode value U+FFFC (OBJECT REPLACEMENT CHARACTER).