Skip to content
Permalink
Browse files

Fix sorting by other than first sort role

  • Loading branch information
m-kuhn committed May 15, 2018
1 parent f1770c7 commit 91f32bf66e373e23b7694c4795ab8064fcc4c5ff
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -616,13 +616,13 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
&& role != Qt::DisplayRole
&& role != Qt::ToolTipRole
&& role != Qt::EditRole
&& role != SortRole
&& role != FeatureIdRole
&& role != FieldIndexRole
&& role != Qt::BackgroundColorRole
&& role != Qt::TextColorRole
&& role != Qt::DecorationRole
&& role != Qt::FontRole
&& role < SortRole
)
)
return QVariant();
@@ -897,7 +897,8 @@ void QgsAttributeTableModel::prefetchSortData( const QString &expressionString,
if ( cache.sortFieldIndex == -1 )
{
mExpressionContext.setFeature( f );
cache.sortCache.insert( f.id(), cache.sortCacheExpression.evaluate( &mExpressionContext ) );
const QVariant cacheValue = cache.sortCacheExpression.evaluate( &mExpressionContext );
cache.sortCache.insert( f.id(), cacheValue );
}
else
{

0 comments on commit 91f32bf

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