DiagramDesigner/include/selectorDialog.h

38 lines
840 B
C
Raw Normal View History

2025-04-17 16:51:20 +08:00
#ifndef SELECTORDIALOG_H
#define SELECTORDIALOG_H
#include <QDialog>
#include <QStandardItemModel>
#include <QListView>
#include <QDialogButtonBox>
#include "global.h"
// 自定义元件选择对话框
class SelectorDialog : public QDialog {
public:
SelectorDialog(QWidget* parent = nullptr);
void initial(SelectorDialogType tpe);
QString selectedComponent() const {
return m_selectedComponent;
}
2025-05-23 10:30:52 +08:00
modelType selectedMeta() const {
return m_selectedMeta;
}
2025-04-17 16:51:20 +08:00
private:
QListView* m_listView;
QString m_selectedComponent;
2025-05-23 10:30:52 +08:00
modelType m_selectedMeta;
2025-04-17 16:51:20 +08:00
QDialogButtonBox* m_buttonBox;
SelectorDialogType m_dlgType;
void setupUI();
void setupConnections();
QStandardItemModel * initialModel();
private:
2025-05-23 10:30:52 +08:00
QList<modelType> getMetaList() const;
2025-04-17 16:51:20 +08:00
};
#endif //SELECTORDIALOG_H