forked from qt-creator/qt-creator
Main: Move option into options
Change-Id: Ibcba302ce959347588c1f1d0d4d9fcff8f99ec25 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -84,6 +84,7 @@ const char CLIENT_OPTION[] = "-client";
|
|||||||
const char SETTINGS_OPTION[] = "-settingspath";
|
const char SETTINGS_OPTION[] = "-settingspath";
|
||||||
const char INSTALL_SETTINGS_OPTION[] = "-installsettingspath";
|
const char INSTALL_SETTINGS_OPTION[] = "-installsettingspath";
|
||||||
const char TEST_OPTION[] = "-test";
|
const char TEST_OPTION[] = "-test";
|
||||||
|
const char STYLE_OPTION[] = "-style";
|
||||||
const char TEMPORARY_CLEAN_SETTINGS1[] = "-temporarycleansettings";
|
const char TEMPORARY_CLEAN_SETTINGS1[] = "-temporarycleansettings";
|
||||||
const char TEMPORARY_CLEAN_SETTINGS2[] = "-tcs";
|
const char TEMPORARY_CLEAN_SETTINGS2[] = "-tcs";
|
||||||
const char PID_OPTION[] = "-pid";
|
const char PID_OPTION[] = "-pid";
|
||||||
@@ -317,6 +318,7 @@ struct Options
|
|||||||
std::optional<QString> userLibraryPath;
|
std::optional<QString> userLibraryPath;
|
||||||
bool hasTestOption = false;
|
bool hasTestOption = false;
|
||||||
bool wantsCleanSettings = false;
|
bool wantsCleanSettings = false;
|
||||||
|
bool hasStyleOption = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Options parseCommandLine(int argc, char *argv[])
|
Options parseCommandLine(int argc, char *argv[])
|
||||||
@@ -353,12 +355,15 @@ Options parseCommandLine(int argc, char *argv[])
|
|||||||
options.wantsCleanSettings = true;
|
options.wantsCleanSettings = true;
|
||||||
options.preAppArguments << arg;
|
options.preAppArguments << arg;
|
||||||
} else { // arguments that are still passed on to the application
|
} else { // arguments that are still passed on to the application
|
||||||
|
if (arg == STYLE_OPTION)
|
||||||
|
options.hasStyleOption = true;
|
||||||
if (arg == TEST_OPTION)
|
if (arg == TEST_OPTION)
|
||||||
options.hasTestOption = true;
|
options.hasTestOption = true;
|
||||||
options.appArguments.push_back(*it);
|
options.appArguments.push_back(*it);
|
||||||
}
|
}
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -697,11 +702,7 @@ int main(int argc, char **argv)
|
|||||||
setPixmapCacheLimit();
|
setPixmapCacheLimit();
|
||||||
loadFonts();
|
loadFonts();
|
||||||
|
|
||||||
if (HostOsInfo::isWindowsHost()) {
|
if (Utils::HostOsInfo::isWindowsHost() && !options.hasStyleOption) {
|
||||||
const bool hasStyleOption = Utils::findOrDefault(options.appArguments, [](char *arg) {
|
|
||||||
return arg && strcmp(arg, "-style") == 0;
|
|
||||||
});
|
|
||||||
if (!hasStyleOption) {
|
|
||||||
// The Windows 11 default style (Qt 6.7) has major issues, therefore
|
// The Windows 11 default style (Qt 6.7) has major issues, therefore
|
||||||
// set the previous default style: "windowsvista"
|
// set the previous default style: "windowsvista"
|
||||||
// FIXME: check newer Qt Versions
|
// FIXME: check newer Qt Versions
|
||||||
@@ -713,7 +714,6 @@ int main(int argc, char **argv)
|
|||||||
if (fractionalDpi)
|
if (fractionalDpi)
|
||||||
QApplication::setStyle(QLatin1String("fusion"));
|
QApplication::setStyle(QLatin1String("fusion"));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
|
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
|
||||||
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));
|
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));
|
||||||
|
Reference in New Issue
Block a user