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

Method setPortMapping

bt_editor/models/BehaviorTreeNodeModel.cpp:452–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void BehaviorTreeDataModel::setPortMapping(const QString &port_name, const QString &value)
453{
454 auto it = _ports_widgets.find(port_name);
455 if( it != _ports_widgets.end() )
456 {
457 if( auto lineedit = dynamic_cast<QLineEdit*>(it->second) )
458 {
459 lineedit->setText(value);
460 }
461 else if( auto combo = dynamic_cast<QComboBox*>(it->second) )
462 {
463 int index = combo->findText(value);
464 if( index == -1 ){
465 qDebug() << "error, combo value "<< value << " not found";
466 }
467 else{
468 combo->setCurrentIndex(index);
469 }
470 }
471 }
472 else{
473 qDebug() << "error, label "<< port_name << " not found in the model";
474 }
475}
476
477bool BehaviorTreeDataModel::eventFilter(QObject *obj, QEvent *event)
478{

Callers 2

substituteNodeMethod · 0.80
recursiveLoadStepMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected