From: Sean Harmer Date: Wed, 19 Sep 2012 13:09:16 +0000 (+0100) Subject: OpenGL: Make use of the requested version and profile in QGLWidget X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77fc6d30f1bd4bdd8894dd98e12373211241a091;p=profile%2Fivi%2Fqtbase.git OpenGL: Make use of the requested version and profile in QGLWidget When instatiating a QGLWidget in Qt5 at present it ignores the version and profile information in the QGLFormat meaning that we always end up with an OpenGL 2.x profile rather than what we asked for. This commit properly takes the version and profile into account. Change-Id: I097f10e397c23f5d97c5fcd8d5354667da286896 Reviewed-by: Samuel Rødal --- diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 8a07b6a..556463b 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -104,6 +104,9 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format) if (format.stencil()) retFormat.setStencilBufferSize(format.stencilBufferSize() == -1 ? 1 : format.stencilBufferSize()); retFormat.setStereo(format.stereo()); + retFormat.setMajorVersion(format.majorVersion()); + retFormat.setMinorVersion(format.minorVersion()); + retFormat.setProfile(static_cast(format.profile())); return retFormat; }