summaryrefslogtreecommitdiffstats
path: root/src/webview/qtwebviewfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/qtwebviewfunctions.cpp')
-rw-r--r--src/webview/qtwebviewfunctions.cpp41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/webview/qtwebviewfunctions.cpp b/src/webview/qtwebviewfunctions.cpp
index 7509f21..975bb17 100644
--- a/src/webview/qtwebviewfunctions.cpp
+++ b/src/webview/qtwebviewfunctions.cpp
@@ -35,15 +35,9 @@
****************************************************************************/
#include "qtwebviewfunctions.h"
-#include "qtwebviewfunctions_p.h"
-#ifdef QT_WEBVIEW_WEBENGINE_BACKEND
-#include <QtWebEngine/qtwebengineglobal.h>
-#endif // QT_WEBVIEW_WEBENGINE_BACKEND
-
-#ifdef Q_OS_MACOS
-#include <QtCore/qbytearray.h>
-#endif
+#include "qwebviewfactory_p.h"
+#include "qwebviewplugin_p.h"
QT_BEGIN_NAMESPACE
@@ -66,32 +60,11 @@ QT_BEGIN_NAMESPACE
void QtWebView::initialize()
{
-#if defined(Q_OS_MACOS)
- if (QtWebViewPrivate::useNativeWebView()) {
- // On macOS, 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");
- } else
-#endif
-#if defined(QT_WEBVIEW_WEBENGINE_BACKEND)
- QtWebEngine::initialize();
-#endif
-}
-
-/*!
- * \fn QtWebView::useNativeWebView()
- * \internal
- */
-
-bool QtWebViewPrivate::useNativeWebView()
-{
-#ifdef Q_OS_MACOS
- return qEnvironmentVariableIsSet("QT_MAC_USE_NATIVE_WEBVIEW");
-#else
- return true;
-#endif
+ if (QWebViewFactory::requiresExtraInitializationSteps()) {
+ QWebViewPlugin *plugin = QWebViewFactory::getPlugin();
+ Q_ASSERT(plugin);
+ plugin->prepare();
+ }
}
QT_END_NAMESPACE