forked from qt-creator/qt-creator
App: Set "windowsvista" style on Windows
This will set the pre Qt 6.7 default style. Task-number: QTBUG-126515 Task-number: QTBUG-126548 Task-number: QTBUG-126549 Change-Id: I947bcbe859c91906f2a273a04f3142d8d42b7af1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -680,11 +680,18 @@ int main(int argc, char **argv)
|
||||
setPixmapCacheLimit();
|
||||
loadFonts();
|
||||
|
||||
// On 100% or 200% scaling we can use the default 'Vista' style on Windows
|
||||
if (Utils::HostOsInfo::isWindowsHost() && !hasStyleOption) {
|
||||
// The Windows 11 default style (Qt 6.7) has major issues, therefore
|
||||
// set the previous default style: "windowsvista"
|
||||
// FIXME: check newer Qt Versions
|
||||
QApplication::setStyle(QLatin1String("windowsvista"));
|
||||
|
||||
// On scaling different than 100% or 200% use the "fusion" style
|
||||
qreal tmp;
|
||||
const bool fractionalDpi = !qFuzzyIsNull(std::modf(qApp->devicePixelRatio(), &tmp));
|
||||
if (Utils::HostOsInfo::isWindowsHost() && fractionalDpi && !hasStyleOption)
|
||||
if (fractionalDpi)
|
||||
QApplication::setStyle(QLatin1String("fusion"));
|
||||
}
|
||||
|
||||
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));
|
||||
|
Reference in New Issue
Block a user