[webkit-qt] WebGL rendering offscreenQ

Allan Sandfeld Jensen kde at carewolf.com
Tue Nov 11 08:00:21 PST 2014

On Tuesday 11 November 2014, Jorge Fernandez Monteagudo wrote:
> >On Tuesday 11 November 2014, Jorge Fernandez Monteagudo wrote:
> >> Hi Allan! Thank you for answering.
> >> 
> >> I'm open to use the correct way to do it. My only need is to be able to
> >> render the given page in my opengl context. The typical example
> >> rendering a WebGL in the faces of a cube in OpenGL will be great! Is
> >> there any demo like this? :)
> >> 
> >> Or, at least, where can I find an example using QGraphicsWebView with a
> >> QGLWidget viewport?
> >
> >See the documentation of QGraphicsView and especially setViewPort (
> >http://qt-project.org/doc/qt-5/qgraphicsview.html ). In Qt 5.4 you can
> >also use a QOpenGLWidget. It basically sets a specific widget as the
> >output, qtwebkit can find that widget and use the same opengl-context in
> >case it uses one. Without this qtwebkit would have its own widget that
> >can mess with yours and would still need copying over CPU to blit
> >textures.
> Hi Allan,
> Only to clarify... Which I need QGraphicsView or QGraphicsWebView?? And
> do you recommend me to update to Qt 5.4 or remain in the Qt 5.3.2?
You need both, the QGraphicsView hosts the scene graph and the 
QGraphicsWebView is an item in the scene. Qt 5.4 is not released yet, so for a 
stable development 5.3.2 is probably better, but 5.4 will be out before the 
end of the year.

You can try looking in Tools/QtTestBrowser for an example that can both work 
with QWebView or a QGraphicsWebView, it is probably overcomplicated for your 
usecase, but it should demonstrate what is needed.

Best regards

More information about the webkit-qt mailing list