From 315e656efa99fce4ec9e822d428eed8af4fd1022 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Feb 2017 16:38:42 +0100 Subject: Improve cross-links between QtWebEngine classes in docs Change-Id: Iae853d4d3ab73306f90d93b62a419d1d440a3259 Reviewed-by: Leena Miettinen Reviewed-by: Kai Koehne --- src/core/api/qwebengineurlrequestinfo.cpp | 11 ++++++----- src/core/api/qwebengineurlschemehandler.cpp | 3 ++- src/webenginewidgets/api/qwebenginecertificateerror.cpp | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp index 877b376b0..c03255a97 100644 --- a/src/core/api/qwebengineurlrequestinfo.cpp +++ b/src/core/api/qwebengineurlrequestinfo.cpp @@ -96,6 +96,9 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q interceptor on the profile enables intercepting, blocking, and modifying URL requests before they reach the networking stack of Chromium. + You can install the interceptor on a profile via QWebEngineProfile::setRequestInterceptor() + or QQuickWebEngineProfile::setRequestInterceptor(). + \sa interceptRequest(), QWebEngineUrlRequestInfo */ @@ -108,14 +111,12 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q /*! \fn void QWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) - Reimplementing this virtual function and setting the interceptor on a profile makes - it possible to intercept URL requests. This function is executed on the IO thread, - and therefore running long tasks here will block networking. + Reimplementing this virtual function makes it possible to intercept URL + requests. This function is executed on the IO thread, and therefore running + long tasks here will block networking. \a info contains the information about the URL request and will track internally whether its members have been altered. - - \sa QWebEngineProfile::setRequestInterceptor() */ diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp index e60d90d04..94b85c42b 100644 --- a/src/core/api/qwebengineurlschemehandler.cpp +++ b/src/core/api/qwebengineurlschemehandler.cpp @@ -49,7 +49,8 @@ QT_BEGIN_NAMESPACE \since 5.6 To implement a custom URL scheme for QtWebEngine, you must write a class derived from this class, - and reimplement requestStarted(). + and reimplement requestStarted(). Then install it via QWebEngineProfile::installUrlSchemeHandler() + or QQuickWebEngineProfile::installUrlSchemeHandler(). \inmodule QtWebEngineCore diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.cpp b/src/webenginewidgets/api/qwebenginecertificateerror.cpp index a0641c9dd..f04b73615 100644 --- a/src/webenginewidgets/api/qwebenginecertificateerror.cpp +++ b/src/webenginewidgets/api/qwebenginecertificateerror.cpp @@ -47,7 +47,8 @@ QT_BEGIN_NAMESPACE \since 5.4 \inmodule QtWebEngineWidgets - Provides information about a certificate error. + Provides information about a certificate error. This class is used as a parameter of + QWebEnginePage::certificateError(). */ class QWebEngineCertificateErrorPrivate { -- cgit v1.2.3 From 8e147ed3be7740092de233a2a7c67ec890069649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 13 Mar 2017 11:13:56 +0100 Subject: Remove stale parent connection when initializing delegate as a child When clicking on a blank link target, the constructor of the RenderWidgetHostViewQtDelegateWidget instance for the newly created view is called with the originating QWebEngineView as its parent and will connect its removeParentBeforeParentDelete slot to the originating view's destroyed signal. This leads to the situation where the delegate's parent will be set to null when the originating view is closed, causing the view to display only an empty widget with the actual web contents remaining live in the background. This patch removes the connection to the old view when initializing the delegate as a child of the QWebEnginePagePrivate instance. The addition to the layout updates the parent and child relationship between the view and the delegate internally. Task-number: QTBUG-58381 Change-Id: I448380478c2bcfcfbddaee8a35caf46010e57972 Reviewed-by: Florian Bruhin Reviewed-by: Joerg Bornemann --- src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index e7ad5b107..14c4d72fe 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -163,6 +163,9 @@ void RenderWidgetHostViewQtDelegateWidget::initAsChild(WebContentsAdapterClient* QWebEnginePagePrivate *pagePrivate = static_cast(container); if (pagePrivate->view) { + if (parentWidget()) + disconnect(parentWidget(), &QObject::destroyed, + this, &RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete); pagePrivate->view->layout()->addWidget(this); pagePrivate->view->setFocusProxy(this); show(); -- cgit v1.2.3 From c554f3348cd0baea8221e668d41132cea0833a8a Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Mon, 20 Mar 2017 11:52:38 +0100 Subject: Delegate QWebEngineHistory::currentItem() to itemAt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling QWebEngineHistory::currentItem() before the first item is inserted, caused a segfault, due to accessing an illegal QList index. We now delegate the lookup to QWebEngineHistory::itemAt(), which checks the index first and returns a dummy element in case of an illegal index. Task-number: QTBUG-59599 Change-Id: I9cdd2533e33415a7b812c29fff5429eb005020dc Reviewed-by: Michael BrĂ¼ning --- src/webenginewidgets/api/qwebenginehistory.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/webenginewidgets/api/qwebenginehistory.cpp b/src/webenginewidgets/api/qwebenginehistory.cpp index 41de8c90b..48ddbc48e 100644 --- a/src/webenginewidgets/api/qwebenginehistory.cpp +++ b/src/webenginewidgets/api/qwebenginehistory.cpp @@ -226,9 +226,7 @@ QWebEngineHistoryItem QWebEngineHistory::backItem() const QWebEngineHistoryItem QWebEngineHistory::currentItem() const { - Q_D(const QWebEngineHistory); - d->updateItems(); - return d->items[currentItemIndex()]; + return itemAt(currentItemIndex()); } QWebEngineHistoryItem QWebEngineHistory::forwardItem() const -- cgit v1.2.3