[Development] [Interest] qt-android: How to make QML application scaled on high DPI screen automatically

Yang Fan missdeer at gmail.com
Tue Mar 4 07:34:01 CET 2014


Thanks for your reply. I think this information should be shared with Qt
developers, and I noticed the bug you mentioned was closed with no comment,
I feel confused.


On Tue, Mar 4, 2014 at 10:46 AM, Daiwei Li <daiweili at gmail.com> wrote:

> Hi Yang and all,
>
> I'm curious about how to scale for high DPI on Android as well, so I did
> some reading of the Qt source today.
>
> On iOS and OSX, scaling is handled by implementing devicePixelRatio() in
> the respective QPlatformWindow implementations. On Android, the equivalent
> concept seems to be "density":
> http://developer.android.com/reference/android/util/DisplayMetrics.html#density.
> Right now, the Android code uses the "scaledDensity" for certain things:
> https://bugreports.qt-project.org/browse/QTBUG-29674, but not for
> implementing the devicePixelRatio.
>
> Can someone with domain knowledge weigh in on how scaling is supposed to
> work? Otherwise, I'll experiment with hooking up devicePixelRatio to
> DisplayMetrics.density and report back.
>
> Thanks,
> Daiwei
> On Mar 1, 2014 7:41 PM, "Yang Fan" <missdeer at gmail.com> wrote:
>
>> Hi list,
>>
>> I'm writing a cross platform application with QML, all things go well
>> except running on high DPI Android device, it seems that it doesn't auto
>> scaled correctly, the elements look small on the high DPI screen while it
>> looks good on iOS device. I have got the physical dots per inch, it is
>> about 210, I know I could get the factor from this value, and let all
>> elements size multiply the factor manually, but I wonder if there is an
>> easy way that let Qt handle this issue just like iOS port does.
>> Any suggestion is appreciated.
>>
>> Regards,
>> Fan Yang
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>


-- 
Regards,
Fan Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140304/2d638cf0/attachment.html>


More information about the Development mailing list