Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to get true, accurate DPI values for monitor?
Publicnamer last edited by
When I obtain the DPI values programmatically like so:
int dpiX = app->desktop()->logicalDpiX(); int dpiY = app->desktop()->logicalDpiY();
... I find that the values are simply the ones that I set in Xfce's Appearance settings. That is fine, except in order to accurately detect whether my code is running on a phone (e.g. PinePhone) versus a desktop/laptop, I need a hardware-based DPI value.
How can I get the true, accurate DPI values for monitor programmatically?
Pl45m4 last edited by
physicalDotsPerInch()if you are using
Kent-Dorfman last edited by Kent-Dorfman
look in your Xorg.0.log file for the EDID data. As far as consistently getting monitor DPI in all cases...you can't. in many cases its broken by design.