[Interest] Exiting a Qt app cleanly.

Joseph W Joshua joshua at megvel.me.ke
Fri Apr 12 07:49:45 CEST 2013


Hi all,

 

I am having a problem in exiting an application.

 

Basically, this is a small GUI application which opens, checks for updates
and then 

starts another executable in the same folder. After launching the other
executable, 

it should exit.

 

The problem is that, after starting the application and calling
qApp->quit();, nothing

Happens.

 

I have checked all forums and past questions here and elsewhere, and they
all point to 

qApp->quit();, which is not working for me.

 

Here is my main.cpp

 

int main(int argc, char *argv[])

{

    QApplication a(argc, argv);

    a.setQuitOnLastWindowClosed(true);

    LauncherDialog w;

    w.show();    

    return a.exec();

}

 

 

Here is the exit part in my LauncherDialog class:

 

void LauncherDialog::closeAll()

{

    qApp->quit();

}

 

 

Regards,

 

Joshua

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130412/5be1790d/attachment.html>


More information about the Interest mailing list