Salome HOME
331c26449c0845cd652d902c1582fa632899d616
[modules/gui.git] / src / SUIT / SUIT_ExceptionHandler.cxx
1 #include "SUIT_ExceptionHandler.h"
2
3 #include "SUIT_MessageBox.h"
4
5 #include <qapplication.h>
6
7 /*!\class SUIT_ExceptionHandler
8  * Show exception message on error handler.
9  */
10
11 /*!
12   Checks: is internal handle on object \a o?
13 */
14 bool SUIT_ExceptionHandler::handle( QObject* o, QEvent* e )
15 {
16   return internalHandle( o, e );
17 }
18
19 /*!
20   Checks: is internal handle on object \a o?
21 */
22 bool SUIT_ExceptionHandler::internalHandle( QObject* o, QEvent* e )
23 {
24   return qApp ? qApp->QApplication::notify( o, e ) : false;
25 }
26
27 /*!
28   Show error message \a mgs, if application is not null.
29 */
30 void SUIT_ExceptionHandler::showMessage( const QString& title, const QString& msg )
31 {
32   if ( !qApp )
33     return;
34
35   SUIT_MessageBox::error1( qApp->mainWidget(), title, msg, "OK" );
36 }