Remove native Mac menu items such as Show Tab Bar
Unsolved
General and Desktop
-
It seems that the action - Show Tab Bar - automatically inserts itself into the View menu that I create.
I would like to keep the menu named as is. Is it possible to remove the system menu action through the Qt API? If not, may I have suggestions for non-Qt solutions?
Thank you,
Arman -
Hi and welcome to devnet,
If you don't have any tool bar then you can use QMainWindow::setUnifiedTitleAndToolBarOnMac.
Hope it helps
-
According to this topic : how-do-i-disable-the-show-tab-bar
you need to call:
[NSWindow setAllowsAutomaticWindowTabbing: NO];For doing that, you have to create a C++ class (named CocoaBridge here) with .mm extension.
Add it to your .pro file:
macx{ HEADERS += CocoaBridge.h OBJECTIVE_SOURCES += CocoaBridge.mm LIBS += -framework AppKit }
The C++ class looks like this:
#ifndef COCOABRIDGE_H #define COCOABRIDGE_H class CocoaBridge { CocoaBridge() {} public: static void setAllowsAutomaticWindowTabbing(bool flag); }; #endif // COCOABRIDGE_H
and CocoaBridge.mm :
#include "CocoaBridge.h" #import <Cocoa/Cocoa.h> void CocoaBridge::setAllowsAutomaticWindowTabbing(bool flag) { [NSWindow setAllowsAutomaticWindowTabbing: flag]; }
Should work ...