diff --git a/doric-Qt/doric/doric.pro.user b/doric-Qt/doric/doric.pro.user index c9c04c3a..c3506cae 100644 --- a/doric-Qt/doric/doric.pro.user +++ b/doric-Qt/doric/doric.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/doric-Qt/doric/plugin/DoricShaderPlugin.cpp b/doric-Qt/doric/plugin/DoricShaderPlugin.cpp index 36c8446e..721390e0 100644 --- a/doric-Qt/doric/plugin/DoricShaderPlugin.cpp +++ b/doric-Qt/doric/plugin/DoricShaderPlugin.cpp @@ -6,18 +6,22 @@ void DoricShaderPlugin::render(QJSValue jsValue, QString callbackId) { getContext()->getDriver()->asyncCall( [this, jsValue] { - QString viewId = jsValue.property("id").toString(); - DoricRootNode *rootNode = getContext()->getRootNode(); + try { + QString viewId = jsValue.property("id").toString(); + DoricRootNode *rootNode = getContext()->getRootNode(); - if (rootNode->getId().isEmpty() && - jsValue.property("type").toString() == "Root") { - rootNode->setId(viewId); - rootNode->blend(jsValue.property("props")); - } else { - DoricViewNode *viewNode = getContext()->targetViewNode(viewId); - if (viewNode != nullptr) { - viewNode->blend(jsValue.property("props")); + if (rootNode->getId().isEmpty() && + jsValue.property("type").toString() == "Root") { + rootNode->setId(viewId); + rootNode->blend(jsValue.property("props")); + } else { + DoricViewNode *viewNode = getContext()->targetViewNode(viewId); + if (viewNode != nullptr) { + viewNode->blend(jsValue.property("props")); + } } + } catch (...) { + qCritical() << "render exception"; } }, DoricThreadMode::UI); diff --git a/doric-Qt/doric/resources/hlayout.qml b/doric-Qt/doric/resources/hlayout.qml index 59566fdd..0cba8a5e 100644 --- a/doric-Qt/doric/resources/hlayout.qml +++ b/doric-Qt/doric/resources/hlayout.qml @@ -1,9 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.5 -Rectangle { - Row { - - } +Row { } diff --git a/doric-Qt/doric/resources/stack.qml b/doric-Qt/doric/resources/stack.qml index b370ff44..72a01878 100644 --- a/doric-Qt/doric/resources/stack.qml +++ b/doric-Qt/doric/resources/stack.qml @@ -2,7 +2,4 @@ import QtQuick 2.12 import QtQuick.Controls 2.5 Rectangle { - StackView { - - } } diff --git a/doric-Qt/doric/resources/view.qml b/doric-Qt/doric/resources/view.qml index b370ff44..72a01878 100644 --- a/doric-Qt/doric/resources/view.qml +++ b/doric-Qt/doric/resources/view.qml @@ -2,7 +2,4 @@ import QtQuick 2.12 import QtQuick.Controls 2.5 Rectangle { - StackView { - - } } diff --git a/doric-Qt/doric/resources/vlayout.qml b/doric-Qt/doric/resources/vlayout.qml index d96fd31f..88d34cc9 100644 --- a/doric-Qt/doric/resources/vlayout.qml +++ b/doric-Qt/doric/resources/vlayout.qml @@ -1,9 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.5 -Rectangle { - Column { - - } +Column { } diff --git a/doric-Qt/doric/shader/DoricViewNode.cpp b/doric-Qt/doric/shader/DoricViewNode.cpp index 034fce91..8ce5803d 100644 --- a/doric-Qt/doric/shader/DoricViewNode.cpp +++ b/doric-Qt/doric/shader/DoricViewNode.cpp @@ -47,5 +47,13 @@ void DoricViewNode::blend(QQuickItem *view, QString name, QJSValue prop) { } else if (name == "backgroundColor") { QString color = DoricUtils::doricColor(prop.toNumber()).name(); view->setProperty("color", color); + } else if (name == "x") { + view->setProperty("x", prop.toInt()); + } else if (name == "y") { + view->setProperty("y", prop.toInt()); + } else if (name == "space") { + view->setProperty("spacing", prop.toInt()); + } else { + qCritical() << name << ": " << prop.toString(); } }