path: root/src/gui/text/qtextdocument.h
diff options
authorEskil Abrahamsen Blomfeldt <>2016-10-14 15:54:13 +0200
committerEskil Abrahamsen Blomfeldt <>2016-10-17 07:29:10 +0000
commitae6681673eb5c7768070cad61f483d2a5405dc9e (patch)
tree60b47153bc84d8b1f1a61e6667c176a261a1ba61 /src/gui/text/qtextdocument.h
parent9944a12a0f57087ea19ae428ffcd974ac0fed7bc (diff)
Add QTextDocument::toRawText() function
The QTextDocument::toPlainText() converts some characters in the text to ASCII, which can be problematic for use cases where you want to save the precise contents of the document, e.g. in Qt Creator. Since we don't want to change the behavior of toPlainText(), we introduce a new function which returns the raw text contents of the document instead, with no modifications. [ChangeLog][QtGui][Text] Added QTextDocument::toRawText() function. Task-number: QTBUG-56538 Change-Id: Ib6c48a16551c4c71c4c431760f993793d1af6806 Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/gui/text/qtextdocument.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h
index 1888088f0d..c2761a39b9 100644
--- a/src/gui/text/qtextdocument.h
+++ b/src/gui/text/qtextdocument.h
@@ -151,6 +151,7 @@ public:
void setHtml(const QString &html);
+ QString toRawText() const;
QString toPlainText() const;
void setPlainText(const QString &text);