diff options
author | ConfuSomu | 2023-06-10 19:20:20 -0400 |
---|---|---|
committer | ConfuSomu | 2023-06-10 19:20:20 -0400 |
commit | cb70783e64d3571dd1de7dd10da6529489c0e603 (patch) | |
tree | 178049d07fe05a513b3c45d8e23a5349340b7300 /src/mainwindow.cpp | |
parent | da6afaedc1bce08ee78b3f8f780ab72ce1f54b6f (diff) | |
download | ActorViewer-cb70783e64d3571dd1de7dd10da6529489c0e603.tar ActorViewer-cb70783e64d3571dd1de7dd10da6529489c0e603.tar.gz ActorViewer-cb70783e64d3571dd1de7dd10da6529489c0e603.zip |
Exit with exit codes depending on command line
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 363dcc0..ec2026e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -11,6 +11,7 @@ #include <QMimeData> #include <QCommandLineParser> #include <QMessageBox> +#include <cstdlib> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -27,13 +28,13 @@ MainWindow::~MainWindow() void MainWindow::act_command_line(CommandLineParsedOptions &options, QCommandLineParser &parser) { switch (options.result) { case CommandLineError: - QMessageBox::critical(this, tr("Command line"), tr("The passed command line is incorrect and will be ignored.\nMore information: %1").arg(options.error_message)); + QMessageBox::critical(this, tr("Command line"), tr("The passed command line is incorrect and will be ignored.\nMore information: %1").arg(options.error_message)); exit(EXIT_FAILURE); break; case CommandLineHelpRequested: - QMessageBox::information(this, QGuiApplication::applicationDisplayName(), "<pre>" + parser.helpText() + "</pre>"); exit(0); + QMessageBox::information(this, QGuiApplication::applicationDisplayName(), "<pre>" + parser.helpText() + "</pre>"); exit(EXIT_SUCCESS); break; case CommandLineVersionRequested: - on_actionAbout_triggered(true); exit(0); + on_actionAbout_triggered(true); exit(EXIT_SUCCESS); break; case CommandLineOk: if (!options.outbox_filename.isEmpty()) |