-
QLineEDit back color
I've implemented a change the Qapp QPalette which filters down to all my other widgets with the exception of QLineEdit. The background color (QPalette::Base) will not set unless I do it directly on that widget. QTextEdit works fine. I'm wondering if there is some problem with the QLineEdit not inheriting properly or maybe the parent is not set correctly. Any help welcome. Thanks.
-
Re: QLineEDit back color
My feeling is that QPalette support is "not the most consistent". I think the preferred way to change the design nowadays is the styleSheet property. Try something like setStyleSheet("QWidget{background: #ffd8c0}"); on the topmost widget you want to change the color. See https://doc.qt.io/qt-5/stylesheet-reference.html for more explanation.
-
Re: QLineEDit back color
Hi, I played a bit with the preview in the Qt Designer, but I was not able to change the background of the QLineEdit with any of the roles. So I agree with stryga42, a stylesheet is probably the only way.
Ginsengelf