From 092dc69654e382aa443fd122aef7baab11d3f1b2 Mon Sep 17 00:00:00 2001 From: Nass <60141996+lanckmann@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:37:00 -0500 Subject: [PATCH] [GUI] Remove italics and use monospaced font for expression fields in the attribute table. Related to issue #44638 (#59139) * [gui] Remove italics and use monospaced font for expression fields in attribute tableThis commit modifies QgsFieldExpressionWidget to ensure that expression fields in the attribute table are displayed using a regular monospaced font instead of the default italics. This improves readability and ensures consistency between different parts of the interface.- Updated QgsFieldExpressionWidget::updateLineEditStyle() to set font to non-italic and apply monospaced family.- Addressed issue reported in #44638 regarding the readability challenges caused by italicized font in expression fields.Related issue: #44638 * [gui] Reformat code to match standard style --- src/gui/qgsfieldexpressionwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/qgsfieldexpressionwidget.cpp b/src/gui/qgsfieldexpressionwidget.cpp index 181b8bf288b7..49970015efab 100644 --- a/src/gui/qgsfieldexpressionwidget.cpp +++ b/src/gui/qgsfieldexpressionwidget.cpp @@ -392,7 +392,8 @@ void QgsFieldExpressionWidget::updateLineEditStyle( const QString &expression ) currentField( &isExpression, &isValid ); } QFont font = mCombo->lineEdit()->font(); - font.setItalic( isExpression ); + font.setFamily( ( QgsCodeEditor::getMonospaceFont() ).family() ); + font.setItalic( false ); mCombo->lineEdit()->setFont( font ); if ( isExpression && !isValid )