MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / SubtreeNodeModel

Method SubtreeNodeModel

bt_editor/models/SubtreeNodeModel.cpp:5–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <QVBoxLayout>
4
5SubtreeNodeModel::SubtreeNodeModel(const NodeModel &model):
6 BehaviorTreeDataModel ( model ),
7 _expanded(false)
8{
9 _line_edit_name->setReadOnly(true);
10 _line_edit_name->setHidden(true);
11
12 _expand_button = new QPushButton( _expanded ? "Collapse" : "Expand", _main_widget );
13 _expand_button->setMaximumWidth(100);
14 _main_layout->addWidget(_expand_button);
15 _main_layout->setAlignment(_expand_button, Qt::AlignHCenter);
16
17 _expand_button->setStyleSheet(
18 "QPushButton{"
19 " color: black; background-color: white; "
20 " border: 0px rgb(115, 210, 22);"
21 " padding: 4px; border-radius: 3px;}\n"
22 "QPushButton:disabled { color: #303030; background-color: #a0a0a0; }");
23 _expand_button->setFlat(false);
24 _expand_button->setFocusPolicy(Qt::NoFocus);
25 _expand_button->adjustSize();
26
27 connect( _expand_button, &QPushButton::clicked,
28 this, [this]()
29 {
30 emit expandButtonPushed() ;
31 });
32
33 updateNodeSize();
34}
35
36void SubtreeNodeModel::setExpanded(bool expand)
37{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected