High DPI issues
David Edmundson
david at davidedmundson.co.uk
Mon May 19 13:07:24 UTC 2014
On Mon, May 19, 2014 at 2:48 PM, Teo Mrnjavac <teo at kde.org> wrote:
> On Monday, May 19, 2014 14:40:59 David Edmundson wrote:
>> Read this before doing anything:
>> http://blog.qt.digia.com/blog/2013/04/25/retina-display-support-for-mac-os-i
>> os-and-x11/
>>
>> There are branches being merged in for 5.4. They affect QWidgets too.
>>
>> Everything is based around a devicePixelRatio.
>> As I understand it, you write code as though you have pixels on a
>> normal 96dpi screen; but then there's a scaling factor for high DPI
>> skills which converts to screen pixels.
>>
>> This can be overridden by an env variable.
>>
>> It's always better to work closer with upstream than to roll your own thing.
>> _______________________________________________
>> Plasma-devel mailing list
>> Plasma-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/plasma-devel
>
> Working with upstream would of course be best. Could you please point me to
> those branches? The blog post you linked is quite old now.
> It still won't be easy to compute a good scaling ratio, but heuristics in Qt
> or a QPA > our own thing.
>
For most platforms it's merged together
See http://qt-project.org/doc/qt-5/qwindow.html#devicePixelRatio
and the base class for the QPA.
qtbase/src/gui/kernel/qplatformscreen.cpp devicePixelRatio
It seems the X Platform backend doesn't implement it yet. Probably for
the reasons you've talked about already. I don't know where any
patches on that are. I could search for it, but you can Google as well
as me.
David
More information about the Plasma-devel
mailing list