Can mouse events only be captured by a class? Or can any specific widget capture an event? For instance, I have a video player window that uses a QAxWidget. This video player window has a series of buttons and sliders. I only want to capture the mouse events that occur within the actual video window itself, not the buttons.
Qt Code:
  1. mpVideoPlayer = new QAxWidget( mpFrame );
  2. mpVideoPlayer->setGeometry( QRect( 0, 0, 561, 351 ) );
  3. mpVideoPlayer->setCursor( Qt::CrossCursor );
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void VideoViewerWindow::mouseReleaseEvent( QMouseEvent *event )
  2. {
  3. if( event->button() == Qt::LeftButton )
  4. {
  5. QString test = QString( event->x() ) + ", " + QString( event->y() );
  6.  
  7. QMessageBox::warning( this, tr( "Position" ), tr( "Left Button Pressed" ) );
  8. }
  9. else if( event->button() == Qt::RightButton )
  10. {
  11. QMessageBox::warning( this, tr( "Position" ), tr( "Right Button Pressed" ) );
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

When running this code, all events are captured no matter where in the VideoViewerWindow class. However, when I try to put mpVideoPlayer->accept() I get compile errors. Do I have to make mpVideoPlayer a subclass of QAxWidget for this to work?

Thanks