move all static xml functions to qetxml

This commit is contained in:
Martin Marmsoler
2021-03-06 20:01:31 +01:00
parent ea793125a5
commit 058824f29a
23 changed files with 725 additions and 675 deletions

View File

@@ -21,6 +21,8 @@
#include "../diagramcommands.h"
#include "../qetgraphicsitem/conductor.h"
#include "../qetxml.h"
/**
Constructeur
@param parent_conductor Conducteur auquel ce texte est rattache
@@ -64,11 +66,11 @@ Conductor *ConductorTextItem::parentConductor() const
void ConductorTextItem::toXml(QDomElement& e) {
if(moved_by_user_)
{
e.appendChild(PropertiesInterface::createXmlProperty("userx", pos().x()));
e.appendChild(PropertiesInterface::createXmlProperty("usery", pos().y()));
e.appendChild(QETXML::createXmlProperty("userx", pos().x()));
e.appendChild(QETXML::createXmlProperty("usery", pos().y()));
}
if(rotate_by_user_)
e.appendChild(PropertiesInterface::createXmlProperty("rotation", rotation()));
e.appendChild(QETXML::createXmlProperty("rotation", rotation()));
}
@@ -80,14 +82,14 @@ void ConductorTextItem::toXml(QDomElement& e) {
void ConductorTextItem::fromXml(const QDomElement &e) {
double userx=0, usery=0;
if (PropertiesInterface::propertyDouble(e, "userx", &userx) == PropertiesInterface::PropertyFlags::Success &&
PropertiesInterface::propertyDouble(e, "usery", &usery) == PropertiesInterface::PropertyFlags::Success) {
if (QETXML::propertyDouble(e, "userx", &userx) == QETXML::PropertyFlags::Success &&
QETXML::propertyDouble(e, "usery", &usery) == QETXML::PropertyFlags::Success) {
setPos(userx, usery);
moved_by_user_ = true;
}
double rotation;
if (PropertiesInterface::propertyDouble(e, "rotation", &rotation) == PropertiesInterface::PropertyFlags::Success) {
if (QETXML::propertyDouble(e, "rotation", &rotation) == QETXML::PropertyFlags::Success) {
setRotation(rotation);
rotate_by_user_ = true;
}