diff --git a/sources/genericpanel.cpp b/sources/genericpanel.cpp index 3f5306f90..a0b473cf8 100644 --- a/sources/genericpanel.cpp +++ b/sources/genericpanel.cpp @@ -984,6 +984,15 @@ QList 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); }