PDA

View Full Version : menu Bar display bug under mac osx 10.10 Yosemite



johnda
10th October 2014, 04:53
I'm testing a preexisting shipping Qt application in Apple's new Yosemite osx 10.10 developer golden master release that is built using the Qt 4.6 framework.

There is a cosmetic bug associated with the main menu bar now when running this Qt based app on the Yosemite golden master release.
If you run a modal dialog, then after you finish with the modal dialog and close it, the main mac menu bar at the top of the screen stays hidden. The normal behavior is that it vanishes while the modal dialog is up, and then returns to view after the modal dialog is finished.

So, i tried a simple fix, where i call
menuBar()->update();
after the modal dialog is finished.

This fixes the cosmetic problem.
Until you run one of the standard file dialogs, like
QFileDialog::getOpenFileName()

While the standard file dialogs are modal, they are different than a normal Qt modal dialog on the mac in that the menu bar stays visible at the top of the screen. And they basically just call the mac's own standard file dialogs as opposed to running some Qt modal dialog window.

After you run any of the standard file dialogs, then the simple fix i mentioned above no longer works.
The main menu bar items stay hidden after the modal dialog is finished. Even after using the simple fix, which does work until you run one of the standard file dialogs.

Now if you click the mouse in the main menu bar, then the menus appear in view.
but obviously i need to figure out a way to fix this issue completely.

Does anyone have any idea what is going on, and how to fix this bug?

I really need to stay with the older version of the Qt frameworks we are using for this existing application.
So i need to figure out a way to solve the problem.
Obviously running the standard file dialogs does something that permanently from that point on prevents the menuBar update call from working after they are run.

It would seem like other existing Qt applications are going to run into this issue as well.
Any suggestions or help on fixing this issue would be greatly appreciated.
Both for me, and for other people running the 4.6 frameworks on their pre-existing Qt based applications on osx 10.10 Yosemite.

wysota
10th October 2014, 07:14
Does it work properly on system releases older than 10.10?

johnda
10th October 2014, 17:39
Yes, the Qt 4.6 based application works fine in all apple osx releases prior to osx 10.10 Yosemite. So something changed in Yosemite that is messing up the menu bar refresh after you run a modal dialog.
And as i said, if you just run normal Qt modal dialogs, then you can fix it by just manually calling menuBar()->update() after running the modal dialog. Then the menu bar reappears after the modal dialog is closed.

I thought that had fixed it with that until i noticed that after your run any of the standard file dialogs, like QFileDialog::getOpenFileName(),
then that fix no longer works. So running that QFileDialog::getOpenFileName() call changes the state of something, so even when you call menuBar()->update() after closing a normal Qt modal dialog, the menu bar still doesn't reappear until the user actually clicks the menu bar.

Is there a way in Qt 4.6 to not have a modal menu dialog make the menu bar vanish, but instead do what QFileDialog::getOpenFileName() does? Because that would probably fix it by making the problem not happen.
Or is there something else i need to do after calling QFileDialog::getOpenFileName() to change focus or something so that menuBar()->update() will actually redisplay the menu bar after closing a normal Qt modal dialog.