From: smh Date: Mon, 29 Mar 2004 13:30:39 +0000 (+0000) Subject: Event handling for VISU X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=74ca05237527abf5b8d9df2ae9c53c849c0794cf;p=modules%2Fkernel.git Event handling for VISU --- diff --git a/src/SALOMEGUI/Makefile.in b/src/SALOMEGUI/Makefile.in index 08d0682d3..6ac95d8bb 100644 --- a/src/SALOMEGUI/Makefile.in +++ b/src/SALOMEGUI/Makefile.in @@ -97,7 +97,8 @@ EXPORT_HEADERS = \ SALOMEGUI_NameDlg.h \ SALOMEGUI_SetValueDlg.h \ SALOMEGUI_SetupCurveDlg.h \ - SALOMEGUI_CloseDlg.h + SALOMEGUI_CloseDlg.h \ + SALOME_Event.hxx # .po files to transform in .qm diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index 9a100591e..850b327f8 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -71,6 +71,8 @@ #include "SALOMEGUI_CloseDlg.h" #include "SALOMEGUI_ActivateComponentDlg.h" +#include "SALOME_Event.hxx" + // QT Includes #include #include @@ -92,6 +94,7 @@ #include #include #include +#include #if QT_VERSION > 300 #include @@ -445,6 +448,16 @@ bool QAD_Desktop::eventFilter( QObject* o, QEvent* e ) } } } + else if ( e->type() == QEvent::User + 1 ) { // SALOME_Event has type QEvent::User + 1 + SALOME_Event* aSE = (SALOME_Event*)e; + + // here we do the job... + for ( int i = 0; i < 100000; i++ ) { + } + + if ( aSE->getWaitCondition() ) + aSE->getWaitCondition()->wakeAll(); + } return QMainWindow::eventFilter( o, e ); } diff --git a/src/SALOMEGUI/SALOME_Event.hxx b/src/SALOMEGUI/SALOME_Event.hxx new file mode 100644 index 000000000..9070b8228 --- /dev/null +++ b/src/SALOMEGUI/SALOME_Event.hxx @@ -0,0 +1,23 @@ +// File: SALOME_Event.hxx +// Created: Mon Mar 29 16:36:52 2004 +// Author: Sergey ANIKIN +// + + +#ifndef SALOME_Event_HeaderFile +#define SALOME_Event_HeaderFile + +#include + +class QWaitCondition; + +class SALOME_Event : public QCustomEvent +{ +public: + SALOME_Event( QWaitCondition* wc = 0 ) : QCustomEvent( (QEvent::Type)(QEvent::User + 1), (void*)wc ) {}; + + QWaitCondition* getWaitCondition() { return (QWaitCondition*)data(); } + +}; + +#endif