| 565 | } |
| 566 | |
| 567 | void GraphicContainer::onConnectionContextMenu(QtNodes::Connection &connection, const QPointF&) |
| 568 | { |
| 569 | QMenu* conn_menu = new QMenu(_view); |
| 570 | |
| 571 | auto categories = {"Control", "Decorator"}; |
| 572 | |
| 573 | for(auto category: categories) |
| 574 | { |
| 575 | QMenu* submenu = conn_menu->addMenu(QString("Insert ") + category + QString("Node") ); |
| 576 | auto model_names = _model_registry->registeredModelsByCategory( category ); |
| 577 | |
| 578 | if( model_names.empty() ) |
| 579 | { |
| 580 | submenu->setEnabled(false); |
| 581 | } |
| 582 | else{ |
| 583 | for(auto& name: model_names) |
| 584 | { |
| 585 | auto action = new QAction(name, submenu); |
| 586 | submenu->addAction(action); |
| 587 | connect( action, &QAction::triggered, |
| 588 | this, [this, &connection, name] |
| 589 | { |
| 590 | this->insertNodeInConnection( connection, name); |
| 591 | }); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | conn_menu->exec( QCursor::pos() ); |
| 597 | } |
| 598 | |
| 599 | void GraphicContainer::recursiveLoadStep(QPointF& cursor, |
| 600 | AbsBehaviorTree& tree, |
nothing calls this directly
no test coverage detected