diff options
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 13e7de4..f2f0722 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1370,8 +1370,13 @@ void QMenuBarPrivate::handleReparent() oldWindow = newWindow; #ifdef Q_WS_MAC - macDestroyMenuBar(); - macCreateMenuBar(newParent); + if (q->isNativeMenuBar() && !macWidgetHasNativeMenubar(newParent)) { + // If the new parent got a native menubar from before, keep that + // menubar rather than replace it with this one (because a parents + // menubar has precedence over children menubars). + macDestroyMenuBar(); + macCreateMenuBar(newParent); + } #endif #ifdef Q_WS_WINCE |