Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How should I properly terminate a program after an exception?
buon43 last edited by
Say, if I have an exception where recovery is not possible, how should I properly terminate the program? There are qFatal, QApplication::quit(), exit(EXIT_FAILURE) and so on. What should I use in my case?
Without knowing your current use case it's difficult to tell. What do you mean by "recovery is not possible" ? Is it something like a device that has been removed ? Or is it something that would make the application crash ? In the second case qFatal is the way to go because your application would crash anyway. Using qFatal you can give a useful information to your user.