After all the code is executed, the application (Qt, console) is closed only by closing the window. How to correct it. On app.quit () and app.exit () does not respond.
3 answers
app.exit () only causes the completion of app.exec (), and kuteshnye programs are terminated in the same way as regular ones - by returning values from main ()
If you did not execute app.exec () in your program, then you do not need to do app.exit ()
|
Send a message box "close"?
- 2Send using emit? I thought ... And from whom to send? I won’t think ( - Alexey Kotov
|
Try QCoreApplication :: exit ();
UPD: Return from the function main 0, instead of app.exec ();
- In fact, I am doing this. QCoreApplication app; . . . app.exit (); Does not work. Or am I wrong? - Alexey Kotov
- 2Not exactly, QCoreApplication :: exit (); This is a static method call that can be called from any part of the code. <br/> UPD Although the documentation says that this call is equivalent to calling app.quit (); - AlexDenisov
- Clear. Tried. The result is the same. - Alexey Kotov
- 3And where are you trying to make a way out? What if you return in the function main 0, not app.exec () ;? Such a way out? - AlexDenisov
- oneYes, in principle, satisfied. I did just that. I just wanted to figure it out. - Alexey Kotov
|