Please, when creating a Qt program, always use an Q...Application object and start an event loop.

By the way, there is no such thing as a hidden return in C++. At the end of a scope, you return from that scope. It's as basic as that. It's up to you to provide the correct return values. If not, the compiler WILL complain. And if you don't set this warning as an error, your program will crash when you do this often. It's bad technique to not control your return values.