57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
#ifndef DIAGRAMVIEW_H
|
|
#define DIAGRAMVIEW_H
|
|
|
|
#include <QDialog>
|
|
#include <QStandardItemModel>
|
|
#include "global.h"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class diagramView; }
|
|
QT_END_NAMESPACE
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class DiagramView : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
DiagramView(QWidget *parent = nullptr);
|
|
~DiagramView();
|
|
|
|
void initial();
|
|
void loadTopologyFromDB(); //加载拓扑关系
|
|
signals:
|
|
void diagramCreate(DiagramInfo);
|
|
void diagramChange(DiagramInfo);
|
|
void diagramDelete(DiagramInfo);
|
|
void diagramSelected(DiagramInfo);
|
|
|
|
void createProject();
|
|
void loadProject();
|
|
public slots:
|
|
void onIndexRbtnClicked(const QPoint &pos); //索引列表右键菜单
|
|
void onItemChanged(QStandardItem *item);
|
|
void onItemClicked(const QModelIndex &index);
|
|
|
|
void onEditorRbtnClicked(const QPoint &pos); //editor右键菜单
|
|
void onEditorDBClicked(QTreeWidgetItem* item, int column);
|
|
//**********editor************
|
|
void onNewEditorCreated(const QString&,QUuid);
|
|
void onEditorLoaded(const QString&,QUuid);
|
|
void onEditorSaved(const QString& strPro,const QString& autor,QUuid uid,QString sTime);
|
|
|
|
void onNewEditorClicked();
|
|
void onOpenEditorClicked();
|
|
void onSaveEditorClicked();
|
|
private:
|
|
Ui::diagramView *ui;
|
|
QStandardItemModel* _pModel;
|
|
int _count;
|
|
private:
|
|
QString generateName();
|
|
int getItemLevel(QTreeWidgetItem *item);
|
|
};
|
|
|
|
#endif
|