QT QStandardItemModel 清除数据方法
QStandardItemModel *model = new QStandardItemModel();
// 假设你已经往 model 中添加了一些数据
model->removeRows(0, model->rowCount()); //保留行标题,清除行数据
model->removeColumns(0, model->columnCount());//清除列数据
model->clear();行列及标题全部清除
欢迎讨论,相互学习。
cdtxw@foxmail.com