This wasn’t immediately clear to me from the docs for QCoreApplication::quit().
Are any pending events in the event loop cancelled when the quit() slot is invoked?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Calling
QCoreApplication::quit()is the same as callingQCoreApplication::exit(0). There it saysSince the event loop is left, I would think any pending events are cancelled.
Edit: I made a small test case to show that pending events are indeed cancelled:
In this case, the event posted in
MyObject::start()will never arrive. It will, of course, if you remove the call toQCoreApplication::quit().