-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.cpp
49 lines (38 loc) · 1.34 KB
/
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
43
44
45
46
47
48
49
// (c) 2015 David Vyvlečka, AGPLv3
/*[Information about Qt + OpenGL classes (e.g. how to use the API) obtained from Qt Reference Pages
http://doc.qt.io/qt-5/reference-overview.html 9. 5. 2015]*/
#include <QApplication>
#include <QDesktopWidget>
#include "window.h"
#include "data.h"
#include "admeshEventFilter.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
setlocale(LC_NUMERIC,"C");
textdomain("admeshgui");
QCoreApplication::setOrganizationName("ADMesh");
QCoreApplication::setApplicationName("ADMeshGUI");
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setSamples(4);
QSurfaceFormat::setDefaultFormat(format);
Window window;
#ifdef Q_OS_MAC
app.installEventFilter(new admeshEventFilter(&app, &window));
#endif
window.setWindowIcon(QIcon::fromTheme("admeshgui", QIcon("://Resources/admeshgui.svg")));
window.resize(window.sizeHint());
int desktopArea = QApplication::desktop()->width() *
QApplication::desktop()->height();
int widgetArea = window.width() * window.height();
window.setWindowTitle("ADMeshGUI");
if (((float)widgetArea / (float)desktopArea) < 0.75f)
window.show();
else
window.showMaximized();
for(int i=1;i<argc;i++){
window.openByFilename(argv[i]);
}
return app.exec();
}