Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Phil Thompson
On Thu, 05 Feb 2009 08:25:30 -0500, Matt Smith wrote: > You've told me this before, but I didn't quite follow what was buggy. > > pal = QtGui.QPalette(MyLineEdit.palette()) > pal.setColor(QtGui.QPalette.Base,QtGui.QColor('red')) > MyLineEdit.setPalette(pal) > > It seems that .palette() is return

Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Matt Smith
You've told me this before, but I didn't quite follow what was buggy. pal = QtGui.QPalette(MyLineEdit.palette()) pal.setColor(QtGui.QPalette.Base,QtGui.QColor('red')) MyLineEdit.setPalette(pal) It seems that .palette() is returning a const and I shouldn't modify it. What about .parent()? should

Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Phil Thompson
On Thu, 05 Feb 2009 07:50:57 -0500, Matt Smith wrote: > You could use the palette. > > > MyLineEdit.palette().setColor(QtGui.QPalette.Base,QtGui.QColor('red')) That's buggy as palette() returns a const. You need to make a copy of the returned palette and modify that. See the roadmap. Phil

Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Matt Smith
You could use the palette. MyLineEdit.palette().setColor(QtGui.QPalette.Base,QtGui.QColor('red')) mbs On Thu, 2009-02-05 at 12:00 +, pyqt-requ...@riverbankcomputing.com > Le 5/2/2009, "Knapp" a crit: > > >I have a qlineedit that I want to turn the background red when the > >input is bad

Re: [PyQt] set qlineedit red, easy?? SOLVED

2009-02-05 Thread Mads Ipsen
- Original Besked Fra: Knapp Til: Frédéric Cc: pyqt@riverbankcomputing.com Emne: Re: [PyQt] set qlineedit red, easy?? SOLVED Dato: 05/02/09 13:11 > On Thu, Feb 5, 2009 at 12:50 PM, Frédéric > <frederic.mantega...@gbiloba.org> wrote: > > > > Le 5/2

Re: [PyQt] set qlineedit red, easy?? SOLVED

2009-02-05 Thread Knapp
On Thu, Feb 5, 2009 at 12:50 PM, Frédéric wrote: > > Le 5/2/2009, "Knapp" 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.

Re: [PyQt] set qlineedit red, easy??

2009-02-05 Thread Frédéric
Le 5/2/2009, "Knapp" 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 { backgrou

[PyQt] set qlineedit red, easy??

2009-02-05 Thread Knapp
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. Thanks. -- Douglas E Knapp Amazon Gift Cards; let them choose!! http://www.amazon.com/gp/