From 529214523d3bd79b749fef0c49cd8a3c2933c19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 25 Aug 2014 12:29:56 +0200 Subject: OS X Implementation. Adds implementation for the native WebView on OS X and removes the QtWebEngine as the fallback. The current implementation requires QT_MAC_WANTS_LAYER=1 QSG_RENDER_LOOP=basic [ChangeLog][WebView][OS X] Added OS X implementation. Change-Id: I2807a082c8aa519b8c3afe332996d3d454ff2383 Reviewed-by: Christian Stromme --- examples/webview/minibrowser/main.cpp | 8 ++++++++ examples/webview/minibrowser/minibrowser.pro | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/webview/minibrowser/main.cpp b/examples/webview/minibrowser/main.cpp index 1db0bc0..bc10a69 100644 --- a/examples/webview/minibrowser/main.cpp +++ b/examples/webview/minibrowser/main.cpp @@ -74,6 +74,14 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main", "QtWebView Example")); +#ifdef Q_OS_OSX + // On OS X, correct WebView / QtQuick compositing and stacking requires running + // Qt in layer-backed mode, which again resuires rendering on the Gui thread. + qWarning("Setting QT_MAC_WANTS_LAYER=1 and QSG_RENDER_LOOP=basic"); + qputenv("QT_MAC_WANTS_LAYER", "1"); + qputenv("QSG_RENDER_LOOP", "basic"); +#endif + #ifdef QT_WEBVIEW_WEBENGINE_BACKEND QtWebEngine::initialize(); #endif // QT_WEBVIEW_WEBENGINE_BACKEND diff --git a/examples/webview/minibrowser/minibrowser.pro b/examples/webview/minibrowser/minibrowser.pro index e02757c..a95b6d4 100644 --- a/examples/webview/minibrowser/minibrowser.pro +++ b/examples/webview/minibrowser/minibrowser.pro @@ -2,7 +2,7 @@ TEMPLATE = app QT += qml quick -qtHaveModule(webengine) { +!osx:qtHaveModule(webengine) { QT += webengine DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND } -- cgit v1.2.3