Resolution d'un probleme avec l'export XML de coordonnees decimales : le separateur decimal utilise variait selon la locale utilisee.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@391 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet 2008-08-23 19:27:14 +00:00
parent 3e31df6820
commit a4acad7317
10 changed files with 29 additions and 29 deletions

View File

@ -931,7 +931,7 @@ QDomElement Conductor::toXml(QDomDocument &d, QHash<Terminal *, int> &table_adr_
foreach(ConductorSegment *segment, segmentsList()) {
current_segment = d.createElement("segment");
current_segment.setAttribute("orientation", segment -> isHorizontal() ? "horizontal" : "vertical");
current_segment.setAttribute("length", segment -> length());
current_segment.setAttribute("length", QString("%1").arg(segment -> length()));
e.appendChild(current_segment);
}
}

View File

@ -248,11 +248,11 @@ QDomDocument Diagram::toXml(bool diagram) {
if (!border_and_inset.fileName().isNull()) racine.setAttribute("filename", border_and_inset.fileName());
if (!border_and_inset.folio().isNull()) racine.setAttribute("folio", border_and_inset.folio());
racine.setAttribute("cols", border_and_inset.nbColumns());
racine.setAttribute("colsize", border_and_inset.columnsWidth());
racine.setAttribute("colsize", QString("%1").arg(border_and_inset.columnsWidth()));
racine.setAttribute("rows", border_and_inset.nbRows());
racine.setAttribute("rowsize", border_and_inset.rowsHeight());
racine.setAttribute("rowsize", QString("%1").arg(border_and_inset.rowsHeight()));
// attribut datant de la version 0.1 - laisse pour retrocompatibilite
racine.setAttribute("height", border_and_inset.diagramHeight());
racine.setAttribute("height", QString("%1").arg(border_and_inset.diagramHeight()));
racine.setAttribute("displaycols", border_and_inset.columnsAreDisplayed() ? "true" : "false");
racine.setAttribute("displayrows", border_and_inset.rowsAreDisplayed() ? "true" : "false");

View File

@ -99,8 +99,8 @@ void DiagramTextItem::fromXml(const QDomElement &e) {
*/
QDomElement DiagramTextItem::toXml(QDomDocument &document) const {
QDomElement result = document.createElement("input");
result.setAttribute("x", pos().x());
result.setAttribute("y", pos().y());
result.setAttribute("x", QString("%1").arg(pos().x()));
result.setAttribute("y", QString("%1").arg(pos().y()));
result.setAttribute("text", toPlainText());
return(result);
}

View File

@ -80,12 +80,12 @@ void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget
const QDomElement PartArc::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("arc");
QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", top_left.x());
xml_element.setAttribute("y", top_left.y());
xml_element.setAttribute("width", rect().width());
xml_element.setAttribute("height", rect().height());
xml_element.setAttribute("start", start_angle);
xml_element.setAttribute("angle", _angle);
xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
xml_element.setAttribute("width", QString("%1").arg(rect().width()));
xml_element.setAttribute("height", QString("%1").arg(rect().height()));
xml_element.setAttribute("start", QString("%1").arg(start_angle));
xml_element.setAttribute("angle", QString("%1").arg(_angle));
stylesToXml(xml_element);
return(xml_element);
}

View File

@ -68,9 +68,9 @@ void PartCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWid
const QDomElement PartCircle::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("circle");
QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", top_left.x());
xml_element.setAttribute("y", top_left.y());
xml_element.setAttribute("diameter", rect().width());
xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
xml_element.setAttribute("diameter", QString("%1").arg(rect().width()));
stylesToXml(xml_element);
return(xml_element);
}

View File

@ -68,10 +68,10 @@ void PartEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWi
const QDomElement PartEllipse::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("ellipse");
QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", top_left.x());
xml_element.setAttribute("y", top_left.y());
xml_element.setAttribute("width", rect().width());
xml_element.setAttribute("height", rect().height());
xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
xml_element.setAttribute("y", QString("%1").arg(top_left.y()));
xml_element.setAttribute("width", QString("%1").arg(rect().width()));
xml_element.setAttribute("height", QString("%1").arg(rect().height()));
stylesToXml(xml_element);
return(xml_element);
}

View File

@ -66,10 +66,10 @@ const QDomElement PartLine::toXml(QDomDocument &xml_document) const {
QPointF p2(sceneP2());
QDomElement xml_element = xml_document.createElement("line");
xml_element.setAttribute("x1", p1.x());
xml_element.setAttribute("y1", p1.y());
xml_element.setAttribute("x2", p2.x());
xml_element.setAttribute("y2", p2.y());
xml_element.setAttribute("x1", QString("%1").arg(p1.x()));
xml_element.setAttribute("y1", QString("%1").arg(p1.y()));
xml_element.setAttribute("x2", QString("%1").arg(p2.x()));
xml_element.setAttribute("y2", QString("%1").arg(p2.y()));
stylesToXml(xml_element);
return(xml_element);
}

View File

@ -421,8 +421,8 @@ QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table
element.setAttribute("type", type_elmt);
// position, selection et orientation
element.setAttribute("x", pos().x());
element.setAttribute("y", pos().y());
element.setAttribute("x", QString("%1").arg(pos().x()));
element.setAttribute("y", QString("%1").arg(pos().y()));
element.setAttribute("orientation", QString("%1").arg(ori.current()));
/* recupere le premier id a utiliser pour les bornes de cet element */

View File

@ -98,8 +98,8 @@ void ElementTextItem::fromXml(const QDomElement &e) {
*/
QDomElement ElementTextItem::toXml(QDomDocument &document) const {
QDomElement result = document.createElement("input");
result.setAttribute("x", originalPos().x());
result.setAttribute("y", originalPos().y());
result.setAttribute("x", QString("%1").arg(originalPos().x()));
result.setAttribute("y", QString("%1").arg(originalPos().y()));
result.setAttribute("text", toPlainText());
return(result);
}

View File

@ -428,8 +428,8 @@ QList<Conductor *> Terminal::conductors() const {
*/
QDomElement Terminal::toXml(QDomDocument &doc) const {
QDomElement qdo = doc.createElement("terminal");
qdo.setAttribute("x", amarrage_elmt.x());
qdo.setAttribute("y", amarrage_elmt.y());
qdo.setAttribute("x", QString("%1").arg(amarrage_elmt.x()));
qdo.setAttribute("y", QString("%1").arg(amarrage_elmt.y()));
qdo.setAttribute("orientation", sens);
return(qdo);
}