Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
6.2.2
-
None
-
Windows 10
Description
I am not sure if this a bug, probably I misunderstood something, but at least I can't explain what `QScreen::physicalDotsPerInch()` returns, for example, Java code below:
DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics(); Log.v("Bug", String.format("DisplayMetrics Width: %d, Height: %d, densityDpi: %d, scaledDensity: %f, xdpi: %f, ydpi: %f, density: %f", displayMetrics.widthPixels, displayMetrics.heightPixels, displayMetrics.densityDpi, displayMetrics.scaledDensity, displayMetrics.xdpi, displayMetrics.ydpi, displayMetrics.density));
prints the following on an xhdpi emulator:
DisplayMetrics Width: 1080, Height: 2148, densityDpi: 440, scaledDensity: 2.750000, xdpi: 440.000000, ydpi: 440.000000, density: 2.750000
while `QScreen::physicalDotsPerInch()` returns `160.0`.
IMHO: it should return 440, shouldn't it?
C++ code:
int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QScreen * p_screen = app.primaryScreen(); auto pixels_per_inch = p_screen->physicalDotsPerInch(); }
tested on the following emulator:
Name: Nexus_10_API_30CPU/ABI: Google APIs Intel Atom (x86_64)Path: C:\Users\D-Ef\.android\avd\Nexus_10_API_30.avdTarget: google_apis [Google APIs] (API level 30)Skin: nexus_10SD Card: 512Mfastboot.chosenSnapshotFile: runtime.network.speed: fullhw.accelerometer: yeshw.device.name: Nexus 10hw.lcd.width: 2560hw.initialOrientation: Portraitimage.androidVersion.api: 30tag.id: google_apishw.mainKeys: nohw.camera.front: emulatedavd.ini.displayname: Nexus 10 API 30hw.gpu.mode: autohw.ramSize: 1536PlayStore.enabled: falsefastboot.forceColdBoot: nohw.cpu.ncore: 4hw.keyboard: yeshw.sensors.proximity: nohw.dPad: nohw.lcd.height: 1600vm.heapSize: 192skin.dynamic: yeshw.device.manufacturer: Googlehw.gps: yeshw.audioInput: yesimage.sysdir.1: system-images\android-30\google_apis\x86_64\showDeviceFrame: yeshw.camera.back: virtualsceneAvdId: Nexus_10_API_30hw.lcd.density: 320hw.arc: falsehw.device.hash2: MD5:813203ac93d1d63cd91f729c376b1f3efastboot.forceChosenSnapshotBoot: nofastboot.forceFastBoot: yeshw.trackBall: nohw.battery: yeshw.sdCard: yestag.display: Google APIsruntime.network.latency: nonedisk.dataPartition.size: 6442450944hw.sensors.orientation: yesavd.ini.encoding: UTF-8hw.gpu.enabled: yes
on a real device I have the same situation.
For example, on my Windows 10 machine with a desktop monitor `QScreen::physicalDotsPerInch()` returns 94.1104, that probably looks correct.