1 // File: VisuGUI_DialogRunner.cxx
2 // Created: Thu Oct 6 10:17:39 2005
3 // Author: Alexander SOLOVYOV
4 // <asl@multiplex.nnov.opencascade.com>
6 #include "VisuGUI_DialogRunner.h"
9 #include <qapplication.h>
11 VisuGUI_DialogRunner::VisuGUI_DialogRunner( QDialog* dlg )
18 connect( myDlg, SIGNAL( destroyed() ), this, SLOT( onDialogDelete() ) );
19 myDlg->installEventFilter( this );
23 VisuGUI_DialogRunner::~VisuGUI_DialogRunner()
27 int VisuGUI_DialogRunner::run( const bool modal )
29 if( myInLoop || !myDlg )
38 return myDlg->result();
41 void VisuGUI_DialogRunner::onDialogDelete()
50 bool VisuGUI_DialogRunner::eventFilter( QObject* o, QEvent* e )
52 if( o==myDlg && e && ( e->type()==QEvent::Close || e->type()==QEvent::Hide ) )
54 if( myInLoop && !myDlg->isMinimized() )
62 return QObject::eventFilter( o, e );