summaryrefslogtreecommitdiffstats
path: root/examples/webview
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-08-25 12:29:56 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-02-12 06:31:20 +0000
commit529214523d3bd79b749fef0c49cd8a3c2933c19c (patch)
treef9c037181829744c2403a392dc486cc6df99de52 /examples/webview
parent083323c8b7c37092fedcec4fd34f568c4a674c03 (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 <christian.stromme@theqtcompany.com>
Diffstat (limited to 'examples/webview')
-rw-r--r--examples/webview/minibrowser/main.cpp8
-rw-r--r--examples/webview/minibrowser/minibrowser.pro2
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
}