I'm getting this in my application output and can't figure out the problem. My code, which is in a subclass of QTableView, with model() returning a QSortFilterProxyModel:

const QSortFilterProxyModel *proxy = dynamic_cast<const QSortFilterProxyModel*>(model());
QModelIndex proxy_index2 = proxy->index(row, column, QModelIndex());
QModelIndex model_index = proxy->mapToSource(proxy_index2);

What am I doing wrong? I'm using Qt 4.7.