diff --git a/src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp b/src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp index 12de761611b6..9dc9312e0148 100644 --- a/src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp +++ b/src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp @@ -244,14 +244,22 @@ void QgsValueRelationWidgetWrapper::updateValues( const QVariant &value, const Q } else if ( mLineEdit ) { + mLineEdit->clear(); + bool wasFound { false }; for ( const QgsValueRelationFieldFormatter::ValueRelationItem &i : qgis::as_const( mCache ) ) { if ( i.key == value ) { mLineEdit->setText( i.value ); + wasFound = true; break; } } + // Value could not be found + if ( ! wasFound ) + { + mLineEdit->setText( tr( "(no selection)" ) ); + } } }