-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Explicitly set focus on text box #20103
Conversation
It works but it's not the only place that needs this:
Not sure if i've found everything. |
Could this actually be a Qt bug, and should be fixed there? Yeah the Qt document doesn't specify the default focus policy for dialogs, but I don't think Qt should change it in an x.y.1 release. So it might be an unintended change. |
If it was not declared to behave in a certain way, then it is not entirely correct to call such a change a bug, especially since it could not have been changed on purpose. It's better to set focus (or maybe even tab order) explicitly. |
Forget. I still got Qt 6.6.1. Unfortunately, latest approach doesn't work. |
Now I believe it is really Qt bug. Could you follow QTBUG-120049 and provide more info if any? |
I guess you can't call setFocus() before showing the dialog:
This suggests using a timer to delay calling setFocus():
|
I can. And it works. |
Maybe we all can facilitate interest in the upstream QTBUG-120049 by voting for it ? |
Closes #20084.