copy all toXML() from master commit 4b82c3a0c4 into the current branch, because the new concept will be used only for user properties

This commit is contained in:
Martin Marmsoler
2021-03-07 10:09:45 +01:00
parent 058824f29a
commit 5d3710c4b2
26 changed files with 267 additions and 294 deletions

View File

@@ -85,25 +85,25 @@ void PartEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
Export this ellipse in xml
@return : an xml element that describe this ellipse
*/
void PartEllipse::toXmlPriv(QDomElement& e) const
void PartEllipse::toXmlPriv(QDomElement& xml_element) const
{
if (qFuzzyCompare(rect().width(), rect().height()))
{
e.setTagName("circle");
e.appendChild(QETXML::createXmlProperty("diameter", rect().width()));
}
else
{
e.setTagName("ellipse");
e.appendChild(QETXML::createXmlProperty("width", rect().width()));
e.appendChild(QETXML::createXmlProperty("height", rect().height()));
}
if (qFuzzyCompare(rect().width(), rect().height()))
{
xml_element.setTagName("circle");
xml_element.setAttribute("diameter", QString("%1").arg(rect().width()));
}
else
{
xml_element.setTagName("ellipse");
xml_element.setAttribute("width", QString("%1").arg(rect().width()));
xml_element.setAttribute("height", QString("%1").arg(rect().height()));
}
QPointF top_left(sceneTopLeft());
e.appendChild(QETXML::createXmlProperty("x", top_left.x()));
e.appendChild(QETXML::createXmlProperty("y", top_left.y()));
QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
stylesToXml(e);
stylesToXml(xml_element);
}
/**