Use gray background for read only line edit

This commit is contained in:
Magne Sjaastad 2024-09-12 12:57:56 +02:00
parent f4da2d748f
commit fcec67e95e

View File

@ -153,6 +153,10 @@ void PdmUiLineEditor::configureAndUpdateUi( const QString& uiConfigName )
QString highlightColor = UiAppearanceSettings::instance()->autoValueEditorColor(); QString highlightColor = UiAppearanceSettings::instance()->autoValueEditorColor();
m_lineEdit->setStyleSheet( QString( "QLineEdit {background-color: %1;}" ).arg( highlightColor ) ); m_lineEdit->setStyleSheet( QString( "QLineEdit {background-color: %1;}" ).arg( highlightColor ) );
} }
else if ( uiField()->isUiReadOnly() )
{
m_lineEdit->setStyleSheet( "QLineEdit:read-only{background: palette(window);}" );
}
else else
{ {
m_lineEdit->setStyleSheet( "" ); m_lineEdit->setStyleSheet( "" );