[Interest] Qt 5.1.1 render with both - OpenGL and QPainter - in one window?

Sletta Gunnar Gunnar.Sletta at digia.com
Wed Sep 25 10:07:47 CEST 2013


This is very possible :)

The classes you are looking for are:

QWindow - to create the window
QOpenGLContext - to get the OpenGL context
QOpenGLPaintDevice - to make the opengl context renderable with QPainter
QPainter - to draw the text.

cheers,
Gunnar


On Sep 24, 2013, at 4:15 PM, Thomas Meyer <public at meyer-thomas.com> wrote:

> Hi,
> is it possible to use OpenGL and QPainter in one window (Qt 5.1.1)?
> And if it is possible, how and is it recommended?
> Example:
> I want to render the word "Triangle" into the 'OpenGL Window Example'
> (please see Qt Creator - Welcome - Examples).
> 
> My first guess is, that it is not possible. I can only render with OpenGL or
> with QPainter, like the example shows.
> 
> Thanks,
>     Thomas
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list