PDA

View Full Version : Qt Creator on MacBook Pro Retina



Sanuden
22nd July 2012, 18:11
I just picked up a new MacBook Pro with Retina and after installing Qt Creator (2.5.0) I was very disappointed to see that the editor window is most definitely not optimized for the retina display (i.e., all the text is blurry). I'm not too concerned about the rest of the UI elements, but I'm wondering if anyone has found a way to force the application into retina mode to get the editor window to display at the ideal resolution.

wysota
23rd July 2012, 00:02
Can't you just change the font?

Sanuden
23rd July 2012, 00:25
Okay, so after digging around the good ol' internet for awhile, I stubbled upon http://comments.gmane.org/gmane.comp.lib.qt.devel/4477 which basically says that by adding


<key>NSPrincipalClass</key>
<string>NSApplication</string>

to the Info.plist of the app bundle (as indicated by http://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html#//apple_ref/doc/uid/TP40012302-CH4-SW7) the native Cocoa automatic scaling would take effect. Of course, I gave that a try with no luck; it wasn't until I stumbled upon http://blog.boastr.net/?p=2839 which gives the key:
Because Mac OS seems to cache the info.plists you may have to logout and login again, or alternatively copy the app bundle and insert it again at the same location. Then delete the old app bundle. After a quick copy/overwrite of the Qt Creator app bundle (logging out didn't seem to work for me) with the NSPrincipalClass key added to Info.plist, everything worked perfectly (with the exception of the icons, of course). Unfortunately, once I built my application I realized the same problem is present with any app bundle build with qmake. I was able to fix the issue with my app using the same trick, but it would be nice if qmake could add the proper key automatically during the build process...any ideas?

Added after 14 minutes:

The internet prevails again, a quick Google search turned up http://qt-project.org/forums/viewthread/6314, http://qt-project.org/faq/answer/how_do_i_add_a_custom_info.plist_to_my_mac_applica tion_with_qmake, and http://lists.trolltech.com/qt-interest/2004-04/thread00370-0.html, all of which give some clues as to how to address the issue. Obviously the next step is to get the entire application retina-aware (i.e., HiDPI aware) but I think my immediate concerns have been addressed. I hope this helps someone else who might be having the same problem.