What is the advantage of your code over this one?
Qt Code:
int main(int argc, char **argv) { Sasaja sasaja; return sasaja.DoWork(); }To copy to clipboard, switch view to plain text mode
What is the advantage of your code over this one?
Qt Code:
int main(int argc, char **argv) { Sasaja sasaja; return sasaja.DoWork(); }To copy to clipboard, switch view to plain text mode
The difference is there is no event loop running.
Whether that is an advantage or not depends on what DoWork does.
Karl
In your version the event loop is not running as well since you exit it immediately after handling the slot which is started immediately after you call exec(). The only difference would be if the constructor of Sasaja scheduled any events by itself that would execute before the DoWork slot did.
We use this method to write server daemons.
We create a private slot that watches for signals that tell the application to exit.
Without the signal, the program continues to run.
Karl
Bookmarks