Suppose I fill some cells of a QTableWidget with buttons:
ui->table->setCellWidget (i, 2, new QPushButton ("Details"));
Just a little bit later I scratch them all and do it again:
ui->table->clear();
Will this buttons get deleted automagically? Or do I need to store a list of them and delete manually? Also, Do I need to specify parent for every button like this: QPushButton ("Details", ui->table)?
The table widget takes ownership of the widget. The documentation states this:
You also don’t need to specify a parent on creation, that will be set by the tablewidget accordingly.