Hi,
(Qt4 SUSE 10)
I have a QStackedWidget with several widgets in it, on top of another widget that serves as a dialog.
But I can't trap the mouse button clicks on the QStackedWidget or the current visible widget in it.
In order to see the event traffic, I installed an event filter for the QStackedWidget on the dialog widget, and I show there all events that the event filter gets, and in deed, mouse button clickes just don't get trapped in the event filter.
I turned on mouse tracking, I made sure the QStackedWidget is enabled (same with its children) I even turened on mouse grabbing - the result is always the same.
I get mouse enter and mouse leave events, and the right mouse button click is trapped as context menu event, wheel events,some move move events when i get on the widget (but this stops after few move events?!) but no mouse buttn press events.
Can some one tell me what I am I missing here?
Maybe there is some option I need to turn on/off that I am no aware of?

Here is some of the relevant code:
Qt Code:
  1. m_widgetStack = new QStackedWidget(this);
  2. m_tabR = new tabR();
  3. m_tabP = new tabP();
  4. m_tabS = new tabS();
  5. m_tabT = new tabT();
  6. m_widgetStack->setGeometry(m_sMenu->width(),0,this->width()-m_sMenu->width(),this->height());
  7. m_widgetStack->addWidget(m_tabR);
  8. m_widgetStack->addWidget(m_tabP);
  9. m_widgetStack->addWidget(m_tabS);
  10. m_widgetStack->addWidget(m_tabT);
  11.  
  12.  
  13. m_widgetStack->grabMouse();
  14. m_widgetStack->setEnabled(true);
  15. m_widgetStack->setMouseTracking(true);
  16. m_widgetStack->setFocusPolicy( Qt::StrongFocus);
  17. m_widgetStack->installEventFilter(this);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. bool MainDlg::eventFilter(QObject *obj,QEvent *event)
  2. {
  3. qDebug("MainDlg::eventFilter %d",event->type());
  4. switch(event->type())
  5. {
  6. case QEvent::MouseButtonPress :qDebug("keyPress");
  7. return true;
  8. break;
  9. case QEvent::MouseButtonRelease: qDebug("keyRelease");
  10. return true;
  11. break;
  12. default: return false;
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

I thought maybe I need to work with the child widgets of the QStackedWidget, so I insatalled the event filter on the first child widget (the first which is visible) and the result is the same...

Any pointers (such as "did you make sure that...") or help will be very appretiated.
Thanks.