Element now use the pattern and variable of formula to create the label, both stored in diagram context (instead of the label with a pattern and formula, to create the final label)

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4795 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-12-01 09:09:50 +00:00
parent a495675b71
commit c811b02516
10 changed files with 122 additions and 166 deletions

View File

@@ -694,18 +694,6 @@ 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);
@@ -762,18 +750,19 @@ ElementTextItem *CustomElement::parseInput(QDomElement &e) {
ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this);
eti -> setFont(QETApp::diagramTextsFont(size));
eti -> setTagg(e.attribute("tagg", "other"));
m_element_informations.addValue(e.attribute("tagg", "other"), e.attribute("text"));
// position the text field
// position the text field
eti -> setOriginalPos(QPointF(pos_x, pos_y));
eti -> setPos(pos_x, pos_y);
// rotation of the text field
// rotation of the text field
qreal original_rotation_angle = 0.0;
QET::attributeIsAReal(e, "rotation", &original_rotation_angle);
eti -> setOriginalRotationAngle(original_rotation_angle);
eti -> setRotationAngle(original_rotation_angle);
// behavior when the parent element is rotated
// behavior when the parent element is rotated
eti -> setFollowParentRotations(e.attribute("rotate") == "true");
list_texts_ << eti;