path: root/tests/auto/quick/qquickwebviewgraphics
diff options
authorSimon Hausmann <>2014-03-26 12:21:25 +0100
committerThe Qt Project <>2014-03-31 18:36:46 +0200
commit3d6d6594b0dd2a8860b8fddd5a58f86c4ebd255c (patch)
tree5a9959d433425d8ff1a1d78d1b2506a1fd147770 /tests/auto/quick/qquickwebviewgraphics
parent3512a6cfe07cb7108485b3e39d586612aa5ed3d8 (diff)
Centralize OpenGL initialization
We now require the user to use QWebEngine::initialize() in main (preferably) and print out an error message if this wasn't set up accordingly. This limits the use of private scene graph API to inside QWebEngine and offers public API for users of the API. Change-Id: I787c176a85ab7784dbc8787d9876960b4872959e Reviewed-by: Jocelyn Turcotte <>
Diffstat (limited to 'tests/auto/quick/qquickwebviewgraphics')
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp b/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp
index 4411107c4..213420b13 100644
--- a/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp
+++ b/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp
@@ -43,7 +43,8 @@
#include <QQmlContext>
#include <QQuickView>
#include <QQuickItem>
-#include <QtQuick/private/qsgcontext_p.h>
+#include <QPainter>
+#include <qtwebengineglobal.h>
class TestView : public QQuickView {
@@ -111,12 +112,7 @@ void tst_QQuickWebViewGraphics::initTestCase()
qApp->setProperty("QQuickWebEngineView_DisableHardwareAcceleration", QVariant(true));
- // This is currently needed by all QtWebEngine application using the HW accelerated QQuickWebView.
- // It enables sharing between the QOpenGLContext of all QQuickWindows of the application.
- // We have to do so until we expose a public API for it, or chose enable it by default in Qt 5.3.0.
- QOpenGLContext *shareContext = new QOpenGLContext;
- shareContext->create();
- QSGContext::setSharedOpenGLContext(shareContext);
+ QWebEngine::initialize();