🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiAttributeTreeItem.hpp
浏览该文件的文档.
1
19
20#pragma once
21
22#include "AstGlobal.h"
23#include "AstUtil/Attribute.hpp"
24#include <QTreeWidgetItem>
25#include <string>
26
27AST_NAMESPACE_BEGIN
28
29class Property;
30
33class AST_GUI_API UiAttributeTreeItem : public QTreeWidgetItem
34{
35public:
37
40
44 static QList<QTreeWidgetItem*> CreateTreeItems(Object* object, int maxDepth = 20);
45
47 Attribute& attribute() { return attr_; }
48
50 const Attribute& attribute() const { return attr_; }
51
53 const std::string& propertyName() const { return name_; }
54
56 const std::string& propertyDesc() const { return desc_; }
57
59 void refreshDisplay();
60
63 void buildChildren(int maxDepth = 20);
64
65 UiAttributeTreeItem* clone() const override;
66
67private:
68 Attribute attr_;
69 std::string name_;
70 std::string desc_;
71};
72
73AST_NAMESPACE_END
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
反射属性类
定义 Property.hpp:67
属性树控件项,封装一个 Attribute(对象-属性绑定),显示属性名和当前值
定义 UiAttributeTreeItem.hpp:34
const std::string & propertyName() const
获取缓存的属性名
定义 UiAttributeTreeItem.hpp:53
Attribute & attribute()
获取内部的 Attribute 引用(可读写)
定义 UiAttributeTreeItem.hpp:47
const std::string & propertyDesc() const
获取缓存的属性描述
定义 UiAttributeTreeItem.hpp:56
const Attribute & attribute() const
获取内部的 Attribute 引用(只读)
定义 UiAttributeTreeItem.hpp:50