diff --git a/examples/quick/quicknanobrowser/main.cpp b/examples/quick/quicknanobrowser/main.cpp index 6c2f91de6dd9397800213f7e725429cc692bbc96..0f0278c22df0ebf53a4feac846f6c1b3dbebfcde 100644 --- a/examples/quick/quicknanobrowser/main.cpp +++ b/examples/quick/quicknanobrowser/main.cpp @@ -53,12 +53,14 @@ int main(int argc, char **argv) { Application app(argc, argv); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) // 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; shareContext.create(); QSGContext::setSharedOpenGLContext(&shareContext); +#endif ApplicationEngine appEngine; diff --git a/lib/content_browser_client_qt.cpp b/lib/content_browser_client_qt.cpp index 68f0523cda3140178f87067c2547249812c237b2..9bc9bfe5ed644942c8a6b1d76e541de01bb64b05 100644 --- a/lib/content_browser_client_qt.cpp +++ b/lib/content_browser_client_qt.cpp @@ -59,7 +59,9 @@ #include "web_contents_view_qt.h" #include <QGuiApplication> +#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) #include <QtQuick/private/qsgcontext_p.h> +#endif #include <qpa/qplatformnativeinterface.h> namespace { @@ -254,10 +256,12 @@ private: void ShareGroupQtQuick::AboutToAddFirstContext() { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) // This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering. QOpenGLContext *shareContext = QSGContext::sharedOpenGLContext(); Q_ASSERT(shareContext); m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext)); +#endif } content::WebContentsViewPort* ContentBrowserClientQt::OverrideCreateWebContentsView(content::WebContents* web_contents, diff --git a/lib/quick/plugin/experimental/experimental.pro b/lib/quick/plugin/experimental/experimental.pro index 7ccfdaa764d3bb260e56189742277e18f30b78f4..ad2e0b8a3d2950af77b1c3a052d7444b9644e8cc 100644 --- a/lib/quick/plugin/experimental/experimental.pro +++ b/lib/quick/plugin/experimental/experimental.pro @@ -6,6 +6,8 @@ IMPORT_VERSION = 1.0 QT += webengine qml quick QT_PRIVATE += webengine-private qml-private quick-private gui-private core-private +qtHaveModule(v8): QT_PRIVATE += v8-private + INCLUDEPATH += $$QTWEBENGINE_ROOT/lib $$QTWEBENGINE_ROOT/lib/quick SOURCES = plugin.cpp diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 96e12c32fb2f3a636dade29a65b0f1d9bdc08d32..51d6454b9bc247303c76ade7862426c3fdeb744f 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS += \ - qquickwebviewgraphics/qquickwebviewgraphics.pro \ qquickwebviewgraphics/qquickwebviewgraphics_software.pro \ + +equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 1): SUBDIRS += qquickwebviewgraphics/qquickwebviewgraphics.pro