You can check the dpi of the screen:
QGuiApplication::primaryScreen()->logicalDotsPerInch();

You can then check if the dpi is above certain threshold to do thing 
differently. Normal desktop full HD screen dpi is around 96.


[36E56279]
une compagnie  [cid:[email protected]]
RAPPROCHEZ LA DISTANCE

Jérôme Godbout
Développeur Logiciel Sénior /
Senior Software Developer

p: +1 (418) 800-1073 ext.:109

amotus.ca<http://www.amotus-solutions.com/>
statum-iot.com<http://statum-iot.com/>
[cid:[email protected]]<https://www.facebook.com/LesSolutionsAmotus/>
 [cid:[email protected]] 
<https://www.linkedin.com/company/amotus-solutions/>  
[cid:[email protected]] <https://twitter.com/AmotusSolutions>  
[cid:[email protected]] 
<https://www.youtube.com/channel/UCoYpQgsmj1iJZyDjTQ3x8Ig>





From: Interest <[email protected]> On Behalf Of Vadim Peretokin
Sent: March 18, 2019 1:00 PM
To: interestqt-project.org <[email protected]>
Subject: [Interest] How to detect a HiDPI display with Qt?

I'm not clear on how to detect if a display is HiDPI with Qt. I've tried 
QApplication.desktop()->screen()->devicePixelRatio() but even that returns 1 
for a display that is 3840x2160.

Has anyone got hints on how to do this successfully?
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest

Reply via email to