c++ - What is the difference between logicalDpiX and physicalDpiX in Qt? -


in documentation of qpaintdevice (which paintable-to entities derive from, such qwidget, qpixmap, etc), there 2 functions receive dpi of device

int logicaldpix() const; int physicaldpix() const;  int logicaldpiy() const; int logicaldpix() const; 

the documentation says

the logicaldpix() , logicaldpiy() functions return horizontal , vertical resolution of device in dots per inch. physicaldpix() , physicaldpiy() functions return resolution of device in dots per inch, note if logical , physical resolution differ, corresponding qpaintengine must handle mapping. finally, colorcount() function returns number of different colors available paint device.

despite description, still don't understand purpose of difference is. can please shed light on this?

i assume physical actual resolution of device , logical user has set in os preferences. popular retina or other high resolution displays using physical dots pixels result in being small.

i found windows specific information: http://msdn.microsoft.com/en-us/library/windows/apps/ff684173

because actual pixel sizes vary, text readable on 1 monitor might small on monitor. also, people have different preferences—some people prefer larger text. reason, windows enables user change dpi setting. example, if user sets display 144 dpi, 72-point font 144 pixels tall. standard dpi settings 100% (96 dpi), 125% (120 dpi), , 150% (144 dpi). user can apply custom setting. starting in windows 7, dpi per-user setting.

even better: qt docs:

a note on logical vs physical dots per inch: physical dpi based on actual physical pixel sizes when available, , useful print preview , other cases it's desirable know exact physical dimensions of screen displayed contents. logical dots per inch used convert font , user interface elements point sizes pixel sizes, , might different physical dots per inch. logical dots per inch user-settable in desktop environment's settings panel, let user globally control ui , font sizes in different applications.


Comments