Hello.

I have a small problem about mouse button event. This is a simple program:

Qt Code:
  1. // ...
  2.  
  3. void MyWidget::mousePressEvent(QMouseEvent *e)
  4. {
  5. qWarning("mousePressEvent");
  6. QWidget::mousePressEvent(e);
  7. }
  8.  
  9. void MyWidget::mouseReleaseEvent(QMouseEvent *e)
  10. {
  11. qWarning("mouseReleaseEvent");
  12. QWidget::mouseReleaseEvent(e);
  13. }
  14.  
  15. // ...
To copy to clipboard, switch view to plain text mode 

When I press a left mouse button, and keep it. I drag to another position and press the middle the button (at this time, both left and middle mouse button are pressed because left mouse button is kept before), and after that, I release the left mouse button.

But why the system only write the message output:
mousePressEvent
It is mean that the mouseReleaseEvent isn't catched.

Please tell me how to solve this problem how to catch mouseReleaseEvent in this case. Thanks.