diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-03-16 10:40:54 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-03-19 13:20:42 +0100 |
commit | cd074545c3c804fd73038625a0750e668907b534 (patch) | |
tree | c43d2cec710eef3d1569833f391a0bb128bc2ce4 /tools | |
parent | af7e85bf55ec24492cfdee12394a7aa4e5031228 (diff) |
tools/qml: Implement --core-profile option
Already possible to do the same using environment variables but this ensures greater compatibility with qmlscene
and better ease of use.
Change-Id: I214aec41aad4369f54bca887e91ccb879153c8be
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qml/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 8e5a493bcd..4c1a69d6c0 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -441,6 +441,9 @@ int main(int argc, char *argv[]) QCommandLineOption glSoftwareOption(QStringLiteral("software"), QCoreApplication::translate("main", "Force use of software rendering (AA_UseSoftwareOpenGL).")); parser.addOption(glSoftwareOption); // Just for the help text... we've already handled this argument above + QCommandLineOption glCoreProfile(QStringLiteral("core-profile"), + QCoreApplication::translate("main", "Force use of OpenGL Core Profile.")); + parser.addOption(glCoreProfile); #endif // QT_GUI_LIB // Debugging and verbosity options QCommandLineOption quietOption(QStringLiteral("quiet"), @@ -511,7 +514,7 @@ int main(int argc, char *argv[]) e.setExtraFileSelectors(customSelectors); #if defined(QT_GUI_LIB) - if (qEnvironmentVariableIsSet("QSG_CORE_PROFILE") || qEnvironmentVariableIsSet("QML_CORE_PROFILE")) { + if (qEnvironmentVariableIsSet("QSG_CORE_PROFILE") || qEnvironmentVariableIsSet("QML_CORE_PROFILE") || parser.isSet(glCoreProfile)) { QSurfaceFormat surfaceFormat; surfaceFormat.setStencilBufferSize(8); surfaceFormat.setDepthBufferSize(24); |