Dorin Botan
Dorin Botan

Reputation: 1388

Is there a way to get the repainted area in Qt?

When calling update() or repaint() with no arguments, everything (including visible elements underneath) is fully repainted. This can be optimized by passing the ClipRect as a parameter. Is there an easy way to get the repainted area or I have to determine it manually?

P.S. There is no such problem when using QGraphicsScene, however, I'm dealing with a QmlApplicationViewer and QDeclarativeItems. May be there is a way to force it to the same behaviour for it.

Upvotes: 0

Views: 238

Answers (1)

Jeremy Friesner
Jeremy Friesner

Reputation: 73304

Is there an easy way to get the repainted area or I have to determine it manually?

The QPaintEvent object that is passed in to paintEvent() contains rect and region members that you can examine to determine which part(s) of the QWidget in particular need to be repainted.

Upvotes: 2

Related Questions