QListView selection with highlight/hover

2.4k views Asked by At

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:

  1. Make QListView
  2. AddSomeItems
  3. Run app
  4. Move mouse to any item
  5. Select it
  6. 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?)

enter image description here

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

0

There are 0 answers