🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
UiObjectTreeItem.hpp
浏览该文件的文档.
1
19
20
#pragma once
21
22
#include "AstGlobal.h"
23
#include "AstUtil/Object.hpp"
24
#include <QTreeWidget>
25
#include <vector>
26
27
AST_NAMESPACE_BEGIN
28
30
struct
TreeBuildOptions
31
{
32
bool
showComponents =
true
;
33
};
34
35
class
AST_GUI_API
UiObjectTreeItem
:
public
QTreeWidgetItem
36
{
37
public
:
38
UiObjectTreeItem
();
39
40
explicit
UiObjectTreeItem
(
Object
* obj);
41
43
void
buildChildren(
const
TreeBuildOptions
& options = {});
44
46
Object
*
object
()
const
{
return
object_.get(); }
47
48
template
<
typename
T>
49
T getObject()
const
{
return
aobject_cast<T>(
object
()); }
50
51
UiObjectTreeItem* clone()
const override
;
52
54
virtual
QList<UiObjectTreeItem*> createChildItems(
const
TreeBuildOptions& options = {})
const
;
55
private
:
57
void
configure(Object* obj);
58
private
:
59
WeakPtr<Object> object_ =
nullptr
;
60
};
61
62
AST_NAMESPACE_END
ast::Object
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义
Object.hpp:95
ast::UiObjectTreeItem
定义
UiObjectTreeItem.hpp:36
ast::UiObjectTreeItem::object
Object * object() const
获取关联的对象
定义
UiObjectTreeItem.hpp:46
ast::TreeBuildOptions
对象树构建选项
定义
UiObjectTreeItem.hpp:31
src
AstGUI
Foundation
ObjectTree
UiObjectTreeItem.hpp
制作者
1.12.0