summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-04-30 12:10:54 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2021-05-25 10:31:12 +0200
commit9167c802f9a05394f72e0ba0dfb744b415686f46 (patch)
tree294344eda1b5c89de9300a69d8d396bcbeba4ab4 /src
parent1a1964e32a78cf917f43c6cfee328f1dadc1d31b (diff)
Make handling of certificate errors possible from a signal
Task-number: QTBUG-74587 Change-Id: I9955a4c70b339523b5e9e9d6dffe928e61fbab90 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/api/qwebenginepage.cpp4
-rw-r--r--src/core/api/qwebenginepage.h2
-rw-r--r--src/webenginequick/doc/src/qtwebengine-overview.qdoc4
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc2
4 files changed, 5 insertions, 7 deletions
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index 367688c88..afb2eedda 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -1616,7 +1616,7 @@ void QWebEnginePagePrivate::javascriptDialog(QSharedPointer<JavaScriptDialogCont
void QWebEnginePagePrivate::allowCertificateError(const QWebEngineCertificateError &error)
{
Q_Q(QWebEnginePage);
- q->certificateError(error);
+ Q_EMIT q->certificateError(error);
}
void QWebEnginePagePrivate::selectClientCert(const QSharedPointer<ClientCertSelectController> &controller)
@@ -2182,8 +2182,6 @@ void QWebEnginePage::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel leve
}
}
-void QWebEnginePage::certificateError(QWebEngineCertificateError) { }
-
bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
{
Q_UNUSED(url);
diff --git a/src/core/api/qwebenginepage.h b/src/core/api/qwebenginepage.h
index 09b7b54df..9ccf8c917 100644
--- a/src/core/api/qwebenginepage.h
+++ b/src/core/api/qwebenginepage.h
@@ -341,6 +341,7 @@ Q_SIGNALS:
void proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost);
void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
+ void certificateError(const QWebEngineCertificateError &certificateError);
// Ex-QWebFrame signals
void titleChanged(const QString &title);
@@ -374,7 +375,6 @@ protected:
virtual bool javaScriptConfirm(const QUrl &securityOrigin, const QString& msg);
virtual bool javaScriptPrompt(const QUrl &securityOrigin, const QString& msg, const QString& defaultValue, QString* result);
virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID);
- virtual void certificateError(QWebEngineCertificateError certificateError);
virtual bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame);
private:
Q_DISABLE_COPY(QWebEnginePage)
diff --git a/src/webenginequick/doc/src/qtwebengine-overview.qdoc b/src/webenginequick/doc/src/qtwebengine-overview.qdoc
index 9908d46a8..4cbe35bcc 100644
--- a/src/webenginequick/doc/src/qtwebengine-overview.qdoc
+++ b/src/webenginequick/doc/src/qtwebengine-overview.qdoc
@@ -227,8 +227,8 @@
The \l{WebEngineCertificateError::error} and \l{QWebEngineCertificateError::Error} enumerations
provide information about the types of certificate errors that might occur. The errors can be
- handled by using the WebEngineView::certificateError QML method or by reimplementing the
- QWebEnginePage::certificateError function.
+ handled by using the WebEngineView::certificateError QML method or by connecting to the
+ QWebEnginePage::certificateError signal.
\section1 Proxy Support
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 087c171cb..9c9f40f74 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -520,7 +520,7 @@
/*!
\fn void QWebEnginePage::certificateError(const QWebEngineCertificateError & certificateError)
- This function is called when an invalid certificate error is raised while loading a given request.
+ This signal is emitted when an invalid certificate error is raised while loading a given request.
The \a certificateError parameter contains information about the certificate and details of the error,
it also provides the way to ignore the error and complete the request or stop loading