Skip to content

Commit

Permalink
Fix handling of empty string in the value relation editor widget
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Mar 21, 2024
1 parent 6230a30 commit 1d3e795
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/core/featurechecklistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,20 @@ void FeatureCheckListModel::setAttributeValue( const QVariant &attributeValue )

if ( mAllowMulti )
{
if ( mAttributeField.type() == QVariant::Map )
if ( mAttributeField.type() == QVariant::Map || mAttributeField.type() == QVariant::List )
{
//store as QVariantList because the field type supports data structure
checkedEntries = attributeValue.toStringList();
if ( attributeValue.canConvert( QVariant::String ) )
{
QString value = attributeValue.value<QString>();
if ( !value.isEmpty() )
{
checkedEntries = attributeValue.toStringList();
}
}
else
{
checkedEntries = attributeValue.toStringList();
}
}
else
{
Expand Down

0 comments on commit 1d3e795

Please sign in to comment.