QTableWidget memory management
Unsolved
General and Desktop
-
Does QTableWidget::setHorizontalHeaderItem() take ownership of the item that is set?
The docs state that setItem() does take ownership, but is silent about the header item. -
Does QTableWidget::setHorizontalHeaderItem() take ownership of the item that is set?
The docs state that setItem() does take ownership, but is silent about the header item.@FuzzieTheWarg
You can assume it does, since itdelete
s any item already there. But I can't show you a doc stating this forsetHorizontalHeaderItem()
per se. -
I wanted more proof, so I went digging. Header Items are deleted when the QTableModel is deleted. Here's a pictorial stack trace for posterity.