summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/textdocumenthandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/textdocumenthandler.cpp')
-rw-r--r--framework/src/domain/textdocumenthandler.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/framework/src/domain/textdocumenthandler.cpp b/framework/src/domain/textdocumenthandler.cpp
index 729d39e8..6c2bc323 100644
--- a/framework/src/domain/textdocumenthandler.cpp
+++ b/framework/src/domain/textdocumenthandler.cpp
@@ -32,6 +32,17 @@ TextDocumentHandler::TextDocumentHandler(QObject *parent)
32{ 32{
33} 33}
34 34
35void TextDocumentHandler::resetFormat()
36{
37 //Clear all formatting from the document.
38 auto cursor = textCursor();
39 cursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
40 cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor);
41 cursor.setCharFormat({});
42 mCachedTextFormat = {};
43 reset();
44}
45
35QQuickTextDocument *TextDocumentHandler::document() const 46QQuickTextDocument *TextDocumentHandler::document() const
36{ 47{
37 return mDocument; 48 return mDocument;