Run this extremely simple sample on Mac:
You first see a message box: press OK, and then you see the window... the problem is that when the window shows up, a system "beep" is heard (additionally, the window is not maximized).
This simple sample is to reproduce a case I have in a big app, where multiple top levels windows are restored (QMainWindow) with restoreGeometry + show(). Some beeps are (sometimes) heard, which puzzle the users!
Fortunatly, I have found the easy solution to the problem...
In file qtbase\src\plugins\platforms\cocoa\qcocoawindow.mm
In method: QCocoaWindow::syncWindowState
There is the line:
It should be changed to:
Note: Qt 4.8 also used "zoom" instead of "performZoom", hence the regression.
The explanation of the beep can be found in the Apple documentation:
"If the window doesn’t have a zoom box or can’t be zoomed for some reason, the computer beeps."
Note that I have absolutly no cue why it is necessary to display a dialog box before the problem happens.