change implement of blend sub node
This commit is contained in:
parent
dca581d641
commit
710f680240
@ -26,8 +26,14 @@ void DoricFlexNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
}
|
||||
|
||||
void DoricFlexNode::blendSubNode(DoricViewNode *subNode,
|
||||
QJsonValue flexConfig) {}
|
||||
QJsonValue flexConfig) {
|
||||
qDebug() << "blendSubNode";
|
||||
}
|
||||
|
||||
void DoricFlexNode::blendYoga(YGLayout *yoga, QJsonValue flexConfig) {}
|
||||
void DoricFlexNode::blendYoga(YGLayout *yoga, QJsonValue flexConfig) {
|
||||
qDebug() << "blendYoga";
|
||||
}
|
||||
|
||||
void DoricFlexNode::blendYoga(YGLayout *yoga, QString name, QJsonValue prop) {}
|
||||
void DoricFlexNode::blendYoga(YGLayout *yoga, QString name, QJsonValue prop) {
|
||||
qDebug() << "blendYoga";
|
||||
}
|
||||
|
@ -16,8 +16,6 @@ protected:
|
||||
|
||||
virtual void blendSubNode(QJsonValue subProperties) = 0;
|
||||
|
||||
virtual void blendSubNode(DoricViewNode *subNode, QJsonValue layoutConfig);
|
||||
|
||||
void recursiveMixin(QJsonValue src, QJsonValue target);
|
||||
|
||||
public:
|
||||
@ -31,6 +29,8 @@ public:
|
||||
|
||||
virtual DoricViewNode *getSubNodeById(QString id) = 0;
|
||||
|
||||
virtual void blendSubNode(DoricViewNode *subNode, QJsonValue layoutConfig);
|
||||
|
||||
private:
|
||||
void mixinSubNode(QJsonValue subNode);
|
||||
|
||||
|
@ -88,7 +88,11 @@ QQuickItem *DoricViewNode::getNodeView() { return mView; }
|
||||
void DoricViewNode::blend(QJsonValue jsValue) {
|
||||
QJsonValue value = jsValue["layoutConfig"];
|
||||
if (value.isObject()) {
|
||||
setLayoutConfig(value);
|
||||
if (mSuperNode != nullptr) {
|
||||
mSuperNode->blendSubNode(this, value);
|
||||
} else {
|
||||
setLayoutConfig(value);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const QString &key, jsValue.toObject().keys()) {
|
||||
|
Reference in New Issue
Block a user