Skip to content

Commit 2073c03

Browse files
committed
attribute table: fix update of sort column (fixes #10976)
1 parent d466870 commit 2073c03

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/gui/attributetable/qgsattributetablemodel.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ void QgsAttributeTableModel::layerDeleted()
192192
void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value )
193193
{
194194
QgsDebugMsgLevel( QString( "(%4) fid: %1, idx: %2, value: %3" ).arg( fid ).arg( idx ).arg( value.toString() ).arg( mFeatureRequest.filterType() ), 3 );
195+
196+
if ( idx == mCachedField )
197+
mFieldCache[ fid ] = value;
198+
195199
// No filter request: skip all possibly heavy checks
196200
if ( mFeatureRequest.filterType() == QgsFeatureRequest::FilterNone )
197201
{
@@ -210,8 +214,6 @@ void QgsAttributeTableModel::attributeValueChanged( QgsFeatureId fid, int idx, c
210214
}
211215
else
212216
{
213-
if ( idx == mCachedField )
214-
mFieldCache[ fid ] = value;
215217
// Update representation
216218
setData( index( idToRow( fid ), fieldCol( idx ) ), value, Qt::EditRole );
217219
}
@@ -522,7 +524,7 @@ bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &
522524

523525
if ( mChangedCellBounds.isNull() )
524526
{
525-
mChangedCellBounds = QRect( index.column(), index.row(), 0, 1 );
527+
mChangedCellBounds = QRect( index.column(), index.row(), 1, 1 );
526528
}
527529
else
528530
{

0 commit comments

Comments
 (0)