summaryrefslogtreecommitdiffstats
path: root/examples/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webengine')
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index da599bfb4..a047b2be5 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -125,6 +125,7 @@ ApplicationWindow {
shortcut: "Ctrl+T"
onTriggered: {
tabs.createEmptyTab()
+ tabs.currentIndex = tabs.count - 1
addressBar.forceActiveFocus();
addressBar.selectAll();
}
@@ -284,7 +285,7 @@ ApplicationWindow {
function createEmptyTab() {
var tab = addTab("", tabComponent)
// We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately.
- tabs.currentIndex = tabs.count - 1
+ tab.active = true
tab.title = Qt.binding(function() { return tab.item.title })
return tab
}
@@ -336,6 +337,10 @@ ApplicationWindow {
print("Warning: Blocked a popup window.")
else if (request.destination == WebEngineView.NewViewInTab) {
var tab = tabs.createEmptyTab()
+ tabs.currentIndex = tabs.count - 1
+ request.openIn(tab.item)
+ } else if (request.destination == WebEngineView.NewViewInBackgroundTab) {
+ var tab = tabs.createEmptyTab()
request.openIn(tab.item)
} else if (request.destination == WebEngineView.NewViewInDialog) {
var dialog = applicationRoot.createDialog()