I have a slot function in my GUI that takes time to complete (10-15 seconds).
I would like to gray the layout and show a box of “Please wait…” that will disappear when the slot function is done.
I need it to be async as I want to use a QProgressBar widget in the “Please wait…” Window.
How can this be done?
Your long running slot should be running in a QThread, while your “Please wait…” widget should be modal in the main GUI thread.
You could use QProgressDialog and maybe choose a windowflag that suits your display needs, or a custom widget. But the long running operation should signal the modal blocking dialog when it has completed, causing the dialog to then hide.