72 lines
2.2 KiB
C++
72 lines
2.2 KiB
C++
#ifndef DIAGRAMEDITORBAYDETAILADDDLG_H
|
||
#define DIAGRAMEDITORBAYDETAILADDDLG_H
|
||
|
||
#include <QDialog>
|
||
//#include "global.h"
|
||
#include "common/core_model/diagram.h"
|
||
|
||
QT_BEGIN_NAMESPACE
|
||
namespace Ui { class diagramEditorBayDetailAddDlg; }
|
||
QT_END_NAMESPACE
|
||
|
||
class DiagramEditorBayDetailSettingDlg;
|
||
class QStandardItemModel;
|
||
class QComboBox;
|
||
class TitleBar;
|
||
class QSizeGrip;
|
||
|
||
class DiagramEditorBayDetailAddDlg : public QDialog
|
||
{
|
||
Q_OBJECT
|
||
public:
|
||
enum Column
|
||
{
|
||
Col_Category = 0,
|
||
Col_Name,
|
||
Col_Type,
|
||
Col_BindObj,
|
||
Col_Route,
|
||
Col_Count
|
||
};
|
||
|
||
DiagramEditorBayDetailAddDlg(QWidget *parent = nullptr);
|
||
~DiagramEditorBayDetailAddDlg();
|
||
|
||
void initial();
|
||
void showDlg();
|
||
void showDlg(DiagramEditorRouteInfo info); //编辑
|
||
void setParent(DiagramEditorBayDetailSettingDlg* p) {_pParent = p;}
|
||
private:
|
||
void updateBindLst(); //刷新关联列表
|
||
void loadFromModelRow(int row); //载入行数据到界面
|
||
void setComboBoxByData(QComboBox *combo,int targetData); //按 data 设置 ComboBox 适用于:cb_category cb_type
|
||
void setBindObjComboBox(QComboBox *combo,int bindType,int bindPara,const QString &bindParent); //专用:设置 cb_bindObj(多 UserRole)
|
||
|
||
void syncSelectedModel(const QString &deviceName); //按设备名同步当前线路(todo:其他线路)
|
||
public slots:
|
||
void onAddClicked();
|
||
void onDeleteClicked();
|
||
void onSaveClicked();
|
||
void onOkClicked();
|
||
void onCancelClicked();
|
||
void onCategoryChanged(const QString&);
|
||
|
||
void onComponentDeleteClicked();
|
||
void onComponentRbtnClicked(const QPoint &pos);
|
||
void onComponentSelected(const QModelIndex &index);
|
||
void onRouteDeleteClicked();
|
||
void onRouteRbtnClicked(const QPoint &pos); //线路右键菜单
|
||
protected:
|
||
void resizeEvent(QResizeEvent *);
|
||
private:
|
||
Ui::diagramEditorBayDetailAddDlg *ui;
|
||
QStandardItemModel* _selectedModel;
|
||
DiagramEditorBayDetailSettingDlg* _pParent;
|
||
int _curMode; //0新建1修改
|
||
QStandardItemModel* _bindItemModel; //绑定的对象模型
|
||
TitleBar* m_titleBar;
|
||
QSizeGrip* _pSizeGrip;
|
||
};
|
||
|
||
#endif
|