Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkSingleApplication.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "QmitkSingleApplication.h"
18 
19 #include "QmitkSafeNotify.h"
20 
21 QmitkSingleApplication::QmitkSingleApplication(int &argc, char **argv, bool safeMode)
22  : QtSingleApplication(argc, argv), m_SafeMode(safeMode)
23 {
24 }
25 
26 bool QmitkSingleApplication::notify(QObject *receiver, QEvent *event)
27 {
28  if (!m_SafeMode)
29  {
30  return QtSingleApplication::notify(receiver, event);
31  }
32 
33  return QmitkSafeNotify<QtSingleApplication>(this, receiver, event);
34 }
35 
37 {
38  m_SafeMode = safeMode;
39 }
40 
42 {
43  return m_SafeMode;
44 }
void setSafeMode(bool safeMode)
QmitkSingleApplication(int &argc, char **argv, bool safeMode=true)
bool notify(QObject *receiver, QEvent *event) override