Probe only for OpenGL levels available in this Qt version

Each version of Qt supports a set of OpenGL levels; the level displayed
to the user is only as high as what was supported at compile-time. Hence
it should be harmless to degrade gracefully to previous Qt versions.
This commit is contained in:
Roland Kaufmann 2012-07-06 12:33:54 +02:00
parent ec7057eb78
commit 0d17997eb3

View File

@ -347,10 +347,13 @@ QString BasicAboutDialog::openGLVersionString() const
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if (flags & QGLFormat::OpenGL_Version_4_0 ) versionString += "4.0";
if (false) ;
#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0))
else if (flags & QGLFormat::OpenGL_Version_4_0 ) versionString += "4.0";
else if (flags & QGLFormat::OpenGL_Version_3_3 ) versionString += "3.3";
else if (flags & QGLFormat::OpenGL_Version_3_2 ) versionString += "3.2";
else if (flags & QGLFormat::OpenGL_Version_3_1 ) versionString += "3.1";
#endif /* QT_VERSION > 4.7 */
else if (flags & QGLFormat::OpenGL_Version_3_0 ) versionString += "3.0";
else if (flags & QGLFormat::OpenGL_ES_Version_2_0 ) versionString += "ES_Version 2.0";
else if (flags & QGLFormat::OpenGL_ES_CommonLite_Version_1_1) versionString += "ES_CommonLite_Version 1.1";