How to do item in QListView selected as I would click on him? Way I tried to do this I have selection but like not-active one. Without Blue highlight only grey one.
To be mroe detailed:
- Make QListView
- AddSomeItems
- Run app
- Move mouse to any item
- Select it
- Now its, selected and ALSO blue. This is what I want to do with item before I run application. If it is possible of course. (selectable + hover + focus?)
I want to have it without clicking
I tried many ways:
view->clicked(selectedIndex);
view->selectionModel()->select( selectedIndex, QItemSelectionModel::Select )
view->setCurrentIndex(selectedIndex);
view->clicked(selectedIndex);
and others, any help needed
QModelIndex ind = ui->listView->model()->index(1,0);
ui->listView->setCurrentIndex(ind);
ui->listView->selectionModel()->select(ind,QItemSelectionModel::Select);
is not what are you looking for? Do you want blue color as user hover mouse on item? – Artist