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

Method insertNodeInConnection

bt_editor/graphic_container.cpp:546–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546void GraphicContainer::insertNodeInConnection(Connection &connection, QString node_name)
547{
548 {
549 const QSignalBlocker blocker(this);
550
551 auto parent_node = connection.getNode(PortType::Out);
552 auto child_node = connection.getNode(PortType::In);
553
554 QPointF pos = child_node->nodeGraphicsObject().pos();
555 pos.setX( pos.x() - 50 );
556
557 QtNodes::Node& inserted_node = _scene->createNodeAtPos( node_name, node_name, pos );
558
559 _scene->deleteConnection(connection);
560 _scene->createConnection(*child_node, 0, inserted_node, 0);
561 _scene->createConnection(inserted_node, 0, *parent_node, 0);
562 nodeReorder();
563 }
564 undoableChange();
565}
566
567void GraphicContainer::onConnectionContextMenu(QtNodes::Connection &connection, const QPointF&)
568{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected