I'm not an expert, but I'll give it a try.
First of all, I would suggest not removing the NoteID and nUnitID columns from the model. Don't know your reason for doing this.
Instead, if you are using a view, use view->setColumnHidden(<column_number>, TRUE) that way the columns are still available in the model, but not shown.
As for the printing and removing, notesmodel->removeRow(i, QModelIndex()) looks like it would remove all rows.
I would need to see more of the surrounding code to see what is going on.
If you removed columns NoteID and nUnitID from the model, then column 0 is now Date.
You can't remove columns for a specific nUnitID after the column has been removed from the model.
Bookmarks