Skip to content

Commit b448826

Browse files
committed
Fix reading of multi selection ValueRelation widgets
1 parent 59cf9f3 commit b448826

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ void QgsValueRelationWidgetWrapper::setValue( const QVariant &value )
149149
{
150150
if ( mListWidget )
151151
{
152-
QStringList checkList = value.toString().remove( QChar( '{' ) ).remove( QChar( '}' ) ).split( ',' );
152+
QStringList checkList;
153+
if ( value.type() == QVariant::StringList )
154+
checkList = value.toStringList();
155+
else if ( value.type() == QVariant::String )
156+
checkList = value.toString().remove( QChar( '{' ) ).remove( QChar( '}' ) ).split( ',' );
153157

154158
for ( int i = 0; i < mListWidget->count(); ++i )
155159
{

0 commit comments

Comments
 (0)