X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpBaseQtApplication%2FBlocker.cxx;fp=lib%2FcpBaseQtApplication%2FBlocker.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=634f25bfa7d170453a0600c2f981945789b1375c;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpBaseQtApplication/Blocker.cxx b/lib/cpBaseQtApplication/Blocker.cxx deleted file mode 100644 index 634f25b..0000000 --- a/lib/cpBaseQtApplication/Blocker.cxx +++ /dev/null @@ -1,67 +0,0 @@ -#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$