diff options
author | Manuel Schneider | 2013-09-27 15:45:53 +0200 |
---|---|---|
committer | Manuel Schneider | 2013-09-27 15:45:53 +0200 |
commit | d9694ef28a55ddb5c901f6e2c34397af6d3b38ba (patch) | |
tree | fabf982d3ee75b81789285e2f400c0cf61259534 /PrinterGUI/PrinterGUI_SRC/main.cpp | |
download | printergui-d9694ef28a55ddb5c901f6e2c34397af6d3b38ba.tar.gz printergui-d9694ef28a55ddb5c901f6e2c34397af6d3b38ba.tar.xz printergui-d9694ef28a55ddb5c901f6e2c34397af6d3b38ba.zip |
Initial
Diffstat (limited to 'PrinterGUI/PrinterGUI_SRC/main.cpp')
-rw-r--r-- | PrinterGUI/PrinterGUI_SRC/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/PrinterGUI/PrinterGUI_SRC/main.cpp b/PrinterGUI/PrinterGUI_SRC/main.cpp new file mode 100644 index 0000000..784c88a --- /dev/null +++ b/PrinterGUI/PrinterGUI_SRC/main.cpp @@ -0,0 +1,28 @@ +#include <QApplication> +#include <fstream> +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + // First check parameter count + if (argc != 2) + return 2; + + // Check if file exists + std::fstream f; + try + { + f.open(argv[1], std::ios::in); + } + catch (std::fstream::failure e) + { + return 3; + } + f.close(); + + QApplication a(argc, argv); + MainWindow w(argv[1]); + w.show(); + + return a.exec(); +} |