DPI and DPI awareness in Windows.
https://msdn.microsoft.com/library/windows/desktop/mt843498(v=vs.85).aspx(d=robot)
http://doc.qt.io/archives/qt-5.5/highdpi.html#microsoft-windows
The test to see how it gets affected is pretty simple to see on a single computer:
Go to Control Panel > Display
Or
Right click on the Desktop > Screen Resolution > Make text and other items larger or smaller
And lastly here is part of my rant on DPI…
Programming for DPI is a relatively new topic driven by mobile and 4K screens and everything in-between. 15 years ago there was 72 ppi and 96 ppi. Now it goes from 72 ppi to 250+ ppi.
Android: https://developer.android.com/guide/practices/screens_support.html
iOS: https://developer.apple.com/high-resolution/ https://developer.apple.com/library/content/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreensInViews/SupportingHiResScreensInViews.html Web Browsers (CSS): http://home.heeere.com/tech-ppi-aware-css-media-query.html
Windows: https://msdn.microsoft.com/library/windows/desktop/mt843498(v=vs.85).aspx(d=robot)
Qt example of setFontSize to fix QGroupBox
qDebug() << "font" << newFontSize;
QString stylesheet;
if(true)
{
// Apply a qstylesheet mid program execution from a file
QFile f("style.css");
if (f.open(QFile::ReadOnly | QFile::Text))
{
QTextStream in(&f);
stylesheet = in.readAll();
}
}
// Fix broken @GroupBox layouts when the fonts get large
qApp->setStyleSheet(stylesheet + QString("* { font-size: %1pt; }"
"QGroupBox { padding: %2px; }"
).arg(QString::number(newFontSize), QString::number(newFontSize*2)));
qApp->style()->unpolish(qApp);
qApp->style()->polish(qApp);
emit fontSizeChanged(newFontSize);
QML Application of it in context of VPlay https://www.youtube.com/watch?v=-zhuM08peT0