tags:

views:

294

answers:

2

In Qt, if I right-click on a toolbar the menu will be shown that allows me to hide the toolbar. I need to disable this functionality because I want the toolbar to be unhidable. Is there a way to do this?

+2  A: 

Inherit QToolbar and reimplement contextMenuEvent().

+5  A: 

Use setContextMenuPolicy (Qt::NoContextMenu) for the main window of the toolbar.

Ariya Hidayat
Hey, you're on stackoverflow. Hi, I'm a fan!
It does not work, I've tried
Sergey Skoblikov
I mistyped and corrected it. NoContextMenu should be for the main window, not the toolbar.
Ariya Hidayat