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 Gaute Lindkvist
parent 3f988f2d79
commit 42ca07d2cd

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);
}