diff options
Diffstat (limited to 'tests/quicktestbrowser')
-rw-r--r-- | tests/quicktestbrowser/quickwindow.qml | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/quicktestbrowser/quickwindow.qml b/tests/quicktestbrowser/quickwindow.qml index 891ab5792..f77fec582 100644 --- a/tests/quicktestbrowser/quickwindow.qml +++ b/tests/quicktestbrowser/quickwindow.qml @@ -235,6 +235,20 @@ ApplicationWindow { Component.onCompleted: createEmptyTab() Component { + id: dialogComponent + Window { + property Item webView: _webView + width: 800 + height: 600 + visible: true + WebEngineView { + id: _webView + anchors.fill: parent + } + } + } + + Component { id: tabComponent WebEngineView { id: webEngineView @@ -268,11 +282,14 @@ ApplicationWindow { } onNewViewRequested: { - if (request.popup) + if (!request.userInitiated) print("Warning: Blocked a popup window.") else if (request.destination == WebEngineView.NewViewInTab) { var tab = tabs.createEmptyTab() request.openIn(tab.item) + } else if (request.destination == WebEngineView.NewViewInDialog) { + var dialog = dialogComponent.createObject() + request.openIn(dialog.webView) } else { var component = Qt.createComponent("quickwindow.qml") var window = component.createObject() |