-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.cpp
57 lines (47 loc) · 1.02 KB
/
Application.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
50
51
52
53
54
55
56
57
/**
* @file Application.cpp
* @author Dan R. Lipsa
* @date 27 August 2010
*
* Definition of the Application class
*/
#include "Application.h"
#include "Debug.h"
boost::shared_ptr<Application> Application::m_application;
Application::Application(int& c, char** v) :
QVTKApplication(c, v)
{
/*
QFont defaultFont = font ();
defaultFont.setPointSize (8);
setFont (defaultFont);
*/
}
boost::shared_ptr<Application> Application::Get (int& c, char** v)
{
if (m_application == 0)
m_application.reset (new Application (c, v));
return m_application;
}
boost::shared_ptr<Application> Application::Get ()
{
if (m_application == 0)
ThrowException ("The application object have to be created first");
return m_application;
}
void Application::release ()
{
m_application.reset ();
}
bool Application::notify(QObject *rec, QEvent *ev)
{
try
{
return QApplication::notify(rec, ev);
}
catch (const exception& e)
{
cdbg << "Exception: " << e.what () << endl;
return false;
}
}