72 lines
2.1 KiB
C++
72 lines
2.1 KiB
C++
#ifndef DIAGRAMEDITORTRANSDETAILADDDLG_H
|
|
#define DIAGRAMEDITORTRANSDETAILADDDLG_H
|
|
|
|
#include <QDialog>
|
|
#include <QStandardItemModel>
|
|
#include "common/core_model/diagram.h"
|
|
//#include "global.h"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class diagramEditorTransDetailAddDlg; }
|
|
QT_END_NAMESPACE
|
|
|
|
class DiagramEditorTransDetailSettingDlg;
|
|
class QComboBox;
|
|
class TitleBar;
|
|
class QSizeGrip;
|
|
|
|
class DiagramEditorTransDetailAddDlg : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
enum Column
|
|
{
|
|
Col_Category = 0,
|
|
Col_Name,
|
|
Col_Type,
|
|
Col_BindObj,
|
|
Col_Route,
|
|
Col_Count
|
|
};
|
|
|
|
DiagramEditorTransDetailAddDlg(QWidget *parent = nullptr);
|
|
~DiagramEditorTransDetailAddDlg();
|
|
|
|
void initial();
|
|
void showDlg(int n);
|
|
void showDlg(DiagramEditorRouteInfo info); //编辑
|
|
void setParent(DiagramEditorTransDetailSettingDlg* p) {_pParent = p;}
|
|
private:
|
|
void updateBindLst(); //刷新关联列表
|
|
void loadFromModelRow(int row); //加载数据到界面
|
|
void setComboByData(QComboBox *combo, int data);
|
|
void setBindObjCombo(QComboBox *combo,int bindType,const QString &bindParent);
|
|
|
|
void syncSelectedModel(const QString &deviceName); //同步设置到当前线路
|
|
public slots:
|
|
void onAddClicked();
|
|
void onDeleteClicked();
|
|
void onSaveClicked();
|
|
void onOkClicked();
|
|
void onCancelClicked();
|
|
void onCategoryChanged(const QString&);
|
|
|
|
void onComponentDeleteClicked();
|
|
void onComponentRbtnClicked(const QPoint &pos);
|
|
void onRouteDeleteClicked();
|
|
void onRouteRbtnClicked(const QPoint &pos); //线路右键菜单
|
|
protected:
|
|
void resizeEvent(QResizeEvent *);
|
|
private:
|
|
Ui::diagramEditorTransDetailAddDlg *ui;
|
|
QStandardItemModel* _selectedModel;
|
|
DiagramEditorTransDetailSettingDlg* _pParent;
|
|
int _curMode; //0新建1修改
|
|
int _curType; //当前回路类型 0高压中性点1中2低
|
|
QStandardItemModel* _bindItemModel; //绑定的对象模型
|
|
TitleBar* m_titleBar;
|
|
QSizeGrip* _pSizeGrip;
|
|
};
|
|
|
|
#endif
|