mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
Tree Selection Editor: If no option items are present, use field value as options
This commit is contained in:
parent
e63005348c
commit
c75ba450ce
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user