I am using the constructor QWidget(QWidget *parent). This parent widget contains a lot of child widgets. I need to clear all the child widgets from the parent a
QWidget(QWidget *parent)
From Qt docs
The following code fragment shows a safe way to remove all items from a layout:
QLayoutItem *child; while ((child = layout->takeAt(0)) != 0) { ... delete child; }