summaryrefslogtreecommitdiffstats
path: root/framework/qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml')
-rw-r--r--framework/qml/TextEditor.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml
index e5cc665c..7b1c5dee 100644
--- a/framework/qml/TextEditor.qml
+++ b/framework/qml/TextEditor.qml
@@ -34,6 +34,7 @@ FocusScope {
34 34
35 property string initialText 35 property string initialText
36 onInitialTextChanged: { 36 onInitialTextChanged: {
37 htmlEnabled = document.isHtml(initialText)
37 edit.text = initialText 38 edit.text = initialText
38 } 39 }
39 40
@@ -55,7 +56,9 @@ FocusScope {
55 document: edit.textDocument 56 document: edit.textDocument
56 selectionStart: edit.selectionStart 57 selectionStart: edit.selectionStart
57 selectionEnd: edit.selectionEnd 58 selectionEnd: edit.selectionEnd
58 onTextChanged: root.htmlEnabled ? root.text = htmlText : root.text = plainText 59 onTextChanged: {
60 root.htmlEnabled ? root.text = htmlText : root.text = plainText
61 }
59 cursorPosition: edit.cursorPosition 62 cursorPosition: edit.cursorPosition
60 } 63 }
61 64