summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-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
}