From 879e08438322352180ff9c8ea14c98eee66c2405 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 12 Dec 2019 20:36:23 -0800 Subject: [PATCH] Enable Qt 5.14's new fractional DPI scaling --- app/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index 4bb2b324..79bd2813 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -284,8 +284,14 @@ int main(int argc, char *argv[]) AntiHookingDummyImport(); #endif + // Enable High DPI support QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + // Enable fractional High DPI scaling on Qt 5.14 and later + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif + // This avoids using the default keychain for SSL, which may cause // password prompts on macOS. qputenv("QT_SSL_USE_TEMPORARY_KEYCHAIN", "1");