| 319 | } |
| 320 | |
| 321 | void GraphicContainer::onNodeCreated(Node &node) |
| 322 | { |
| 323 | if( auto bt_node = dynamic_cast<BehaviorTreeDataModel*>( node.nodeDataModel() ) ) |
| 324 | { |
| 325 | connect( bt_node, &BehaviorTreeDataModel::parameterUpdated, |
| 326 | this, &GraphicContainer::undoableChange ); |
| 327 | |
| 328 | connect( bt_node, &BehaviorTreeDataModel::portValueDoubleChicked, |
| 329 | this, &GraphicContainer::onPortValueDoubleClicked ); |
| 330 | |
| 331 | connect( bt_node, &BehaviorTreeDataModel::instanceNameChanged, |
| 332 | this, &GraphicContainer::undoableChange ); |
| 333 | |
| 334 | if( auto subtree_node = dynamic_cast<SubtreeNodeModel*>( bt_node ) ) |
| 335 | { |
| 336 | auto main_win = dynamic_cast<MainWindow*>( parent() ); |
| 337 | if( main_win && main_win->getTabByName( bt_node->registrationName() ) == nullptr ) |
| 338 | { |
| 339 | subtree_node->expandButton()->setEnabled(true); |
| 340 | } |
| 341 | connect( subtree_node, &SubtreeNodeModel::expandButtonPushed, |
| 342 | &(node), [&node, this]() |
| 343 | { |
| 344 | emit requestSubTreeExpand( *this, node ); |
| 345 | }); |
| 346 | } |
| 347 | |
| 348 | bt_node->initWidget(); |
| 349 | } |
| 350 | undoableChange(); |
| 351 | } |
| 352 | |
| 353 | void GraphicContainer::onNodeContextMenu(Node &node, const QPointF &) |
| 354 | { |
nothing calls this directly
no test coverage detected