Add ability to store informations for element like label, manufacturer, ref etc....

Add widget to edit it, save/load works
Informations are stored in a diagramcontext, this class was modified (new feature) to store information
but keep compatibilty with older version.  


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2850 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-02-12 17:36:35 +00:00
parent 2c8bf84795
commit b361788873
14 changed files with 510 additions and 16 deletions

View File

@@ -24,6 +24,7 @@
#include <QtDebug>
#include <ui/elementpropertieswidget.h>
#include "elementprovider.h"
#include "elementsproperties.h"
/**
Constructeur pour un element sans scene ni parent
@@ -395,6 +396,9 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
//uuid of this element
uuid_= QUuid(e.attribute("uuid", QUuid::createUuid().toString()));
//load informations
informations_.fromXml(e.firstChildElement("informations"), "information");
// position, selection
setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
@@ -473,6 +477,11 @@ QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table
}
element.appendChild(links_uuids);
}
//save information of this element
QDomElement infos = document.createElement("informations");
informations_.toXml(infos, "information");
element.appendChild(infos);
return(element);
}