From a9b0d84df95db7c30c668190ccac00d37cbf1b40 Mon Sep 17 00:00:00 2001 From: Nick Korotysh Date: Wed, 25 Mar 2020 17:00:58 +0300 Subject: [PATCH] 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. --- src/app/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/main.cpp b/src/app/main.cpp index 04842be67..711379191 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -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 {