qml rectangle not support different radii

Qt Doc: The same radius is used by all 4 corners; there is currently no way to specify different radii for different corners.
This commit is contained in:
王劲鹏 2021-04-30 09:47:04 +08:00 committed by osborn
parent a5e00e4fa5
commit 7dfc7f7929

View File

@ -113,7 +113,14 @@ void DoricViewNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
} else if (name == "y") {
getLayouts()->setMarginTop(prop.toDouble());
} else if (name == "corners") {
if (prop.isDouble()) {
view->setProperty("radius", prop.toDouble());
} else if (prop.isObject()) {
view->setProperty("radiusLeftTop", prop["leftTop"].toDouble());
view->setProperty("radiusRightTop", prop["rightTop"].toDouble());
view->setProperty("radiusLeftBottom", prop["leftBottom"].toDouble());
view->setProperty("radiusRightBottom", prop["rightBottom"].toDouble());
}
} else if (name == "onClick") {
if (prop.isString())
clickFunction = prop.toString();