summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/browser/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webenginewidgets/browser/webview.cpp')
-rw-r--r--examples/webenginewidgets/browser/webview.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/webenginewidgets/browser/webview.cpp b/examples/webenginewidgets/browser/webview.cpp
index e32ab71d..ce0f7c41 100644
--- a/examples/webenginewidgets/browser/webview.cpp
+++ b/examples/webenginewidgets/browser/webview.cpp
@@ -129,6 +129,21 @@ bool WebPage::acceptNavigationRequest(QWebEngineFrame *frame, const QNetworkRequ
}
#endif
+bool WebPage::certificateError(const QWebEngineCertificateError &error)
+{
+ if (error.isOverridable()) {
+ QMessageBox msgBox;
+ msgBox.setIcon(QMessageBox::Warning);
+ msgBox.setText(error.errorDescription());
+ msgBox.setInformativeText(tr("If you wish so, you may continue with an unverified certicate. Accepting an unverified certicate means you may not be connected with the host you tried to connect to.\nDo you wish to override the security check and continue?"));
+ msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ msgBox.setDefaultButton(QMessageBox::No);
+ return msgBox.exec() == QMessageBox::Yes;
+ }
+ QMessageBox::critical(view(), tr("Certificate Error"), error.errorDescription(), QMessageBox::Ok, QMessageBox::NoButton);
+ return false;
+}
+
class PopupWindow : public QWidget {
Q_OBJECT
public: