Skip to content

Commit 744c61c

Browse files
committedJun 3, 2016
[attrtable] Order by the correct column when header is clicked
The column index was messed up when columns have been reordered
1 parent 4a3a814 commit 744c61c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/gui/attributetable/qgsattributetablefiltermodel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ bool QgsAttributeTableFilterModel::lessThan( const QModelIndex &left, const QMod
6363

6464
void QgsAttributeTableFilterModel::sort( int column, Qt::SortOrder order )
6565
{
66-
masterModel()->prefetchColumnData( column );
67-
QSortFilterProxyModel::sort( column, order );
66+
int myColumn = mColumnMapping.at( column );
67+
masterModel()->prefetchColumnData( myColumn );
68+
QSortFilterProxyModel::sort( myColumn, order );
6869
}
6970

7071
QVariant QgsAttributeTableFilterModel::data( const QModelIndex& index, int role ) const

0 commit comments

Comments
 (0)
Please sign in to comment.