Disable PdmUiColorEditor correctly when set to read-only.

This commit is contained in:
Kristian Bendiksen 2020-04-06 21:10:11 +02:00 committed by Magne Sjaastad
parent eff3c91e4b
commit 2b28bbc0b6

View File

@ -93,6 +93,11 @@ void PdmUiColorEditor::configureAndUpdateUi(const QString& uiConfigName)
}
}
bool isReadOnly = uiField()->isUiReadOnly(uiConfigName);
m_colorTextLabel->setEnabled(!isReadOnly);
m_colorSelectionButton->setEnabled(!isReadOnly);
m_colorPreviewLabel->setEnabled(!isReadOnly);
QColor col = uiField()->uiValue().value<QColor>();
setColorOnWidget(col);
}