-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
42 lines (34 loc) · 881 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* File: main.cpp
* Author: saikrishna
*
* Created on January 1, 2014, 9:13 AM
*/
#include <QApplication>
#include "MainForm.h"
#include "mainconsole.h"
int main(int argc, char *argv[]) {
// initialize resources, if needed
// Q_INIT_RESOURCE(resfile);
QApplication app(argc, argv);
QStringList arguments = app.arguments();
QStringList options;
bool automated = false;
for (int i = 1; i < arguments.size(); i++) {
QString argument = arguments.at(i);
if (argument.startsWith("--")) {
options.append(argument);
}
if (argument.startsWith("--auto")) {
automated = true;
}
}
if (automated) {
MainConsole mainConsole(options);
return app.exec();
} else {
MainForm mainForm(options);
mainForm.show();
return app.exec();
}
}