PDA

View Full Version : QItemSelectionModel select a row by giving a filename, row not selected



qt_gotcha
26th August 2010, 08:10
in my app the user can select a filename in a text and it should move the fileView to this file. The fileView is a tableView that has a selection model. I select everything by the entire row for purposes elsewhere in the program. If I do the following

QModelIndex ind = fileModel->index(selectedfilename);
selectionModel->setCurrentIndex(ind, QItemSelectionModel::Rows );

the fileview scrolls to the right index, but not the whole row is selcted but only the first column. It seems as if QItemSelectionModel::Rows doesn't work. Am I missing something? thanks