QSortFilterProxyModel && QSqlTableModel && QTableView, get QSqlTableModel selected row [Solved]
-
Hi all,
I have a QTableView showing a QSortFilterProxyModel that has a QSqlTableModel as its source model.QSortFilterProxyModel has a filter so not all row of QSqlTableModel are shown in the QTableView.
when I click a row in the QTableView I need to get the row number in the original QSqlTableModel because I need to execute:
@
mySqlTableModel->removeRow(row_number);
@How can I proceed?
-
"QAbstractProxyModel::mapToSource() ":http://doc.qt.nokia.com/4.7/qabstractproxymodel.html#mapToSource translates the selection model's index back to the original model's index.
[EDIT: wrong method name, mapToSource is right]
-
[quote author="Volker" date="1309901676"]"QAbstractProxyModel::mapToSource() ":http://doc.qt.nokia.com/4.7/qabstractproxymodel.html#mapToSource translates the selection model's index back to the original model's index.
[EDIT: wrong method name, mapToSource is right][/quote]
Thanks Volker,
this is what i was looking for...