| 393 | } |
| 394 | |
| 395 | QJsonObject BehaviorTreeDataModel::save() const |
| 396 | { |
| 397 | QJsonObject modelJson; |
| 398 | modelJson["name"] = registrationName(); |
| 399 | modelJson["alias"] = instanceName(); |
| 400 | |
| 401 | for (const auto& it: _ports_widgets) |
| 402 | { |
| 403 | if( auto linedit = dynamic_cast<QLineEdit*>(it.second)){ |
| 404 | modelJson[it.first] = linedit->text(); |
| 405 | } |
| 406 | else if( auto combo = dynamic_cast<QComboBox*>(it.second)){ |
| 407 | modelJson[it.first] = combo->currentText(); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | return modelJson; |
| 412 | } |
| 413 | |
| 414 | void BehaviorTreeDataModel::restore(const QJsonObject &modelJson) |
| 415 | { |
nothing calls this directly
no outgoing calls
no test coverage detected