diff options
author | Cristian Adam <cristian.adam@qt.io> | 2024-04-10 18:41:14 +0200 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2024-05-06 09:27:43 +0000 |
commit | 6656204b1efb76abda7fe6add98bbdeaa478e1f0 (patch) | |
tree | 49ce745fc3f0fa9cac95b4ff2ca3b586820a5334 /src/app/main.cpp | |
parent | 70dba4977f829e084ad5860407df5d44659741be (diff) |
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 <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'src/app/main.cpp')
-rw-r--r-- | src/app/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp index 4105b4cca0..9851078e72 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)); |