I have a model/view where the code searches for the value in a field.
The correct row is always selected ok, but the view does not scroll so the selected row is visible.
proxy.setSourceModel(model);
proxy.setFilterKeyColumn(1);
proxy.setFilterFixedString(ui->mwCall->text());
vidx = proxy.mapToSource(proxy.index(0,0));
QSortFilterProxyModel proxy;
proxy.setSourceModel(model);
proxy.setFilterKeyColumn(1);
proxy.setFilterFixedString(ui->mwCall->text());
QModelIndex vidx;
vidx = proxy.mapToSource(proxy.index(0,0));
view->selectionModel()->select(vidx, QItemSelectionModel::Select | QItemSelectionModel::Rows);
view->scrollTo(vidx, QAbstractItemView::EnsureVisible);
To copy to clipboard, switch view to plain text mode
Any ideas as to how to fix this to make it scrollTo correctly?
Bookmarks