Skip to content
Permalink
Browse files

identify result: show id as feature label if html display string is e…

…nabled (fixes #10410)
  • Loading branch information
jef-n committed Jun 17, 2014
1 parent cdc235f commit a120bb9678147d823440ad7b549063362e603969
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/app/qgsidentifyresultsdialog.cpp
@@ -390,7 +390,6 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
}

//QgsIdentifyResultsFeatureItem *featItem = new QgsIdentifyResultsFeatureItem( fields, f, crs );
QgsIdentifyResultsFeatureItem *featItem = new QgsIdentifyResultsFeatureItem( vlayer->pendingFields(), f, vlayer->crs() );
featItem->setData( 0, Qt::UserRole, FID_TO_STRING( f.id() ) );
featItem->setData( 0, Qt::UserRole + 1, mFeatures.size() );
@@ -399,6 +398,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat

const QgsFields &fields = vlayer->pendingFields();
const QgsAttributes& attrs = f.attributes();
bool featureLabeled = false;
for ( int i = 0; i < attrs.count(); ++i )
{
if ( i >= fields.count() )
@@ -427,11 +427,18 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
{
featItem->setText( 0, attrItem->text( 0 ) );
featItem->setText( 1, attrItem->text( 1 ) );
featureLabeled = true;
}

featItem->addChild( attrItem );
}

if( !featureLabeled )
{
featItem->setText( 0, tr( "feature id" ) );
featItem->setText( 1, QString::number( f.id() ) );
}

if ( derivedAttributes.size() >= 0 )
{
QTreeWidgetItem *derivedItem = new QTreeWidgetItem( QStringList() << tr( "(Derived)" ) );

0 comments on commit a120bb9

Please sign in to comment.
You can’t perform that action at this time.