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

charles.yin at nokia.com charles.yin at nokia.com
Thu Mar 31 05:49:36 CEST 2011


Hi James,

Did you try to replace the "return 1;" with "exit(1);"?

Cheers
Charles
________________________________________
From: qt-interest-bounces+charles.yin=nokia.com at qt.nokia.com [qt-interest-bounces+charles.yin=nokia.com at qt.nokia.com] on behalf of ext James Yan [james.pizza at gmail.com]
Sent: Thursday, 31 March 2011 1:04 PM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] how quit the app completely before MainWindow show up

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
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list