Correct way to quit a Qt program?

前端 未结 6 1540
半阙折子戏
半阙折子戏 2020-12-04 08:07

How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file?

Should I:

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 08:47

    You can call qApp.exit();. I always use that and never had a problem with it.

    If you application is a command line application, you might indeed want to return an exit code. It's completely up to you what the code is.

提交回复
热议问题