How to setFocus on two widgets at once
Solved
General and Desktop
-
well if u set list to Nofocus you can scroll it with mouse and keyboard focus stays with
QLineEdit -
Well its not ideal but I got it working.
- ListView has noFocus policy.
- If line edit has focus, re-implemented up and down arrows keys change index and selection of listview.
- Line Edit change policy to clickFocus because otherwise the arrows keys cause it to get focus (undesirable).
- connect ListView row clicked to accept and close events even if the menu wasnt focused.
- Style listview selected:!active so it doesnt show two different colors on click
I will post the code soon, I also want to try the classical QListWidget, it might be way simpler and should be faster?