[PyQt] Bug in QRectF

David Boddie dboddie at trolltech.com
Fri Jul 24 18:22:37 BST 2009


On Fri Jul 24 17:56:58 BST 2009, Phil Thompson wrote:
> On Fri, 24 Jul 2009 06:16:38 -0700, David Lassonde wrote:
> >
> > the following does not work in PyQt 4.5.2:
> >
> > from PyQt4.QtCore import QRectF
> > wrongRect = QRectF(0,0,0,3000) | QRectF(0,0,0,16)
> >
> > The expected result is (0,0,0,3000) but I get (0,0,0,16).
> >
> > it used to work in PyQt 4.4.3
> >
> > As a workaround, I am now using my own "or" function.
> >
> > I thought you might be interested in the information.
>
> This is a (legitimate I think) change in behaviour in Qt. Your rectangles
> aren't valid (as they have zero width) so the result of the operator is
> undefined.

It looks like Qt 4.5 changed the behaviour, but current snapshots of Qt 4.6
give the desired result. There's no guarantee that this will still be the
case when it's finally released, though. :-/

David


More information about the PyQt mailing list