summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-12-01 04:34:04 -0800
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2015-01-23 12:10:54 +0100
commitfb612f3d2b181742730e18ca15c0944af0b743c5 (patch)
tree4706e39aca1d3e9908fba20c90a30dfffe3a4772 /tests/quicktestbrowser
parenta9cae7c25c67dfc21f63202a9fadba8ad20d24df (diff)
Move newViewRequested to the public API
This moves the API to public, with proper versioning, adds documentation and adjust the warning to also report an null parameter to openIn that would cause the load to fail. The experimental example code is copied from quicktestbrowser to quicknanobrowser. Change-Id: I23b06c7a5add0323d0540a783873584438d85ea8 Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'tests/quicktestbrowser')
-rw-r--r--tests/quicktestbrowser/BrowserWindow.qml29
1 files changed, 15 insertions, 14 deletions
diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml
index 98156eeb4..7516d0a65 100644
--- a/tests/quicktestbrowser/BrowserWindow.qml
+++ b/tests/quicktestbrowser/BrowserWindow.qml
@@ -355,6 +355,21 @@ ApplicationWindow {
}
]
+ onNewViewRequested: {
+ if (!request.userInitiated)
+ print("Warning: Blocked a popup window.")
+ else if (request.destination == WebEngineView.NewViewInTab) {
+ var tab = tabs.createEmptyTab()
+ request.openIn(tab.item.webView)
+ } else if (request.destination == WebEngineView.NewViewInDialog) {
+ var dialog = applicationRoot.createDialog()
+ request.openIn(dialog.currentWebView)
+ } else {
+ var window = applicationRoot.createWindow()
+ request.openIn(window.currentWebView)
+ }
+ }
+
experimental {
isFullScreen: webEngineView.state == "FullScreen" && browserWindow.isFullScreen
onFullScreenRequested: {
@@ -367,20 +382,6 @@ ApplicationWindow {
}
}
- onNewViewRequested: {
- if (!request.userInitiated)
- print("Warning: Blocked a popup window.")
- else if (request.destination == WebEngineView.NewViewInTab) {
- var tab = tabs.createEmptyTab()
- request.openIn(tab.item.webView)
- } else if (request.destination == WebEngineView.NewViewInDialog) {
- var dialog = applicationRoot.createDialog()
- request.openIn(dialog.currentWebView)
- } else {
- var window = applicationRoot.createWindow()
- request.openIn(window.currentWebView)
- }
- }
onFeaturePermissionRequested: {
permBar.securityOrigin = securityOrigin;
permBar.requestedFeature = feature;