diff --git a/doric-Qt/example/doric/resources/text.qml b/doric-Qt/example/doric/resources/text.qml index c147ae1a..cda19a1a 100644 --- a/doric-Qt/example/doric/resources/text.qml +++ b/doric-Qt/example/doric/resources/text.qml @@ -124,7 +124,13 @@ Text { transparentBorder: true } - textFormat: TextEdit.AutoText + property var htmlText: false + + onHtmlTextChanged: { + if (htmlText) { + textFormat = TextEdit.RichText + } + } property var strikethrough: false diff --git a/doric-Qt/example/doric/shader/DoricTextNode.cpp b/doric-Qt/example/doric/shader/DoricTextNode.cpp index 8ae468ee..92d3359b 100644 --- a/doric-Qt/example/doric/shader/DoricTextNode.cpp +++ b/doric-Qt/example/doric/shader/DoricTextNode.cpp @@ -79,6 +79,7 @@ void DoricTextNode::blend(QQuickItem *view, QString name, QJsonValue prop) { view->setProperty("shadowOpacity", prop["opacity"].toDouble()); } else if (name == "htmlText") { view->setProperty("text", prop.toString()); + view->setProperty("htmlText", true); } else if (name == "maxWidth") { DoricLayouts *layout = (DoricLayouts *)(mView->property("doricLayout").toULongLong());