What just happened?

The qApp macro is a shortcut for a function that returns a pointer to the application singleton object, so when the action is triggered, Qt will call the quit() slot on the QApplication object created in main(), which, in turn, will cause the application to end.