[PyQt] Properties in PyQt5

Glenn Ramsey gr at componic.co.nz
Wed Sep 24 05:51:59 BST 2014


On 24/09/14 16:37, Florian Bruhin wrote:
> * Glenn Ramsey <gr at componic.co.nz> [2014-09-24 16:03:30 +1200]:
>> Hi,
>>
>> I have a dialog that has been created in Qt Designer and I would like to
>> be able to set a red border on a QLineEdit based on its contents (or lack thereof).
>>
>> Below is what I have tried, based on the PyQt4 version in Mark Summerfield's
>> book "Rapid GUI programming with Python and Qt", but it doesn't work.
> 
> It'd be useful if you said which page/snippet so I could take a look
> at that as well ;)

It's on pages 322-323.

> 
>> What have I done wrong here?
> 
> AFAIK you need to call setStyleSheet again after a property changed.
> I do something like this (from memory, untested):
> 

Yes, that was it, thanks. It's working now, and I now see the piece of
information I was missing is on p324.

Glenn



More information about the PyQt mailing list