Elements panel now avoid marking freshly integrated elements as unused.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1713 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-04-29 20:29:37 +00:00
parent 339d5e0f43
commit 7990889d99

View File

@@ -984,6 +984,15 @@ QList<ElementsLocation> GenericPanel::elementIntegrated(QETProject *project, con
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);
}