View Full Version : Making rows visible in QTableView

11th October 2006, 16:10
I'm implementing a search feature for my table. I've got it so that it's able to find the search text and highlight the rows containing the text. I'd like the view to automatically scroll to the first selected row. Does anybody know if there's an equivalent method to the QListView::ensureItemVisible(const QListViewItem * i) (http://doc.trolltech.com/3.3/qlistview.html#ensureItemVisible) method in Qt3??

An equivalent method in Qt4 for QTableView, that is... :D

11th October 2006, 16:19
void QAbstractItemView::scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible) should do the trick.

11th October 2006, 16:38
Unbelievable! I looked ALL Over for something like this and it was right there in front of my face. Thanks!! :rolleyes: