Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How should I properly terminate a program after an exception?
Forum Updated to NodeBB v4.3 + New Features

How should I properly terminate a program after an exception?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 675 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    buon43
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved