Blocked waiting for a asynchronous Qt signal

前端 未结 3 410
小蘑菇
小蘑菇 2020-12-24 07:22

I know, there are some similar questions to the following out there, but I couldn\'t find a concrete answer that helps me. So here\'s my problem:

I work on an applic

3条回答
  •  天命终不由人
    2020-12-24 07:47

    Working from chalup's answer, if you are going to be waiting for a user-noticeable time, you might want to show a progress bar instead (or a splash screen, perhaps).

    MyApp::MyApp(QWidget *parent) : ....
    {
        doSomeInits();
        {
            QSpashScreen splash;
            splash.connect(configManager, SIGNAL(updateCompleted()), SLOT(close()));
            configManager->updateConfigurations(); 
            splash.exec();
        }
        doReaminingInitsThatHadToWaitForConfigMgr();
    }
    

提交回复
热议问题