QListView selection with highlight/hover

天大地大妈咪最大 提交于 2019-12-22 12:09:09

问题


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?)

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

来源:https://stackoverflow.com/questions/26992849/qlistview-selection-with-highlight-hover

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!