added save functions to various classes
Each class is responsible for its own saving and loading from the XML data in order to reduce the complexity of the save code.
This commit is contained in:
@@ -282,3 +282,23 @@ QByteArray NodeParam::ValueToBytesInternal(const QVariant &v)
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
void NodeParam::SaveConnections(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writer->writeStartElement("connections");
|
||||
|
||||
foreach (NodeEdgePtr edge, edges_) {
|
||||
NodeParam* other;
|
||||
|
||||
if (edge->input() == this) {
|
||||
other = edge->output();
|
||||
} else {
|
||||
other = edge->input();
|
||||
}
|
||||
|
||||
writer->writeTextElement("connection",
|
||||
QString::number(reinterpret_cast<quintptr>(other)));
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // connections
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user