If I add a new QTableWidgetItem to a QTableWidget, do I have to free the memory myself or is it automatically handled. For example:
ui->table->setVerticalHeaderItem(0,new QTableWidgetItem(tr("Table Item")));
How is the dynamically created QTableWidgetItem handled?
The QTableWidget takes ownership of the QTableWidgetItem. You do not need to delete it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With