Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0 Beta1
-
None
-
Mac OS X 10.9, 10.7.5
-
-
efa7a5a659696901fddc8a93f870d1b83473dc64
Description
Background: I'm building a cross-platform MDI style app with two different window types that each require a different set of main menus. When a window is activated, I want to rebuild the QMainWindow's menu bar to display the appropriate set of menus. I'm seeing a menubar refresh problem under Mac OS X.
What I've done: taken the Qt Examples program mdi, and modified it slightly by adding two menu items under the File menu. These either add or remove an "Extra" menu.
Specific problem: the app calls this function...
void MainWindow::showExtraMenu()
{
extraMenuIsActive = true;
menuBar()->clear();
createMenus();
}
After executing this function, only two menu bar items are visible: the 'apple' menu and the 'mdi' application menu. The 'File', 'Edit', 'Extra' and 'Window' menus are invisible.
However, if you select the menu item 'mdi -> About mdi', then click OK, the missing menus appear. It seems that sending the main window behind the 'about' dialog, then bringing it to the front, refreshes the rebuilt menu bar. Similarly, clicking on another application then back to 'mdi' will refresh the menu.
This should be a simple fix - refresh the menu bar after a call to menuBar()->clear();