|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
A single-instance application with optional exception-safe event dispatching. More...
#include <QmitkSingleApplication.h>


Public Member Functions | |
| QmitkSingleApplication (int &argc, char **argv, bool safeMode=true) | |
| Construct a QmitkSingleApplication. More... | |
| bool | notify (QObject *receiver, QEvent *event) override |
| Reimplements QtSingleApplication::notify() to catch unhandled exceptions. More... | |
| void | setSafeMode (bool safeMode) |
| Enable or disable safe mode. More... | |
| bool | getSafeMode () const |
| Query whether safe mode is currently enabled. More... | |
A single-instance application with optional exception-safe event dispatching.
This class extends QtSingleApplication (which ensures only one instance of the application runs at a time) with the same safe-mode behavior as QmitkSafeApplication. When safe mode is enabled, unhandled exceptions thrown during Qt event processing are caught and reported to the user instead of crashing the application.
This class is used by mitk::BaseApplication when single-instance mode is requested.
Definition at line 34 of file QmitkSingleApplication.h.
| QmitkSingleApplication::QmitkSingleApplication | ( | int & | argc, |
| char ** | argv, | ||
| bool | safeMode = true |
||
| ) |
Construct a QmitkSingleApplication.
| [in,out] | argc | Reference to the application argument count (passed to QtSingleApplication). |
| [in] | argv | Array of command line argument strings (passed to QtSingleApplication). |
| [in] | safeMode | If true, exception-safe event dispatching is enabled. Defaults to true. |
| bool QmitkSingleApplication::getSafeMode | ( | ) | const |
Query whether safe mode is currently enabled.
true if safe mode is enabled; false otherwise.
|
override |
Reimplements QtSingleApplication::notify() to catch unhandled exceptions.
When safe mode is enabled, exceptions thrown during event processing are caught and an error message dialog is displayed. When safe mode is disabled, this method delegates directly to QtSingleApplication::notify().
| [in] | receiver | The target QObject that should receive the event. |
| [in] | event | The QEvent to be delivered to the receiver. |
true if the event was recognized and processed by the receiver; false otherwise. | void QmitkSingleApplication::setSafeMode | ( | bool | safeMode | ) |
Enable or disable safe mode.
| [in] | safeMode | If true, exception-catching event dispatching is enabled. |