PDA

View Full Version : Drawing background of a scene



maverick_pol
11th January 2008, 11:12
Hi all,

Let's say I have implemented my own


void MYSCENE::drawBackground(QPainter* painter, QRect &rect)
{
....
draw the whole scene background(QRectF(QPointF(-180,-90),QPointF(180,90));
....
}


Everytime I zoom in( I fit in view a part of the scene rect) the background is redrawn.
An here I have some doubts:

1) when I fitInView( QRectF(QPointF(0,0),QPointF(10,10)) the drawBackground is invoked, but only background of the "exposed rectangle( P(0,0),P(10,10))" is redrawn?

3) or do I have to check in the drawBackground(...) if what I am about to redrawn intersects with the "exposed Rectangle) ?

4) doest the drawBackground automatically sensors is the painter going to draw someting in the "exposed rectangle" and then allows it ? Or do I have to write some code and check it on my own using the "rect" parameter?

Thank you for any help.

Maverick