Qt work a lot with raw pointers (why? this isn't the 1990 anymore...). But given that fact I'll have to work myself around this. I notice from the documentation that the layout in those cases often take ownership of the pointer.
However what happens if the container fails & (re)throws an exception - ? ie, consider the following mockup:
Now I believe that if an exception occurs during QLayout::addItem() the tree WILL be freed? (layout takes immediate responsibility on the tree when function starts)?Qt Code:
QLayout layout; layout.addItem(tree.release());To copy to clipboard, switch view to plain text mode
Bookmarks