]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Event handling for VISU
authorsmh <smh@opencascade.com>
Mon, 29 Mar 2004 13:30:39 +0000 (13:30 +0000)
committersmh <smh@opencascade.com>
Mon, 29 Mar 2004 13:30:39 +0000 (13:30 +0000)
src/SALOMEGUI/Makefile.in
src/SALOMEGUI/QAD_Desktop.cxx
src/SALOMEGUI/SALOME_Event.hxx [new file with mode: 0644]

index 08d0682d339d979951d6a93f12968f1fde08f402..6ac95d8bb8dd2221413226cd82ed7d379bc591a1 100644 (file)
@@ -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
index 9a100591e5993238f8c750a7536d8eb2e15da098..850b327f881c873bf6d40d79e52a6fab06492ee8 100644 (file)
@@ -71,6 +71,8 @@
 #include "SALOMEGUI_CloseDlg.h"
 #include "SALOMEGUI_ActivateComponentDlg.h"
 
+#include "SALOME_Event.hxx"
+
 // QT Includes
 #include <qlabel.h>
 #include <qlayout.h>
@@ -92,6 +94,7 @@
 #include <qlineedit.h>
 #include <qdatetime.h>
 #include <qthread.h>
+#include <qwaitcondition.h>
 
 #if QT_VERSION > 300
   #include <qlistbox.h>
@@ -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 (file)
index 0000000..9070b82
--- /dev/null
@@ -0,0 +1,23 @@
+// File:       SALOME_Event.hxx
+// Created:    Mon Mar 29 16:36:52 2004
+// Author:     Sergey ANIKIN
+//             <san@startrex.nnov.opencascade.com>
+
+
+#ifndef SALOME_Event_HeaderFile
+#define SALOME_Event_HeaderFile
+
+#include <qevent.h>
+
+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