I'm using a QSqlTableModel to read and write data to a sqlite database. At this model I apply a costum SortFilterProxyModel, the result is diplayed in a QTableView. My problem is:
I want to eliminate a line selected by the user on the database. Without the sorting the user select the line and then I delete it directly from the model with modelTable->removeRow(index.row ()).
If now I enable setSortingEnabled(true) in the QTableView or I use the SortFilterProxyModel to isolate some characters, the order of the row change and it is not the same of the model. It doesn't allow me to delete a line from the model with removeRow because the row number of the Table is not the same row number of the Model.

How do I have to do for resolving the problem? have I perhaps mistaken approach?

Thanks in advance
(excuse for my bad English)