You could use the palette.

MyLineEdit.palette().setColor(QtGui.QPalette.Base,QtGui.QColor('red'))

mbs

On Thu, 2009-02-05 at 12:00 +0000, [email protected] 
> Le 5/2/2009, "Knapp" <[email protected]> a crit:
> 
> >I have a qlineedit that I want to turn the background red when the
> >input is bad but I can't seem to find how to do this. I would think
> it
> >would be easy but it does not seem to be. unless I missed something.
> 
> Using a stylesheet?
> 
> css = """QLineEdit {
>      background-color: red;
> }"""
> myWidget. setStyleSheet(css)
> 
> I didn't test...

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to