33 lines
730 B
C++
33 lines
730 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;
|
|
}
|
|
private:
|
|
QListView* m_listView;
|
|
QString m_selectedComponent;
|
|
QDialogButtonBox* m_buttonBox;
|
|
SelectorDialogType m_dlgType;
|
|
|
|
void setupUI();
|
|
void setupConnections();
|
|
QStandardItemModel * initialModel();
|
|
private:
|
|
QStringList getMetaList() const;
|
|
};
|
|
|
|
#endif //SELECTORDIALOG_H
|