How to execute initialization method after QApplication::exec has been called?
Unsolved
General and Desktop
-
wrote on 20 Jul 2018, 13:23 last edited by
I'm working with a very simple main method like this:
int main() { MyQtApp app; return app.exec(); }
Lets assume my app has to do some very heavy initialization which should happen after application startup (especially without any user interaction to trigger). How can I achieve this?
If I just do this:
int main() { MyQtApp app; app.heavy_init(); return app.exec(); }
then the even queue won't run and I can't emit signals. If I use a dedicated thread, it's still awkward because once the initialization is finished, I can't join the threads because the main thread will be executing QApplication::exec. Any ideas how to do what I'm looking for?
-
1/2