summaryrefslogtreecommitdiff
path: root/examples/webenginewidgets/simplebrowser/webpage.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-04-05 09:27:08 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-04-05 12:19:25 +0000
commitf353c92cc326cfd93d8ecc54d52524c1a9079443 (patch)
tree216a623bb8c3ee209b5792c9a9c719a63f75fee8 /examples/webenginewidgets/simplebrowser/webpage.cpp
parent4c9f9e4d305cd9a8e4e123d25cc6d8ecbc0990ad (diff)
downloadqtwebengine-f353c92cc326cfd93d8ecc54d52524c1a9079443.tar.gz
Simple browser example: Fix up the code
- Remove duplicated unused helper questionForFeature() - Replace lambdas by slots where possible - Fix clang warning about using multiple arguments to QString::arg() - Remove dead code in WebView::contextMenuEvent() which checks on inspectElement == actions.cend(), but is within an "if" checking the same condition. Change-Id: Ie85a3811f4f5a8c3fa9550d4eb2ca5bf79e39084 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 88ef502099d535823156c31e77251dd2a723ad1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/webenginewidgets/simplebrowser/webpage.cpp')
-rw-r--r--examples/webenginewidgets/simplebrowser/webpage.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/examples/webenginewidgets/simplebrowser/webpage.cpp b/examples/webenginewidgets/simplebrowser/webpage.cpp
index 66de5d6d9..699e3d2ed 100644
--- a/examples/webenginewidgets/simplebrowser/webpage.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpage.cpp
@@ -22,29 +22,6 @@ void WebPage::handleCertificateError(QWebEngineCertificateError error)
[this, error]() mutable { emit createCertificateErrorDialog(error); });
}
-inline QString questionForFeature(QWebEnginePage::Feature feature)
-{
- switch (feature) {
- case QWebEnginePage::Geolocation:
- return WebPage::tr("Allow %1 to access your location information?");
- case QWebEnginePage::MediaAudioCapture:
- return WebPage::tr("Allow %1 to access your microphone?");
- case QWebEnginePage::MediaVideoCapture:
- return WebPage::tr("Allow %1 to access your webcam?");
- case QWebEnginePage::MediaAudioVideoCapture:
- return WebPage::tr("Allow %1 to access your microphone and webcam?");
- case QWebEnginePage::MouseLock:
- return WebPage::tr("Allow %1 to lock your mouse cursor?");
- case QWebEnginePage::DesktopVideoCapture:
- return WebPage::tr("Allow %1 to capture video of your desktop?");
- case QWebEnginePage::DesktopAudioVideoCapture:
- return WebPage::tr("Allow %1 to capture audio and video of your desktop?");
- case QWebEnginePage::Notifications:
- return WebPage::tr("Allow %1 to show notification on your desktop?");
- }
- return QString();
-}
-
void WebPage::handleSelectClientCertificate(QWebEngineClientCertificateSelection selection)
{
// Just select one.