summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/demobrowser/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webenginewidgets/demobrowser/webview.cpp')
-rw-r--r--examples/webenginewidgets/demobrowser/webview.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/webenginewidgets/demobrowser/webview.cpp b/examples/webenginewidgets/demobrowser/webview.cpp
index 42f725fe8..35f765b5c 100644
--- a/examples/webenginewidgets/demobrowser/webview.cpp
+++ b/examples/webenginewidgets/demobrowser/webview.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Toolkit.
+** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
@@ -175,6 +185,8 @@ QWebEnginePage *WebPage::createWindow(QWebEnginePage::WebWindowType type)
{
if (type == QWebEnginePage::WebBrowserTab) {
return mainWindow()->tabWidget()->newTab()->page();
+ } else if (type == QWebEnginePage::WebBrowserBackgroundTab) {
+ return mainWindow()->tabWidget()->newTab(false)->page();
} else if (type == QWebEnginePage::WebBrowserWindow) {
BrowserApplication::instance()->newMainWindow();
BrowserMainWindow *mainWindow = BrowserApplication::instance()->mainWindow();
@@ -377,6 +389,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
++it;
menu->insertAction(*it, page()->action(QWebEnginePage::OpenLinkInNewWindow));
menu->insertAction(*it, page()->action(QWebEnginePage::OpenLinkInNewTab));
+ menu->insertAction(*it, page()->action(QWebEnginePage::OpenLinkInNewBackgroundTab));
}
menu->popup(event->globalPos());