mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Merge branch 'master' into preferences
This commit is contained in:
commit
03adef372c
@ -255,6 +255,17 @@ int main(int argc, char* argv[])
|
||||
|
||||
#else
|
||||
|
||||
bool shiftKeyPressedAtLaunch(int argc, char *argv[])
|
||||
{
|
||||
// Reliably detecting the shift key requires a QGuiApplication instance, but
|
||||
// we need to create the real QApplication afterwards, so create a temporary
|
||||
// instance here.
|
||||
QGuiApplication* app = new QGuiApplication(argc, argv);
|
||||
Qt::KeyboardModifiers keymodifier = QGuiApplication::queryKeyboardModifiers();
|
||||
delete app;
|
||||
return keymodifier == Qt::ShiftModifier;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
QString homeDocs = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/";
|
||||
@ -265,9 +276,8 @@ int main(int argc, char *argv[]) {
|
||||
QSettings settings;
|
||||
|
||||
// If shift key was held down when OSCAR was launched, force Software graphics Engine (aka LegacyGFX)
|
||||
Qt::KeyboardModifiers keymodifier = QApplication::keyboardModifiers();
|
||||
QString forcedEngine = "";
|
||||
if (keymodifier == Qt::ShiftModifier){
|
||||
if (shiftKeyPressedAtLaunch(argc, argv)){
|
||||
settings.setValue(GFXEngineSetting, (unsigned int)GFX_Software);
|
||||
forcedEngine = "Software Engine forced by shift key at launch";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user