Basically I want to delete all rows in my model. I'd prefer to use removeRows(..)
instead of clear()
, because I want to keep my headers.
I guess I have missed something (docu here), my code is pretty simple:
int c = MainWindow::_viewDataModel->rowCount();
bool r = MainWindow::_viewDataModel->removeRows(0, c);
c
e.g. is 4, but r
is always false. I have tried 0 and 1 as first index. Using clear()
works. The above code has no impact at all.