Qt: showMaximized() not working in Windows Qt: showMaximized() not working in Windows windows windows

Qt: showMaximized() not working in Windows


Simplest workaround is use resize(800,600) before using showMaximized(). I have similar error in Qt 5.7.0 on Windows 8.1.


The very first time a process calls ShowWindow, the show command is ignored and uses the command provided in the STARTUPINFO structure (which should correspond with the nCmdShow parameter in WinMain).

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548%28v=vs.85%29.aspx

This surprising behavior has a tendency to manifest itself in problems like the one you describe. You may be able to resolve it by simply issuing QT's showMaximized call twice if you don't want to use any Win32 API calls directly.