Skip to content
Snippets Groups Projects
Commit ccaa56e3 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

VectorProperty: use Tag namespace for serialization

parent f1f578b2
No related branches found
No related tags found
1 merge request!1154rm VectorDescriptor
Pipeline #81606 passed
......@@ -17,6 +17,16 @@
#include "GUI/Support/XML/UtilXML.h"
#include <QUuid>
namespace {
namespace Tag {
const QString X("X");
const QString Y("Y");
const QString Z("Z");
} // namespace Tag
} // namespace
using std::variant;
void VectorProperty::init(const QString& label, const QString& tooltip,
......@@ -55,16 +65,16 @@ void VectorProperty::rwProperty(Streamer& s, const QString& tag)
{
if (QXmlStreamWriter* w = s.xmlWriter()) {
w->writeStartElement(tag);
Serialize::rwProperty(s, "X", m_x);
Serialize::rwProperty(s, "Y", m_y);
Serialize::rwProperty(s, "Z", m_z);
Serialize::rwProperty(s, Tag::X, m_x);
Serialize::rwProperty(s, Tag::Y, m_y);
Serialize::rwProperty(s, Tag::Z, m_z);
w->writeEndElement();
} else if (QXmlStreamReader* r = s.xmlReader()) {
r->readNextStartElement();
s.assertCurrentTag(tag);
Serialize::rwProperty(s, "X", m_x);
Serialize::rwProperty(s, "Y", m_y);
Serialize::rwProperty(s, "Z", m_z);
Serialize::rwProperty(s, Tag::X, m_x);
Serialize::rwProperty(s, Tag::Y, m_y);
Serialize::rwProperty(s, Tag::Z, m_z);
s.gotoEndElementOfTag(tag);
} else
ASSERT(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment