From 6656204b1efb76abda7fe6add98bbdeaa478e1f0 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 10 Apr 2024 18:41:14 +0200 Subject: App: Use 'fusion' style only on fractional dpi on Windows On 200% on 4k screens there is no reason to use the 'fusion' style since the 'vista' native one works perfectly fine. Task-number: QTCREATORBUG-16095 Change-Id: I1ffd02891aa5ef30c0172edd949d63d4270400c4 Reviewed-by: Alessandro Portale Reviewed-by: Reviewed-by: Cristian Adam --- src/app/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 4105b4cca06..9851078e72d 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -679,10 +679,12 @@ int main(int argc, char **argv) setPixmapCacheLimit(); loadFonts(); - if (Utils::HostOsInfo::isWindowsHost() && !qFuzzyCompare(qApp->devicePixelRatio(), 1.0) - && !hasStyleOption) { + // On 100% or 200% scaling we can use the default 'Vista' style on Windows + qreal tmp; + const bool fractionalDpi = !qFuzzyIsNull(std::modf(qApp->devicePixelRatio(), &tmp)); + if (Utils::HostOsInfo::isWindowsHost() && fractionalDpi && !hasStyleOption) QApplication::setStyle(QLatin1String("fusion")); - } + const int threadCount = QThreadPool::globalInstance()->maxThreadCount(); QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount)); -- cgit v1.2.3