Hi there!
I Only had to do that with QListWidgets before. But try setCurrentIndex.
QModelIndex index
= listView
->model
()->index
(rowYouWantToSelect,
0);
listView->setCurrentIndex(index);
QModelIndex index = listView->model()->index(rowYouWantToSelect,0);
listView->setCurrentIndex(index);
To copy to clipboard, switch view to plain text mode
By default the selectionMode is QItemSelectionModel::SelectCurrent so that the current item is selected as well. If its not you can force this:
listView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent);
To copy to clipboard, switch view to plain text mode
Hope you can translate that to pyqt!
HIH
Johannes
Bookmarks