On multi monitor setup
will always initially report the rect of the main screen (screen 0) even if the window is shown on a different screen.
Only after the window is moved to the main screen and back to the second it will start reporting correct dimensions.
- Connect a second monitor (to your Mac)
- Move QCreator to the second monitor
- Compile and run the code below
- Press space, the rect of the main monitor is printed first, then the correct rect from QDesktopWidget