diff --git a/sources/ElementsCollection/elementscollectionmodel.cpp b/sources/ElementsCollection/elementscollectionmodel.cpp index a55eb523e..ae687da72 100644 --- a/sources/ElementsCollection/elementscollectionmodel.cpp +++ b/sources/ElementsCollection/elementscollectionmodel.cpp @@ -538,6 +538,11 @@ QList ElementsCollectionModel::project() const */ void ElementsCollectionModel::highlightUnusedElement() { + //Reset the background of every item first, so elements that are no + //longer unused lose their previous red highlight (issue #159). + for (ElementCollectionItem *eci : items()) + eci->setBackground(QBrush()); + QList unused; foreach (QETProject *project, m_project_list)