Working with Qt 4.8.4 on OS X -- Desktop Application development. I need to be able to detect, at paint time, if I am on a hiDPI display ("retina") or not. Does anyone know how to achieve this?
Software support to boost the spread of super high pixel density displays. Support for the high pixel density display environment in the PC OS is called HiDPI support.
And here's what HiDPI mode looks like with an effective resolution of 960×600: Although it may be difficult to discern on your own display (you can click on each image to view them larger), the HiDPI mode makes macOS and apps look much crisper, but significantly reduces the working resolution of the system.
you can disable this by going to system preferences - then to energy saver. in the top left corner is a box you can tick or untick with the option to let high sierra decide to use automatic graphics switching or not. hope that helps.
HiDPI (High Dots Per Inch) displays, also known by Apple's "Retina Display" marketing name, are screens with a high resolution in a relatively small format. They are mostly found in high-end laptops and monitors. Not all software behaves well in high-resolution mode yet.
You can use QScreen
for this in Qt 5, and in Qt 4 you can use the QSystemDisplayInfo
class from Qt Mobility.
There is QSystemDisplayInfo
- http://doc.qt.digia.com/qtmobility/qsystemdisplayinfo.html
The relevant methods are getDPIHeight
and getDPIWidth
.
You could also use QDesktopWidget
's physicalDpiX
and physicalDpiY
methods.
Use QScreen
- http://qt-project.org/doc/qt-5.0/qtgui/qscreen.html#physicalDotsPerInch-prop
((QGuiApplication*)QCoreApplication::instance())
->primaryScreen()->physicalDotsPerInch()
There are also physicalDotsPerInchX
and physicalDotsPerInchY
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With