[qet] [3555] Conductor text item : minor bug fix

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


Revision: 3555
Author:   blacksun
Date:     2014-12-14 22:30:58 +0100 (Sun, 14 Dec 2014)
Log Message:
-----------
Conductor text item : minor bug fix

Modified Paths:
--------------
    trunk/sources/diagram.cpp
    trunk/sources/qetgraphicsitem/conductor.cpp

Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp	2014-12-14 18:51:49 UTC (rev 3554)
+++ trunk/sources/diagram.cpp	2014-12-14 21:30:58 UTC (rev 3555)
@@ -624,8 +624,8 @@
 				}
 				if (can_add_conductor) {
 					Conductor *c = new Conductor(table_adr_id.value(id_p1), table_adr_id.value(id_p2));
+					addItem(c);
 					c -> fromXml(f);
-					addItem(c);
 					added_conductors << c;
 				}
 			}
@@ -747,6 +747,7 @@
 		QGraphicsScene::addItem(conductor);
 		conductor -> terminal1 -> addConductor(conductor);
 		conductor -> terminal2 -> addConductor(conductor);
+		conductor -> calculateTextItemPosition();
 	}
 }
 

Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp	2014-12-14 18:51:49 UTC (rev 3554)
+++ trunk/sources/qetgraphicsitem/conductor.cpp	2014-12-14 21:30:58 UTC (rev 3555)
@@ -92,7 +92,6 @@
 	// ajout du champ de texte editable
 	text_item = new ConductorTextItem(properties_.text, this);
 	text_item -> setFlag(QGraphicsItem::ItemStacksBehindParent);
-	calculateTextItemPosition();
 	connect(
 		text_item,
 		SIGNAL(diagramTextChanged(DiagramTextItem *, const QString &, const QString &)),
@@ -1337,8 +1336,11 @@
  * @param p : properties
  */
 void Conductor::setProperties(const ConductorProperties &p) {
-	properties_ = p;
-	readProperties();
+	if (properties_ != p)
+	{
+		properties_ = p;
+		readProperties();
+	}
 }
 
 /**


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