Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking outside of Search Suggestion List Should Fall through #1200

Open
ShaopengLin opened this issue Sep 9, 2024 · 0 comments
Open

Clicking outside of Search Suggestion List Should Fall through #1200

ShaopengLin opened this issue Sep 9, 2024 · 0 comments
Labels
Milestone

Comments

@ShaopengLin
Copy link
Collaborator

Follow up from #1189 and Point 4 of comment

Qt's popup windows do not provide this fall-through behavior and we will need to implement our own.

One solution is to make the QCompleter::popup() as a Qt::Tool window with setWindowFlags(), which makes the window non-modal allowing clicks to fall through. The problem comes with:

  1. how to hide the popup on click.
  2. preventing flickers to the suggestions when typing as seen here.
  3. Keep all other suggestion list behavior the same.

Difficulty comes from the focus relationship between SearchBarLineEdit and QCompleter::popup(). QCompleter::popup() proxies its focus to SearchBarLineEdit and our completion logic relies on focuses. Here is what I have tried:

1. Disconnect the proxy and handle each separately. This has deemed difficult as, popup needs focus to allow user keyboard navigations, and it will take focus away from the line edit. In addition, if we hide popup when it focuses out, it will flicker when user starts typing as it constantly races for focus with the line edit.

2. Keep the proxy and go for eventFilter. It is ad-hoc and would only work to filter out FocusOut events. Global click events are not reliable for this scenario since multiple clicks can happen at the same time for one click. Also, when users clicks minimize and maximize, the suggestions does not go away as the line edit doesn't lose focus.

There might be a lot more problems than what I described here when we switch to Qt::Tool window. I have not been able to find a solution, so maybe someone more experienced has more knowledge on how to make this work.

@kelson42 kelson42 added bug enhancement UI User Interface labels Sep 9, 2024
@kelson42 kelson42 added this to the 2.5.0 milestone Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants