Hi,

so what i want to do is basically to make my QTabWidget able to respond to right mouse button event as if it was a left button and ALSO a right button; tab bar should both set clicked widget as current and exec context menu. The problem is that I have no idea how to achieve that.

I tried to redefine mousePressEvent as you can see in the example below (code is in Ruby, I hope that's not a problem, but if so I can try to translate it to C++).
Qt Code:
  1. class MainTab < Qt::TabWidget
  2. def mousePressEvent(event)
  3. if event.button == Qt::RightButton
  4. newEvent = Qt::MouseEvent.new(Qt::Event::MouseButtonPress, event.pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)
  5. mousePressEvent(newEvent)
  6. end
  7. end
  8. end
To copy to clipboard, switch view to plain text mode 
Of course it doesn't work, and I am totally clueless what to do now. So I was hoping you could give me some hints.