PDA

View Full Version : How to make a graphic item paint itself AND its children ?



camleroi
6th January 2014, 10:06
Hello,
I was wondering if there was a way to make the paint method of the QGraphicsItem ( virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) ) also paint all the children of the item ?

This would correspond to the behavior of the QGraphicsView::render method, but for the QGraphicsItem…

Thank you in advance for your answers !

anda_skoa
6th January 2014, 10:49
I am not sure what your goal is but doesn't QGraphicsView already take care of painting all items that are visible within its boundaries, including children?

Cheers,
_