Skip to content

Commit 9f704d6

Browse files
committed
Attribute table: always show sequential column header numbers
1 parent 4746158 commit 9f704d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/gui/attributetable/qgsattributetablefiltermodel.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,13 @@ QVariant QgsAttributeTableFilterModel::headerData( int section, Qt::Orientation
9797
}
9898
else
9999
{
100-
int sourceSection = mapToSource( index( section, mColumnMapping.at( 0 ) == -1 ? 1 : 0 ) ).row();
101-
return sourceModel()->headerData( sourceSection, orientation, role );
100+
if ( role == Qt::DisplayRole )
101+
return section + 1;
102+
else
103+
{
104+
int sourceSection = mapToSource( index( section, mColumnMapping.at( 0 ) == -1 ? 1 : 0 ) ).row();
105+
return sourceModel()->headerData( sourceSection, orientation, role );
106+
}
102107
}
103108
}
104109

0 commit comments

Comments
 (0)