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

Method refreshNodesLayout

bt_editor/mainwindow.cpp:1161–1195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1159
1160
1161void MainWindow::refreshNodesLayout(QtNodes::PortLayout new_layout)
1162{
1163 if( new_layout != _current_layout)
1164 {
1165 QString icon_name = ( new_layout == QtNodes::PortLayout::Horizontal ) ?
1166 ":/icons/BT-horizontal.png" :
1167 ":/icons/BT-vertical.png";
1168 QIcon icon;
1169 icon.addFile(icon_name, QSize(), QIcon::Normal, QIcon::Off);
1170 ui->toolButtonLayout->setIcon(icon);
1171 ui->toolButtonLayout->update();
1172 }
1173
1174 bool refreshed = false;
1175 {
1176 const QSignalBlocker blocker( currentTabInfo() );
1177 for(auto& tab: _tab_info)
1178 {
1179 auto scene = tab.second->scene();
1180 if( scene->layout() != new_layout )
1181 {
1182 auto abstract_tree = BuildTreeFromScene( scene );
1183 scene->setLayout( new_layout );
1184 NodeReorder( *scene, abstract_tree );
1185 refreshed = true;
1186 }
1187 }
1188 on_toolButtonCenterView_pressed();
1189 }
1190 _current_layout = new_layout;
1191 if(refreshed)
1192 {
1193 onPushUndo();
1194 }
1195}
1196
1197void MainWindow::refreshExpandedSubtrees()
1198{

Callers

nothing calls this directly

Calls 5

BuildTreeFromSceneFunction · 0.85
NodeReorderFunction · 0.85
sceneMethod · 0.80
layoutMethod · 0.80
setLayoutMethod · 0.80

Tested by

no test coverage detected