QStandardItemModel::removeRows() 是递归的吗?

Is QStandardItemModel::removeRows() recursive?

当使用树结构在 QStandardItemModel 上调用 removeRows() 时,这会递归地释放所有子 QStandartItem 的内存吗?

Is QStandardItemModel::removeRows() recursive?

没有。不可能,因为模型不是模型树。

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

是的,但这与removeRows()关系不大。 ~QStandardItem() 析构函数处理 children。因此,任何销毁 QStandardItem 的方法也会销毁和处理 children。什么都不会泄露。