2025-03-04 09:44:03 +08:00
|
|
|
#ifndef PROJECTMODELDLG_H
|
|
|
|
|
#define PROJECTMODELDLG_H
|
|
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
|
#include <QItemSelection>
|
2025-04-17 16:51:20 +08:00
|
|
|
#include <QTableWidgetItem>
|
|
|
|
|
#include "tools.h"
|
|
|
|
|
#include "global.h"
|
2025-03-04 09:44:03 +08:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui { class projectModelDlg; }
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class projectModelDlg : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
projectModelDlg(QWidget *parent = nullptr);
|
|
|
|
|
~projectModelDlg();
|
|
|
|
|
|
|
|
|
|
void initial();
|
|
|
|
|
void initialModel();
|
|
|
|
|
void initialList();
|
2025-04-17 16:51:20 +08:00
|
|
|
//void update();
|
2025-03-04 09:44:03 +08:00
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void onSaveClicked();
|
|
|
|
|
void onCancelClicked();
|
|
|
|
|
void onApplyClicked();
|
|
|
|
|
void onRevokeClicked();
|
2025-03-07 19:24:19 +08:00
|
|
|
void onIndexRbtnClicked(const QPoint &pos); //索引列表右键菜单
|
|
|
|
|
void onDeleteProjectClicked(); //删除选中工程模
|
2025-04-17 16:51:20 +08:00
|
|
|
|
|
|
|
|
void addPropertyGroup(); //添加tableWidget中的工程模
|
|
|
|
|
void onTableItemClicked(QTableWidgetItem *item); //模型item点击事件
|
|
|
|
|
void onDelegateFinishEdit(const QModelIndex &index, const QString &value); //lineEdit代理编辑完成事件
|
2025-03-04 09:44:03 +08:00
|
|
|
public:
|
2025-03-14 17:18:25 +08:00
|
|
|
QString getProjectName() const; //返回当前选择项目的名称
|
|
|
|
|
QString getMetaName() const; //返回当前元模型名
|
2025-06-06 18:57:37 +08:00
|
|
|
|
2025-03-04 09:44:03 +08:00
|
|
|
private:
|
2025-04-17 16:51:20 +08:00
|
|
|
void removeProjectData(const QString&,const QString&,int role); //移除对应的project层级结构
|
|
|
|
|
|
|
|
|
|
void setupUI();
|
|
|
|
|
void initialTypeMap();
|
2025-04-30 16:29:17 +08:00
|
|
|
|
2025-04-17 16:51:20 +08:00
|
|
|
projectState couldSave();
|
|
|
|
|
|
|
|
|
|
void setTableItemState(int row,TableItemState state); //设置状态
|
|
|
|
|
int getModelEditState(); //返回工程模编辑状态(选择、编辑、新建)
|
2025-03-04 09:44:03 +08:00
|
|
|
private:
|
|
|
|
|
Ui::projectModelDlg *ui;
|
|
|
|
|
QString _curMeta; //当前元模型
|
|
|
|
|
QString _curProject; //当前工程模
|
2025-04-17 16:51:20 +08:00
|
|
|
QString _curType; //当前关联类型
|
|
|
|
|
PropertyModel _curModel; //新建的model
|
|
|
|
|
int _curRow; //当前操作行
|
|
|
|
|
|
|
|
|
|
BiDirectionalMap<QString,int> _mapType; //类型名映射表
|
2025-03-04 09:44:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|