mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
add methods to save/load autonumerotation of conductor to .qet file
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2171 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -317,6 +317,13 @@ QDomDocument Diagram::toXml(bool whole_content) {
|
||||
QDomElement default_conductor = document.createElement("defaultconductor");
|
||||
defaultConductorProperties.toXml(default_conductor);
|
||||
racine.appendChild(default_conductor);
|
||||
|
||||
//autonumerotation of conductor
|
||||
if (!getNumerotation(Diagram::Conductors).isEmpty()) {
|
||||
QDomElement autonum = document.createElement("autonum");
|
||||
autonum.appendChild(getNumerotation(Diagram::Conductors).toXML(document, "conductor"));
|
||||
racine.appendChild(autonum);
|
||||
}
|
||||
}
|
||||
document.appendChild(racine);
|
||||
|
||||
@@ -460,6 +467,16 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf
|
||||
if (!default_conductor_elmt.isNull()) {
|
||||
defaultConductorProperties.fromXml(default_conductor_elmt);
|
||||
}
|
||||
// find the first element autonum
|
||||
QDomElement num_auto = root.firstChildElement("autonum");
|
||||
if (!num_auto.isNull()) {
|
||||
QDomElement num_conductor = num_auto.firstChildElement("conductor");
|
||||
//set the auto-numerotation of conductor
|
||||
if (!num_conductor.isNull()) {
|
||||
NumerotationContext nc(num_conductor);
|
||||
setNumerotation(Diagram::Conductors, nc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// si la racine n'a pas d'enfant : le chargement est fini (schema vide)
|
||||
|
||||
Reference in New Issue
Block a user