56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
#ifndef DIAGRAMVIEW_H
|
||
#define DIAGRAMVIEW_H
|
||
|
||
#include <QDialog>
|
||
#include <QStandardItemModel>
|
||
#include "common/core_model/diagram.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();
|
||
signals:
|
||
void diagramCreate(DiagramInfo);
|
||
void diagramChange(DiagramInfo);
|
||
void diagramDelete(DiagramInfo);
|
||
void diagramSelected(DiagramInfo);
|
||
|
||
void prepareCreateHMI();
|
||
public slots:
|
||
void onIndexRbtnClicked(const QPoint &pos); //索引列表右键菜单
|
||
void onItemChanged(QStandardItem *item);
|
||
void onItemClicked(const QModelIndex &index);
|
||
|
||
void onNewHMICreated(const QString&,QUuid); //图名,图id
|
||
void onHMIUpdated(const QString&,QUuid,int,QString); //*,*,状态(0未保存1已保存),保存时间
|
||
void onHMISaved(const QString& strPro,const QString& autor,QUuid uid,QString sTime);
|
||
|
||
void onNewHMIClicked();
|
||
void onSaveHMIClicked();
|
||
private:
|
||
void updateState(QStandardItem*,int); //更新状态item
|
||
void updateSaveTime(QStandardItem*,QString); //更新时间item
|
||
private:
|
||
Ui::diagramView *ui;
|
||
QStandardItemModel* _pModel;
|
||
int _count;
|
||
|
||
QIcon m_iconUnsaved;
|
||
QIcon m_iconSaved;
|
||
private:
|
||
QString generateName();
|
||
};
|
||
|
||
#endif
|