[Development] Mismatch of display resolutions and window sizes in Android applications
Morten.Sorvig at qt.io
Mon Jan 15 15:12:06 CET 2018
This is by design for Qt::AA_EnableHighDpiScaling: you get the logical window size. The
physical size can be computed by multiplying with QQuickWindow::effectiveDevicePixelRatio().
For QtLocation it looks like you have to enable high-dpi tiles by setting “osm.mapping.highdpi_tiles"
(or a similar option, depending on which tile provider you are using).
> On 13 Jan 2018, at 19:27, Denis Shienkov <denis.shienkov at gmail.com> wrote:
> The problem was in Qt::AA_EnableHighDpiScaling option.
> 13.01.2018 19:34, Denis Shienkov пишет:
>> Hi all.
>> Rigth now I faced with the strange issue is that the QML
>> window size (screen) does not correspond to the display
>> For example, I have the "ASUS ZenFone 4 Max ZC554KL"
>> smartphone which has display resolution as 1280x720 pixels.
>> But if I run there the QML application and try to print out
>> the ApplicationWindow size, then it is 360x568 or 640x288
>> pixels, depends on orientation. O_o
>> I have checked the same and on other smartphones, and see
>> that there the situation is similar. E.g. for the
>> "Samsung Galaxy Ace 3 GT-S7270" with 800x480 display I got
>> 320x460 or 533x247 pixels of my ApplicationWindow.
>> For example if try to use the QtLocation module, then any
>> maps looks ugly.
>> It is very bad surprise for me... Because, seems, now I can
>> not write any applications with high resolusion (or, at least
>> to operate with a real resolutions from my QML code).
>> Is there are any tricks to fix it?
>> PS: Some Android's firmwares (e.g. Cyanogen) allows to change
>> the DPI, and with the minimum DPI the ApplicationWindow size
>> increases a bit.. But it is not an option anyway.
> Development mailing list
> Development at qt-project.org
More information about the Development