[PyQt] set qlineedit red, easy??

Phil Thompson phil at riverbankcomputing.com
Thu Feb 5 13:51:39 GMT 2009


On Thu, 05 Feb 2009 08:25:30 -0500, Matt Smith <melkor at orangepalantir.org>
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 returning a const and I shouldn't modify it.
> What about .parent()?  should I not use .parent() to make connections?

parent() doesn't return a const so there is no problem.

Phil


More information about the PyQt mailing list