[qet] qet/qet: [5636] Dynamic text item : load the requested font style name, like: italic,

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5636
Author:   scorpio810
Date:     2018-12-06 16:48:45 +0100 (Thu, 06 Dec 2018)
Log Message:
-----------
Dynamic text item :  load the requested font style name, like: italic,
bold, regular, etc

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp

Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp	2018-12-06 15:14:58 UTC (rev 5635)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp	2018-12-06 15:48:45 UTC (rev 5636)
@@ -95,6 +95,7 @@
 	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 @@
 	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);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/