[qet] [1713] Elements panel now avoid marking freshly integrated elements as unused.

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


Revision: 1713
Author:   xavier
Date:     2012-04-29 22:29:37 +0200 (Sun, 29 Apr 2012)
Log Message:
-----------
Elements panel now avoid marking freshly integrated elements as unused.

Modified Paths:
--------------
    branches/0.3/sources/genericpanel.cpp

Modified: branches/0.3/sources/genericpanel.cpp
===================================================================
--- branches/0.3/sources/genericpanel.cpp	2012-04-29 20:28:12 UTC (rev 1712)
+++ branches/0.3/sources/genericpanel.cpp	2012-04-29 20:29:37 UTC (rev 1713)
@@ -984,6 +984,15 @@
 	if (added_locations.count()) {
 		refreshElementsCategory(loc);
 	}
+	
+	// Since we have refreshed the panel before the element is actually used by
+	// the diagram, it will appear as unused; we force it as unused.
+	// FIXME a better solution would be to get warned when an element gets used
+	// or unused.
+	if (QTreeWidgetItem *integrated_element_qtwi = itemForElementsLocation(location)) {
+		integrated_element_qtwi -> setToolTip(0, location.toString());
+		integrated_element_qtwi -> setBackground(0, QBrush());
+	}
 	return(added_locations);
 }
 


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