🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiAttributeTree.hpp
浏览该文件的文档.
1
19
20#pragma once
21
22#include "AstGlobal.h"
23#include "AstUtil/Object.hpp"
24#include "AstUtil/Attribute.hpp"
25#include <QTreeWidget>
26
27AST_NAMESPACE_BEGIN
28
29class UiAttributeTreeItem;
30
32class AST_GUI_API UiAttributeTree : public QTreeWidget
33{
34 Q_OBJECT
35
36public:
37 explicit UiAttributeTree(QWidget* parent = nullptr);
38
40 void setObject(Object* object);
41
43 Object* object() const;
44
46 void refresh();
47
49 Attribute selectedAttribute() const;
50
51signals:
53 void attributeSelected(const Attribute& attr);
54
55private:
57 void collectProperties(Class* type, std::vector<Property*>& out) const;
58
59 WeakPtr<Object> rootObject_;
60};
61
62AST_NAMESPACE_END
类元信息
定义 Class.hpp:40
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
属性树控件,显示一个 AST 对象的所有反射属性(遍历继承链)
定义 UiAttributeTree.hpp:33
void attributeSelected(const Attribute &attr)
当用户在树中选中属性时发出
弱引用指针
定义 WeakPtr.hpp:35