On 21 Sep 2012, at 07:12, Kai-Uwe Behrmann <[email protected]> wrote: > Am 20.09.12, 19:09 -0700 schrieb P Bai: >> I have a few questions about how to add retina display support to my >> application. I understand by reading an earlier discuss that you can add a >> few lines in the info.plist to enable HiDPI render. That would only work for >> text and standard widgets, right?
Right. >> How about icons and pixmaps? How do I detect if the application is running >> in HiDPI mode? At the moment only through platform API, e.g. UIScreen scale >> For example if I write an image viewer program, how do I know when to draw a >> high resolution image? I guess I can just always force draw the high-res >> image to the rect of a regular sized image, I don't think that would work atm. Afaik Qt doesn't draw at "sub-point" coordinates as is and would downscale your high-res image to the point size of the rectangle. (See below for an explanation what I mean with that.) Morten Sørvig is working on a solution for the HiDPI issue, a (probably outdated) experiment is on https://codereview.qt-project.org/33266 >> but that would be a huge waste of system resource and performance drag when >> running on non-retina system. Are there any better solutions? > > Aren't you seeing the window size in pixels as usual? With that available, > you would have a generic answere for your kind of question. Well, no. "Pixel" in the Qt world atm means something different than "pixel" in the physical world (when talking about Cocoa / Mac). The integer coordinates in Qt actually are mapped to what Cocoa calls "points" which is referring to "logical" coordinate space, not "device" coordinate space. A HiDPI screen has the same number of "points" as a corresponding non-HiDPI screen, but it has a "scale" (of 2). Applications see the same number of points when they run on a HiDPI screen as they would on a non-HiDPI screen (--> everything has exactly the same physical dimensions when running on different screens). That means that Qt also reports the same dimensions. Rastering for pixmaps is also done based on "points". -- Eike Ziller Senior Software Engineer Digia Germany GmbH Rudower Chausse 13, 12489 D-Berlin Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B, Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius Email: [email protected] Tel: +49 30 63 92 32 55 Digia Germany is a group company of Digia Plc, Valimotie 21, FI-00380 Helsinki Finland Visit us at: www.digia.com ------------------------------------------------------------------ PRIVACY AND CONFIDENTIALITY NOTICE This message and any attachments are intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee you should not disseminate, copy or take any action in reliance on it. If you have received this message in error, please contact the sender immediately and delete the message and any attachments accompanying it. Digia Germany GmbH and Digia Plc do not accept liability for any corruption, interception, amendment, tampering or viruses occurring to this message. _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
