-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (33 loc) · 1.01 KB
/
main.cpp
File metadata and controls
40 lines (33 loc) · 1.01 KB
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
#include <QApplication>
#include <QDebug>
#include "common.h"
#include "options.h"
#include "browser.h"
void safeExit()
{
qDebug() << "Exit";
QApplication::exit();
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setApplicationName(APP_NAME);
QApplication::setApplicationVersion(APP_VERSION);
qDebug() << APP_NAME << APP_VERSION << " - " << APP_DESCRIPTION;
Options options;
bool parserResult = parseOptions(QCoreApplication::arguments(), options);
qDebug() << " url =" << options.url;
qDebug() << " out =" << options.out;
qDebug() << " width =" << options.width;
qDebug() << " height =" << options.height;
qDebug() << " delay =" << options.delay;
qDebug() << " timeout =" << options.timeout;
if (!parserResult) {
qDebug() << "Invalid or missing arguments";
return -1;
}
Browser browser(options);
QObject::connect(&browser, &Browser::screenshotFinished, safeExit);
browser.run();
return app.exec();
}