@_ said in Does QLayoutItem delete its managed item in its destructor?:
@Pl45m4 said
QLayoutItem does not delete anything, same as all QLayouts.
QLayoutItem is not a layout, rather, it is a layout item, so I don't understand your comment.
On the contrary, layouts are also layout items (it is so in order to allow sublayouts).
It means what it says.
@_ said in Does QLayoutItem delete its managed item in its destructor?:
If i understand that correctly, layouts delete their child layouts in their destructor.
Is it done through the layout item destructor?
Check it yourself.
QLayoutItem destructor does basically nothing, except destroying the QLayoutItem itself
https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qlayoutitem.cpp.html#_ZN11QLayoutItemD1Ev
whereas, if you delete a QLayout, it will delete all of its child-layouts, but not their widgets
https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qlayout.cpp.html#_ZN7QLayoutD1Ev