[Interest] Exiting a Qt app cleanly.

Gopalakrishna Bhat gopalakbhat at gmail.com
Fri Apr 12 08:16:08 CEST 2013


On Fri, Apr 12, 2013 at 5:49 AM, Joseph W Joshua <joshua at megvel.me.ke>wrote:

> 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();****
>
> }
>
Couple of things to check:
1)Have you set setModal(true) for the dialog?

2)Is closeAll() being called?  If not maybe you are waiting for the other
process to complete execution.

>  **
>
> ** **
>
> Regards,****
>
> ** **
>
> Joshua****
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>


-- 
My blog http://gkbhat.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130412/fedf27d6/attachment.html>


More information about the Interest mailing list