diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2012-09-19 14:09:16 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-19 16:16:38 +0200 |
commit | 77fc6d30f1bd4bdd8894dd98e12373211241a091 (patch) | |
tree | 3e150a49c4b79254b1cecf334ea68e115a79b11f /src/opengl | |
parent | c45005a77890a14d20498d3a829f70ce209f3742 (diff) |
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 <samuel.rodal@digia.com>
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl_qpa.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 8a07b6a5ad..556463be8d 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<QSurfaceFormat::OpenGLContextProfile>(format.profile())); return retFormat; } |