-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (34 loc) · 951 Bytes
/
main.cpp
File metadata and controls
39 lines (34 loc) · 951 Bytes
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
#include <QApplication>
#include <unistd.h>
#include "include/window.h"
#include "include/console.h"
int main(int argc, char *argv[])
{
// seed generator for srand -> requires QTime
qsrand(QDateTime::currentDateTime().toTime_t() ^ (getpid() + (getpid() << 15)));
char video[] = "-v";
//qsrand(QTime(0,0,0).msecsTo(QTime::currentTime()) * static_cast<unsigned int>(getpid()));
if( argc > 1 )
{
if( !strcmp( argv[1], video ))
{
QApplication app(argc, argv);
Window window;
window.show();
return app.exec();
}
else
{
fprintf(stderr, "Incorrect runtime flag\n");
exit(1);
}
}
else
{
QCoreApplication app(argc, argv);
Console console;
QObject::connect(&console,SIGNAL(finished()),&app, SLOT(quit()),Qt::QueuedConnection);
return app.exec();
}
return 1;
}