diff options
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r-- | src/webenginewidgets/api/qwebengineview.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp index af7d27dab..f75945942 100644 --- a/src/webenginewidgets/api/qwebengineview.cpp +++ b/src/webenginewidgets/api/qwebengineview.cpp @@ -699,11 +699,19 @@ void QWebEngineViewPrivate::bindPageAndWidget(QWebEnginePagePrivate *pagePrivate // Change pointers first. - if (oldPagePrivate && oldPagePrivate != pagePrivate) - oldPagePrivate->delegateItem = nullptr; + if (widget && oldPagePrivate != pagePrivate) { + if (oldPagePrivate) + oldPagePrivate->delegateItem = nullptr; + if (widget->m_contentItem) + widget->m_contentItem->m_adapterClient = pagePrivate; + } - if (pagePrivate && oldWidget != widget) - pagePrivate->delegateItem = widget->m_contentItem; + if (pagePrivate && oldWidget != widget) { + if (oldWidget && oldWidget->m_contentItem) + oldWidget->m_contentItem->m_adapterClient = nullptr; + if (widget) + pagePrivate->delegateItem = widget->m_contentItem; + } // Then notify. |