Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkSafeApplication.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "QmitkSafeApplication.h"
14 
15 #include "QmitkSafeNotify.h"
16 
17 #include <mitkException.h>
18 #include <mitkLogMacros.h>
19 
20 QmitkSafeApplication::QmitkSafeApplication(int &argc, char **argv, bool safeMode)
21  : QApplication(argc, argv),
22  m_SafeMode(safeMode)
23 {
24 }
25 
26 bool QmitkSafeApplication::notify(QObject *receiver, QEvent *event)
27 {
28  return m_SafeMode
29  ? QmitkSafeNotify<QApplication>(this, receiver, event)
30  : QApplication::notify(receiver, event);
31 }
32 
34 {
35  m_SafeMode = safeMode;
36 }
37 
39 {
40  return m_SafeMode;
41 }
QmitkSafeApplication(int &argc, char **argv, bool safeMode=true)
bool notify(QObject *receiver, QEvent *event) override
void setSafeMode(bool safeMode)