Skip to content

Commit

Permalink
attribute table: fix update of sort column (fixes #10976)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 10, 2015
1 parent d466870 commit 2073c03
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -192,6 +192,10 @@ void QgsAttributeTableModel::layerDeleted()
void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value )
{
QgsDebugMsgLevel( QString( "(%4) fid: %1, idx: %2, value: %3" ).arg( fid ).arg( idx ).arg( value.toString() ).arg( mFeatureRequest.filterType() ), 3 );

if ( idx == mCachedField )
mFieldCache[ fid ] = value;

// No filter request: skip all possibly heavy checks
if ( mFeatureRequest.filterType() == QgsFeatureRequest::FilterNone )
{
Expand All @@ -210,8 +214,6 @@ void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, c
}
else
{
if ( idx == mCachedField )
mFieldCache[ fid ] = value;
// Update representation
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
}
Expand Down Expand Up @@ -522,7 +524,7 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &

if ( mChangedCellBounds.isNull() )
{
mChangedCellBounds = QRect( index.column(), index.row(), 0, 1 );
mChangedCellBounds = QRect( index.column(), index.row(), 1, 1 );
}
else
{
Expand Down

0 comments on commit 2073c03

Please sign in to comment.