Tree Selection Editor: If no option items are present, use field value as options

This commit is contained in:
Magne Sjaastad 2024-07-03 15:15:47 +02:00
parent e63005348c
commit c75ba450ce

View File

@ -181,6 +181,18 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi( const QString& uiConfigName
QList<PdmOptionItemInfo> options = uiField()->valueOptions();
if ( options.empty() )
{
QVariant fieldValue = uiField()->uiValue();
QStringList texts = fieldValue.toStringList();
for ( const auto& text : texts )
{
PdmOptionItemInfo item( text, text );
options.push_back( item );
}
}
bool itemCountHasChaged = false;
if ( m_model->optionItemCount() != options.size() ) itemCountHasChaged = true;