I m porting qt3 codes to qt4.
Here I have a class TableGrid which inherits Q3Table (inherit QTable originally)

Qt Code:
  1. class TableGrid : public Q3Table {
  2. public:
  3. MyTableGrid( int numRows, int numCols, QWidget* parent, const char* name);
  4. void paintCell(QPainter *p, int row, int col, const QRect& cr, bool selected, const QColorGroup& cg);
  5. };
To copy to clipboard, switch view to plain text mode 

and I used this TableGrid in another class MyTable:
Qt Code:
  1. class MyTable : public QWidget
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. ...
  7. ...
  8. TableGrid* tbl; // Table
  9. ...
  10. ...
  11. ...
  12. }
To copy to clipboard, switch view to plain text mode 

And I called
Qt Code:
  1. tbl->installEventFilter( this );
To copy to clipboard, switch view to plain text mode 
to set the event filter.

The objective is to filter the mouse button pressed event signal.

Qt Code:
  1. bool MyTable::eventFilter ( QObject * obj, QEvent * e ){
  2. bool retval = false;
  3. if( QString(obj->name())==QString("tbl") )
  4. {
  5. if( e->type()==QEvent::Resize )
  6. {
  7. configTable();
  8. retval = true;
  9. }
  10. else if( e->type()==QEvent::MouseButtonPress )
  11. {
  12. tbl_mousePress();
  13. retval = true;
  14. }
  15. }
  16. return retval;
  17. }
To copy to clipboard, switch view to plain text mode 

This work in the past (QT3)
however I found that in QT4, the MouseButtonPress QEvent can no longer received when I click on the TableGrid.

Can anyone tell me what's going wrong??
Thanks a lot