PDA

View Full Version : QStyleOptionGraphicsItem exposedRect, is it used for other purposes?



Thuan Seah Tan
21st February 2012, 02:36
Hi all,

I am experiencing some weird issue with the exposedRect property of QStyleOptionGraphicsItem. It seems to return me some random rect instead of what is exposed of a given QGraphicsWidget. According to the documentation,

This variable holds the exposed rectangle, in item coordinates.
Make use of this rectangle to speed up item drawing when only parts of the item are exposed. If the whole item is exposed, this rectangle will be the same as QGraphicsItem::boundingRect().

I have been testing a few cases where even though the whole item is exposed, this variable did not return me a rectangle equal to that of boundingRect. This seems to occur when another graphics widget overlaps the graphics widget and triggering a repaint or something. Does Qt use this variable when it needs to redraw a dirty region but not the entire widget?

Thuan