Reputation: 3617
I found a lot of answers about removing widget from QVBoxLayout.
But I didn't find out any answer about removing a layout. I know I can put my sub-layout into a QWidget. I just want to know something more.
layout = QtGui.QVBoxLayout()
item_in_layout = create_layout()
layout.addLayout(item_in_layout)
# Remove?
Upvotes: 6
Views: 5521
Reputation: 40492
Use QLayout::itemAt
to obtain the corresponding layout item and QLayout::removeItem
to remove it.
Upvotes: 0
Reputation: 7034
Use removeItem with the pointer to the layout you want to remove.
Upvotes: 4