X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_EventFilter.cxx;h=6803869d2464620d9d7d50780573fea34f28224f;hb=f1343b39ab73a30415d2d909a4887f6536278e2e;hp=77ab42c9f37bbacdb876c001643d8e0915616fd0;hpb=f830c97c748d8f8a6a7eccc8e3a58e19066a1181;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_EventFilter.cxx b/src/LightApp/LightApp_EventFilter.cxx index 77ab42c9f..6803869d2 100644 --- a/src/LightApp/LightApp_EventFilter.cxx +++ b/src/LightApp/LightApp_EventFilter.cxx @@ -1,17 +1,20 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -21,7 +24,9 @@ #include -#include +#include + +#include LightApp_EventFilter* LightApp_EventFilter::myFilter = NULL; @@ -50,19 +55,36 @@ bool LightApp_EventFilter::eventFilter( QObject* o, QEvent* e ) SUIT_Desktop* aDesktop = 0; while( parent ) - { - if ( aDesktop = dynamic_cast(parent) ) - break; - parent = parent->parentWidget(); - } + { + aDesktop = dynamic_cast(parent); + if ( aDesktop ) + break; + parent = parent->parentWidget(); + } if ( aDesktop ) - aDesktop->emitActivated(); + aDesktop->emitActivated(); + } + + else if(e->type() == SALOME_EVENT) + { + SALOME_Event* aSE = (SALOME_Event*)((SALOME_CustomEvent*)e)->data(); + processEvent(aSE); + ((SALOME_CustomEvent*)e)->setData( 0 ); + return true; } return QObject::eventFilter( o, e ); } +/*!Process event.*/ +void LightApp_EventFilter::processEvent( SALOME_Event* theEvent ) +{ + if(theEvent) + theEvent->ExecutePostedEvent(); +} + + /*!Create new instance of LightApp_EventFilter*/ void LightApp_EventFilter::Init() {