Skip to content
Permalink
Browse files

Fix crash when disabling defined sort order in attribute table

  • Loading branch information
github-actions authored and nyalldawson committed Jun 16, 2020
1 parent e0fb3fb commit 29e958033cd4861dce1ac3bc1029ee8504062cf2
@@ -73,10 +73,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 );
}

@@ -107,6 +107,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 29e9580

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