Skip to content
Permalink
Browse files

[UX] Show feature id in attribute table tooltip

  • Loading branch information
m-kuhn committed Jun 17, 2016
1 parent 4411267 commit 15e9e0a903f0b80ac3555e0beb1ec2f072f9b132
Showing with 15 additions and 2 deletions.
  1. +15 −2 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -517,10 +517,10 @@ QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orient
}
else if ( section >= 0 && section < mFieldCount )
{
QString attributeName = layer()->attributeAlias( mAttributes[section] );
QString attributeName = layer()->attributeAlias( mAttributes.at( section ) );
if ( attributeName.isEmpty() )
{
QgsField field = layer()->fields().at( mAttributes[section] );
QgsField field = layer()->fields().at( mAttributes.at( section ) );
attributeName = field.name();
}
return QVariant( attributeName );
@@ -530,6 +530,19 @@ QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orient
return tr( "extra column" );
}
}
else if ( role == Qt::ToolTipRole )
{
if ( orientation == Qt::Vertical )
{
// TODO show DisplayExpression
return tr( "Feature ID: %1" ).arg( rowToId( section ) );
}
else
{
QgsField field = layer()->fields().at( mAttributes.at( section ) );
return field.name();
}
}
else
{
return QVariant();

0 comments on commit 15e9e0a

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