summaryrefslogtreecommitdiffstats
path: root/examples/webview/minibrowser/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webview/minibrowser/main.cpp')
-rw-r--r--examples/webview/minibrowser/main.cpp8
1 files changed, 8 insertions, 0 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