Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Focus button is no longer in focus when you click outside of a modal dialog
Lynn last edited by
I have a modal dialog that pops up and on that dialog window are two buttons. One is in focus by using (setFocus()). The functionality works great, but for some reason, when you click another window (can be outside of application or the main window the dialog window originated from), the modal dialog window is no longer in focus (to be expected) yet the default button that was supposed to be in focus on that window is no longer...it's the next button...it's as if you pressed tab in the dialog window and the next button has gained focus. If I click back on that modal dialog to regain focus for that window, the correct button is refocused so all is good there but I'd like to understand why when you press outside of the modal dialog window, the focus button changes.
Sounds odd. Tried to make a mini sample but nothing happened.
No button move.
Do you have a small sample that does this?
Hi and welcome to devnet,
To add to @mrjj What version of Qt and OS are you running ?