I have explored using QTimer.singleShot to open dialog. however with out threading this also blocks the main thread.
Modifying the source code may be easier. The would see the show used instead of exec and the windowModilatriy set to modal.
This will also require a src code logical change where rather than waiting for the modal dialog to be accepted and the thread to then process the user data a signal will need to be fired to run the code processing the users input.
This Dlg has been made non modal. This was after talking with other in LI that write such tests. The consensus was blocking window make testing overly complicated.
The new feature dialog is opened via exec. This blocks the main feed until the user accepts or rejects the dialog.
See below - exec opens the dialog and does not process the user data until the dialog == QDialog.Accepted:
https://github.com/linz/gazetteer/blob/f56196be7e46e92b5f152ec7718ce1ded9ab8d7d/src/NZGBplugin/NewFeatureDialog.py#L31
I have explored using QTimer.singleShot to open dialog. however with out threading this also blocks the main thread.
Modifying the source code may be easier. The would see the
show
used instead ofexec
and the windowModilatriy set to modal.This will also require a src code logical change where rather than waiting for the modal dialog to be accepted and the thread to then process the user data a signal will need to be fired to run the code processing the users input.