diff --git a/sources/ElementsCollection/fileelementcollectionitem.cpp b/sources/ElementsCollection/fileelementcollectionitem.cpp index 15274722c..b14e86088 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.cpp +++ b/sources/ElementsCollection/fileelementcollectionitem.cpp @@ -327,6 +327,26 @@ void FileElementCollectionItem::setUpData() { search_list.append(context.value(key).toString()); } search_list.append(localName(loc)); setData(search_list.join(" ")); + + // Tooltip: show what a truncated tree label can't - the full + // localized name and the descriptive element information. + // Reuses the location/context already parsed for the search + // index above; the collection path stays as the last line + // (it used to be the whole tooltip). + QStringList tip; + tip << localName(loc); + for (const auto &key : { QStringLiteral("description"), + QStringLiteral("manufacturer"), + QStringLiteral("manufacturer_reference") }) + { + const QString value = context.value(key).toString(); + if (!value.isEmpty()) + tip << value; + } + tip << collectionPath(); + tip.removeDuplicates(); + setToolTip(tip.join(QLatin1Char('\n'))); + return; } }