[qet] [2929] cross ref item: use symbolic contact instead of text NO NC ( No need to translate, understand everywhere)

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


Revision: 2929
Author:   blacksun
Date:     2014-03-17 18:58:04 +0100 (Mon, 17 Mar 2014)
Log Message:
-----------
cross ref item: use symbolic contact instead of text NO NC (No need to translate, understand everywhere)
Element selector widget: add label of element.

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/crossrefitem.cpp
    trunk/sources/ui/elementselectorwidget.cpp

Modified: trunk/sources/qetgraphicsitem/crossrefitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-03-17 13:15:19 UTC (rev 2928)
+++ trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-03-17 17:58:04 UTC (rev 2929)
@@ -63,12 +63,37 @@
 	qp.drawLine(30, 0,  30, boundingRect().height()); //vertical line
 	qp.drawLine(0,	10, boundingRect().width(), 10);  //horizontal line
 
+	//draw the symbolic NO
+	qp.drawLine(2, 5, 10, 5);
+	static const QPointF p1[3] = {
+		QPointF(10, 8),
+		QPointF(18, 5),
+		QPointF(26, 5),
+	};
+	qp.drawPolyline(p1,3);
+
+	//draw the symbolic NC
+	static const QPointF p2[3] = {
+		QPointF(34, 5),
+		QPointF(42, 5),
+		QPointF(42, 0),
+	};
+	qp.drawPolyline(p2,3);
+	static const QPointF p3[3] = {
+		QPointF(40, 0),
+		QPointF(50, 5),
+		QPointF(58, 5),
+	};
+	qp.drawPolyline(p3,3);
+
+	///keep this code for possible next feature
+	///choice to use symbolic or text.
 	//draw the header
-	qp.setFont(QETApp::diagramTextsFont(7));
+	/*qp.setFont(QETApp::diagramTextsFont(7));
 	QRectF header_rect (0,0,30,10);
 	qp.drawText(header_rect, Qt::AlignCenter, "NO");
 	header_rect.setRect(30, 0, 30, 10);
-	qp.drawText(header_rect, Qt::AlignCenter, "NC");
+	qp.drawText(header_rect, Qt::AlignCenter, "NC");*/
 
 	//and fill it
 	fillCrossRef(&qp);

Modified: trunk/sources/ui/elementselectorwidget.cpp
===================================================================
--- trunk/sources/ui/elementselectorwidget.cpp	2014-03-17 13:15:19 UTC (rev 2928)
+++ trunk/sources/ui/elementselectorwidget.cpp	2014-03-17 17:58:04 UTC (rev 2929)
@@ -105,6 +105,12 @@
 	foreach (Element *elmt, elements_list) {
 		//label for the button
 		QString button_text;
+		//if element is master and have label, add label to the string
+		if (elmt->linkType() & Element::Master) {
+			QString label = elmt->elementInformations()["label"].toString();
+			if (!label.isEmpty()) button_text += (label + "   ");
+		}
+
 		QString title = elmt->diagram()->title();
 		if (title.isEmpty()) title = tr("Sans titre");
 		button_text += QString(tr("Folio\240 %1 (%2), position %3.")).arg(elmt->diagram()->folioIndex() + 1)


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