Removing child item from QGRaphicsItem
Hi,
I have added few QGraphicsItems to a parent QGraphicsItem.Then I need to remove some child items from the parent QGraphicsItem. But there seems to be no function to remove child QGraphicsItems. QGraphicsScene provides functions(addItem and removeItem). Is there any way to remove child QGraphicsItems from the parent QGraphicsItem.
Thanks,
Mangesh
Re: Removing child item from QGRaphicsItem
Try
Code:
childToRemove->setParentItem(NULL);
This will also add the "childToRemove" object to the parent's scene, if you want you must remove it from this scene yourself.