I have a small application that inherits QMainWindow. I have implemented my own mechanism enabling user to show and hide Toolbars. It is placed in QMenuBar and contains a few checkable actions. The problem is that when one clicks a right button on a free space on a ToolBar he gets the context menu that enables him to show and hide toolbars. Thus when one switches one toolbar off in this context menu, the checkable action i menubar remains checked as it is not related to the context menu. I tried to reimplement QMouseEvent and simply do nothing inside just to remove the feature of ToolBar context menu but it didn't work. So here comes my question:

How to disable context menu that emerges when we click right mouse button on a QToolBar that is a part of QMainApplication class?

MJ