From 7da2b4a3cbaa4cc74468ccd4e7898cc85467b2fc Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 4 Jun 2015 12:38:12 +0200 Subject: [PATCH] Startup: Limit devicePixelRatio tweaking to Windows Setting DEVICE_PIXEL_RATIO on Linux to "auto" will disable font hinting even on systems with a DPR of 1. This patch limits our tweak to Windows. On OSX, it works reliably, anyways. Task-number: QTCREATORBUG-14516 Change-Id: I3c22c264c7f5019d22e1e3692b6d94c1d0777fc6 Reviewed-by: Paul Olav Tvete Reviewed-by: Eike Ziller --- src/app/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 5a49d3da4e2..ce7ed2dcb9d 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -292,8 +292,10 @@ static inline QSettings *userSettings() int main(int argc, char **argv) { - if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO")) + if (Utils::HostOsInfo().isWindowsHost() + && !qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO")) { qputenv("QT_DEVICE_PIXEL_RATIO", "auto"); + } QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false")); #ifdef Q_OS_MAC // increase the number of file that can be opened in Qt Creator. @@ -306,7 +308,8 @@ int main(int argc, char **argv) SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv); - if (!qFuzzyCompare(qApp->devicePixelRatio(), 1.0) + if (Utils::HostOsInfo().isWindowsHost() + && !qFuzzyCompare(qApp->devicePixelRatio(), 1.0) && QApplication::style()->objectName().startsWith( QLatin1String("windows"), Qt::CaseInsensitive)) { QApplication::setStyle(QLatin1String("fusion"));