@@ -199,31 +199,39 @@ void QgsAttributeTableModel::layerDeleted()
199
199
void QgsAttributeTableModel::attributeValueChanged ( QgsFeatureId fid, int idx, const QVariant &value )
200
200
{
201
201
QgsDebugMsgLevel ( QString ( " (%4) fid: %1, idx: %2, value: %3" ).arg ( fid ).arg ( idx ).arg ( value.toString () ).arg ( mFeatureRequest .filterType () ), 3 );
202
- if ( loadFeatureAtId ( fid ) )
202
+ // No filter request: skip all possibly heavy checks
203
+ if ( mFeatureRequest .filterType () == QgsFeatureRequest::FilterNone )
203
204
{
204
- if ( mFeatureRequest .acceptFeature ( mFeat ) )
205
+ setData ( index ( idToRow ( fid ), fieldCol ( idx ) ), value, Qt::EditRole );
206
+ }
207
+ else
208
+ {
209
+ if ( loadFeatureAtId ( fid ) )
205
210
{
206
- if ( ! mIdRowMap . contains ( fid ) )
211
+ if ( mFeatureRequest . acceptFeature ( mFeat ) )
207
212
{
208
- // Feature changed in such a way, it will be shown now
209
- featureAdded ( fid );
213
+ if ( !mIdRowMap .contains ( fid ) )
214
+ {
215
+ // Feature changed in such a way, it will be shown now
216
+ featureAdded ( fid );
217
+ }
218
+ else
219
+ {
220
+ if ( idx == mCachedField )
221
+ mFieldCache [ fid ] = value;
222
+ // Update representation
223
+ setData ( index ( idToRow ( fid ), fieldCol ( idx ) ), value, Qt::EditRole );
224
+ }
210
225
}
211
226
else
212
227
{
213
- if ( idx == mCachedField )
214
- mFieldCache [ fid ] = value;
215
- // Update representation
216
- setData ( index ( idToRow ( fid ), fieldCol ( idx ) ), value, Qt::EditRole );
217
- }
218
- }
219
- else
220
- {
221
- if ( mIdRowMap .contains ( fid ) )
222
- {
223
- // Feature changed such, that it is no longer shown
224
- featureDeleted ( fid );
228
+ if ( mIdRowMap .contains ( fid ) )
229
+ {
230
+ // Feature changed such, that it is no longer shown
231
+ featureDeleted ( fid );
232
+ }
233
+ // else: we don't care
225
234
}
226
- // else: we don't care
227
235
}
228
236
}
229
237
}
0 commit comments