forked from qt-creator/qt-creator
App: Move the -style check into windows-specific code
Creates warning about unused variable on Linux.
Amends 3babe8c73
.
Change-Id: I038502afc7e488354da7c871520c39a08ec54aa6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -534,10 +534,6 @@ int main(int argc, char **argv)
|
||||
Options options = parseCommandLine(argc, argv);
|
||||
applicationDirPath(argv[0]);
|
||||
|
||||
const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) {
|
||||
return strcmp(arg, "-style") == 0;
|
||||
});
|
||||
|
||||
if (qEnvironmentVariableIsSet("QTC_DO_NOT_PROPAGATE_LD_PRELOAD")) {
|
||||
Utils::Environment::modifySystemEnvironment(
|
||||
{{"LD_PRELOAD", "", Utils::EnvironmentItem::Unset}});
|
||||
@@ -680,7 +676,11 @@ int main(int argc, char **argv)
|
||||
setPixmapCacheLimit();
|
||||
loadFonts();
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost() && !hasStyleOption) {
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) {
|
||||
return strcmp(arg, "-style") == 0;
|
||||
});
|
||||
if (!hasStyleOption) {
|
||||
// The Windows 11 default style (Qt 6.7) has major issues, therefore
|
||||
// set the previous default style: "windowsvista"
|
||||
// FIXME: check newer Qt Versions
|
||||
@@ -692,6 +692,7 @@ int main(int argc, char **argv)
|
||||
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