When you disable the 'Mirror Displays' checkbox on macOS, all running Qt applications are crashing. See attached video to see Qt Creator crashing.
- This issue is reproducible with Qt 5.13.1 on macOS 10.15.1
Steps to reproduce
- Attach an external display to a Mac (tested with iMac and MacBook Pro). I used a Thunderbolt Dock and Display Port to connect the external display.
- Launch any Qt application on the external screen. For example Qt Creator.
- Open System Preferences > Displays > Arrangement
- Check "Mirror Displays" if it is not checked
- Uncheck "Mirror Displays"
Result: All running Qt applications (for example Qt Creator) are crashing
Qt Support has tested and confirms the crash.
The crash occurs in QCocoaScreen::initializeScreens() in qcocoascreen.mm.
As you can see in this code, there is no check for NULL pointer for the variable mainDisplay and cocoaScreen:
If the variables mainDisplay or cocoaScreen are NULL - which is what seems to be the case when disabling "Mirror Displays" - the application is crashing.