2021-02-09 15:54:22 +08:00
|
|
|
#ifndef DORICSUPERNODE_H
|
|
|
|
#define DORICSUPERNODE_H
|
|
|
|
|
2021-04-02 20:47:15 +08:00
|
|
|
#include <QJsonArray>
|
|
|
|
|
2021-05-18 16:15:28 +08:00
|
|
|
#include "DoricExport.h"
|
|
|
|
|
2021-02-09 15:54:22 +08:00
|
|
|
#include "DoricViewNode.h"
|
|
|
|
|
2021-05-18 16:15:28 +08:00
|
|
|
class DORIC_EXPORT DoricSuperNode : public DoricViewNode {
|
2021-02-20 16:20:18 +08:00
|
|
|
private:
|
2021-04-02 20:47:15 +08:00
|
|
|
QMap<QString, QJsonValue> subNodes;
|
2021-02-19 15:43:09 +08:00
|
|
|
|
2021-02-09 15:54:22 +08:00
|
|
|
protected:
|
2021-04-02 20:47:15 +08:00
|
|
|
virtual void blend(QQuickItem *view, QString name, QJsonValue prop) override;
|
2021-02-19 19:01:31 +08:00
|
|
|
|
2021-04-02 20:47:15 +08:00
|
|
|
virtual void blendSubNode(QJsonValue subProperties) = 0;
|
2021-02-20 16:20:18 +08:00
|
|
|
|
2021-05-07 18:17:07 +08:00
|
|
|
void recursiveMixin(QJsonValue src, QJsonValue target);
|
|
|
|
|
2021-02-09 15:54:22 +08:00
|
|
|
public:
|
|
|
|
using DoricViewNode::DoricViewNode;
|
2021-02-19 15:43:09 +08:00
|
|
|
|
|
|
|
bool mReusable = false;
|
2021-02-20 16:20:18 +08:00
|
|
|
|
2021-04-02 20:47:15 +08:00
|
|
|
QJsonValue getSubModel(QString id);
|
|
|
|
|
|
|
|
void blendSubLayoutConfig(DoricViewNode *viewNode, QJsonValue jsValue);
|
2021-02-20 16:20:18 +08:00
|
|
|
|
2021-05-07 18:17:07 +08:00
|
|
|
virtual DoricViewNode *getSubNodeById(QString id) = 0;
|
|
|
|
|
2021-06-07 16:19:00 +08:00
|
|
|
virtual void blendSubNode(DoricViewNode *subNode, QJsonValue layoutConfig);
|
|
|
|
|
2021-02-20 16:20:18 +08:00
|
|
|
private:
|
2021-04-02 20:47:15 +08:00
|
|
|
void mixinSubNode(QJsonValue subNode);
|
2021-02-20 16:20:18 +08:00
|
|
|
|
2021-04-02 20:47:15 +08:00
|
|
|
void mixin(QJsonValue src, QJsonValue target);
|
2021-05-07 18:17:07 +08:00
|
|
|
|
|
|
|
bool viewIdIsEqual(QJsonValue src, QJsonValue target);
|
2021-02-09 15:54:22 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DORICSUPERNODE_H
|