change qml component to quick item
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include "DoricRootNode.h"
|
||||
|
||||
void DoricRootNode::setRootView() {}
|
||||
void DoricRootNode::setRootView(QQuickItem *rootView) {
|
||||
this->mView = rootView;
|
||||
}
|
||||
|
@@ -1,13 +1,15 @@
|
||||
#ifndef ROOTNODE_H
|
||||
#define ROOTNODE_H
|
||||
|
||||
#include <QQuickItem>
|
||||
|
||||
#include "DoricStackNode.h"
|
||||
|
||||
class DoricRootNode : public DoricStackNode {
|
||||
public:
|
||||
using DoricStackNode::DoricStackNode;
|
||||
|
||||
void setRootView();
|
||||
void setRootView(QQuickItem *rootView);
|
||||
};
|
||||
|
||||
#endif // ROOTNODE_H
|
||||
|
@@ -1,14 +1,13 @@
|
||||
#include "DoricStackNode.h"
|
||||
|
||||
QQmlComponent *DoricStackNode::build() {
|
||||
QQmlComponent *component = new QQmlComponent();
|
||||
QQuickItem *DoricStackNode::build() {
|
||||
QQmlComponent component;
|
||||
|
||||
const QUrl url(QStringLiteral("qrc:/stack.qml"));
|
||||
component->loadUrl(url);
|
||||
component.loadUrl(url);
|
||||
|
||||
return component;
|
||||
QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
|
||||
return item;
|
||||
}
|
||||
|
||||
void DoricStackNode::blendLayoutConfig() {
|
||||
DoricViewNode::blendLayoutConfig();
|
||||
}
|
||||
void DoricStackNode::blendLayoutConfig() { DoricViewNode::blendLayoutConfig(); }
|
||||
|
@@ -8,7 +8,7 @@ class DoricStackNode : public DoricGroupNode
|
||||
public:
|
||||
using DoricGroupNode::DoricGroupNode;
|
||||
|
||||
QQmlComponent *build() override;
|
||||
QQuickItem *build() override;
|
||||
|
||||
void blendLayoutConfig() override;
|
||||
};
|
||||
|
@@ -1,16 +1,16 @@
|
||||
#ifndef DORICVIEWNODE_H
|
||||
#define DORICVIEWNODE_H
|
||||
|
||||
#include <QQmlComponent>
|
||||
#include <QQuickItem>
|
||||
|
||||
#include "../utils/DoricContextHolder.h"
|
||||
|
||||
class DoricViewNode : public DoricContextHolder {
|
||||
|
||||
protected:
|
||||
QQmlComponent mView;
|
||||
QQuickItem *mView;
|
||||
|
||||
virtual QQmlComponent *build() = 0;
|
||||
virtual QQuickItem *build() = 0;
|
||||
|
||||
virtual void blendLayoutConfig();
|
||||
|
||||
|
Reference in New Issue
Block a user