[Development] OpenGL in Qt 5.1 and onwards

Sletta Gunnar Gunnar.Sletta at digia.com
Mon Jan 7 09:13:08 CET 2013


On Jan 7, 2013, at 8:28 AM, Yves Bailly <yves.bailly at sescoi.fr> 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?
> 
> Or did I miss something?

Hi Yves,

What we have done in Qt 5 is to move most of what is in QtOpenGL into QtGui under new names. The "old" classes in the QtOpenGL will continue to work and will not go away anytime soon, so you can safely continue using them if you are already using them for existing code.  

We do however promote using QWindow, QOpenGLContext and QOpenGLFormat classes in QtGui for new code. They have cleaner API, are slightly more light-weight and support one OpenGL context for multiple surfaces if that is interesting for you. The QOpenGL module is implemented in terms of the classes in QtGui so they do interoperate.

An example on how to use the new classes is in the QtGui examples repo: http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html

cheers,
Gunnar

> 
> Regards,
> 
> -- 
>      /- Yves Bailly - Software developper  -\
>      \- Sescoi R&D  - http://www.sescoi.fr -/
> "The possible is done. The impossible is being done. For miracles,
> thanks to allow a little delay."
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development




More information about the Development mailing list