OK, here is the smallest possible example I could make it. The bug happens when I click on the lower half of the image. Just copy a jpg image at the same folder and rename it to "big.jpg".<div><br></div><div>Zsolt</div>
<div><br></div><div><br></div><div><br></div><div><br><div><br></div><div><br><br><div class="gmail_quote">On 23 October 2012 20:42, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Tue, 23 Oct 2012 20:20:30 +0100, Zsolt Ero <<a href="mailto:zsolt.ero@gmail.com" target="_blank">zsolt.ero@gmail.com</a>> wrote:<br>
> I'm having a weird problem: my whole QGraphicsView goes crazy if I<br>
> uncomment the following lines in a class (of QtGui.QGraphicsItem):<br>
><br>
> if len( self.points ) == 1:<br>
> rect = QtCore.QRectF( self.points[0].x()-self.radius,<br>
> self.points[0].y()-self.radius,<br>
> self.points[0].x()+self.radius,<br>
> self.points[0].y()+self.radius )<br>
> return rect<br>
><br>
> Here is the full boundingRect function:<br>
><br>
> def boundingRect( self ):<br>
> if len( self.points ) == 1:<br>
> rect = QtCore.QRectF( self.points[0].x()-self.radius,<br>
> self.points[0].y()-self.radius,<br>
> self.points[0].x()+self.radius,<br>
> self.points[0].y()+self.radius )<br>
> return rect<br>
><br>
> poly = QtGui.QGraphicsPolygonItem( self.polygon )<br>
> poly.setPen( self.pen )<br>
> return poly.boundingRect()<br>
><br>
> What happens is that the view moves to top-left corner _sometimes_ when<br>
the<br>
> rectangle code is run.<br>
><br>
> Here is my full code (just rename an image to big.jpg next to the file):<br>
> <a href="http://pastebin.com/h9tFZmpk" target="_blank">http://pastebin.com/h9tFZmpk</a><br>
><br>
> I believe it's a bug in PyQt4, can you have a look at it?<br>
<br>
</div></div>Not without a short, complete example that demonstrates the problem.<br>
<span><font color="#888888"><br>
Phil<br>
</font></span></blockquote></div><br></div></div>