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,
|
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(QJsonValue subProperties) = 0;
|
||||||
|
|
||||||
virtual void blendSubNode(DoricViewNode *subNode, QJsonValue layoutConfig);
|
|
||||||
|
|
||||||
void recursiveMixin(QJsonValue src, QJsonValue target);
|
void recursiveMixin(QJsonValue src, QJsonValue target);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -31,6 +29,8 @@ public:
|
|||||||
|
|
||||||
virtual DoricViewNode *getSubNodeById(QString id) = 0;
|
virtual DoricViewNode *getSubNodeById(QString id) = 0;
|
||||||
|
|
||||||
|
virtual void blendSubNode(DoricViewNode *subNode, QJsonValue layoutConfig);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mixinSubNode(QJsonValue subNode);
|
void mixinSubNode(QJsonValue subNode);
|
||||||
|
|
||||||
|
@ -88,7 +88,11 @@ QQuickItem *DoricViewNode::getNodeView() { return mView; }
|
|||||||
void DoricViewNode::blend(QJsonValue jsValue) {
|
void DoricViewNode::blend(QJsonValue jsValue) {
|
||||||
QJsonValue value = jsValue["layoutConfig"];
|
QJsonValue value = jsValue["layoutConfig"];
|
||||||
if (value.isObject()) {
|
if (value.isObject()) {
|
||||||
setLayoutConfig(value);
|
if (mSuperNode != nullptr) {
|
||||||
|
mSuperNode->blendSubNode(this, value);
|
||||||
|
} else {
|
||||||
|
setLayoutConfig(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QString &key, jsValue.toObject().keys()) {
|
foreach (const QString &key, jsValue.toObject().keys()) {
|
||||||
|
Reference in New Issue
Block a user