I placed a QTreeWidget on a QDialog. And I want to get QTreeWiget's mouse press event,so I use eventFilter like this:
in QDialog's construction
Qt Code:
  1. ui.m_pTreeWidget->installEventFilter( this );
To copy to clipboard, switch view to plain text mode 
in the eventFilter() function:
Qt Code:
  1. bool ***::(QObject *pTarget, QEvent *pEvent)
  2. {
  3. if( pTarget == ui.m_pTreeWidget )
  4. {
  5. if( pEvent->type() == QEvent::MouseButtonPress )
  6. {
  7. return false;
  8. }
  9. }
  10. return QDialog::eventFilter( pTarget, pEvent );
  11. }
To copy to clipboard, switch view to plain text mode 
But I can't get the mouse press event,why?
Thanks a lot !