refactor doric layouts

This commit is contained in:
王劲鹏 2021-06-03 14:37:18 +08:00 committed by osborn
parent 4377c29951
commit dca581d641
2 changed files with 8 additions and 8 deletions

View File

@ -47,17 +47,17 @@ void DoricViewNode::blendLayoutConfig(QJsonValue jsValue) {
}
void DoricViewNode::createLayouts(QQuickItem *view) {
if (mLayouts == nullptr) {
mLayouts = new DoricLayouts();
mLayouts->setWidth(view->width());
mLayouts->setHeight(view->height());
mLayouts->setView(view);
if (mDoricLayouts == nullptr) {
mDoricLayouts = new DoricLayouts();
mDoricLayouts->setWidth(view->width());
mDoricLayouts->setHeight(view->height());
mDoricLayouts->setView(view);
view->setProperty("doricLayout", QString::number((qint64)mLayouts));
view->setProperty("doricLayout", QString::number((qint64)mDoricLayouts));
}
}
DoricLayouts *DoricViewNode::getLayouts() { return mLayouts; }
DoricLayouts *DoricViewNode::getLayouts() { return mDoricLayouts; }
void DoricViewNode::setLayoutConfig(QJsonValue layoutConfig) {
if (mSuperNode != nullptr) {

View File

@ -17,7 +17,7 @@ class DORIC_EXPORT DoricViewNode : public DoricContextHolder {
protected:
QQuickItem *mView;
DoricLayouts *mLayouts = nullptr;
DoricLayouts *mDoricLayouts = nullptr;
virtual QQuickItem *build() = 0;