add node hierarchy
This commit is contained in:
parent
b406460a8d
commit
915814fc2a
@ -31,7 +31,10 @@ SOURCES += \
|
|||||||
engine/DoricTimerExtension.cpp \
|
engine/DoricTimerExtension.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
plugin/DoricShaderPlugin.cpp \
|
plugin/DoricShaderPlugin.cpp \
|
||||||
|
shader/DoricGroupNode.cpp \
|
||||||
shader/DoricRootNode.cpp \
|
shader/DoricRootNode.cpp \
|
||||||
|
shader/DoricStackNode.cpp \
|
||||||
|
shader/DoricSuperNode.cpp \
|
||||||
shader/DoricViewNode.cpp \
|
shader/DoricViewNode.cpp \
|
||||||
utils/DoricConstant.cpp \
|
utils/DoricConstant.cpp \
|
||||||
utils/DoricContextHolder.cpp
|
utils/DoricContextHolder.cpp
|
||||||
@ -71,7 +74,10 @@ HEADERS += \
|
|||||||
engine/DoricTimerExtension.h \
|
engine/DoricTimerExtension.h \
|
||||||
plugin/DoricNativePlugin.h \
|
plugin/DoricNativePlugin.h \
|
||||||
plugin/DoricShaderPlugin.h \
|
plugin/DoricShaderPlugin.h \
|
||||||
|
shader/DoricGroupNode.h \
|
||||||
shader/DoricRootNode.h \
|
shader/DoricRootNode.h \
|
||||||
|
shader/DoricStackNode.h \
|
||||||
|
shader/DoricSuperNode.h \
|
||||||
shader/DoricViewNode.h \
|
shader/DoricViewNode.h \
|
||||||
template/DoricSingleton.h \
|
template/DoricSingleton.h \
|
||||||
utils/DoricConstant.h \
|
utils/DoricConstant.h \
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>main.qml</file>
|
<file>main.qml</file>
|
||||||
<file>qtquickcontrols2.conf</file>
|
<file>qtquickcontrols2.conf</file>
|
||||||
<file>view.qml</file>
|
<file>stack.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/doric">
|
<qresource prefix="/doric">
|
||||||
<file alias="doric-sandbox.js">../../doric-js/bundle/doric-sandbox.js</file>
|
<file alias="doric-sandbox.js">../../doric-js/bundle/doric-sandbox.js</file>
|
||||||
|
1
doric-Qt/doric/shader/DoricGroupNode.cpp
Normal file
1
doric-Qt/doric/shader/DoricGroupNode.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "DoricGroupNode.h"
|
11
doric-Qt/doric/shader/DoricGroupNode.h
Normal file
11
doric-Qt/doric/shader/DoricGroupNode.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef DORICGROUPNODE_H
|
||||||
|
#define DORICGROUPNODE_H
|
||||||
|
|
||||||
|
#include "DoricSuperNode.h"
|
||||||
|
|
||||||
|
class DoricGroupNode : public DoricSuperNode {
|
||||||
|
public:
|
||||||
|
using DoricSuperNode::DoricSuperNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DORICGROUPNODE_H
|
14
doric-Qt/doric/shader/DoricStackNode.cpp
Normal file
14
doric-Qt/doric/shader/DoricStackNode.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "DoricStackNode.h"
|
||||||
|
|
||||||
|
QQmlComponent *DoricStackNode::build() {
|
||||||
|
QQmlComponent *component = new QQmlComponent();
|
||||||
|
|
||||||
|
const QUrl url(QStringLiteral("qrc:/stack.qml"));
|
||||||
|
component->loadUrl(url);
|
||||||
|
|
||||||
|
return component;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoricStackNode::blendLayoutConfig() {
|
||||||
|
DoricViewNode::blendLayoutConfig();
|
||||||
|
}
|
16
doric-Qt/doric/shader/DoricStackNode.h
Normal file
16
doric-Qt/doric/shader/DoricStackNode.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef DORICSTACKNODE_H
|
||||||
|
#define DORICSTACKNODE_H
|
||||||
|
|
||||||
|
#include "DoricGroupNode.h"
|
||||||
|
|
||||||
|
class DoricStackNode : public DoricGroupNode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using DoricGroupNode::DoricGroupNode;
|
||||||
|
|
||||||
|
QQmlComponent *build() override;
|
||||||
|
|
||||||
|
void blendLayoutConfig() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DORICSTACKNODE_H
|
1
doric-Qt/doric/shader/DoricSuperNode.cpp
Normal file
1
doric-Qt/doric/shader/DoricSuperNode.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "DoricSuperNode.h"
|
14
doric-Qt/doric/shader/DoricSuperNode.h
Normal file
14
doric-Qt/doric/shader/DoricSuperNode.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef DORICSUPERNODE_H
|
||||||
|
#define DORICSUPERNODE_H
|
||||||
|
|
||||||
|
#include "DoricViewNode.h"
|
||||||
|
|
||||||
|
class DoricSuperNode : public DoricViewNode {
|
||||||
|
protected:
|
||||||
|
void blendSubLayoutConfig(DoricViewNode *viewNode);
|
||||||
|
|
||||||
|
public:
|
||||||
|
using DoricViewNode::DoricViewNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DORICSUPERNODE_H
|
@ -1 +1,5 @@
|
|||||||
#include "DoricViewNode.h"
|
#include "DoricViewNode.h"
|
||||||
|
|
||||||
|
void DoricViewNode::blendLayoutConfig(){
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1,9 +1,23 @@
|
|||||||
#ifndef DORICVIEWNODE_H
|
#ifndef DORICVIEWNODE_H
|
||||||
#define DORICVIEWNODE_H
|
#define DORICVIEWNODE_H
|
||||||
|
|
||||||
|
#include <QQmlComponent>
|
||||||
|
|
||||||
#include "../utils/DoricContextHolder.h"
|
#include "../utils/DoricContextHolder.h"
|
||||||
|
|
||||||
class DoricViewNode : public DoricContextHolder {
|
class DoricViewNode : public DoricContextHolder {
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QQmlComponent mView;
|
||||||
|
|
||||||
|
virtual QQmlComponent *build() = 0;
|
||||||
|
|
||||||
|
virtual void blendLayoutConfig();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString mId;
|
||||||
|
QString mType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using DoricContextHolder::DoricContextHolder;
|
using DoricContextHolder::DoricContextHolder;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
import QtQuick.Controls 2.5
|
import QtQuick.Controls 2.5
|
||||||
|
|
||||||
Rectangle {
|
StackView {
|
||||||
color: 'red'
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user