mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-28 05:39:58 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user