[attrtable] Order by the correct column when header is clicked

The column index was messed up when columns have been reordered
This commit is contained in:
Matthias Kuhn 2016-06-03 15:54:24 +02:00
parent 4a3a814d08
commit 744c61cb19

View File

@ -63,8 +63,9 @@ bool QgsAttributeTableFilterModel::lessThan( const QModelIndex &left, const QMod
void QgsAttributeTableFilterModel::sort( int column, Qt::SortOrder order )
{
masterModel()->prefetchColumnData( column );
QSortFilterProxyModel::sort( column, order );
int myColumn = mColumnMapping.at( column );
masterModel()->prefetchColumnData( myColumn );
QSortFilterProxyModel::sort( myColumn, order );
}
QVariant QgsAttributeTableFilterModel::data( const QModelIndex& index, int role ) const