app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
To copy to clipboard, switch view to plain text mode

Originally Posted by
jacek
You don't need this in Qt4.
After removing it, it became better but still from time to time the program quits when I confirm login with enter instead of clicking the button. I will therefore rewrite the main the way you suggested first, and do app.setQuitOnLastWindowClosed( false ); before the login dialog is displayed and enable it again before the main window is shown.
Bookmarks