On Fri, 24 Feb 2017 19:12:18 +0800
jack ma <assang...@gmail.com> wrote:

> Hi,
> 
> is it correct to use “delete” directly delete the item ?
> 
> or I should first call removeItem() and then call "delete item"  to
> remove it?
> 
> How are these two ways affect the bsp tree?
> 
> Thanks,
> jack

From the docs for ~QGraphicsItem():

> Destroys the QGraphicsItem and all its children. If this item is
> currently associated with a scene, the item will be removed from the
> scene before it is deleted.

> Note: It is more efficient to remove the item from the QGraphicsScene
> before destroying the item.

So either method is safe, but explicitly removing it is better.


-Francis
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to