Qt: Is there notification when event loop starts?

前端 未结 3 2022
一向
一向 2021-02-19 00:19

I have a Qt application with this kind of main()...

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    MainWindow   mainWin;

    ... A sep         


        
3条回答
  •  你的背包
    2021-02-19 00:37

    You can do it in the following order:

    QApplication app(argc, argv);
    Mainwinwdow mainWin;
    QThread yourThread;
    
    //connect the signals from the thread to the mainWin here
    
    mainWin.Init();
    mainWin.show();
    
    yourThread.start();
    
    return app.exec();
    

提交回复
热议问题