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

Method save

QtNodeEditor/src/Connection.cpp:85–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84
85QJsonObject
86Connection::
87save() const
88{
89 QJsonObject connectionJson;
90
91 if (_inNode && _outNode)
92 {
93 connectionJson["in_id"] = _inNode->id().toString();
94 connectionJson["in_index"] = _inPortIndex;
95
96 connectionJson["out_id"] = _outNode->id().toString();
97 connectionJson["out_index"] = _outPortIndex;
98
99 if (_converter)
100 {
101 auto getTypeJson = [this](PortType type)
102 {
103 QJsonObject typeJson;
104 NodeDataType nodeType = this->dataType(type);
105 typeJson["id"] = nodeType.id;
106 typeJson["name"] = nodeType.name;
107
108 return typeJson;
109 };
110
111 QJsonObject converterTypeJson;
112
113 converterTypeJson["in"] = getTypeJson(PortType::In);
114 converterTypeJson["out"] = getTypeJson(PortType::Out);
115
116 connectionJson["converter"] = converterTypeJson;
117 }
118 }
119
120 return connectionJson;
121}
122
123
124QUuid

Callers

nothing calls this directly

Calls 1

dataTypeMethod · 0.80

Tested by

no test coverage detected