mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
move all static xml functions to qetxml
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user