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/example/doric/DoricPanel.cpp
2021-05-20 18:27:45 +08:00

24 lines
650 B
C++

#include "DoricPanel.h"
#include "shader/DoricRootNode.h"
DoricPanel::DoricPanel(QQmlEngine *qmlEngine, QQuickItem *quickItem) {
mQmlEngine = qmlEngine;
mQuickItem = quickItem;
}
DoricPanel::~DoricPanel() {
delete mContext;
}
void DoricPanel::config(QString script, QString alias, QString extra) {
DoricContext *context = DoricContext::create(script, alias, extra);
config(context);
}
void DoricPanel::config(DoricContext *context) {
this->mContext = context;
this->mContext->setQmlEngine(mQmlEngine);
this->mContext->getRootNode()->setRootView(mQuickItem);
this->mContext->build(mQuickItem->width(), mQuickItem->height());
}