[qet] qet/qet: [5603] Dynamic text item : load the good font from xml.

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


Revision: 5603
Author:   blacksun
Date:     2018-11-24 22:12:27 +0100 (Sat, 24 Nov 2018)
Log Message:
-----------
Dynamic text item : load the good font from xml.
Laurent, you can now sleep well :) 

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

Modified: trunk/sources/qetgraphicsitem/diagramtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/diagramtextitem.cpp	2018-11-24 12:56:15 UTC (rev 5602)
+++ trunk/sources/qetgraphicsitem/diagramtextitem.cpp	2018-11-24 21:12:27 UTC (rev 5603)
@@ -153,7 +153,9 @@
 void DiagramTextItem::setFontSize(int s)
 {
 	prepareAlignment();
-    setFont(QETApp::diagramTextsFont(s));
+	QFont font_ = font();
+	font_.setPointSize(s);
+    setFont(font_);
 	finishAlignment();
 	emit fontSizeChanged(s);
 }

Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp	2018-11-24 12:56:15 UTC (rev 5602)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp	2018-11-24 21:12:27 UTC (rev 5603)
@@ -161,7 +161,9 @@
 	}
 	
 	QGraphicsTextItem::setRotation(dom_elmt.attribute("rotation", QString::number(0)).toDouble());
-	setFont(QETApp::diagramTextsFont(dom_elmt.attribute("font_size", QString::number(9)).toInt()));
+	QFont font_(dom_elmt.attribute("dynamicitemfont", font().family()),
+				dom_elmt.attribute("font_size", QString::number(9)).toInt());
+	setFont(font_);
 	m_uuid = QUuid(dom_elmt.attribute("uuid", QUuid::createUuid().toString()));
 	setFrame(dom_elmt.attribute("frame", "false") == "true"? true : false);
 	setTextWidth(dom_elmt.attribute("text_width", QString::number(-1)).toDouble());


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