mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
ResInsight: Integrated from Caf trunc. Multi variable fields (multiselect) with option values now handled. Improved PdmUi layout. Improved Viewer widget size behaviour, Xml keyword check.
p4#: 18777
This commit is contained in:
@@ -59,20 +59,25 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
|
||||
m_comboBox->setEnabled(!field()->isUiReadOnly(uiConfigName));
|
||||
|
||||
// Demo code for attribute retreival when becoming relevant
|
||||
// PdmUiComboBoxEditorAttribute attributes;
|
||||
// field()->ownerObject()->editorAttribute(field(), uiConfigName, &attributes);
|
||||
|
||||
bool fromMenuOnly = false;
|
||||
QList<PdmOptionItemInfo> enumNames = field()->valueOptions(&fromMenuOnly);
|
||||
if (!enumNames.isEmpty() && fromMenuOnly == true)
|
||||
QList<PdmOptionItemInfo> options = field()->valueOptions(&fromMenuOnly);
|
||||
m_comboBox->blockSignals(true);
|
||||
m_comboBox->clear();
|
||||
if (!options.isEmpty())
|
||||
{
|
||||
m_comboBox->blockSignals(true);
|
||||
m_comboBox->clear();
|
||||
m_comboBox->addItems(PdmOptionItemInfo::extractUiTexts(enumNames));
|
||||
m_comboBox->blockSignals(false);
|
||||
m_comboBox->addItems(PdmOptionItemInfo::extractUiTexts(options));
|
||||
m_comboBox->setCurrentIndex(field()->uiValue().toInt());
|
||||
}
|
||||
|
||||
PdmUiComboBoxEditorAttribute attributes;
|
||||
field()->ownerObject()->editorAttribute(field(), uiConfigName, &attributes);
|
||||
|
||||
m_comboBox->setCurrentIndex(field()->uiValue().toInt());
|
||||
else
|
||||
{
|
||||
m_comboBox->addItem(field()->uiValue().toString());
|
||||
m_comboBox->setCurrentIndex(0);
|
||||
}
|
||||
m_comboBox->blockSignals(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user