In the end of your mousePressEvent
function you should pass the event to the base class, which will do its own operations on mouse click:
void MyMenu::mousePressEvent(QMouseEvent *event)
{
// do your stuff
QMenu::mousePressEvent(event);
}
Here you can read about the Qt Event System.