-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.cpp
More file actions
37 lines (34 loc) · 791 Bytes
/
Application.cpp
File metadata and controls
37 lines (34 loc) · 791 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
#include "Application.h"
#include "Exceptions.h"
#include "ToolBase.h"
#include "GUIHelper.h"
Application::Application(int& argc, char** argv)
: QApplication(argc, argv)
{
QCoreApplication::setApplicationVersion(ToolBase::version());
}
bool Application::notify(QObject* rec, QEvent* ev)
{
try
{
return QApplication::notify(rec,ev);
}
catch(Exception& e)
{
QMap<QString, QString> add;
add.insert("file", e.file());
add.insert("line", QString::number(e.line()));
GUIHelper::showMessage("Uncaught cppCORE exception", e.message(), add);
exit(1);
}
catch(std::exception& e)
{
GUIHelper::showMessage("Uncaught std::exception", e.what());
exit(1);
}
catch(...)
{
GUIHelper::showMessage("Uncaught unknown exception", "Unknown exception type!");
}
return false;
}