add strikethrough & underline

This commit is contained in:
王劲鹏 2021-05-25 14:44:42 +08:00 committed by osborn
parent ec9dfe9e58
commit a5522660a7
2 changed files with 16 additions and 0 deletions

View File

@ -125,4 +125,16 @@ TextArea {
} }
textFormat: TextEdit.AutoText textFormat: TextEdit.AutoText
property var strikethrough: false
onStrikethroughChanged: {
font.strikeout = strikethrough
}
property var underline: false
onUnderlineChanged: {
font.underline = underline
}
} }

View File

@ -65,6 +65,10 @@ void DoricTextNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
DoricLayouts *layout = DoricLayouts *layout =
(DoricLayouts *)(mView->property("doricLayout").toULongLong()); (DoricLayouts *)(mView->property("doricLayout").toULongLong());
layout->setMaxHeight(prop.toDouble()); layout->setMaxHeight(prop.toDouble());
} else if (name == "strikethrough") {
view->setProperty("strikethrough", prop.toBool());
} else if (name == "underline") {
view->setProperty("underline", prop.toBool());
} else { } else {
DoricViewNode::blend(view, name, prop); DoricViewNode::blend(view, name, prop);
} }