Fix Element Label when opening older QET versions. Fix old user created element label's handling on newer QET versions

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4591 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
dfochi
2016-07-25 19:18:26 +00:00
parent 138505a14e
commit 52e33787a8
3 changed files with 36 additions and 13 deletions

View File

@@ -726,6 +726,18 @@ bool CustomElement::parseText(QDomElement &e, QPainter &qp) {
eti -> setFollowParentRotations(e.attribute("rotate") == "true");
list_texts_ << eti;
if (e.attribute("tagg")=="label") {
DiagramContext &dc = this->rElementInformations();
dc.addValue("label", e.attribute("text"));
this->setElementInformations(dc);
this->setTaggedText("label", e.attribute("text"));
}
else if (e.attribute("tagg")=="function") {
DiagramContext &dc = this->rElementInformations();
dc.addValue("function", e.attribute("text"));
this->setElementInformations(dc);
}
// Se positionne aux coordonnees indiquees dans la description du texte
qp.setTransform(QTransform(), false);
qp.translate(pos_x, pos_y);
@@ -783,18 +795,6 @@ ElementTextItem *CustomElement::parseInput(QDomElement &e) {
eti -> setFont(QETApp::diagramTextsFont(size));
eti -> setTagg(e.attribute("tagg", "other"));
if (e.attribute("tagg")=="label") {
DiagramContext &dc = this->rElementInformations();
dc.addValue("label", e.attribute("text"));
this->setElementInformations(dc);
this->setTaggedText("label", e.attribute("text"));
}
else if (e.attribute("tagg")=="function") {
DiagramContext &dc = this->rElementInformations();
dc.addValue("function", e.attribute("text"));
this->setElementInformations(dc);
}
// position the text field
eti -> setOriginalPos(QPointF(pos_x, pos_y));
eti -> setPos(pos_x, pos_y);