QApplication assumes that screen is always available when creating it. But screen count can be also zero. It's possible when using application auto launching (Login Items). There should be some safety if screen count is zero for any reason. For example do rest of QApplication painting initialization after screen is added.
Crash log shows that colormap initialize cause the crash
- System: Maverics 10.9 OSX
- Qt version: 5.2.0
For the both case please find Steps to reproduce:
1) Build the sample application using Qt 5.2.0 and you get a binary image example sample.app
2) So copy this sample.app into /Application folder so that all users can run this application
3) Make this application as a login item for two or three users. For this go to System Preferences -> select Login items tab -> add the application name sample.app. Do this for all other users as well.
4) After adding the sample.app as login item for all users,then logout from all users.
5) Restart the Mac. This is critical to reproduce crash to QApplication.
6) Now start login to first user and then switch between different users.Then you will get crash.