nodeview: implemented copying/pasting nodes

Re-uses XML-based project saving/loading functions to store nodes, their
parameters, and their connections in a text-based format in the clipboard.
This commit is contained in:
itsmattkc
2020-03-15 20:01:58 +11:00
parent 50061e4e55
commit 34f60e639a
24 changed files with 306 additions and 71 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef XMLREADLOOP_H
#define XMLREADLOOP_H
#include <QXmlStreamReader>
#include "node/node.h"
#define XMLReadLoop(reader, section) \
while (!reader->atEnd() && !(reader->name() == section && reader->isEndElement()) && reader->readNext())
#define XMLAttributeLoop(reader, item) \
QXmlStreamAttributes __attributes = reader->attributes(); \
foreach (const QXmlStreamAttribute& item, __attributes)
Node *XMLLoadNode(QXmlStreamReader* reader);
void XMLConnectNodes(const QHash<quintptr, NodeOutput *> &output_ptrs, const QList<NodeParam::SerializedConnection> &desired_connections);
#endif // XMLREADLOOP_H