From 6c5d20bc019373388e1aef204afcf1d12565c8e4 Mon Sep 17 00:00:00 2001 From: fperillo Date: Thu, 5 Oct 2017 22:01:50 +0200 Subject: [PATCH] Dotted underline when widget is disabled --- components/qtmaterialtextfield.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/qtmaterialtextfield.cpp b/components/qtmaterialtextfield.cpp index 97480c9..795a0df 100644 --- a/components/qtmaterialtextfield.cpp +++ b/components/qtmaterialtextfield.cpp @@ -299,6 +299,10 @@ void QtMaterialTextField::paintEvent(QPaintEvent *event) QPen pen; pen.setWidth(1); pen.setColor(underlineColor()); + if( !isEnabled() ) + { + pen.setStyle( Qt::DotLine ); + } painter.setPen(pen); painter.setOpacity(1); painter.drawLine(2.5, y, wd, y);