diff --git a/src/main.cc b/src/main.cc index 22fdf1b1a5affa6686b690e478e70c85e3f6e6ad..c2cdbf4802b7a1a02c66cd36d90443d77952d8e2 100644 --- a/src/main.cc +++ b/src/main.cc @@ -145,11 +145,19 @@ int main(int argc, char *argv[]) // Set our own OpenGL buglist qputenv("QT_OPENGL_BUGLIST", ":/opengl/resources/opengl/buglist.json"); - if (QCoreApplication::arguments().contains(QStringLiteral("-angle"))) { - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - } else if (QCoreApplication::arguments().contains(QStringLiteral("-swrast"))) { - QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + + // Allow for command line override of renderer + for (int i = 0; i < argc; i++) { + const QString arg(argv[i]); + if (arg == QStringLiteral("-angle")) { + QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); + break; + } else if (arg == QStringLiteral("-swrast")) { + QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + break; + } } + #endif // The following calls to qRegisterMetaType are done to silence debug output which warns