Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSingleApplication.h
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 #ifndef QmitkSingleApplication_h
14 #define QmitkSingleApplication_h
15 
16 #include <MitkAppUtilExports.h>
17 
18 #include <qtsingleapplication.h>
19 
20 #include <QmitkSafeNotify.h>
21 
34 class MITKAPPUTIL_EXPORT QmitkSingleApplication : public QtSingleApplication
35 {
36 public:
43  QmitkSingleApplication(int &argc, char **argv, bool safeMode = true);
44 
56  bool notify(QObject *receiver, QEvent *event) override;
57 
62  void setSafeMode(bool safeMode);
63 
68  bool getSafeMode() const;
69 
70 private:
71  bool m_SafeMode;
72 };
73 
74 #endif
#define MITKAPPUTIL_EXPORT
A single-instance application with optional exception-safe event dispatching.
bool notify(QObject *receiver, QEvent *event) override
Reimplements QtSingleApplication::notify() to catch unhandled exceptions.
QmitkSingleApplication(int &argc, char **argv, bool safeMode=true)
Construct a QmitkSingleApplication.
void setSafeMode(bool safeMode)
Enable or disable safe mode.
bool getSafeMode() const
Query whether safe mode is currently enabled.