refactor doric panel; add blend method

This commit is contained in:
王劲鹏
2021-02-19 19:01:31 +08:00
committed by osborn
parent 7ced952a57
commit ea0b87df24
11 changed files with 81 additions and 28 deletions

View File

@@ -21,23 +21,18 @@ void DoricDemoBridge::navigate(QVariant route) {
view->setHeight(800);
}
DoricPanel *panel = new DoricPanel();
panel->setParentItem(view->rootObject());
panel->setWidth(450);
panel->setHeight(800);
panel->config(script, name, NULL);
{
QQmlComponent component(view->engine());
const QUrl url(QStringLiteral("qrc:/doric/qml/panel.qml"));
component.loadUrl(url);
QQuickItem *quickItem = qobject_cast<QQuickItem *>(component.create());
DoricPanel *panel = new DoricPanel(quickItem);
quickItem->setWidth(450);
quickItem->setHeight(800);
quickItem->setParentItem(view->rootObject());
QQmlEngine *engine = view->engine();
QQmlComponent component(engine);
const QUrl empty(QStringLiteral("qrc:/doric/qml/panel.qml"));
component.loadUrl(empty);
QQuickItem *childItem = qobject_cast<QQuickItem *>(component.create());
if (childItem == nullptr) {
qCritical() << component.errorString();
return;
panel->config(script, name, NULL);
}
childItem->setParentItem(view->rootObject());
view->show();
break;