[Development] OpenGL in Qt 5.1 and onwards

Samuel Rødal samuel.rodal at digia.com
Mon Jan 7 08:44:49 CET 2013


On 01/07/2013 08:28 AM, Yves Bailly wrote:
> Greetings all,
>
> Le 18/12/2012 14:34, Sean Harmer a écrit :
>> I would like to start a discussion on the future level of support for OpenGL
>> enablers in Qt for those that are interested. So here goes...
>
> This may be a bit off-topic, but I have a little concern when reading the
> Qt5 doc about OpenGL support... it is said here and there that the "old"
> QGLFormat, QGLContext, ... classes are deprecated and should no longer be
> used.
>
> However, there's no alternative when using QGLWidget, so are they really
> deprecated or in some kind of "not-yet-deprecated-but-soon" state?

I'm not sure _all_ the QGL*-classes are marked as deprecated at the 
moment? QGLFormat, QGLContext, and QGLWidget still show up in the class 
list: http://qt-project.org/doc/qt-5.0/qtdoc/classes.html

QGLFramebufferObject and QGLShaderProgram are deprecated, but note that 
QOpenGLFramebufferObject, QOpenGLShaderProgram, QOpenGLFunctions, etc 
can be used perfectly well in combination with QGLWidget. QGLContext is 
implemented in terms of QOpenGLContext, and you can access it through 
the contextHandle() function, though typically you don't need to, as 
QOpenGLShaderProgram etc will use the current context by default.

--
Samuel




More information about the Development mailing list