Is there a way of waiting on closure of a modeless dialog?
Here is an example application: I start some program which needs to do some startup stuff and also needs the user to log-in. Since the user logging in takes some time, I'd like to have the login box be modeless, so that I can continue doing my other startup stuff in the background. But at some point I am not going to be able to continue until the login process is completed. So ideally I'd like to be able to call something like dialog.wait_until_complete()
when I get to that point and have it then act like a modal dialog, only continuing once the user accepts/rejects the dialog.
Connect to the dialog's finished signal:
To prevent user interaction, you could just
hide()
the main window until the login is completed. Otherwise, to change the dialog's modality, you need to do something like: