hi all

i am working on a subclass of the QGraphicsItem class, i am trying to reimplemented the MouseReleaseEvent to do actions based on the pressed button but i cant get the right button to work, what i did was this:

Qt Code:
  1. void MyClass::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
  2. {
  3. if(event->button() == Qt::LeftButton)
  4. {
  5. //do stuff
  6. }
  7.  
  8. else if(event->button() == Qt::RightButton)
  9. {
  10. //do other stuff
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 

is this the right way to do it?