mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
Move load of kind information from element to custom element, because the kind information
belong to the element definition, so custom element. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2896 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -161,6 +161,9 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) {
|
|||||||
// extrait les noms de la definition XML
|
// extrait les noms de la definition XML
|
||||||
names.fromXml(xml_def_elmt);
|
names.fromXml(xml_def_elmt);
|
||||||
setToolTip(name());
|
setToolTip(name());
|
||||||
|
|
||||||
|
//load kind informations
|
||||||
|
kind_informations_.fromXml(xml_def_elmt.firstChildElement("kindInformations"), "kindInformation");
|
||||||
|
|
||||||
// parcours des enfants de la definition : parties du dessin
|
// parcours des enfants de la definition : parties du dessin
|
||||||
int parsed_elements_count = 0;
|
int parsed_elements_count = 0;
|
||||||
|
|||||||
@@ -398,8 +398,6 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
|||||||
|
|
||||||
//load informations
|
//load informations
|
||||||
element_informations_.fromXml(e.firstChildElement("elementInformations"), "elementInformation");
|
element_informations_.fromXml(e.firstChildElement("elementInformations"), "elementInformation");
|
||||||
//load kind informations
|
|
||||||
kind_informations_.fromXml(e.firstChildElement("kindInformations"), "kindInformation");
|
|
||||||
|
|
||||||
// position, selection
|
// position, selection
|
||||||
setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
|
setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
|
||||||
@@ -487,14 +485,6 @@ QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table
|
|||||||
element.appendChild(infos);
|
element.appendChild(infos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//save kind_informations of this element
|
|
||||||
if (! kind_informations_.keys().isEmpty()) {
|
|
||||||
QDomElement kind_infos = document.createElement("kindInformations");
|
|
||||||
kind_informations_.toXml(kind_infos, "kindInformation");
|
|
||||||
element.appendChild(kind_infos);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return(element);
|
return(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user