0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-01-11 17:18:10 +03:00

Font stylename property is now saved by XmlFontSerializator

This commit is contained in:
Arin Alexander 2016-05-27 00:05:33 +04:00
parent d595d76eb2
commit 9359caaf30

View File

@ -169,28 +169,27 @@ QVariant XmlBoolSerializator::loadValue()
void XmlFontSerializator::save(const QVariant &value, QString name) void XmlFontSerializator::save(const QVariant &value, QString name)
{ {
QFont font = value.value<QFont>(); QFont font = value.value<QFont>();
QDomElement _node = doc()->createElement(name); QDomElement _node = doc()->createElement(name);
_node.setAttribute("Type","QFont"); _node.setAttribute("Type","QFont");
_node.setAttribute("family",font.family()); _node.setAttribute("family",font.family());
_node.setAttribute("pointSize",font.pointSize()); _node.setAttribute("pointSize",font.pointSize());
_node.setAttribute("stylename",font.styleName());
saveBool(_node,"bold",font.bold()); saveBool(_node,"bold",font.bold());
saveBool(_node,"italic",font.italic()); saveBool(_node,"italic",font.italic());
saveBool(_node,"underline",font.underline()); saveBool(_node,"underline",font.underline());
node()->appendChild(_node); node()->appendChild(_node);
} }
QVariant XmlFontSerializator::loadValue() QVariant XmlFontSerializator::loadValue()
{ {
QFont font; QFont font;
font.setFamily(node()->attribute("family")); font.setFamily(node()->attribute("family"));
font.setPointSize(node()->attribute("pointSize").toInt()); font.setPointSize(node()->attribute("pointSize").toInt());
font.setBold(node()->attribute("bold").toInt()); font.setBold(node()->attribute("bold").toInt());
font.setItalic(node()->attribute("italic").toInt()); font.setItalic(node()->attribute("italic").toInt());
font.setUnderline(node()->attribute("underline").toInt()); font.setUnderline(node()->attribute("underline").toInt());
font.setStyleName(node()->attribute("stylename"));
return font; return font;
} }