refactor doric panel; add blend method
This commit is contained in:
@@ -1 +1,19 @@
|
||||
#include "DoricGroupNode.h"
|
||||
|
||||
void DoricGroupNode::blend(QQuickItem *view, QString name, QJSValue prop) {
|
||||
if (name == "children") {
|
||||
mChildViewIds.clear();
|
||||
if (prop.isArray()) {
|
||||
qDebug() << prop.toString();
|
||||
}
|
||||
} else {
|
||||
DoricSuperNode::blend(view, name, prop);
|
||||
}
|
||||
}
|
||||
|
||||
void DoricGroupNode::blend(QJSValue jsValue) {
|
||||
DoricViewNode::blend(jsValue);
|
||||
configChildNode();
|
||||
}
|
||||
|
||||
void DoricGroupNode::configChildNode() {}
|
||||
|
@@ -6,6 +6,17 @@
|
||||
class DoricGroupNode : public DoricSuperNode {
|
||||
public:
|
||||
using DoricSuperNode::DoricSuperNode;
|
||||
|
||||
virtual void blend(QQuickItem *view, QString name, QJSValue prop) override;
|
||||
|
||||
virtual void blend(QJSValue jsValue) override;
|
||||
|
||||
protected:
|
||||
QList<DoricViewNode *> mChildNodes;
|
||||
|
||||
QList<QString> mChildViewIds;
|
||||
|
||||
void configChildNode();
|
||||
};
|
||||
|
||||
#endif // DORICGROUPNODE_H
|
||||
|
@@ -1 +1,11 @@
|
||||
#include "DoricSuperNode.h"
|
||||
|
||||
void DoricSuperNode::blend(QQuickItem *view, QString name, QJSValue prop) {
|
||||
if (name == "subviews") {
|
||||
if (prop.isArray()) {
|
||||
qDebug() << prop.toString();
|
||||
}
|
||||
} else {
|
||||
DoricViewNode::blend(view, name, prop);
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,8 @@
|
||||
class DoricSuperNode : public DoricViewNode {
|
||||
|
||||
protected:
|
||||
virtual void blend(QQuickItem *view, QString name, QJSValue prop) override;
|
||||
|
||||
void blendSubLayoutConfig(DoricViewNode *viewNode);
|
||||
|
||||
public:
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "DoricViewNode.h"
|
||||
#include <QJSValueIterator>
|
||||
|
||||
#include "../utils/DoricUtils.h"
|
||||
#include "DoricSuperNode.h"
|
||||
#include "DoricViewNode.h"
|
||||
|
||||
void DoricViewNode::blendLayoutConfig() {}
|
||||
|
||||
@@ -19,4 +21,18 @@ QString DoricViewNode::getId() { return mId; }
|
||||
|
||||
void DoricViewNode::setId(QString id) { mId = id; }
|
||||
|
||||
void DoricViewNode::blend(QJSValue jsValue) { qDebug() << jsValue.toString(); }
|
||||
void DoricViewNode::blend(QJSValue jsValue) {
|
||||
QJSValueIterator it(jsValue);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
qDebug() << it.name() << ": " << it.value().toString();
|
||||
blend(mView, it.name(), it.value());
|
||||
}
|
||||
}
|
||||
|
||||
void DoricViewNode::blend(QQuickItem *view, QString name, QJSValue prop) {
|
||||
if (name == "width") {
|
||||
|
||||
} else if (name == "height") {
|
||||
}
|
||||
}
|
||||
|
@@ -33,6 +33,8 @@ public:
|
||||
|
||||
void setId(QString id);
|
||||
|
||||
void blend(QJSValue jsValue);
|
||||
virtual void blend(QJSValue jsValue);
|
||||
|
||||
virtual void blend(QQuickItem *view, QString name, QJSValue prop);
|
||||
};
|
||||
#endif // DORICVIEWNODE_H
|
||||
|
Reference in New Issue
Block a user