summaryrefslogtreecommitdiff
path: root/examples/webenginewidgets/notifications/main.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-09-24 12:03:59 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-09-24 13:03:43 +0200
commit52345f558f55e04ea68a8fa30d9862ca69131a18 (patch)
tree3bd9da3e6842af2d0b9c04b46693c66ab437fd2e /examples/webenginewidgets/notifications/main.cpp
parent16192598a84eaf9ac9a50b7cca6ac5e4c21bb5e8 (diff)
parentd8fe250e542519012247952a034e78b0d492b730 (diff)
downloadqtwebengine-52345f558f55e04ea68a8fa30d9862ca69131a18.tar.gz
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: config.tests/glibc/glibc.cpp src/3rdparty src/core/configure.json src/core/profile_io_data_qt.cpp src/webengine/configure.json src/webenginewidgets/api/qwebenginepage.cpp tests/auto/widgets/qwebenginepage/BLACKLIST Change-Id: I3e1781048c3cb09bfbf7427dfc5dd1fec11a2b97
Diffstat (limited to 'examples/webenginewidgets/notifications/main.cpp')
-rw-r--r--examples/webenginewidgets/notifications/main.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/examples/webenginewidgets/notifications/main.cpp b/examples/webenginewidgets/notifications/main.cpp
index 661b82ff5..c3039b9e0 100644
--- a/examples/webenginewidgets/notifications/main.cpp
+++ b/examples/webenginewidgets/notifications/main.cpp
@@ -56,11 +56,13 @@
#include <QWebEngineProfile>
#include <QWebEngineView>
-class WebEnginePage : public QWebEnginePage {
+class WebEnginePage : public QWebEnginePage
+{
public:
WebEnginePage(QWidget *parent) : QWebEnginePage(parent) { }
- bool acceptNavigationRequest(const QUrl &url, NavigationType, bool) override {
+ bool acceptNavigationRequest(const QUrl &url, NavigationType, bool) override
+ {
if (url.scheme() != "https")
return true;
QDesktopServices::openUrl(url);
@@ -81,16 +83,15 @@ int main(int argc, char *argv[])
QObject::connect(view.page(), &QWebEnginePage::featurePermissionRequested,
[&] (const QUrl &origin, QWebEnginePage::Feature feature) {
- if (feature != QWebEnginePage::Notifications)
- return;
- view.page()->setFeaturePermission(origin, feature, QWebEnginePage::PermissionGrantedByUser);
- });
+ if (feature != QWebEnginePage::Notifications)
+ return;
+ view.page()->setFeaturePermission(origin, feature, QWebEnginePage::PermissionGrantedByUser);
+ });
auto profile = view.page()->profile();
auto popup = new NotificationPopup(&view);
- profile->setNotificationPresenter([&] (std::unique_ptr<QWebEngineNotification> notification) {
- popup->present(notification);
- });
+ profile->setNotificationPresenter([&] (std::unique_ptr<QWebEngineNotification> notification)
+ { popup->present(notification); });
view.resize(640, 480);
view.show();