BUG: Specify application-modality when opening dialogs as application-modal. #164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modal Traits UIs are always opened as application-modal: the call to
exec_()
always blocks the entire application. However, we have been incorrectly specifying the window-modal flag instead. To make an actually-window-modal dialog, one needs to work asynchronously by listening to thefinished()
slot of theQDialog
and doing all of the follow-up code there; then one callsopen()
instead ofexec_()
to avoid blocking the whole application. We don't do this.The practical change is one of styling on the Mac platform. Window-modal dialogs appear as drop-down sheets from their parent window, and not independent windows with their own titlebar. These are intended for small dialogs, like "OK/Cancel" dialogs, while most Traits UI Views do not fit this styling very well . Notably, with this change, a Tasks application preferences dialog will no longer appear as a sheet.