[Development] resolution independence (was Re: Retina display support)

Jiang Jiang gzjjgod at gmail.com
Wed Oct 3 14:35:29 CEST 2012


Hi Shawn,

On Wed, Oct 3, 2012 at 2:24 PM, Shawn Rutledge
<shawn.t.rutledge at gmail.com> wrote:
> I've been working on this patch to make QScreen properties more
> complete and remove the hard-coded 72 DPI:
> https://codereview.qt-project.org/#change,36121
> I was surprised to find that if I ask OS X for the logical DPI, it is
> really still saying 72 DPI.  That's not like the other platforms.
> Doesn't that mean that with the same monitor, the same Qt UI will
> appear larger on a Mac than on Windows or Linux?
>
> But at least with this patch it is possible to get the actual screen
> size and actual DPI.  So it will become possible to design UIs using
> real-world units whenever we get around to that.

Keep in mind that you need to listen to
windowDidChangeBackingProperties: as described in
http://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/APIs/APIs.html
to handle windows moving around displays with different DPIs. I have a
patch but unfortunately that was lost when I clear my machine, but it
should be trivial enough for you to write from scratch.

- Jiang



More information about the Development mailing list