Commit 80b7a1e9 authored by Nate Weibley's avatar Nate Weibley

Don't try to use QCoreApplication::arguments before an app is created

parent 91c050b9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment