[PyQt] set qlineedit red, easy?? SOLVED

Knapp magick.crow at gmail.com
Thu Feb 5 12:08:09 GMT 2009


On Thu, Feb 5, 2009 at 12:50 PM, Frédéric
<frederic.mantegazza at gbiloba.org> wrote:
>
> Le 5/2/2009, "Knapp" <magick.crow at gmail.com> 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...
>
> http://doc.trolltech.com/4.4/stylesheet.html#overview
> http://doc.trolltech.com/4.4/qwidget.html#styleSheet-prop
> http://doc.trolltech.com/4.4/stylesheet-examples.html#customizing-qlineedit
>
> --
>   Frédéric
>

Worked perfectly. I knew it had to be easy and I overlooked the answer!
Thanks all.
-- 
Douglas E Knapp

Amazon Gift Cards; let them choose!!
http://www.amazon.com/gp/product/B001078FFE?ie=UTF8&tag=seattlebujinkand&linkCode=as2&camp=1789&creative=9325&creativeASIN=B001078FFE



More information about the PyQt mailing list