QT: how to exit application and close UI
<p>I tried to use qApp->exit() to exit application and close UI. but I failed the UI is still there after qApp->exit() executed. Anyone can help to figure out why? thanks a lot.</p>

<pre><code>#include "clsDownloadUpdateList.h"
#include &lt;QApplication&gt;
#include &lt;qtranslator.h&gt;
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QTranslator translator;
    translator.load("en-CN_upgrader");
    qApp-&gt;installTranslator(&amp;translator);
    clsDownloadUpdateList w;
    w.show();

    return a.exec();
}

clsDownloadUpdateList::clsDownloadUpdateList(QWidget *parent) :
    QMainWindow(parent),
    _state(STOP),
    ui(new Ui::clsDownloadUpdateList)
{
    ui-&gt;setupUi(this);
    this-&gt;setWindowTitle("GCS Upgrader");
// other code
// here comes the code to exit application
            qApp-&gt;exit();
// but the UI is still there.
}
</code></pre>