[Qt-interest] how quit the app completely before MainWindow show up

James Yan james.pizza at gmail.com
Thu Mar 31 05:04:31 CEST 2011


Hey all,
   i've code looks simply like this:

===
int main(int argc, char* argv[])
{
    QApplication app(argc,argv);
    
    //do some check
    if(some_check_fail())
    {
         QMessageBox msgbox(0);
         msgbox.setText("Hey, fail to start application.");
         msgbox.exec();
         return 1;
    }

    //everything ok, so show mainwindow up
    MainWindow mw;
    mw.show();
  
    return app.exec();
}
====

i found my application does not quit completely after msgbox was confirmed, the process still could be found in "task manager" on Mac OS X.
Any good suggestion? i've try app.closeAllWindow() / app.quit() after msgbox.exec(), but with no help.

regards,
James


More information about the Qt-interest-old mailing list