From 68d217df49762d7aceba290989f7884ccdc0c4e0 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Sat, 11 Oct 2014 12:38:41 +0200 Subject: [PATCH] Mac menu bar init has to be repeated for Qt5 after clearing the menu --- src/frontends/qt4/Menus.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index ec5263d5bc..f64c07c0bf 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -1944,6 +1944,7 @@ void Menus::Impl::macxMenuBarInit(QMenuBar * qmb) const size_t num_entries = sizeof(entries) / sizeof(entries[0]); const bool first_call = mac_special_menu_.empty(); + LYXERR(Debug::GUI, "Creating Mac OS X special menu bar"); // the special menu for Menus. Fill it up only once. if (first_call) { for (size_t i = 0 ; i < num_entries ; ++i) { @@ -2236,12 +2237,14 @@ void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial) // the first time a QMenuBar is created. Otherwise Qt will // create duplicate items in the application menu. It seems // that Qt does not remove them when the QMenubar is cleared. - LYXERR(Debug::GUI, "Creating Mac OS X special menu bar"); d->macxMenuBarInit(qmb); #endif } else { // Clear all menubar contents before filling it. qmb->clear(); +#if (QT_VERSION >= 0x050000) + d->macxMenuBarInit(qmb); +#endif } LYXERR(Debug::GUI, "populating menu bar" << d->menubar_.name()); -- 2.39.2