Make it possible to render QtWebEngine in QOpenGLWidget

Setup the GL context as shared with the Qt global share context.

Change-Id: I199cfc7d290466d0ad99294bcffcd738b615862b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Jocelyn Turcotte 2014-03-28 15:41:29 +01:00 committed by The Qt Project
parent 9a4beb4d36
commit 495c4d501e

View File

@ -79,6 +79,7 @@
#include "qfileinfo.h"
#include <QtGui/qinputmethod.h>
#include <QtGui/qopenglcontext.h>
#include <QtGui/private/qopenglcontext_p.h>
#include <private/qgraphicseffect_p.h>
#include <qbackingstore.h>
@ -11148,6 +11149,7 @@ QOpenGLContext *QWidgetPrivate::shareContext() const
QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this);
if (!extra->topextra->shareContext) {
QOpenGLContext *ctx = new QOpenGLContext();
ctx->setShareContext(QOpenGLContextPrivate::globalShareContext());
ctx->setFormat(extra->topextra->window->format());
ctx->create();
that->extra->topextra->shareContext = ctx;