Don't round scaling factor

Qt 5.14 introduced new feature related to HighDPI screens support,
this parameter is called "scale factor rounding policy", and it is
intended to improve fractional scale factor support (like 150%).
Qt::PassThrough value guarantee that no any rounding will applied to
scale factor, and will be used as is.
This commit is contained in:
Nick Korotysh 2020-03-25 17:00:58 +03:00
parent fcc87b4e9b
commit a9b0d84df9
No known key found for this signature in database
GPG key ID: 7D0D4117C97CCC46

View file

@ -136,6 +136,9 @@ int main(int argc, char *argv[])
// Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created
if (qgetenv("QT_ENABLE_HIGHDPI_SCALING").isEmpty() && qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR").isEmpty())
Application::setAttribute(Qt::AA_EnableHighDpiScaling, true);
// HighDPI scale factor policy must be set before QGuiApplication is created
if (qgetenv("QT_SCALE_FACTOR_ROUNDING_POLICY").isEmpty())
Application::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
try {