mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Dynamic text item : load the requested font style name, like: italic,
bold, regular, etc git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5636 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -95,6 +95,7 @@ QDomElement DynamicElementTextItem::toXml(QDomDocument &dom_doc) const
|
||||
root_element.setAttribute("font_size", font().pointSize());
|
||||
root_element.setAttribute("uuid", m_uuid.toString());
|
||||
root_element.setAttribute("font_family", font().family());
|
||||
root_element.setAttribute("dynamicitemstyle", font().styleName());
|
||||
root_element.setAttribute("frame", m_frame? "true" : "false");
|
||||
root_element.setAttribute("text_width", QString::number(m_text_width));
|
||||
|
||||
@@ -163,6 +164,7 @@ void DynamicElementTextItem::fromXml(const QDomElement &dom_elmt)
|
||||
QGraphicsTextItem::setRotation(dom_elmt.attribute("rotation", QString::number(0)).toDouble());
|
||||
QFont font_(dom_elmt.attribute("font_family", font().family()),
|
||||
dom_elmt.attribute("font_size", QString::number(9)).toInt());
|
||||
font_.setStyleName(dom_elmt.attribute("dynamicitemstyle", font().styleName()));
|
||||
setFont(font_);
|
||||
m_uuid = QUuid(dom_elmt.attribute("uuid", QUuid::createUuid().toString()));
|
||||
setFrame(dom_elmt.attribute("frame", "false") == "true"? true : false);
|
||||
|
||||
Reference in New Issue
Block a user