47 #ifndef _MIRA_FRAMEWORKWITHGUI_H_ 48 #define _MIRA_FRAMEWORKWITHGUI_H_ 51 #include <boost/scoped_ptr.hpp> 54 #include <QApplication> 55 #include <QMessageBox> 87 bool notify(QObject *rec, QEvent *ev)
90 return QApplication::notify(rec, ev);
92 catch (std::exception& ex) {
95 std::string msg = ex.what() +
96 std::string(
"\n\nDo you want to continue or abort");
97 if(QMessageBox::critical(NULL,
"Unhandled exception", msg.c_str() ,
98 QMessageBox::Ignore | QMessageBox::Abort) == QMessageBox::Abort)
102 MIRA_LOG(
ERROR) <<
"Unhandled exception: <unknown exception>";
104 std::string msg =
"<unknown exception>" +
105 std::string(
"\n\nDo you want to continue or abort");
106 if(QMessageBox::critical(NULL,
"Unhandled exception", msg.c_str() ,
107 QMessageBox::Ignore | QMessageBox::Abort) == QMessageBox::Abort)
127 FrameworkWithGui(
int& argc,
char** argv, QApplication* app,
bool startImmediately =
false) :
151 MIRA_LOG(
DEBUG) <<
"Application was closed, terminating ...";
157 QCoreApplication::instance ()->quit();
FrameworkWithGui(int &argc, char **argv, QApplication *app, bool startImmediately=false)
Constructor that takes previously created QApplication.
Definition: FrameworkWithGui.h:127
static Type & instance()
Returns a reference to the singleton instance.
Definition: Singleton.h:544
bool mInExec
Definition: Framework.h:393
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
A thread monitor, which collects information about the resources of all running threads of the curren...
#define MIRA_LOG(level)
Use this macro to log data.
Definition: LoggingCore.h:529
static void closeSplashScreen()
virtual void requestTermination(int exitcode=0)
Requests the termination of the framework and hence the whole application.
Definition: FrameworkWithGui.h:156
Declaration of SplashScreen.
virtual int exec()
Executes the framework and executes the underlying QApplication until the application is terminated...
Definition: FrameworkWithGui.h:146
~FrameworkWithGui()
Definition: FrameworkWithGui.h:133
Application(int &argc, char **argv)
Definition: FrameworkWithGui.h:81
Auxiliary logging macros for special entities like exceptions, etc.
Definition: FrameworkWithGui.h:66
This class represents the core element of a modular application.
Definition: Framework.h:149
virtual void requestTermination(int exitcode=0)
Requests the termination of the framework and hence the whole application.
#define MIRA_LOG_EXCEPTION(level, ex)
Log the specified exception, including all information that the exception object carries.
Definition: LoggingAux.h:107
bool notify(QObject *rec, QEvent *ev)
Overwrites QApplication::notify in order to catch exceptions.
Definition: FrameworkWithGui.h:87
Implements our own Application derived from QApplication in order to overwrite the notify method...
Definition: FrameworkWithGui.h:77
int getTerminationExitCode() const
Returns the exit code as specified by requestTermination(), or 0 if requestTermination() was not call...
Definition: LoggingCore.h:78
Definition: LoggingCore.h:75
The framework that holds all manager classes and provides startup and shutdown of all framework relat...
FrameworkWithGui(int &argc, char **argv, bool startImmediately=false)
Constructor that creates own FrameworkWithGui::Application.
Definition: FrameworkWithGui.h:117