Prevent QCompleter's popup from hidding
-
Hello guys ! I am trying to make my own virtual keyboard and it is working well so far but i have an issue with QComboBox with QCompleter. When i start using my virtual keyboard on the QComboBox, the autocomplete's drop down appear ( wich is good ) but then it seem to be taking focus or something , the next time i try ty use the keyboard, the drop down menu disappear and the click is ignored ( probably the drop down just lost focus ) and then i have to click on the key again, the next character is then taken into account.
The behavior i wish is that the drop down menu stay visible the whole time but i am having big trouble achieving that. I have tried to lock focus on the keyboard or the QComboBox without results and now i am trying to add an event filter to the whole application to try and intercept all click and hide events but it was wondering if there was a better solution. Any clue ?
In brief : I do not want the popup of the QCompleter to hide when i click on my virtual keyboard and i don't want clicking on the keyboard ( or it's child widgets ) to take focus from anything and right now i failed in both
Alternatively , i think the best would be for the keyboard to never take focus away from anything but i have not found a way from achieving that. The setFocus( Qt::NoFocus ) simply does not prevent the popup from being hidden.
-
Unfortunatly the focus policy alone is not enought. The popup windows has proven quite stubborn in hiding itself every time i do something on my virtual keyboard.
Right now what i am trying to do it add an event filter to the whole QApplication and intercept all mousepress events that are done inside my keyboard and completly block the signal. But that mean i have to manually do my own events for everything happening in the keyboard and it is slowly turning into quite the nightmare. I just can't believe this is the best solution. And i'm not even sure yet that it's even going to work.