Back to index

salome-gui  6.5.0
Public Member Functions | Private Attributes
SALOME_QApplication Class Reference
Collaboration diagram for SALOME_QApplication:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SALOME_QApplication (int &argc, char **argv)
virtual bool notify (QObject *receiver, QEvent *e)
SUIT_ExceptionHandlerhandler () const
void setHandler (SUIT_ExceptionHandler *h)

Private Attributes

SUIT_ExceptionHandlermyHandler

Detailed Description

Definition at line 242 of file SALOME_Session_Server.cxx.


Constructor & Destructor Documentation

SALOME_QApplication::SALOME_QApplication ( int &  argc,
char **  argv 
) [inline]

Definition at line 249 of file SALOME_Session_Server.cxx.

  : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
#else
  : QApplication( argc, argv ), 
#endif
    myHandler ( 0 ) {}

Member Function Documentation

Definition at line 300 of file SALOME_Session_Server.cxx.

{ return myHandler; }
virtual bool SALOME_QApplication::notify ( QObject receiver,
QEvent *  e 
) [inline, virtual]

Definition at line 260 of file SALOME_Session_Server.cxx.

  {
#if OCC_VERSION_LARGE < 0x06010100
    // Disable GUI user actions while python command is executed
    if (SUIT_Session::IsPythonExecuted()) {
      // Disable mouse and keyboard events
      QEvent::Type aType = e->type();
      if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
          aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
          aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
          aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
          aType == QEvent::Accel || aType == QEvent::AccelOverride)
        return false;
    }
#endif

#ifdef ENABLE_TESTRECORDER
    return myHandler ? myHandler->handle( receiver, e ) :
      TestApplication::notify( receiver, e );
#else
    try {
      return myHandler ? myHandler->handle( receiver, e ) : QApplication::notify( receiver, e );
    }
    catch (std::exception& e) {
      std::cerr << e.what()  << std::endl;
    }
    catch (CORBA::Exception& e) {
      std::cerr << "Caught CORBA::Exception"  << std::endl;
      CORBA::Any tmp;
      tmp<<= e;
      CORBA::TypeCode_var tc = tmp.type();
      const char *p = tc->name();
      std::cerr << "notify(): CORBA exception of the kind : " << p << " is caught" << std::endl;
    }
    catch (...) {
      std::cerr << "Unknown exception caught in Qt handler: it's probably a bug in SALOME platform" << std::endl;
    }
    return false;  // return false when exception is caught
#endif
  }

Definition at line 301 of file SALOME_Session_Server.cxx.

{ myHandler = h; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 304 of file SALOME_Session_Server.cxx.


The documentation for this class was generated from the following file: