From 75447a8adb0020fe539d0943a78456750d386322 Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Thu, 6 Dec 2018 15:48:45 +0000 Subject: [PATCH] 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 --- sources/qetgraphicsitem/dynamicelementtextitem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/qetgraphicsitem/dynamicelementtextitem.cpp b/sources/qetgraphicsitem/dynamicelementtextitem.cpp index 9a32b1245..96cbb8b4c 100644 --- a/sources/qetgraphicsitem/dynamicelementtextitem.cpp +++ b/sources/qetgraphicsitem/dynamicelementtextitem.cpp @@ -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);