This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/shader/DoricViewNode.cpp
2021-05-20 18:27:45 +08:00

47 lines
1.2 KiB
C++

#include <QJSValueIterator>
#include "../utils/DoricUtils.h"
#include "DoricSuperNode.h"
#include "DoricViewNode.h"
void DoricViewNode::blendLayoutConfig() {}
void DoricViewNode::setLayoutConfig(QJSValue layoutConfig) {}
void DoricViewNode::init(DoricSuperNode *superNode) {
if (DoricUtils:: instanceof <DoricSuperNode *>(this)) {
DoricSuperNode *thiz = dynamic_cast<DoricSuperNode *>(this);
thiz->mReusable = superNode->mReusable;
}
this->mSuperNode = superNode;
this->mView = build();
}
QString DoricViewNode::getId() { return mId; }
void DoricViewNode::setId(QString id) { mId = id; }
void DoricViewNode::blend(QJSValue jsValue) {
QJSValueIterator it(jsValue);
QMap<QString, QJSValue> values;
while (it.hasNext()) {
it.next();
values.insert(it.name(), it.value());
}
auto keys = values.keys();
for (const QString &key : keys) {
qCritical() << key << ": " << values.value(key).toString();
qCritical() << mView;
blend(mView, key, values.value(key));
}
}
void DoricViewNode::blend(QQuickItem *view, QString name, QJSValue prop) {
qCritical() << "view node blend";
if (name == "width") {
} else if (name == "height") {
}
}