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

44 lines
1.1 KiB
C++
Raw Normal View History

2021-02-19 19:01:31 +08:00
#include <QJSValueIterator>
#include "../utils/DoricUtils.h"
#include "DoricSuperNode.h"
2021-02-19 19:01:31 +08:00
#include "DoricViewNode.h"
2021-02-09 15:54:22 +08:00
void DoricViewNode::blendLayoutConfig() {}
2021-02-09 15:54:22 +08:00
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();
2021-02-09 15:54:22 +08:00
}
QString DoricViewNode::getId() { return mId; }
void DoricViewNode::setId(QString id) { mId = id; }
QString DoricViewNode::getType() { return mType; }
QQuickItem *DoricViewNode::getNodeView() { return mView; }
2021-02-19 19:01:31 +08:00
void DoricViewNode::blend(QJSValue jsValue) {
QJSValueIterator it(jsValue);
while (it.hasNext()) {
it.next();
blend(mView, it.name(), it.value());
2021-02-19 19:01:31 +08:00
}
}
void DoricViewNode::blend(QQuickItem *view, QString name, QJSValue prop) {
if (name == "width") {
view->setWidth(100);
2021-02-19 19:01:31 +08:00
} else if (name == "height") {
view->setHeight(100);
} else if (name == "backgroundColor") {
2021-02-19 19:01:31 +08:00
}
}