[PyQt] set qlineedit red, easy??

Phil Thompson phil at riverbankcomputing.com
Thu Feb 5 13:11:40 GMT 2009


On Thu, 05 Feb 2009 07:50:57 -0500, Matt Smith <melkor at orangepalantir.org>
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


More information about the PyQt mailing list