From 7dfc7f7929b01be9eaca9bf97f8c032ef214ca36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Fri, 30 Apr 2021 09:47:04 +0800 Subject: [PATCH] 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. --- doric-Qt/example/doric/shader/DoricViewNode.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doric-Qt/example/doric/shader/DoricViewNode.cpp b/doric-Qt/example/doric/shader/DoricViewNode.cpp index 53cb9c83..25239559 100644 --- a/doric-Qt/example/doric/shader/DoricViewNode.cpp +++ b/doric-Qt/example/doric/shader/DoricViewNode.cpp @@ -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") { - view->setProperty("radius", prop.toDouble()); + 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();