[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Problem updating QLabel font
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2008-01-07 15:09:27
Message-ID: 200801071509.27322.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

On Monday 07 January 2008, Arve Knudsen wrote:
> Hello
>
> I've run into what looks like a bug in PyQt. When changing the font of a
> QLabel at runtime, it doesn't update its appearance unless I call its
> update() method. I've verified that this problem doesn't occur when using
> Qt directly from C++. Even after calling update(), something isn't right
> however, as the containing QGridLayout isn't adjusted to account for the
> label's changed dimensions.
>
> The attached program showcases the problem. Uncomment line 20 to see the
> layout problem.

Change the first line of changeFont() to...

    f = QFont(self.__lab.font())

...so that it is closer to what C++ would do.

SIP doesn't enforce "const". I've been mulling over this for a while. SIP 
could enforce "const" so that the call to setBold() would raise an exception. 
The disadvantage is that existing apps may break - but, then again, they are 
broken anyway.

An alternative might be to automatically make a copy under the covers so that 
wrapped C++ instances are never const.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic