基本上我想删除模型中的所有行。我更喜欢使用removeRows(..)而不是clear(),因为我想保留我的标题。
我想我错过了一些东西(docu here),我的代码很简单:
int c = MainWindow::_viewDataModel->rowCount();
bool r = MainWindow::_viewDataModel->removeRows(0, c);
ceg 是 4,但r总是错误的。我已经尝试将 0 和 1 作为第一个索引。使用clear()作品。上面的代码完全没有影响。