Hi all - I have a qt5 app which has a QGraphicsScene into which I place a lot of Elements, a custom class which derives from QGraphicsItem. Element reimplements paint(), boundingRect(), and opaqueArea(). Several Elements should overlap and completely obscure other Elements.

However, paint() is being called for every Element in the QGraphicsScene (with QStyleOptionGraphicsItem->explosedRect always matching the full boundingRect), even the ones that will be completely obscured by other Elements.

Is there a way I can avoid painting the Elements which which shouldn't need to be painted due to being obscured?

Thanks!