I have a QVBoxLayout where I put some buttons. I wrote a function to remove a button, but when I do it, the box doesn't adapt its size to the content. Here is a piece of the removal function:
for each_difference in differences_remove:
old_index = self.all_tags.index(each_difference)
print("old" + str(old_index))
self.vbox_all_tags.removeWidget(self.liste_pressoirs[old_index])
del self.liste_pressoirs[old_index]
I would like self.vbox_all_tags to adapt its size to the new content after I remove a button. How would you do that ?
Kindly.