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)
You can use the following in your parent widget class:
QList widgets = findChildren(); foreach(QWidget * widget, widgets) { delete widget; }