Skip to content

Commit

Permalink
Merge pull request #36804 from elpaso/bugfix-gh32756-value-map-not-found
Browse files Browse the repository at this point in the history
ValueMap widget: show unmatched items in ()
  • Loading branch information
elpaso committed Jun 2, 2020
2 parents ebc5995 + 1d5a4a5 commit d4a5d9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/editorwidgets/qgsvaluemapwidgetwrapper.cpp
Expand Up @@ -78,5 +78,11 @@ void QgsValueMapWidgetWrapper::updateValues( const QVariant &value, const QVaria
v = value.toString();

if ( mComboBox )
{
if ( mComboBox->findData( v ) == -1 && !( v.startsWith( '(' ) && v.endsWith( ')' ) ) )
{
mComboBox->addItem( v.prepend( '(' ).append( ')' ), v );
}
mComboBox->setCurrentIndex( mComboBox->findData( v ) );
}
}

0 comments on commit d4a5d9c

Please sign in to comment.