PDA

View Full Version : QGraphicsScene:drawForegroud(...) question



maverick_pol
19th December 2007, 18:00
Hi,

I have drawn a complex map in the background of the QGraphicsScene object. Now I want to draw some additional pixmaps in the foreground of that scene object and update a given rectangle(using invalidate(..) method). It's ok, but the foreground(whole scene foreground) is updated everytime I move a cursor on that scene. Howto force the scene not to update the whole scene all the time?

I would like to update only a rectangle, that has changed...etc.
When I implemented the QGraphicsScene::drawForeground(...) and added a static int member, incremented it by 1 and used 'qDebug()<<' to show the value, qDebug is like in the loop. withing 10 sec x reaches 1000(when I move the mouse on the scene).

I thaught that foreground is another layer and should react almost the same way as background( not redrawing while moving the mouse), but I suppose I am wrong. Could anyone explain the difference to me.


THank you for any help.

Kacper

marcel
19th December 2007, 19:01
What about the exposed rectangle which is passed to you? Do you take it into account?