Skip to content

Commit

Permalink
Attribute table: always show sequential column header numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 16, 2016
1 parent 4746158 commit 9f704d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/attributetable/qgsattributetablefiltermodel.cpp
Expand Up @@ -97,8 +97,13 @@ QVariant QgsAttributeTableFilterModel::headerData( int section, Qt::Orientation
}
else
{
int sourceSection = mapToSource( index( section, mColumnMapping.at( 0 ) == -1 ? 1 : 0 ) ).row();
return sourceModel()->headerData( sourceSection, orientation, role );
if ( role == Qt::DisplayRole )
return section + 1;
else
{
int sourceSection = mapToSource( index( section, mColumnMapping.at( 0 ) == -1 ? 1 : 0 ) ).row();
return sourceModel()->headerData( sourceSection, orientation, role );
}
}
}

Expand Down

4 comments on commit 9f704d6

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 9f704d6 Jun 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be row headers of course

@NathanW2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is a good use case to also show the feature id in the attribute table, maybe in the row header in row id (feature id)

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 9f704d6 Jun 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or in the tooltip?

@NathanW2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tooltip is good for now, mainly just so that you can match if you need to for what ever reason.

Please sign in to comment.