Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QTableWidget releasing ownership of pointers
Robert Sanson last edited by
I have std::vector's with pre-allocated std::unique_ptr's to memory and when I insert a row into the QTableWidget, I release ownership of these unique_ptr's to the specific row within the QTableWidget. Is there a way for these unique_ptr's to regain ownership of the data within the QTableWidget before removing a row from it?
Wouldn't it be simpler to have a custom a QAbstractTableModel on top of your data structure so you do not have to do these back and forth with your data ?