[qet] [3561] When unlink an element, make sure this element isn't highlighted

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


Revision: 3561
Author:   blacksun
Date:     2014-12-19 20:18:05 +0100 (Fri, 19 Dec 2014)
Log Message:
-----------
When unlink an element, make sure this element isn't highlighted

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/masterelement.cpp
    trunk/sources/qetgraphicsitem/reportelement.cpp
    trunk/sources/qetgraphicsitem/slaveelement.cpp

Modified: trunk/sources/qetgraphicsitem/masterelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/masterelement.cpp	2014-12-18 10:51:08 UTC (rev 3560)
+++ trunk/sources/qetgraphicsitem/masterelement.cpp	2014-12-19 19:18:05 UTC (rev 3561)
@@ -81,11 +81,14 @@
  * Unlink the given elmt in parametre
  * @param elmt element to unlink from this
  */
-void MasterElement::unlinkElement(Element *elmt) {
-	//Ensure elmt is linked to this element
-	if (connected_elements.contains(elmt)) {
+void MasterElement::unlinkElement(Element *elmt)
+{
+		//Ensure elmt is linked to this element
+	if (connected_elements.contains(elmt))
+	{
 		connected_elements.removeOne(elmt);
-		elmt->unlinkElement(this);
+		elmt -> unlinkElement  (this);
+		elmt -> setHighlighted (false);
 
 		//update the graphics cross ref
 		disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));

Modified: trunk/sources/qetgraphicsitem/reportelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.cpp	2014-12-18 10:51:08 UTC (rev 3560)
+++ trunk/sources/qetgraphicsitem/reportelement.cpp	2014-12-19 19:18:05 UTC (rev 3561)
@@ -88,11 +88,13 @@
  * @brief ReportElement::unLinkAllElements
  * Unlink all of the element in the QList connected_elements
  */
-void ReportElement::unlinkAllElements(){
+void ReportElement::unlinkAllElements()
+{
 	if (!isFree()){
 		QList <Element *> tmp_elmt = connected_elements;
 
-		foreach(Element *elmt, connected_elements) {
+		foreach(Element *elmt, connected_elements)
+		{
 			disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
 			disconnect(elmt, SIGNAL(yChanged()), this, SLOT(updateLabel()));
 			disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
@@ -100,8 +102,10 @@
 		connected_elements.clear();
 		updateLabel();
 
-		foreach(Element *elmt, tmp_elmt){
-			elmt->unlinkAllElements();
+		foreach(Element *elmt, tmp_elmt)
+		{
+			elmt -> setHighlighted(false);
+			elmt -> unlinkAllElements();
 		}
 	}
 }

Modified: trunk/sources/qetgraphicsitem/slaveelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/slaveelement.cpp	2014-12-18 10:51:08 UTC (rev 3560)
+++ trunk/sources/qetgraphicsitem/slaveelement.cpp	2014-12-19 19:18:05 UTC (rev 3561)
@@ -85,9 +85,11 @@
  * Unlink the given elmt in parametre
  * @param elmt
  */
-void SlaveElement::unlinkElement(Element *elmt) {
-	//Ensure elmt is linked to this element
-	if (connected_elements.contains(elmt)) {
+void SlaveElement::unlinkElement(Element *elmt)
+{
+		//Ensure elmt is linked to this element
+	if (connected_elements.contains(elmt))
+	{
 		connected_elements.removeOne(elmt);
 
 		disconnect(elmt,                 SIGNAL(xChanged()),                                       this, SLOT(updateLabel()));
@@ -99,7 +101,8 @@
 		delete Xref_item; Xref_item = NULL;
 
 		updateLabel();
-		elmt -> unlinkElement(this);
+		elmt -> unlinkElement  (this) ;
+		elmt -> setHighlighted (false);
 	}
 }
 


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