When using QMainWindow, you can right-click in the toolbar area to get a popup menu that displays the names of the toolbars in a checkmark list (the active toolbars are checked), and you uncheck the checkmark to remove a toolbar from the main window or check it to activate the toolbar.

How to disable this menu?