| 450 | } |
| 451 | |
| 452 | void 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 | |
| 477 | bool BehaviorTreeDataModel::eventFilter(QObject *obj, QEvent *event) |
| 478 | { |
no outgoing calls
no test coverage detected