#include #include // ------------------------------------------------------------------------- cpBaseQtApplication::Blocker:: Blocker( ) : QObject( ) { } // ------------------------------------------------------------------------- cpBaseQtApplication::Blocker:: ~Blocker( ) { } // ------------------------------------------------------------------------- void cpBaseQtApplication::Blocker:: block( ) { QApplication* app = dynamic_cast< QApplication* >( QApplication::instance( ) ); if( app != NULL ) { app->setOverrideCursor( Qt::WaitCursor ); app->installEventFilter( this ); } // fi } // ------------------------------------------------------------------------- void cpBaseQtApplication::Blocker:: unblock( ) { QApplication* app = dynamic_cast< QApplication* >( QApplication::instance( ) ); if( app != NULL ) { while( app->overrideCursor( ) ) app->restoreOverrideCursor( ); app->removeEventFilter( this ); } // fi } // ------------------------------------------------------------------------- bool cpBaseQtApplication::Blocker:: eventFilter( QObject* obj, QEvent* event ) { return( true ); // -> Block all events /* NOTE: this should be the correct implementation: switch( event->type( ) ) { //list event you want to prevent here ... case QEvent::KeyPress: case QEvent::KeyRelease: case QEvent::MouseButtonRelease: case QEvent::MouseButtonPress: case QEvent::MouseButtonDblClick: //... return( true ); } // hctiws return( this->QObject::eventFilter( obj, event ) ); */ } // eof - $RCSfile$