diff options
author | Morten Johan Sørvig <[email protected]> | 2014-08-25 12:29:56 +0200 |
---|---|---|
committer | Morten Johan Sørvig <[email protected]> | 2015-02-12 06:31:20 +0000 |
commit | 529214523d3bd79b749fef0c49cd8a3c2933c19c (patch) | |
tree | f9c037181829744c2403a392dc486cc6df99de52 /examples/webview | |
parent | 083323c8b7c37092fedcec4fd34f568c4a674c03 (diff) |
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 <[email protected]>
Diffstat (limited to 'examples/webview')
-rw-r--r-- | examples/webview/minibrowser/main.cpp | 8 | ||||
-rw-r--r-- | examples/webview/minibrowser/minibrowser.pro | 2 |
2 files changed, 9 insertions, 1 deletions
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 } |