35 lines
936 B
C
35 lines
936 B
C
|
|
#ifndef BASEPROPERTYMANAGER_H
|
||
|
|
#define BASEPROPERTYMANAGER_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QMap>
|
||
|
|
#include "export.hpp"
|
||
|
|
/****元件属性数据管理类*****/
|
||
|
|
|
||
|
|
class BaseProperty;
|
||
|
|
|
||
|
|
class DIAGRAM_DESIGNER_PUBLIC BasePropertyManager : public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit BasePropertyManager(QObject *parent = nullptr);
|
||
|
|
~BasePropertyManager();
|
||
|
|
|
||
|
|
static BasePropertyManager& instance();
|
||
|
|
|
||
|
|
//===========================元件实时数据================================
|
||
|
|
void insertEntityData(QUuid,BaseProperty*);
|
||
|
|
BaseProperty* findEntityData(QUuid);
|
||
|
|
void deleteEntityData(QUuid);
|
||
|
|
QMap<QUuid,BaseProperty*> getEntityData() const;
|
||
|
|
signals:
|
||
|
|
void dataCreated(QString uuid);
|
||
|
|
void dataChanged(QString uuid);
|
||
|
|
public slots:
|
||
|
|
void onDataDelete(QString uuid);
|
||
|
|
private:
|
||
|
|
QMap<QUuid,BaseProperty*> m_entityData; //每个实例化元件的唯一数据
|
||
|
|
};
|
||
|
|
#endif // BASEPROPERTYMANAGER_H
|