def removeButtons(self):
    for cnt in reversed(list(range(self.dvbox.count()))):
        widget = self.dvbox.takeAt(cnt).widget()
if widget is not None:
    widget.deleteLater()
What is best way to remove items from layout in pyqt