Independent text can have custom font.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5766 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-03-08 13:47:33 +00:00
parent c9ebb78639
commit a58cecc22a
4 changed files with 91 additions and 15 deletions

View File

@@ -52,6 +52,12 @@ void IndependentTextItem::fromXml(const QDomElement &e) {
setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble());
setHtml(e.attribute("text"));
setRotation(e.attribute("rotation").toDouble());
if (e.hasAttribute("font"))
{
QFont font;
font.fromString(e.attribute("font"));
setFont(font);
}
}
/**
@@ -65,6 +71,7 @@ QDomElement IndependentTextItem::toXml(QDomDocument &document) const
result.setAttribute("y", QString("%1").arg(pos().y()));
result.setAttribute("text", toHtml());
result.setAttribute("rotation", QString::number(QET::correctAngle(rotation())));
result.setAttribute("font", font().toString());
return(result);
}