[Development] Revisiting high-DPI configuration options

Morten Sorvig Morten.Sorvig at qt.io
Thu Jun 23 08:29:22 CEST 2016


> On 22 Jun 2016, at 15:32, ekke <ekke at ekkes-corner.org> wrote:
> 
> Am 22.06.16 um 14:46 schrieb Morten Sorvig:
>>> 
>> What I have for Android devices are tables like this: (there are various
>> sources, see below)
>> 
>> 0.75 - ldpi
>> 1.0 - dpi
>> 1.5 - hdpi
>> 2.0 - xhdpi
>> 3.0 - xxhdpi
>> 4.0 - xxxhdpi
>> 
>> The factor here is DisplayMetrics.density. This suggests integer factors, or
>> at least a convergence towards integer factors if we allow that new Android
>> devices are xhdpi or better.
>> 
> my android device  reports 3.5 for
> 
> qApp->primaryScreen()->devicePixelRatio()
> 
> Does this mean Qt is using 4.0 and not 3.5 as scale factor ?
> Images are correctly used from @4

In this case Qt is indeed using 3.5. And when loading images we round up
and use the @4 version. You could double check that this actually the value
DisplayMetrics.density() returns, but I think we’ll find that it is.

This data point suggests that the Android world is not as simple as
the above table.

Morten




More information about the Development mailing list