qt - Detect hiDPI mode -


working qt 4.8.4 on os x -- desktop application development. need able detect, @ paint time, if on hidpi display ("retina") or not. know how achieve this?

you can use qscreen in qt 5, , in qt 4 can use qsystemdisplayinfo class qt mobility.

for qt 4

there qsystemdisplayinfo - http://doc.qt.digia.com/qtmobility/qsystemdisplayinfo.html

the relevant methods getdpiheight , getdpiwidth.

you use qdesktopwidget's physicaldpix , physicaldpiy methods.

for qt 5

use qscreen - http://qt-project.org/doc/qt-5.0/qtgui/qscreen.html#physicaldotsperinch-prop

((qguiapplication*)qcoreapplication::instance())     ->primaryscreen()->physicaldotsperinch() 

there physicaldotsperinchx , physicaldotsperinchy.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -