diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2024-03-04 08:40:42 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2024-03-04 14:02:09 +0100 |
commit | 3ceb65d7125f180288904ad73531efb1485d6c3a (patch) | |
tree | f51539af7dbb4b180505449da915db7633386a88 /src/webview | |
parent | 39d05ae48c13195a26d283fc02346a37d79e230b (diff) |
windows: Fix freeze when loading Qt Web Engine plugin
The mechanism which initializes Qt Web Engine via the plugin loader
does not work on some graphics drivers on Windows, which do not
support initializing graphics in DllMain(). Since Qt Web Engine is
always the backend on Windows, this patch makes Qt Web View depend
on it directly and calls initialize from QtWebView::initialize()
instead on that platform.
[ChangeLog][Windows] Fixed a freeze on startup on Windows. As part
of the solution for this, the Qt Web View library now depends
directly on Qt Web Engine on Windows, instead of indirectly via
the plugin library.
Fixes: QTBUG-117882
Change-Id: Ia1b3e54145477f645bbb97856bdbbb68b58d2785
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/webview/qtwebviewfunctions.cpp | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/webview/CMakeLists.txt b/src/webview/CMakeLists.txt index a58e084..4ef10b4 100644 --- a/src/webview/CMakeLists.txt +++ b/src/webview/CMakeLists.txt @@ -30,6 +30,13 @@ qt_internal_add_module(WebView Qt::GuiPrivate ) +qt_internal_extend_target(WebView CONDITION WIN32 AND TARGET Qt::WebEngineQuick + PUBLIC_LIBRARIES + Qt::WebEngineQuick + DEFINES + QTWEBVIEW_LINK_WEBENGINE +) + if(ANDROID) set_property(TARGET WebView APPEND PROPERTY QT_ANDROID_BUNDLED_JAR_DEPENDENCIES jar/QtAndroidWebView.jar diff --git a/src/webview/qtwebviewfunctions.cpp b/src/webview/qtwebviewfunctions.cpp index 0f0c6a6..da108d4 100644 --- a/src/webview/qtwebviewfunctions.cpp +++ b/src/webview/qtwebviewfunctions.cpp @@ -8,6 +8,10 @@ #include <QtCore/QCoreApplication> +#if defined(QTWEBVIEW_LINK_WEBENGINE) +# include <QtWebEngineQuick/QtWebEngineQuick> +#endif + QT_BEGIN_NAMESPACE /*! @@ -52,6 +56,8 @@ void QtWebView::initialize() { #ifdef QT_STATIC initializeImpl(); +#elif defined(QTWEBVIEW_LINK_WEBENGINE) + QtWebEngineQuick::initialize(); #endif } |