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

Method save

bt_editor/models/BehaviorTreeNodeModel.cpp:395–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395QJsonObject 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
414void BehaviorTreeDataModel::restore(const QJsonObject &modelJson)
415{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected