Merge pull request #63342 from alexbruy/identify-menu-item-names

show layer name in the identify menu if there are overlapping features from the same layer (fix #50049)
This commit is contained in:
Alexander Bruy 2025-09-26 05:19:36 +01:00 committed by GitHub
commit 9609c3fc2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -428,6 +428,11 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer *layer, const QList<QgsMapT
if ( featureTitle.isEmpty() )
featureTitle = QString::number( result.mFeature.id() );
// if results are from the same layer we still add layer name to the feature
// title to be consistent with other cases, see https://github.com/qgis/QGIS/issues/50049
if ( layerMenu == this )
featureTitle = QStringLiteral( "%1 (%2)" ).arg( layer->name(), featureTitle );
if ( customFeatureActions.isEmpty() && ( !featureActionMenu || featureActionMenu->actions().isEmpty() ) )
{
featureAction = new QAction( featureTitle, layerMenu );