[PyQt] Bug in QRectF

Phil Thompson phil at riverbankcomputing.com
Fri Jul 24 17:56:58 BST 2009


On Fri, 24 Jul 2009 06:16:38 -0700, David Lassonde
<David.Lassonde at autodesk.com> wrote:
> Hi all,
> 
> 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.

Phil


More information about the PyQt mailing list