Here's my code:
int main(int argc, char *argv[])
{
MyWidget myWidget;
return a.exec();
}
MyWidget::MyWidget()
{
...
show();
do_heavy_init();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyWidget myWidget;
return a.exec();
}
MyWidget::MyWidget()
{
...
show();
do_heavy_init();
}
To copy to clipboard, switch view to plain text mode
As above, "a.exec();" is called after "do_heavy_init();".
Because "do_heavy_init()" costs much time, the main window would not show up immediately.
In my case, I actually want "do_heavy_init()" to be called after myWidget is shown up on the screen. Is there an elegant way to do so? Many thanks~
Bookmarks