DiagramDesigner/include/selectorDialog.h

38 lines
840 B
C++

#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;
}
modelType selectedMeta() const {
return m_selectedMeta;
}
private:
QListView* m_listView;
QString m_selectedComponent;
modelType m_selectedMeta;
QDialogButtonBox* m_buttonBox;
SelectorDialogType m_dlgType;
void setupUI();
void setupConnections();
QStandardItemModel * initialModel();
private:
QList<modelType> getMetaList() const;
};
#endif //SELECTORDIALOG_H