From 70a376d73718cc4ff8d96f6761b8c1896ca25c23 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 9 Nov 2015 15:23:32 +0100 Subject: Make QWebEngineFullScreenRequest const correct Let QWebEngineFullScreenRequest be logically const-correct. It feels weird to be allowed to call "accept()" or "reject()" on a constant object. Also allow the user to copy the request, but check whether the page is still valid in the implementations of accept(), reject(). Change-Id: Ibf139a126734fc8e2db68ec26dc8f24cd4438942 Reviewed-by: Allan Sandfeld Jensen --- examples/webenginewidgets/demobrowser/tabwidget.cpp | 10 +++++----- examples/webenginewidgets/demobrowser/tabwidget.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/webenginewidgets/demobrowser/tabwidget.cpp b/examples/webenginewidgets/demobrowser/tabwidget.cpp index 3b2069858..95b79aaac 100644 --- a/examples/webenginewidgets/demobrowser/tabwidget.cpp +++ b/examples/webenginewidgets/demobrowser/tabwidget.cpp @@ -325,8 +325,8 @@ void TabWidget::currentChanged(int index) this, SIGNAL(loadProgress(int))); disconnect(oldWebView->page()->profile(), SIGNAL(downloadRequested(QWebEngineDownloadItem*)), this, SLOT(downloadRequested(QWebEngineDownloadItem*))); - disconnect(oldWebView->page(), SIGNAL(fullScreenRequested(const QWebEngineFullScreenRequest&)), - this, SLOT(fullScreenRequested(const QWebEngineFullScreenRequest&))); + disconnect(oldWebView->page(), SIGNAL(fullScreenRequested(QWebEngineFullScreenRequest)), + this, SLOT(fullScreenRequested(QWebEngineFullScreenRequest))); } #if defined(QWEBENGINEVIEW_STATUSBARMESSAGE) @@ -339,8 +339,8 @@ void TabWidget::currentChanged(int index) this, SIGNAL(loadProgress(int))); connect(webView->page()->profile(), SIGNAL(downloadRequested(QWebEngineDownloadItem*)), this, SLOT(downloadRequested(QWebEngineDownloadItem*))); - connect(webView->page(), SIGNAL(fullScreenRequested(const QWebEngineFullScreenRequest&)), - this, SLOT(fullScreenRequested(const QWebEngineFullScreenRequest&))); + connect(webView->page(), SIGNAL(fullScreenRequested(QWebEngineFullScreenRequest)), + this, SLOT(fullScreenRequested(QWebEngineFullScreenRequest))); for (int i = 0; i < m_actions.count(); ++i) { WebActionMapper *mapper = m_actions[i]; @@ -356,7 +356,7 @@ void TabWidget::currentChanged(int index) webView->setFocus(); } -void TabWidget::fullScreenRequested(const QWebEngineFullScreenRequest &request) +void TabWidget::fullScreenRequested(QWebEngineFullScreenRequest request) { WebPage *webPage = qobject_cast(sender()); if (request.toggleOn()) { diff --git a/examples/webenginewidgets/demobrowser/tabwidget.h b/examples/webenginewidgets/demobrowser/tabwidget.h index f71ac398a..b00131130 100644 --- a/examples/webenginewidgets/demobrowser/tabwidget.h +++ b/examples/webenginewidgets/demobrowser/tabwidget.h @@ -42,8 +42,8 @@ #ifndef TABWIDGET_H #define TABWIDGET_H +#include #include - #include QT_BEGIN_NAMESPACE @@ -217,7 +217,7 @@ private slots: void lineEditReturnPressed(); void windowCloseRequested(); void moveTab(int fromIndex, int toIndex); - void fullScreenRequested(const QWebEngineFullScreenRequest& request); + void fullScreenRequested(QWebEngineFullScreenRequest request); private: QAction *m_recentlyClosedTabsAction; -- cgit v1.2.3