From ed277f30c8a95eadfc4a351b032ded333783e3b5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 6 Oct 2017 09:57:20 +0200 Subject: TextEditor html conversion and testrunner --- framework/qml/TextEditor.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'framework/qml/TextEditor.qml') diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index 570bc322..609b85db 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml @@ -39,6 +39,19 @@ FocusScope { } } + onHtmlEnabledChanged: { + if (htmlEnabled) { + var t = document.htmlText + edit.textFormat = Qt.RichText + edit.text = t + } else { + var t = document.plainText + edit.textFormat = Qt.PlainText + edit.font.bold = false + edit.text = t + } + } + Kube.DocumentHandler { id: document document: edit.textDocument @@ -92,7 +105,6 @@ FocusScope { focus: true selectByMouse: true wrapMode: TextEdit.WordWrap - textFormat: root.htmlEnabled ? Qt.RichText : Qt.PlainText onCursorRectangleChanged: flickableItem.ensureVisible(cursorRectangle) color: Kube.Colors.textColor -- cgit v1.2.3