Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSafeApplication.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 QmitkSafeApplication_h
14 #define QmitkSafeApplication_h
15 
16 #include <MitkAppUtilExports.h>
17 
18 #include <QApplication>
19 #include <QMessageBox>
20 
32 class MITKAPPUTIL_EXPORT QmitkSafeApplication : public QApplication
33 {
34 public:
41  QmitkSafeApplication(int &argc, char **argv, bool safeMode = true);
42 
54  bool notify(QObject *receiver, QEvent *event) override;
55 
60  void setSafeMode(bool safeMode);
61 
66  bool getSafeMode() const;
67 
68 private:
69  bool m_SafeMode;
70 };
71 
72 #endif
#define MITKAPPUTIL_EXPORT
A QApplication subclass that optionally catches unhandled exceptions in the Qt event loop.
QmitkSafeApplication(int &argc, char **argv, bool safeMode=true)
Construct a QmitkSafeApplication.
bool getSafeMode() const
Query whether safe mode is currently enabled.
void setSafeMode(bool safeMode)
Enable or disable safe mode.
bool notify(QObject *receiver, QEvent *event) override
Reimplements QApplication::notify() to catch unhandled exceptions.