[Interest] Drawing artifacts when scrolling QGraphicsView on OS X

Jelmer van der Linde jelmer at ikhoefgeen.nl
Fri Jun 8 14:44:27 CEST 2012


Hello Jordi, 

If I increase the size of the rectangle boundingRect returns, it does correctly clear that area. But my bounding rectangle is already as large (or just for testing, larger than) the actual tooltip.

It also only occurs when I scroll. If I move the mouse (and therefore reposition the tooltip) but don't scroll the view at the same time, drawing and invalidating happens just as expected. It is only when I scroll that Qt doesn't invalidate the the old drawing area. As if the position changes due to scrolling aren't taken into account when invalidating the old rect.

~ Jelmer 


On Friday 8 June 2012 at 14:19, Jordi Pujol wrote:

> Hi Jelmer,
> 
> Just a clue, without looking at your code : ensure your tooltip's
> bounding rect is greater than the tooltip itself. I mean ALL the
> tooltip, text and grey-box-background.
> 
> This error appears when you don't take care of this. QGraphicsView only
> invalidates the rect returned by the method you (may) have overloaded in
> your custom class :
> 
> QRectF QGraphicsItem::boundingRect () const
> 
> So first, try to make this QRectF a little bit bigger. Looking at the
> screenshot it seems is smaller than it must...
> 
> J.
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org (mailto:Interest at qt-project.org)
> http://lists.qt-project.org/mailman/listinfo/interest






More information about the Interest mailing list