Skip to content
Permalink
Browse files

Fix crash when disabling defined sort order in attribute table

  • Loading branch information
uclaros authored and nyalldawson committed Jun 15, 2020
1 parent 300fc9e commit 05f43592111ce95e2569a815fab795cc61170ef8
@@ -78,10 +78,16 @@ void QgsAttributeTableFilterModel::sort( int column, Qt::SortOrder order )
{
if ( order != Qt::AscendingOrder && order != Qt::DescendingOrder )
order = Qt::AscendingOrder;

int myColumn = mColumnMapping.at( column );
masterModel()->prefetchColumnData( myColumn );
QSortFilterProxyModel::sort( myColumn, order );
if ( column < 0 || column >= mColumnMapping.size() )
{
sort( QString() );
}
else
{
int myColumn = mColumnMapping.at( column );
masterModel()->prefetchColumnData( myColumn );
QSortFilterProxyModel::sort( myColumn, order );
}
emit sortColumnChanged( column, order );
}

@@ -108,6 +108,8 @@ void QgsAttributeTableView::setAttributeTableConfig( const QgsAttributeTableConf
i++;
}
mConfig = config;
if ( config.sortExpression().isEmpty() )
horizontalHeader()->setSortIndicatorShown( false );
}

QList<QgsFeatureId> QgsAttributeTableView::selectedFeaturesIds() const

0 comments on commit 05f4359

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