diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index d4cf83a380..bd406ee176 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -49,6 +49,7 @@ #include #include "qcocoaapplication.h" #include "qcocoamenuloader.h" +#include "qcocoamenubar.h" #include "qcocoawindow.h" #import "qnsview.h" @@ -538,6 +539,7 @@ void QCocoaMenu::syncModalState(bool modal) void QCocoaMenu::setMenuBar(QCocoaMenuBar *menuBar) { m_menuBar = menuBar; + setParent(menuBar); } QCocoaMenuBar *QCocoaMenu::menuBar() const