Can't Interact with Main GUI while Brining up Dialog
-
wrote on 16 Mar 2017, 18:40 last edited by
I have a dialog that takes a long time to come up. I made it non-modal, so once it's up, I can interact with the rest of my GUI. However, while it's coming up I can't. Is there any way around that?
-
Hi,
What makes that dialog creation so long ?
-
wrote on 17 Mar 2017, 00:04 last edited by
It has to get info from several different hosts. So it has to ssh to each host and run several commands.
-
It has to get info from several different hosts. So it has to ssh to each host and run several commands.
wrote on 17 Mar 2017, 02:42 last edited by@DougyDrumz Open the dialog without this information. Then in a separate thread (so you don't lock things up) get the info you need and populate the dialog once the info is available.
The way I would do that is just show a loading widget of some sort while it loads the info, then once loaded, show the real widgets on the dialog. You can use QStackedWidget to make this easy.
Another way is don't use dialogs. Modern applications rarely use them any more, except for things like File->Open.
1/4