🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiNewObjectDialog.hpp
浏览该文件的文档.
1
21
22#pragma once
23
24#include "AstGlobal.h"
25#include <QDialog>
26#include <QListWidget>
27#include <QLineEdit>
28#include <QLabel>
29#include <QPushButton>
30#include <vector>
31#include <string>
32
33AST_NAMESPACE_BEGIN
34
35class Class;
36
40class AST_GUI_API UiNewObjectDialog : public QDialog
41{
42 Q_OBJECT
43
44public:
45 explicit UiNewObjectDialog(QWidget* parent = nullptr);
46 ~UiNewObjectDialog() override;
47
49 QString selectedTypeName() const;
50
52 QString objectName() const;
53
54private:
55 void setupUi();
56 void populateTypeList(const QString& filter = QString());
57 void updateDescription();
58 QString generateUniqueName(const QString& typeName) const;
59
60 struct ClassInfo
61 {
62 std::string name;
63 std::string desc;
64 Class* cls;
65 };
66
67 std::vector<ClassInfo> allClasses_;
68 mutable QString generatedName_;
69
70 QLineEdit* searchEdit_ = nullptr;
71 QListWidget* typeList_ = nullptr;
72 QLabel* descLabel_ = nullptr;
73 QPushButton* okButton_ = nullptr;
74 QPushButton* cancelButton_ = nullptr;
75};
76
77AST_NAMESPACE_END
类元信息
定义 Class.hpp:40
新建对象对话框
定义 UiNewObjectDialog.hpp:41