summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-11-09 15:23:32 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-11-12 12:36:15 +0000
commit70a376d73718cc4ff8d96f6761b8c1896ca25c23 (patch)
tree27111f884d6c8dcb04f0d0f52217413b99452b44 /examples
parent93745b5452c2ec69c04be2a2043c0937327ee556 (diff)
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 <allan.jensen@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/demobrowser/tabwidget.cpp10
-rw-r--r--examples/webenginewidgets/demobrowser/tabwidget.h4
2 files changed, 7 insertions, 7 deletions
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<WebPage*>(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 <QtWebEngineWidgets/QWebEngineFullScreenRequest>
#include <QtWidgets/QTabBar>
-
#include <QtWidgets/QShortcut>
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;