PDA

View Full Version : Do I need to destroy the widget of setItemWidget?



qlands
30th May 2011, 13:33
Hi,

I am adding widgets to the items of a QTreeWidget. The documentation of setItemWidget says:

The tree takes ownership of the widget.

Does this means that when the QTreeWidget gets destroyed it destroy the item widget?

Thanks,
Carlos.

wysota
30th May 2011, 14:09
Yes, that's correct.

DanH
30th May 2011, 14:24
Right. Whenever an object "takes ownership" of another object, it takes over responsibility for deleting the object when appropriate.