Is QStandardItemModel::removeRows() recursive?

144 views Asked by At

When calling removeRows() on QStandardItemModel with tree structure does this free the memory for all the children QStandartItems recursively?

1

There are 1 answers

0
Kuba hasn't forgotten Monica On BEST ANSWER

Is QStandardItemModel::removeRows() recursive?

No. It can't be since a model isn't a tree of models.

does this free the memory for all the children QStandartItems recursively?

Yes, but this has little to do with removeRows(). The ~QStandardItem() destructor disposes of the children. So any method that destroys a QStandardItem will also destroy and dispose of the children. Nothing will leak.