Skip to content

Commit

Permalink
Do not overwrite values in attribute form while SearchMode
Browse files Browse the repository at this point in the history
Because it can be in SearchMode during editing state, a change of selection in the feature list would overwrite the values of the selected one by the one selected before. This because the widget-values were not resetet for the current feature and are saved.

The saving is not avoided, because on edit, and switching to SearchMode and changing selection, the old feature still have to be saved. But it does reset the values of the current widget in SearchMode after changing selection - even if it's not visible by the user - to avoid to have wrong values there.

fixes ##17751
  • Loading branch information
signedav authored and nyalldawson committed Oct 26, 2018
1 parent 6526dd0 commit b150554
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/qgsattributeform.cpp
Expand Up @@ -268,9 +268,13 @@ void QgsAttributeForm::setFeature( const QgsFeature &feature )
}
break;
}
case QgsAttributeEditorContext::MultiEditMode:
case QgsAttributeEditorContext::SearchMode:
case QgsAttributeEditorContext::AggregateSearchMode:
{
resetValues();
break;
}
case QgsAttributeEditorContext::MultiEditMode:
{
//ignore setFeature
break;
Expand Down

0 comments on commit b150554

Please sign in to comment.